--1.订单表--管理员操作后台
--2.订单详情--顾客操作
----------------------------------------------------------------
create table userinfo ( id int identity(1,1) primary key, username varchar(500), password varchar(500), email varchar(500), phone varchar(500), address varchar(500) ) ------------------ ---------------- create table book ( id int identity(1,1) primary key, bookname varchar(200), price decimal(12,0), isbn varchar(200), image varchar(200), info varchar(200), stock int, count int, ) ------------ ------- create table cartitem ( uid int not null , bid int not null, count int, bookname varchar(200), price decimal(12,0), image varchar(200), primary key(uid,bid) ) select * from book -------------------------- create table orders ( id int identity(1,1) primary key, userid int foreign key references userinfo(id), createtime datetime default(getdate()), total decimal(12,2), shipaddress varchar(200), contactphone varchar(200), status varchar(200), ) create table orderdetails ( id int identity(1,1) primary key, oid int foreign key references orders(id), bid int foreign key references orders(id), amount int, tranprice decimal(12,2), )