客房预订管理系统(一)

实现语言: C# 、ASP.NET
使用程序: Visual Studio 2010 或以上 ,SQL Server 2005 或以上
时间:2020年7月

数据库

--主数据库
use master
go
--判断
if exists (select * from sys.databases where name = 'HotelDB')
drop database HotelDB
go
--创建数据库
create database HotelDB
go
--使用创建的数据库
use HotelDB
go
--判断
if exists (select * from sys.objects where name = 'RoomType')
drop table RoomType
if exists (select * from sys.objects where name = 'RoomInfo')
drop table RoomInfo
go
--创建表
create table RoomType
(
	TypeID int primary key identity(1,1),--房间类型编号 主键,自动增长列 
	TypeName varchar(50) not null,--房间类型名称  不允许为空 
)
create table RoomInfo
(
	roomeID int primary key identity(1,1), --房间编号  主键,自动增长列 
	Roomname varchar(50) not null,--房间名称 不允许为空
	roomePrice Int not null,--房间金额  不允许为空 
	RoomDes Varchar(500) not null,--房间简介 不允许为空
	addTime datetime,--入住时间 允许为空 (预订房间后才有时间更新)
	joininday Int,--入住天数 允许为空 
	Totalprice Int,--总金额 允许为空
	buyState int check (buyState=1 or buyState=2),--订购状态 1值为1或2,分别表示: 1:未预订  2:已 预订
	roomtypeID int references RoomType(TypeID),--所属类型编号  外键,房间所属房间类型编号 
)
go
--添加数据
insert into RoomType values ('豪华套房')
insert into RoomType values ('商务套房')
insert into RoomType values ('普通间')
insert into RoomType values ('标准间')
insert into RoomType values ('行政房')

insert into RoomInfo values ('夜的旋律',888,'地中海设计',null,null,1,null,1)
insert into RoomInfo values ('水城之恋',388,'地中海设计',null,null,1,null,2)
insert into RoomInfo values ('丝路花雨',468,'地中海设计',null,null,1,null,3)
insert into RoomInfo values ('吉祥如意',698,'地中海设计',null,null,1,null,4) 
--测试
select * from RoomType
select * from RoomInfo

测试结果

测试结果

未完待续…

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值