【数据库课程设计】

建表

create table Admin(
	ID int primary key,
	Name varchar(20) not null,
	Telnum varchar(11) not null,
	Email varchar(20) not null
	Remark text);
	
create table Commodity(
	ID int primary key,
	Name varchar(20) not null,
	Number int not null,
	Class varchar(20) not null,
	Remark text);
	
create table User(
	ID int primary key,
	Name varchar(20) not null,
	Telnum varchar(20) not null,
	Email varchar(20) not null,
	Address varchar(20) not null,
	Class int not null,
	Remark text);

create table Order(
	ID int primary key,
	Ordersid int not null,
	Itemid int not null,
	Number int not null,
	Time datetime not null,
	Money int not null,
	Remark text);
	foreign key(Ordersid) references User(ID),
	foreign key(Itemid) references Commodity(ID),
	Remark text);
	
create table ClinkM(
	ID int primary key,
	Commodityid int not null,
	Ownerid int not null,
	foreign key(Commodityid) references Commodity(ID),
	foreign key(Ownerid) references User(ID),
	Remark text);
	
	

展开阅读全文

没有更多推荐了,返回首页