table_roomlist.sql
来自「一套宾馆管理系统」· SQL 代码 · 共 155 行
SQL
155 行
use hotel
go
create table RoomProperty --房间特征表
(
roompro_id smallint not null primary key identity(1,1), --程序用id
roompro_name varchar(30) not null default '普通房间', --房间特征
memo varchar(30) default '' --备注
)
create table RoomList --房间表
(
room_id int not null primary key identity(1,1), --程序用唯一id
room_no varchar(10) not null default '', --房间编号
flooer_id smallint not null default 1, --房间所在楼层
bed_num smallint default 1, --房间床位数
roompro_id smallint references RoomProperty(roompro_id) , --房间特征代码
memo1 varchar(30) default '', --备注1
memo2 varchar(30) default '' --各注2
IsLock bit default (0)
)
create table DateList --日期列表
(
date_id smallint not null primary key identity(1,1), --程序用id
date_name datetime not null default getdate(), --日期内容(日期值)
memo varchar(30) default '' --备注
)
create table CustomerList
(
custom_name varchar(50) not null,--姓名
custom_sexid tinyint not null, --性别
custom_countryid smallint not null, --国籍
custom_nation smallint default 0, --民族
custom_birth varchar(10) default '',
custom_phone varchar(20) default '',
custom_post varchar(20) default '',
custom_address varchar(50) default '',
image_path varchar(50) default '',
regist_date smallint not null,
regist_time varchar(10) not null,
leave_date smallint not null,
leave_time varchar(10) not null,
room_id int not null,
bed_no int not null,
bedstate_id smallint default 1,
memo1 varchar(30) default '',
memo2 varchar(30) default ''
)
create table BedStatus
(
bedstate_id smallint not null primary key identity(1,1),
bedstate_name varchar(20) not null ,
memo varchar(30)
)
create table SexList
(
sex_id tinyint not null primary key identity(1,1),
sex_name varchar(10) not null,
memo varchar(30) default ''
)
create table CountryList
(
Country_id smallint not null primary key identity(1,1),
country_name varchar(50) not null,
memo varchar(30) default ''
)
create table UserList
(
userid int not null primary key identity(1,1),
username varchar(20) not null,
secret varchar(20) not null,
memo varchar(30) default ''
)
create table PermitList
(
permitid int not null primary key identity(1,1) ,
permission varchar(50) not null,
memo varchar(30) default ''
)
create table RoleList
(
roleid int not null primary key identity(1,1),
rolename varchar(30) not null,
memo varchar(30) default ''
)
create table UserRoles
(
userid int not null,
roleid int not null,
memo varchar(30) default ''
)
create table RolePermits
(
roleid int not null,
permitid int not null,
memo varchar(30) default ''
)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?