Jump to content

Are the Tables OK for this Database?


OilSheikh

Recommended Posts

Hi ppl,

 

I am developing a Shopping Site.

 

And these are the Tables I have. Are the fields OK? Inputs appreciated.  ;)

 

customer

 

Field      Type            Null Default Links to Comments MIME

custid    int(4)           No    

name     varchar(50)   No    

address  text             No    

postcode  varchar(9)   No    

phone       int(11)        Yes NULL    

email         varchar(50) No    

username  char(10)     No    

password  char(10)     No    

 

order

 

Field          Type        Null Default Links to Comments MIME

ordernum    int(4)      No    

custid        int(10)     No    

productid   int(10)      No    

quantity    int(2)        No    

orderdate  date          No    

totalpaid  decimal(6,0)  No    

orderstatus                       set('ALLOCATED', 'DISPATCHED', 'CANCELLED') No ALLOCATED    

 

product

 

Field          Type              Null Default Links to Comments MIME

productid    int(4)             No    

name          varchar(50)    No    

stock level  int(2)             Yes NULL    

price          decimal(6,0)   No    

rating          int(1)           Yes NULL    

reviews        text             Yes NULL    

 

Link to comment
https://forums.phpfreaks.com/topic/45477-are-the-tables-ok-for-this-database/
Share on other sites

I don't know the scope of your project but customer info should not be stored with login. Have a login table and have another table for customer info.

 

Order will comprise of multiple products which mean same order number for different product Id's.

 

I suggest lookup all conceptual Database design books. On another note I will also suggest not making a brand new shopping cart. Look up oscommerce.com or zen cart. You have already built in shopping carts for free. Use it and modify what you don't need.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.