Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple SQL/Database RDBMS Schema - Beginner Level - What Do You Think?

Status
Not open for further replies.

peace2009

MIS
Aug 2, 2009
3
CA
First of all, i'm glad to be part of your forum members! Hi to everybody...

****************************************

* represents primary key

As far as i see, this design is good. I need your confirmation I followed 1NF, 2NF, 3NF, and one to many relationships guidelines.

-Seller Table {*SellerID (number), first name (text), last name (text), address (text), city (text), CountryID (foreign key), phone number (text), date hired (date)}

-Customer Table {*CustomerID (number), first name (text), last name (text), address (text), city (text), CountryID (foreign key), SellerID (foreign key) }

-Car Table {*CarID (number), manufacturer (text), model (text), car year (text) }

-Purchased Car Table {*CarID (foreign key), *CustomerID (foreign key), date purchased (date)}

-----

These tables have multivalued fields...

Country Table {*CountryID (number), country name (text)}

A customer can store several phone number (home, cell, work):

Phone Table {*PhoneID (number), CustomerID (foreign key), phone number (text)}
 
change this --

Phone Table {*PhoneID (number), CustomerID (foreign key), phone number (text)}

to this --

Phone Table {*CustomerID (foreign key), *phone number (text)}

if you don't understand why, pls ask

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Phone Table {*CustomerID (foreign key), *phone number (text)}

This is one to one relationship, so every customer will have three records since every customer will have to store 3 phone numbers (cell - home - work).

Assuming it is a must for a customer to store 3 numbers.
 
One to one relationship shares same primary key. Phone Table {*CustomerID (foreign key), *phone number (text)}, here phone table and customer table share same primary key!

I'm thinking to get your ebook in the near future. I'm little bit overwhelmed with what i have right now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top