我有一个book store application
,我想设计它的数据库。首先,我需要的是E图。
(This is not homework)
它有如此简单的场景:
这是最好的设计吗?
发布于 2015-02-23 07:39:55
书籍和订单之间应该有联系,而不是书籍和订单。“订单”表应该是中心表。一个简单的结构是
CUSTOMERS
id
name
adddress, etc
ORDERS
id
customer (foreign key to customers table)
curdate
status (open, closed)
% discount
ORDERITEMS
id
order (foreign key to orders table)
book (foreign key to books table)
quantity
price
% discount
status (open, closed, ordered from distributor?)
BOOKS
id
title
author
costprice
salesprice
isbn
https://stackoverflow.com/questions/28664423
复制相似问题