---如何编写订单---

来源:互联网 发布:vb.net安装包 编辑:程序博客网 时间:2024/05/16 05:21
--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),


)








-------------------------






0 0
原创粉丝点击