Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Is this database structure correct? Please help
Old 10-14-2009, 03:12 AM Is this database structure correct? Please help
Novice Talker

Posts: 6
Name: AJ
Trades: 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




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
badmanmc is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-14-2009, 04:54 AM Re: Is this database structure correct? Please help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The "repairs" table is a little simplistic for a real application but it will be Ok for practise. Performance is more how you structure the queries rather than the tables, provided of course you keep the redundancy down to an absolute minimum (or none).

BTW it's "bear with me" as "bare with me" would involve a mutual removal of clothing and I guess that is not what you meant
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-14-2009, 01:16 PM Re: Is this database structure correct? Please help
infotech rules's Avatar
Super Talker

Posts: 129
Name: Sidney shieldon
Trades: 0
Hmm.... It will work bro. Make things easy for users and you will have awesome results. Best of luck.
infotech rules is offline
Reply With Quote
View Public Profile
 
Old 10-14-2009, 01:36 PM Re: Is this database structure correct? Please help
Clarence_82's Avatar
Skilled Talker

Posts: 90
Name: Clarence
Trades: 0
As long as the database is built to hold all the information you will need, then that is all you will need. The only thing I would suggest though, is always adding an id with the auto increment feature to every table. This way everything entered into a table will be given a unique id in case you ever need to sort them this way. If you don't ever need to, it won't hurt having it, just don't use it.

In the future, your sure to want to make changes to all sites, and having the id field will truly come in handy more than you realize now.
__________________
-Clarence Cowan

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Clarence_82 is offline
Reply With Quote
View Public Profile
 
Old 10-14-2009, 07:24 PM Re: Is this database structure correct? Please help
Novice Talker

Posts: 6
Name: AJ
Trades: 0
Thanks!!

I have taken all your replies on board and will adjust the database accordingly.

lol BEAR with me..apologies..lets not all get naked!


Appreciate the replies
badmanmc is offline
Reply With Quote
View Public Profile
 
Old 10-15-2009, 04:38 AM Re: Is this database structure correct? Please help
Average Talker

Posts: 26
Trades: 0
The "bare" thing is funny. But good you figured it out, best of luck!
__________________

Please login or register to view this content. Registration is FREE
justin11 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Is this database structure correct? Please help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.10762 seconds with 12 queries