📄 crebas.sql
字号:
/*==============================================================*/
/* DBMS name: Microsoft SQL Server 2000 */
/* Created on: 2006-9-18 18:14:59 */
/*==============================================================*/
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'Relationship_6_FK'
and indid > 0
and indid < 255)
drop index Employee.Relationship_6_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_ap_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_ap_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_dept_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_dept_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_dip_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_dip_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_evaluation_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_evaluation_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_exp_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_exp_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_home_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_home_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_lev_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_lev_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_marriage_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_marriage_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_nation_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_nation_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_poli_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_poli_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_rel_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_rel_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_sex_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_sex_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_skill_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_skill_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_title_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_title_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_tra_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_tra_FK
go
if exists (select 1
from sysindexes
where id = object_id('Employee')
and name = 'emp_trans_FK'
and indid > 0
and indid < 255)
drop index Employee.emp_trans_FK
go
if exists (select 1
from sysindexes
where id = object_id('emp_relation')
and name = 'rel_poli_FK'
and indid > 0
and indid < 255)
drop index emp_relation.rel_poli_FK
go
if exists (select 1
from sysindexes
where id = object_id('transCode')
and name = 'trans_type_FK'
and indid > 0
and indid < 255)
drop index transCode.trans_type_FK
go
if exists (select 1
from sysobjects
where id = object_id('Department')
and type = 'U')
drop table Department
go
if exists (select 1
from sysobjects
where id = object_id('Employee')
and type = 'U')
drop table Employee
go
if exists (select 1
from sysobjects
where id = object_id('PoliCode')
and type = 'U')
drop table PoliCode
go
if exists (select 1
from sysobjects
where id = object_id('Skill')
and type = 'U')
drop table Skill
go
if exists (select 1
from sysobjects
where id = object_id('awardpunish')
and type = 'U')
drop table awardpunish
go
if exists (select 1
from sysobjects
where id = object_id('dip_code')
and type = 'U')
drop table dip_code
go
if exists (select 1
from sysobjects
where id = object_id('emp_relation')
and type = 'U')
drop table emp_relation
go
if exists (select 1
from sysobjects
where id = object_id('evaluation')
and type = 'U')
drop table evaluation
go
if exists (select 1
from sysobjects
where id = object_id('experience')
and type = 'U')
drop table experience
go
if exists (select 1
from sysobjects
where id = object_id('home_code')
and type = 'U')
drop table home_code
go
if exists (select 1
from sysobjects
where id = object_id('level_code')
and type = 'U')
drop table level_code
go
if exists (select 1
from sysobjects
where id = object_id('marriage')
and type = 'U')
drop table marriage
go
if exists (select 1
from sysobjects
where id = object_id('nation_code')
and type = 'U')
drop table nation_code
go
if exists (select 1
from sysobjects
where id = object_id('sex_code')
and type = 'U')
drop table sex_code
go
if exists (select 1
from sysobjects
where id = object_id('status_code')
and type = 'U')
drop table status_code
go
if exists (select 1
from sysobjects
where id = object_id('tansition')
and type = 'U')
drop table tansition
go
if exists (select 1
from sysobjects
where id = object_id('title_code')
and type = 'U')
drop table title_code
go
if exists (select 1
from sysobjects
where id = object_id('training')
and type = 'U')
drop table training
go
if exists (select 1
from sysobjects
where id = object_id('transCode')
and type = 'U')
drop table transCode
go
/*==============================================================*/
/* Table: Department */
/*==============================================================*/
create table Department (
dept_Id int not null,
dept_Name char(50) not null,
dept_Code char(10) not null,
dept_Leader int not null,
dept_Office char(200) null,
dept_Tel char(25) null,
dept_Fax char(25) null,
dept_Description text null,
constraint PK_DEPARTMENT primary key (dept_Id)
)
go
/*==============================================================*/
/* Table: Employee */
/*==============================================================*/
create table Employee (
emp_Id int not null,
ski_id int null,
ap_id int null,
sex_code char(1) not null,
trans_id int null,
evl_id int null,
dept_Id int not null,
marriage_code char(1) null,
poli_code char(1) null,
rel_id int null,
exp_id int null,
home_code char(3) not null,
title_code char(3) not null,
dip_code char(2) null,
status_code char(1) not null,
tra_id int null,
lev_code char(2) null,
nation_code char(2) null,
emp_Code char(10) not null,
emp_Name char(10) not null,
emp_IdNum char(25) not null,
emp_sex_Code char(1) null,
emp_dept_Code char(10) null,
emp_dipl_Code char(1) null,
emp_home_Code char(30) null,
emp_title_Code char(2) null,
emp_homeTel char(25) null,
emp_officeTel char(25) null,
emp_mobilePhone char(25) null,
emp_level_Code char(2) null,
emp_pager char(25) null,
emp_birthdate datetime null,
emp_totalWorkyear int null,
emp_address char(50) null,
emp_postcode char(8) null,
emp_status char(1) null,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -