📄 sms.txt
字号:
/*==============================================================*/
/* Index: Relationship_8_FK */
/*==============================================================*/
create index Relationship_8_FK on TB_EMPLOYEE (
emtId ASC
)
go
/*==============================================================*/
/* Table: TB_EMPLOYEE_TYPE */
/*==============================================================*/
create table TB_EMPLOYEE_TYPE (
emtId varchar(15) not null,
emtName varchar(10) not null,
constraint PK_TB_EMPLOYEE_TYPE primary key nonclustered (emtId)
)
go
/*==============================================================*/
/* Table: TB_GOODS */
/*==============================================================*/
create table TB_GOODS (
gsId varchar(14) not null,
gtId int null,
gsName varchar(30) not null,
gsPrice int not null,
constraint PK_TB_GOODS primary key nonclustered (gsId)
)
go
/*==============================================================*/
/* Index: Relationship_1_FK */
/*==============================================================*/
create index Relationship_1_FK on TB_GOODS (
gtId ASC
)
go
/*==============================================================*/
/* Table: TB_GOODS_TYPE */
/*==============================================================*/
create table TB_GOODS_TYPE (
gtId int not null,
gtName varchar(20) not null,
gtParentId int not null,
constraint PK_TB_GOODS_TYPE primary key nonclustered (gtId)
)
go
/*==============================================================*/
/* Table: TB_MEMBER */
/*==============================================================*/
create table TB_MEMBER (
memId varchar(15) not null,
memName varchar(10) not null,
memIdentity varchar(18) not null,
memPoint int not null,
constraint PK_TB_MEMBER primary key nonclustered (memId)
)
go
/*==============================================================*/
/* Table: TB_PROVIDER */
/*==============================================================*/
create table TB_PROVIDER (
proId varchar(15) not null,
proName varchar(30) not null,
proLinkName varchar(10) not null,
proTelephone varchar(30) not null,
constraint PK_TB_PROVIDER primary key nonclustered (proId)
)
go
/*==============================================================*/
/* Table: TB_SALE_GOODS */
/*==============================================================*/
create table TB_SALE_GOODS (
sagId varchar(15) not null,
sasId varchar(15) null,
gsId varchar(14) null,
sagCount int not null,
sagSasId varchar(15) not null,
constraint PK_TB_SALE_GOODS primary key nonclustered (sagId)
)
go
/*==============================================================*/
/* Index: Relationship_3_FK */
/*==============================================================*/
create index Relationship_3_FK on TB_SALE_GOODS (
gsId ASC
)
go
/*==============================================================*/
/* Index: Relationship_9_FK */
/*==============================================================*/
create index Relationship_9_FK on TB_SALE_GOODS (
sasId ASC
)
go
/*==============================================================*/
/* Table: TB_SALE_SHEET */
/*==============================================================*/
create table TB_SALE_SHEET (
sasId varchar(15) not null,
empId varchar(15) null,
sasTotalMoney decimal not null,
sasTime datetime not null,
constraint PK_TB_SALE_SHEET primary key nonclustered (sasId)
)
go
/*==============================================================*/
/* Index: Relationship_7_FK */
/*==============================================================*/
create index Relationship_7_FK on TB_SALE_SHEET (
empId ASC
)
go
/*==============================================================*/
/* Table: TB_STOCK_GOODS */
/*==============================================================*/
create table TB_STOCK_GOODS (
stgId varchar(15) not null,
stsId varchar(15) null,
gsId varchar(14) null,
stgCount int not null,
constraint PK_TB_STOCK_GOODS primary key nonclustered (stgId)
)
go
/*==============================================================*/
/* Index: Relationship_4_FK */
/*==============================================================*/
create index Relationship_4_FK on TB_STOCK_GOODS (
gsId ASC
)
go
/*==============================================================*/
/* Index: Relationship_10_FK */
/*==============================================================*/
create index Relationship_10_FK on TB_STOCK_GOODS (
stsId ASC
)
go
/*==============================================================*/
/* Table: TB_STOCK_SHEET */
/*==============================================================*/
create table TB_STOCK_SHEET (
stsId varchar(15) not null,
empId varchar(15) null,
proId varchar(15) null,
stsTotalMoney decimal not null,
stsTime datetime not null,
constraint PK_TB_STOCK_SHEET primary key nonclustered (stsId)
)
go
/*==============================================================*/
/* Index: Relationship_5_FK */
/*==============================================================*/
create index Relationship_5_FK on TB_STOCK_SHEET (
proId ASC
)
go
/*==============================================================*/
/* Index: Relationship_6_FK */
/*==============================================================*/
create index Relationship_6_FK on TB_STOCK_SHEET (
empId ASC
)
go
/*==============================================================*/
/* Table: TB_STORAGE */
/*==============================================================*/
create table TB_STORAGE (
stoId varchar(15) not null,
gsId varchar(14) null,
stoCount int not null,
stoTime datetime not null,
constraint PK_TB_STORAGE primary key nonclustered (stoId)
)
go
/*==============================================================*/
/* Index: Relationship_2_FK */
/*==============================================================*/
create index Relationship_2_FK on TB_STORAGE (
gsId ASC
)
go
/*==============================================================*/
/* Table: TB_SUPPLY */
/*==============================================================*/
create table TB_SUPPLY (
supId varchar(15) not null,
proId varchar(15) null,
gtId int null,
constraint PK_TB_SUPPLY primary key nonclustered (supId)
)
go
/*==============================================================*/
/* Index: Relationship_11_FK */
/*==============================================================*/
create index Relationship_11_FK on TB_SUPPLY (
proId ASC
)
go
/*==============================================================*/
/* Index: Relationship_12_FK */
/*==============================================================*/
create index Relationship_12_FK on TB_SUPPLY (
gtId ASC
)
go
alter table TB_EMPLOYEE
add constraint FK_TB_EMPLO_RELATIONS_TB_EMPLO foreign key (emtId)
references TB_EMPLOYEE_TYPE (emtId)
go
alter table TB_GOODS
add constraint FK_TB_GOODS_RELATIONS_TB_GOODS foreign key (gtId)
references TB_GOODS_TYPE (gtId)
go
alter table TB_SALE_GOODS
add constraint FK_TB_SALE__RELATIONS_TB_GOODS foreign key (gsId)
references TB_GOODS (gsId)
go
alter table TB_SALE_GOODS
add constraint FK_TB_SALE__RELATIONS_TB_SALE_ foreign key (sasId)
references TB_SALE_SHEET (sasId)
go
alter table TB_SALE_SHEET
add constraint FK_TB_SALE__RELATIONS_TB_EMPLO foreign key (empId)
references TB_EMPLOYEE (empId)
go
alter table TB_STOCK_GOODS
add constraint FK_TB_STOCK_RELATIONS_TB_STOCK foreign key (stsId)
references TB_STOCK_SHEET (stsId)
go
alter table TB_STOCK_GOODS
add constraint FK_TB_STOCK_RELATIONS_TB_GOODS foreign key (gsId)
references TB_GOODS (gsId)
go
alter table TB_STOCK_SHEET
add constraint FK_TB_STOCK_RELATIONS_TB_PROVI foreign key (proId)
references TB_PROVIDER (proId)
go
alter table TB_STOCK_SHEET
add constraint FK_TB_STOCK_RELATIONS_TB_EMPLO foreign key (empId)
references TB_EMPLOYEE (empId)
go
alter table TB_STORAGE
add constraint FK_TB_STORA_RELATIONS_TB_GOODS foreign key (gsId)
references TB_GOODS (gsId)
go
alter table TB_SUPPLY
add constraint FK_TB_SUPPL_RELATIONS_TB_PROVI foreign key (proId)
references TB_PROVIDER (proId)
go
alter table TB_SUPPLY
add constraint FK_TB_SUPPL_RELATIONS_TB_GOODS foreign key (gtId)
references TB_GOODS_TYPE (gtId)
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -