阿摩線上測驗 登入

申論題資訊

試卷:111年 - 111 一般警察特種考試_三等_警察資訊管理人員:資料庫應用#108505
科目:公職◆資料庫應用
年份:111年
排序:0

申論題內容

三、給予如下兩個關聯綱要(Relation Schemas) ,EMPLOYEE 關聯綱要記錄 員工編號(ssn) 、年齡(age)及所在部門(dno) ,主鍵為 ssn,DEPARTMENT 關聯綱要記錄部門編號(dnum)及名稱(dname),主鍵為 dnum,其中 EMPLOYEE 的外來鍵(Foreign Key)“dno”參考到 DEPARTMENT 的主 鍵(Primary Key)“dnum”,請用 SQL GROUP BY 寫出查詢「至少兩個 人的部門,取出部門名稱及年齡大於 25 歲的人數(For each department that has more than two employees, retrieve the department name and the number of its employees who each is more than twenty-five years old)」。