公交车查询的数据库设计
来源:互联网 发布:高速网络已成为家庭 编辑:程序博客网 时间:2024/04/24 18:06
--一次都不换乘的情况
create view BusLine_NoTransfer
as
select bl2.Line,bl2.stop StartStop,bl1.stop EndStop,bl1.position-bl2.position StopCount
from BusLine bl1 ,BusLine bl2
where bl1.Line = bl2.Line and bl1.position > bl2.position
--一次换乘的情况
create view BusLine_TransferOnce
as
select startline.StartStop StartStop,EndLine.EndStop EndStop,
StartLine.Line firstLine,StartLine.EndStop TransStop,EndLine.Line secondLine,
StartLine.StopCount+EndLine.StopCount StopCount
from BusLine_NoTransfer startline,BusLine_NoTransfer endline
where startline.line <> endline.line and startline.EndStop = EndLine.StartStop
--二次换乘的情况
create view BusLine_TransferTwice
as
select firstLine.StartStop StartStop,firstLine.Line line1,
firstLine.EndStop TransStop1,secondLine.Line line2,secondLine.EndStop TransStop2,
thirdLine.Line Line3,
thirdLine.EndStop EndStop,firstLine.StopCount+secondLine.StopCount+thirdLine.StopCount StopCount
from BusLine_NoTransfer firstLine,BusLine_NoTransfer secondLine,BusLine_NoTransfer thirdLine
where firstline.EndStop = secondLine.StartStop
and secondLine.EndStop = thirdLine.StartStop
and firstLine.Line <> secondLine.Line
and firstLine.Line <> thirdLine.Line
create view BusLine_NoTransfer
as
select bl2.Line,bl2.stop StartStop,bl1.stop EndStop,bl1.position-bl2.position StopCount
from BusLine bl1 ,BusLine bl2
where bl1.Line = bl2.Line and bl1.position > bl2.position
--一次换乘的情况
create view BusLine_TransferOnce
as
select startline.StartStop StartStop,EndLine.EndStop EndStop,
StartLine.Line firstLine,StartLine.EndStop TransStop,EndLine.Line secondLine,
StartLine.StopCount+EndLine.StopCount StopCount
from BusLine_NoTransfer startline,BusLine_NoTransfer endline
where startline.line <> endline.line and startline.EndStop = EndLine.StartStop
--二次换乘的情况
create view BusLine_TransferTwice
as
select firstLine.StartStop StartStop,firstLine.Line line1,
firstLine.EndStop TransStop1,secondLine.Line line2,secondLine.EndStop TransStop2,
thirdLine.Line Line3,
thirdLine.EndStop EndStop,firstLine.StopCount+secondLine.StopCount+thirdLine.StopCount StopCount
from BusLine_NoTransfer firstLine,BusLine_NoTransfer secondLine,BusLine_NoTransfer thirdLine
where firstline.EndStop = secondLine.StartStop
and secondLine.EndStop = thirdLine.StartStop
and firstLine.Line <> secondLine.Line
and firstLine.Line <> thirdLine.Line
and secondLine.Line <> thirdLine.Line
- 公交车查询的数据库设计
- 公交车路线查询系统后台数据库设计
- 公交车路线查询系统后台数据库设计——查询算法
- 公交车路线查询系统后台数据库设计—路线查询
- 公交车路线查询系统后台数据库设计——查询算法
- 公交车路线查询系统后台数据库设计--查询算法
- 数据库查询的设计
- 公交车路线查询系统后台数据库设计--关联地名和站点
- 公交车路线查询系统后台数据库设计--引入步行路线
- 公交车线路查询系统
- 公交车查询系统
- 公交车线路查询系统
- perl 公交车查询
- android 查询公交车还有几站的功能实现
- 公交车线路微机监控系统的设计与实现
- 公交车查询系统(20070719更新)
- SQL-公交车线路查询系统
- 公交车路线查询系统后台数据库设计—关联地名和站点
- Qt 与 OpenGL ES
- 快速枚举
- linux启动脚本学习
- NYOJ 动态规划
- usaco Longest Prefix
- 公交车查询的数据库设计
- 自动变量的潜在问题
- 2012.8.14 单词 New protection for Nepalese
- 学生信息管理系统总结 之 “风格”
- Android单词查找器
- 深入浅出FPGA-9-DFT之SCAN
- Android开发把项目打包成apk
- 【基础排序】折半插入排序
- Android开发—数据库应用—访问数据表(SQLite OpenHelper)