| | |
Is this database structure correct? Please help
Please support our Database Design advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 4
Reputation:
Solved Threads: 0
I am fairly new to mysql and wanted to practice making a database and tables. As well as filling the tables with made up data and then practicing queries. I wanted to emulate a real life database project.
So I decided to make a database for a Car Dealership.
the database consists of three tables...Car...Buyer..Repairs. The structure is displayed below.
CAR table -
car_id int(5) primary key
make varchar(15)
model varchar(15)
year int(4)
origin varchar(15)
buyer int(5) foreign key references buyer_id in the BUYER table
cost double(5,2)
BUYER table -
buyer_id int(5) primary key
name varchar(20)
address varchar(20)
tel int(10)
car_id int(5) foreign key references car_id in the CAR table
REPAIRS table-
part_id int(5) primary key
origin varchar(15)
cost double(5,2)
car_id int(5) foreign key references car_id in the CAR table
(SCREENSHOT ATTACHED)
Do you see any problems in this structure?
anything I should have done differently?
anything I could do to improve database performance?
Please bare with me as I am new to this and wish to be a DBA one day soon!
All comments will be appreciated!!
Thanks people
So I decided to make a database for a Car Dealership.
the database consists of three tables...Car...Buyer..Repairs. The structure is displayed below.
CAR table -
car_id int(5) primary key
make varchar(15)
model varchar(15)
year int(4)
origin varchar(15)
buyer int(5) foreign key references buyer_id in the BUYER table
cost double(5,2)
BUYER table -
buyer_id int(5) primary key
name varchar(20)
address varchar(20)
tel int(10)
car_id int(5) foreign key references car_id in the CAR table
REPAIRS table-
part_id int(5) primary key
origin varchar(15)
cost double(5,2)
car_id int(5) foreign key references car_id in the CAR table
(SCREENSHOT ATTACHED)
Do you see any problems in this structure?
anything I should have done differently?
anything I could do to improve database performance?
Please bare with me as I am new to this and wish to be a DBA one day soon!
All comments will be appreciated!!
Thanks people
Last edited by badmanmc; Oct 13th, 2009 at 10:01 pm.
0
#2 Oct 14th, 2009
Here are some recommendations I have:
1) Remove the car_id field from the buyer table; what is the purpose of that field?
2) Create a table to track the make of the car; instead of typing in the make for each car in the car table, I would use a table to track all the makes of cars.
3) Create a table to track the model of each car.
4) Break out the repairs table; I would use one table to track when a person brings in a car for a repair and use another table to track all the parts that need to be worked on during the repair session.
1) Remove the car_id field from the buyer table; what is the purpose of that field?
2) Create a table to track the make of the car; instead of typing in the make for each car in the car table, I would use a table to track all the makes of cars.
3) Create a table to track the model of each car.
4) Break out the repairs table; I would use one table to track when a person brings in a car for a repair and use another table to track all the parts that need to be worked on during the repair session.
•
•
Join Date: Jun 2005
Posts: 60
Reputation:
Solved Threads: 5
0
#4 Oct 15th, 2009
Have a look through this http://www.geekgirls.com/databases_from_scratch_1.htm
Very good intro to DB design.
Very good intro to DB design.
![]() |
Similar Threads
- JDBC Access Database Problem (Java)
- VB Data Structure Need help to check (Visual Basic 4 / 5 / 6)
- Whether my database structure is right or wrong? (Database Design)
- database structure theory question? (MySQL)
- Database structure program (Windows Software)
- Database-Structure Backup (MS SQL)
- database structure - boohooo help me (MySQL)
- database won't give correct permissions (MS SQL)
- Update entire Mysql DataBase with PhP (PHP)
Other Threads in the Database Design Forum
- Previous Thread: database design for a questionaire type form
- Next Thread: Final year project topic
| Thread Tools | Search this Thread |





