Current location - Training Enrollment Network - Books and materials - Book table structure English
Book table structure English
Students should study hard!

Create table [dbo]. [Bookstore Table] (

[BookstoreNo.] [nvarchar] (6) Collated Chinese _ PRC _ CI _ as is not empty,

[Store Name] [nvarchar] (30) Collated Chinese _ PRC _ ci _ as is not empty,

[Telephone] [CHAR] (8) Organize Chinese _ PRC _ CI _ as null,

[address] [char] (40) Organize Chinese _ PRC _ ci _ as null,

[Postal Code] [CHAR] (6) Organize Chinese _ PRC _ CI _ as null

) on [main]

go to

Create table [dbo]. [Desk] (

[book number] [nvarchar] (6) sorting out Chinese _ PRC _ ci _ as not null,

[Title] [nvarchar] (30) finishing Chinese _ PRC _ CI _ as not null,

[first author] [char] (10) finishing Chinese _ PRC _ CI _ as not null,

[release date] [smalldatetime] NULL,

[Price] [Number ](4, 1) NULL

) on [main]

go to

Create table [dbo]. [Book Sales Table] (

[book number] [nvarchar] (6) sorting out Chinese _ PRC _ ci _ as not null,

[BookstoreNo.] [nvarchar] (6) Collated Chinese _ PRC _ CI _ as is not empty,

[sales date] [smalldatetime] is not empty.

[sales quantity] [smallint] is empty.

) on [main]

go to

Change the table. [bookstore desk] with NOCHECK ADD

Constraint [PK_ bookstore table] primary key aggregation

(

[Bookstore number]

) on [main]

go to

Change the table. [book list] with NOCHECK ADD

Constraint [PK_ book table] primary key aggregation

(

[Book number]

) on [main]

go to

Change the table. [book sales table] with NOCHECK ADD

Constraint [PK_ Book Sales Table] PK aggregation

(

[book number],

[Bookstore number],

[Date of sale]

) on [main]

go to