Note that there are some explanatory texts on larger screens.

plurals
  1. POBook Store Database Design
    primarykey
    data
    text
    <p>I'm going to build a book store in which we have 3 entities(classes): Seller,Buyer,Book. I've designed the database as the following details:<br> - Both buyer and seller can buy/sell one or more books respectively.<br> - A buyer needs a seller account if he/she wants to sell a book.<br> - Buyers will offer their price and seller would like to sell to best buyer and I have to save all information among these. </p> <pre> In this model the <em>process</em> class will be the other three classes connector: seller book buyer ------- ------ ------- sID* bID* byID* name --> sID <p>This was my first thought &amp; then I found out that this schema will fail in the process due to a buyer could buy multiple books at same time and there were other reasons, too. so I changed it:</p> <pre> In this model the <em>process</em> class will be the other three classes connector: ______ ______ ________ _______ |seller| | book | |process | | buyer | -------- -------- ---------- --------- | sID* | | bID* | | pID* | | byID* | | name | | XXX | --> | sID | |date &..| ---------- (*) indicates a primary key </pre> <p>this will work better I think, but how to get into work with <strong>Price offers</strong>?<br> yes, I can add a offer to the <em>process</em> class, so I've changed my mind &amp; this model came into the place: (sorry for long description)</p> The *Offer* field will be added to the *process* class: ______ ______ _________ _______ |seller| | book | |process | | buyer | -------- -------- ----------- --------- | sID* | | bID* | | pID* | | byID* | | name | | XXX | --> | sID | | offer | | date &..| ----------- (*) indicates a primary key </pre> <p>I'm absolutely confused with the db design due to it's my first time. Is this going to satisfy the system needs? If no, how can I make it work? If yes, is there any better design? </p> <p>Any suggestion is appreciated, thanks in advance :)</p> <p><em>update</em> - I really can't choose the best answer here, all helped. Many many many thanks guys. hope you best ^o^</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload