Current location - Training Enrollment Network - Books and materials - Create tables of sql database
Create tables of sql database
1、

Create data table

create

table

Book list (ISBN)

figure

primary

Keys,

title of a book

varchar2(20)

no

empty

,

author

varchar2(20)

no

empty

,

News number

Number,

unit price

Number, isbn

varchar2(50)

no

Empty,

publication date

varchar2(20)

no

Empty, Sales Status

figure

System default value

0,

comment

varchar2(500)

, constraint

Con_ unit price

Check (unit price

& gt= 1), constraint

Con_ sales status

Check (sales status

exist

(0, 1)));

2. Create a sequence for the book number.

create

sequence

Serial number _ ISBN

3. Add a foreign key for Publishing House

create

table

Publishing house table

(id

figure

primary

Key);

change

table

book list

increase

limit

Con_ publishing house number

foreign

key

(Publisher number)

refer to

Publisher list (id);