标签:ref def const fit arc arch birt name employee
GO
create table Department(
Dep_Id CHAR(3) constraint PK_Dep_Id primary key not null,
Depname VarChar(40) not null,
Telephone char(16) null,
Fax char(16) null
)
GO
GO
create table Employee(
Emp_ID Char(6) constraint PK_Emp_Id primary key,
Empname Varchar(10) constraint NU_Empname not null,
Sex char(2) constraint CK_Sex check(Sex =‘男‘ or Sex =‘女‘),
Birthday DATE,
Dep_Id char(3) references Department (Dep_Id),
Prof varchar(10),
Phone varchar (20),
Email varchar(20),
Onjob BIT constraint DF_Onjob default 1
)
GO
GO
create table Salary(
Emp_Id char(6) references Employee(Emp_Id),
Month char(6),
Base decimal(10,2),
Bonus decimal(10,2),
Benefit decimal(10,2),
Yfgz AS (Base+Bonus+Benefit)PERSISTED,
Insurance decimal(10,2),
Tax decimal(10,2),
Sfgz as (Base+Bonus+Benefit-Insurance-Tax)PERSISTED,
primary key(Emp_Id,Month)
)
GO
select * from Department
标签:ref def const fit arc arch birt name employee
原文地址:http://www.cnblogs.com/ysxxxttt/p/7488619.html