毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

VB客房管理系统设计 第3页

更新时间:2010-1-26:  来源:毕业论文
VB客房管理系统设计 第3页
[Rstates] [char] (2) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Cid] [int] NULL
) ON [PRIMARY]
GO
F 在表GuestInfo中,创建一个触发器:
CREATE TRIGGER insert_tri ON dbo.GuestInfo
FOR INSERT
AS
update RoomInfo
set Rstates='满',Cid=(select Cid from inserted)
where Rnum=(select Rnum from inserted)
功能:当向表GuestInfo中插入一个客户信息时,触发表RoomInfo的某房间的状态变为“满”
(3)建立视图
A 管理员信息视图
CREATE VIEW dbo.ViewAdminInfo
AS
SELECT Aid, Aname, Alimit
FROM dbo.AdminInfo
B 总收入视图
CREATE VIEW dbo.ViewAllCost
AS
SELECT SUM(Ccost) AS AllCost
FROM dbo.GuestInfo
C 标准房收入视图
CREATE VIEW dbo.ViewBiaozhunCost
AS
SELECT SUM(a.Ccost) AS BiaozhunCost
FROM dbo.GuestInfo a INNER JOIN
      dbo.RoomInfo b ON a.Rnum = b.Rnum
WHERE (b.Rtype = '标准')
D 收入视图
CREATE VIEW dbo.ViewCost
AS
SELECT dbo.ViewAllCost.AllCost, dbo.ViewPutongCost.putongCost,
      dbo.ViewBiaozhunCost.BiaozhunCost, dbo.ViewHaohuaCost.HaohuaCost
FROM dbo.ViewAllCost CROSS JOIN
      dbo.ViewPutongCost CROSS JOIN
      dbo.ViewBiaozhunCost CROSS JOIN
      dbo.ViewHaohuaCost

E 空房信息视图
CREATE VIEW dbo.ViewEmptyRoomInfo
AS
SELECT Rnum, Rtype, Rprice, Rstates
FROM dbo.RoomInfo
WHERE (Rstates = '空')
F 满房信息视图
CREATE VIEW dbo.ViewFullRoomInfo
AS
SELECT dbo.RoomInfo.*
FROM dbo.RoomInfo
WHERE (Rstates = '满')
G 客户信息视图
CREATE VIEW dbo.ViewGuestInfo
AS
SELECT dbo.GuestInfo.*
FROM dbo.GuestInfo

H 豪华房收入视图
CREATE VIEW dbo.ViewHaohuaCost
AS
SELECT SUM(a.Ccost) AS HaohuaCost
FROM dbo.GuestInfo a INNER JOIN
      dbo.RoomInfo b ON a.Rnum = b.Rnum
WHERE (b.Rtype = '豪华'
I 普通房收入视图
CREATE VIEW dbo.ViewPutongCost
AS
SELECT SUM(a.Ccost) AS PutongCost
FROM dbo.GuestInfo a INNER JOIN
      dbo.RoomInfo b ON a.Rnum = b.Rnum
WHERE (b.Rtype = '普通')
J 房间信息视图
CREATE VIEW dbo.ViewRoomInfo
AS
SELECT dbo.RoomInfo.*

上一页  [1] [2] [3] [4] 下一页

VB客房管理系统设计 第3页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。