下面是编程之家 jb51.cc 通过网络收集整理的代码片段。
编程之家小编现在分享给大家,也给大家做个参考。
--购物车表 create table Cart( BookID int, BookName nvarchar(30), Quantity int, Status int ) --管理员表 create table admin( adminname nvarchar(15) primary key, Pws varchar(15) not null) --图书表 create table books( Idbook int primary key, Idcategory int not null references categories(Idcategory), Idsubcategory int not null references subcategories(Idsubcategory), Idsupplier int not null references suppliers(Idsupplier), bookname nvarchar(30) not null, Isbn varchar(13) not null, Details nvarchar(300) null, Orgcost money not null, Price money not null, discount int not null, imageurl nvarchar(50) null, Stock int not null, availstock int not null, Active bit not null, Hotdeal bit not null, Sakes int not null, Visits int not null ) --图书类表 create table categories( Idcategory int primary key, categoryname nvarchar(20) not null) --子类表 create table subcategories( Idsubcategory int primary key, subcategoryname nvarchar(20) not null, Idcategory int references categories(Idcategory) ) --出版商表 create table suppliers( Idsupplier int primary key, suppliername nvarchar(30) not null ) --顾客表 create table customers( Idcustomer int primary key, username nvarchar(15) not null, password varchar(15) not null, realname nvarchar(15) not null, phone varchar(19) not null, email varchar(30) null, [add] nvarchar(30) not null, City nchar(10) not null, State nchar(10) not null, Zip char(6) not null ) --订单表 create table orders( Idorder int primary key, orderdate datetime not null default getdate(), Idcustomer int not null references customers(Idcustomer), Idbook int not null references books(Idbook), totalmoney money not null, totalbooks int not null, comment nvarchar(300) null, Idpayment int not null, Send bit not null ) --stockmovements表 create table stockmovements( Idbook int not null, Datemovement datetime not null, Quantity int not null ) GO CREATE VIEW dbo.Customer_Order WITH SCHEMABINDING AS SELECT * FROM dbo.customers INNER JOIN dbo.orders ON dbo.orders.Idcustomer=dbo.customers.Idcustomer GO
以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。