用户表:
user_info:
isAdmin:bool
name: char PK
password: char
货物表:
cargo:
ISBN: char PK
price: double
discount: double
count: int
name:varchar
销售表:
sale_item:
streamId: INT PK
operatorId: char FK
totalPrice: double
datetime:
item_have_saled:
Isbn: char PK FK
Price: double
Discount: double
Count: int
whichStream: INT FK
name:varchar
注意,不要使用money 类型来表示钱!(会出现计算错误)
表格的修改语句主要参考自下面
http://www.w3school.com.cn/sql/sql_alter.asp
设置主键自动增加
http://blog.youkuaiyun.com/andyelvis/article/details/2446865
http://bbs.youkuaiyun.com/topics/350024912
http://blog.youkuaiyun.com/fengda2870/article/details/3245024
删除外键约束
http://www.cnblogs.com/stu-acer/archive/2010/08/02/1790678.html