建库建表.txt

来自「本系统适合中小规模宾馆使用」· 文本 代码 · 共 42 行

TXT
42
字号
create database hotel
on primary
(name=hotel_dat,filename='E:\Hotel System\hotel_dat.mdf',size=5,maxsize=10,filegrowth=1)
log on
(name='hotel_log',filename='E:\Hotel System\hotel_log.ldf',size=5,maxsize=10,filegrowth=1)



create table duty
(
 yname varchar(20) not null,
 fnum varchar(3) not null
)

 create table hotel
(
 gname varchar(20) not null primary key clustered,
 sex varchar(6) check(sex='male' or sex='female'),
 age int,
 idnumber varchar(20),
 room varchar(3),
 in_date varchar(10)
 constraint fk_hotel_hotel foreign key(room) references duty(fnum)
)


create table users
(
 用户名 varchar(10) not null primary key clustered,
 密码 varchar(8) 
)

create table info
(
 工号 varchar(10) not null primary key clustered,
 姓名 varchar(10) not null,
 工龄 int,
 年龄 int,
 性别 varchar(6) check(性别='male' or 性别='female')
)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?