題組內容
二、假設現有如下會議室借用紀錄資訊的關連式資料庫,請使用 SQL 回答相
關的子問題。
Room(rID, type, capacity, manageDept)
FKs: manageDept ref. Department(dID)
Department(dID, name, managerID) FKs: managerID ref. Employee(eID)
Employee(eID, name, deptID, expertise) FKs: deptID ref. Department(dID)
UseRecord(roomID, employeeID, date, startHour, endHour, purpose)
FKs: roomID ref. Room(rID), employeeID ref. Employee(eID)
其中 eID 是由西元年+3 位數的流水號所組成,如 2019001 表示 2019 年
第一位公司所聘用的員工。部門的主管,不一定是該部門的員工。所有
資料欄位不允許空白。