use pubs
GO
--类别表
--drop table category
create table Category
(
CategoryID int identity primary key ,
Category varchar(50),
CategoryDesc varchar(250)
)
insert into category values('尊严和自由','无限飞扬')
--文章表
--drop table articles
create table Articles
(
ArticleID int identity primary key,
CategoryId int references category(categoryID) ,
FileName varchar(50),
Abstract varchar(500),
Rating varchar(5) ,
Status varchar(20),
PostedBy varchar(30),
[Post/Read] varchar(50)
)
insert into Articles values(1,'title','content','ratg','status','postby','PostRead')
select * from category
--会员信息
create table Members
(
MemberID varchar(8) primary key,
Password char(6),
MemberName varchar(30),
Qualification varchar(50),
Experience varchar(30)
)
--评论表
create table Comments
(
ArticleID int references articles(articleid),
LoginID varchar(8),
Comments varchar(500)
)
select * From comments
-- 应付费文章信息
create table PayableArticles
(
ArticleID int references articles(articleid),
Price money
)
--普通用户详细信息
create table Uses
(
LoginID varchar (8) primary key,
Password char(6)
)
insert into uses values('oo','ooo')
--所购文章详细信息
create table ArticlesPurchased
(
ArticleID int references articles(articleid),
LoginID varchar(8) references uses(loginid),
CreditCardNo varchar(30),
EmailID varchar(50),
SentOrNot char (1)
)
--drop table articlesPurchased
--drop table articles
--drop table category
--drop table members
--drop table comments
--drop table uses
--drop table payableArticles