以下几道题尚未掌握,需更多练习——
4.以下查詢列出途經 London Road (149) 或 Craiglockhart (53)的巴士線號碼。注意有兩條路線會經過這兩個站兩次。 加入 HAVING 語句來限制只列出這兩條路線。
(**知其然不知其所以然,这道题需要更多体会**)
5.執行自我合拼來,留意b.stop代表由Craiglockhart出發不用轉車可前住的地方。 修改它來顯示由Craiglockhart到 London Road的服務資料。
(**完全照猫画虎,还未理解**)
6.此題和上題相似,但是用兩個stops表來自我合拼。這樣我們可以用站名而非站編號。 修改它來顯示由Craiglockhart到 London Road的服務資料。 如你太悶,可試一試由 'Fairmilehead' 到 'Tollcross' (系統會當答錯的。正確有3條路線:11,15,315)
(**self join语句需要继续练习**)
7.列出連接115 和 137 ('Haymarket' 和 'Leith') 的公司名和路線號碼。不要重覆。
(**两种方式均可**)
9.不重覆列出可以由 'Craiglockhart' 乘一程車到達的站stops,包括'Craiglockhart'本身。 列出站名,公司名和路線號碼。
10.Find the routes involving two buses that can go from Craiglockhart to Sighthill.
Show the bus no. and company for the first bus, the name of the stop for the transfer,
and the bus no. and company for the second bus.
Hint
Self-join twice to find buses that visit Craiglockhart and Sighthill, then join those on matching stops.
(**暂时解不出来,暂空,做出来再补充**)