If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > ER modelling for the database of online bookstore (bookshop)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-06, 09:59
chickenyd chickenyd is offline
Registered User
 
Join Date: Mar 2006
Posts: 4
ER modelling for the database of online bookstore (bookshop)

Hi,

how would the ER diagram for the database of an online bookshop look like? I only know a few records that can be included in the Database so far such as Book details eg. Title, Author, ISBN, and then Customer details such as name, email etc., AND ORDER details etc. but the DB may be bigger than this. so any1 have a ER diagram for this kind?



thanks
Reply With Quote
  #2 (permalink)  
Old 03-10-06, 15:46
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
Well, what kinds of data would you need?

Customer data

Sales Order Data

Supplier Data

Purchase Order data

Shipment Data

Break down each class of data into more discrete information. For instance, the customer data would include, at a minimum, a name (first, last, middle initial) address (Street, PO Box, city, state/Province, Postal Code, Country) Telephone number(s), etc. Probably, the simplest way of joining the customer to other tables would be to add a surrogate primary key (customer number) as well.

The sales order data would include a sales order number, timestamp, customer reference, requested delivery date, shippment method, etc. Possibly the tax rate, as well.

Note that I did NOT include the details of the order here. Each item of an order (you CAN order more than one book from the book store...) would be stored in a separate child table. Call it SalesOrder_Detail, maybe. It would include a foreign key to the parent sales order table, an item or line number within the order (1-N), and the combination (AKA a Compound Key) of these two fields would form the unique key (PK) for this table. In addition, it would need to describe the detail of the order line item - the quantity, the as-sold price each, and the part number (ISBN Number, maybe) and possibly a discount percentage rate. In a normalized database you would NOT include the line item total as a separate field, as it is a derived, or calculated field.

You could find some more basic information on table design and normalization in the database installments of this tutorial.

I'll leave it up to you to refine the other classes of data you'll need to store.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Last edited by loquin; 03-10-06 at 15:50.
Reply With Quote
  #3 (permalink)  
Old 03-10-06, 18:43
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
loquin, a very generous response to a RFH* question

i trust buddy appreciates it

RFH = request for homework
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 03-10-06, 20:52
chickenyd chickenyd is offline
Registered User
 
Join Date: Mar 2006
Posts: 4
thanks loquin
Reply With Quote
  #5 (permalink)  
Old 04-11-06, 22:54
chickenyd chickenyd is offline
Registered User
 
Join Date: Mar 2006
Posts: 4
i see Loquin thanks I think I have managed to create my tables thanks to ur tutorials, BUT my problem now is how to normalise data see my thread normalisation help

i have attached the normalisation table there.

oh yeah R937 this is not a RTF. I am trying to learn database for educational purposes.
Reply With Quote
  #6 (permalink)  
Old 05-04-06, 08:38
bdimple bdimple is offline
Registered User
 
Join Date: Jul 2003
Posts: 74
A helpful Data Model

Check out this Data Model which will give you a Kick-Start :-
http://www.databaseanswers.org/data_...tore/index.htm

B.Dimple
Senior DBA
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On