100 likes | 257 Views
Decomposing Barnes and Noble. MIS 2502. An author may write many books and a book may be written by multiple authors. What does it mean if I put the royalty on the book table? What about the author table?. Need M:N relationship between author and book I’ve named bridge Royalty
E N D
Decomposing Barnes and Noble MIS 2502
An author may write many books and a book may be written by multiple authors What does it mean if I put the royalty on the book table? What about the author table? • Need M:N relationship between author and book • I’ve named bridge Royalty • Must include PKs of author and book table • Also includes the royalty that the author receives on this book.
Placement of Royalty on bridge table If royalty on the book table it says all the authors on the book got the same royalty. • If royalty on the bridge table it says this • Each author can get a different royalty on each book • Each author could conceivably get different royalties on a book (i.e. on first 100 $3, next 200 $4) If royalty on the author table it says this author always gets the same royalty
For each book, information such as the advance for the book, the publication date, and the price of the book must be tracked. In addition, Each book is a specific type (i.e. biography, non-fiction, poetry, how-to) • The attributes of advance, publication date, price, advance, and book type are indicated as required. • I’ve added pub_id as a lookup table to the publisher table noted later. If you don’t have this – no problem
There may be multiple editors on a book. There is an order assigned to each editor. Obviously, an editor will edit more than one book, as well. • Need M:N relationship editor and book • I’ve named bridge Editor_assignment • Must include PKs of author and book table
When a book is shipped to the store, the quantity ordered, quantity shipped, and the date shipped is collected. • Invoicing in General: • Remember with invoicing you want to find the following: • Customer • Seller • Items Bought • A customer “visits” seller multiple times and seller has multiple customers– M:N relationship. • Each customer can purchase many items on a visit and item can be purchased by many customers –M:N relationship
Invoice Header – M:N relationship between customer and store • Seller = publisher • Customer = store • I’ve called the invoice header ShipHeader • invoice header is bridge between M:N relationship between buyer and seller. • Like all bridges, need to see the PKs of the buyer (store) and seller (publisher). • Also include ship date • Can also include order date, etc.
Invoice Detail– M:N relationship between customer and visit (can purchase Many Items on 1 visit and vice versa) • On each “visit”, customer can buy multiple items. Items can be bought on multiple visits • Invoice Detail (called ship detail here) is bridge between header and items bought • As in all bridges, need PKs of two tables (ISBN and ship header ID)
Each book is published by only one publisher. • Lookup table from book to publisher