MySQL准备得比较晚,参考小薄本书:《MySQL》必知必会。简单写了些笔记,缺点是,没有自己的创新认识,所以仅供初学者参考,欢迎指正。
样例表如下
(没有输入具体的数据)
venders表:供应商
列 |
---|
vend_id (主键) |
vend_name |
vend_address |
vend_city |
vend_state |
vend_zip |
vend_country |
Products表:产品的信息
列 |
---|
prod_id(主键) |
vend_id(外键) |
prod_name |
prod_price |
prod_desc |
Customer表:所有顾客的信息
列 |
---|
cust_id(主键) |
cust_name |
cust_ address |
cust_city |
cust_state |
cust_zip |
cust_country |
cust_contact |
cust_email |
Orders表:顾客订单
列 |
---|
order_num (主键) |
order_date |
cust_id(外键) |
Orderitems表:每个订单的实际物品
列 |
---|
order_num |
order_item |
prod_id(外键) |
quantity |
Item_price |
说明:order_num 和order_item为主键
Productnotes:存储特定产品的注释
列 |
---|
note_id |
prod_id(外键) |
note_date |
note_text |