作业
要求:
新建产品库mydb6_product,新建3张表如下:
employees表
列1:id ,整型,主键
列2:name ,字符串,最大长度50,不能为空
列3:age,整型
列4:gender,字符串,最大长度10,不能为空,默认值“unknown'
列5:salary,浮点型
orders表
列1:id,整型,主键
列2:name,字符串,最大长度100,不能为空
列3:price,浮点型
列4:quantity,整型
列5:category,字符串,最大长度50
oinvoices表
列1:number,整型,主键自增长
列2:order id,整型,外键关联到orders表的id列
列3:in date: 日期型
列4:total amount:浮点型,要求数据大于0
代码:
# 登录root用户
C:\Users\13573>mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can