上机实验
上一节
下一节
实验目的
掌握通过SQL创建数据库、创建表及设置表关系的方法
实验内容
请以SQL完成下面数据库及表的创建:
1、以默认方式创建数据库ProductManage
2、productTypes(id,name)
id: primary key,int; parent:int
name: varchar(50),not null
3、producer(id,name)
id: primary key,int; name:varchar(50),not null
4、products(id,name,price,ptype,producer)
id: primary key,int; name:varchar(50),not null
price: decimal(7,2); ptype: int; producer: int;
说明:
products(ptype) 参考 productTypes(id)
products(producer) 参考 producer(id)

