数据库每月12日前更新,最新完整数据库包含“台北”和“台中”机场超过 46,486 条数据。
表:Domestic(地区/城市)字段说明
Address_en(英文名称);Address_cn(城市/地区中文名称);Abbreviation(缩写)
表:AirlineDate2(国内航班详细表)字段说明
startCity(起飞城市/地区缩写);lastCity(到达城市/地区缩写);Company(航班公司);AirlineCode(航班号);StartDrome(起飞机场);ArriveDrome(到达机场);StartTime(起飞时间);ArriveTime(到达时间);Mode(机型);AirlineStop(备用字段);Week(星期)
注:表字段类型均为 NVarChar(50) 字符串类型
-- 通过城市/地区中文名称查询缩写 SQL
SELECT [Abbreviation] FROM [Domestic] WHERE ([Address_cn] LIKE @Address_cn)
ORDER BY [Abbreviation] ASC
-- 通过城市/地区缩写查询航班数据 SQL
SELECT * FROM [AirlineDate2]
WHERE ([startCity] = @startCity AND [lastCity] = @lastCity) ORDER BY [StartTime] ASC
-- 飞机航班一次中转换乘查询
SELECT DISTINCT
TOP (100) PERCENT dbo.Domestic.Address_cn AS sCity,
dbo.AirlineDate2.StartDrome AS sDrome, dbo.AirlineDate2.AirlineCode AS sCode,
Domestic_2.Address_cn AS tCity, dbo.AirlineDate2.ArriveDrome AS tDrome,
AirlineDate2_1.AirlineCode AS tCode, Domestic_1.Address_cn AS eCity,
AirlineDate2_1.ArriveDrome AS eDrome
FROM dbo.Domestic AS Domestic_2 INNER JOIN
dbo.Domestic INNER JOIN
dbo.AirlineDate2 ON dbo.Domestic.Abbreviation = dbo.AirlineDate2.startCity ON
Domestic_2.Abbreviation = dbo.AirlineDate2.lastCity INNER JOIN
dbo.Domestic AS Domestic_1 INNER JOIN
dbo.AirlineDate2 AS AirlineDate2_1 ON
Domestic_1.Abbreviation = AirlineDate2_1.lastCity ON
dbo.AirlineDate2.lastCity = AirlineDate2_1.startCity
WHERE (dbo.Domestic.Address_cn = '无锡') AND (Domestic_1.Address_cn = '香格里拉') AND
(dbo.AirlineDate2.Company <> '没有航班') AND (AirlineDate2_1.Company <> '没有航班')
ORDER BY tDrome
/*
sCity = 出发城市,sDrome = 出发机场,sCode = 出发航班,tCitu = 中转城市,
tDrome = 中转机场,tCode = 中转航班,eCity = 到达城市,eDrome = 到达机场
如果 Ms Sql Server 不是 dbo 或 Access 请去掉 “dbo.”
*/