SQL语句创建表

create table Depart
(
depNo int primary key,
depName varchar(50) not null,
depMan varchar(50) not null
)
go
create table Teacther
(
tNo int primary key,
tName varchar(50) not null,
tSex  varchar(2) not null check (tsex in ('男','女')),
tBirthDate datetime not null,
tSalary decimal(18,2),
tHairDate datetime,
depNo int
foreign key(depNo) references Depart(depNo)
)

你可能感兴趣的:(dataBase)