三等一般警察人員考試 資料庫一題 - 考試
By Anthony
at 2013-06-30T23:54
at 2013-06-30T23:54
Table of Contents
二、假設某學校資料庫如下:
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 (*)可能會多算,
我不是很熟資料庫,
請問我的想法是否正確?
請各位大大解惑 感謝~~
--
Tags:
考試
All Comments
By Zenobia
at 2013-07-05T14:42
at 2013-07-05T14:42
By Una
at 2013-07-10T04:15
at 2013-07-10T04:15
By Jack
at 2013-07-13T11:50
at 2013-07-13T11:50
By Hedda
at 2013-07-16T09:55
at 2013-07-16T09:55
By Olga
at 2013-07-19T00:28
at 2013-07-19T00:28
By Isla
at 2013-07-23T14:14
at 2013-07-23T14:14
By Mia
at 2013-07-23T20:13
at 2013-07-23T20:13
By Tristan Cohan
at 2013-07-24T12:16
at 2013-07-24T12:16
By William
at 2013-07-25T21:24
at 2013-07-25T21:24
By Candice
at 2013-07-29T23:09
at 2013-07-29T23:09
By Sandy
at 2013-08-03T05:38
at 2013-08-03T05:38
By Jessica
at 2013-08-06T15:29
at 2013-08-06T15:29
By Robert
at 2013-08-07T06:07
at 2013-08-07T06:07
By Doris
at 2013-08-08T01:15
at 2013-08-08T01:15
By Mary
at 2013-08-11T07:23
at 2013-08-11T07:23
By Dora
at 2013-08-15T11:09
at 2013-08-15T11:09
By Carol
at 2013-08-17T08:44
at 2013-08-17T08:44
By Michael
at 2013-08-19T13:18
at 2013-08-19T13:18
Related Posts
公職抉擇 資訊處理或一般行政
By Cara
at 2013-06-30T23:20
at 2013-06-30T23:20
考P的時候要帶護照嗎?
By Andrew
at 2013-06-30T23:18
at 2013-06-30T23:18
台電雇員(養成班)備取問題
By Hedwig
at 2013-06-30T23:07
at 2013-06-30T23:07
財稅師資選擇
By Hardy
at 2013-06-30T22:52
at 2013-06-30T22:52
證交法問題
By Quintina
at 2013-06-30T22:51
at 2013-06-30T22:51