二、假設某學校資料庫如下: Course (CID, NAME, DEPT) // 課程(課程代號,課程名稱,系名) Classroom (RID, LOCATION, TYPE) // 教室(教室編號,教室地點,類別) Use(CID , RID, TIME) // 使用(課程代號,教室編號,使用時間) 藍色為主鍵 (四)指出並改正下列SQL 語法錯誤以找出每間小型教室的使用次數。(10 分) SELECT R.RID, COUNT (*) AS usecount FROM Classroom R, Use S WHERE R.RID=S.RID GROUP BY R.RID HAVING R.TYPE='small' 我認為的答案是改COUNT(TIME) 因為同一時間可能有兩個課程使用同一間教室? COUNT (*)可能會多算, 我不是很熟資料庫, 請問我的想法是否正確? 請各位大大解惑 感謝~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.34.219.104
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html
You are receiving this email because you subscribed to this feed at blogtrottr.com.