我设置下面的数据 在SQL server2008中数据库中要怎么创建book和provider表?(用T-SQL语句写代码)

TABLE :Book -表名称
BookISBN:char(30) pk
BookName:varchar(30) not null
AuthorName: varchar(50) not null
Publish:varchar(30) not null
Price : money not null
Keyword : varchar(30) not null
Qty : int not null
ProviderID : char(10) not null fk
Place : varchar(30)
TABLE : Provider
ProviderID:char(10) pk
ProviderName : varchar(30) not null
Phone : varchar(20)
Address : varchar(30)

第1个回答  2011-05-05
你先用:SQL Server Management Studio建一个表。然后在这个表选择生成SQL语句。就OK了。本回答被提问者和网友采纳
第2个回答  2011-05-05
简单的语句!自己多练习!
create table 表名

字段名(字段类型)

具体查看SQL帮助!不会的话,利用SQLSER管理软件手工建
第3个回答  2011-05-05
create table book(
BookISBN char(30) premary key,
BookName varchar(30) not null,
AuthorName varchar(50) not null,
Publish varchar(30) not null,
Price money not null,
Keyword varchar(30) not null,
Qty int not null,
ProviderID char(10) not null foreign key,
Place varchar(30)
)
create table Provider(
ProviderID char(10) premary key,
ProviderName varchar(30) not null,
Phone varchar(20),
Address varchar(30)
)
第4个回答  2011-05-05
create table book
(
你设置的数据
BookISBN:char(30) primary key,
BookName:varchar(30) not null,
AuthorName: varchar(50) not null,
Publish:varchar(30) not null,
Price : money not null,
Keyword : varchar(30) not null,
Qty : int not null

)
go
相似回答