close

[employee table 員工資料表]

employee.png

[department table 部門資料表]

department.png

[dependent table 眷屬資料表]

dependent.png

[works_on table 參與資料表]

works_on.png

[project table 專案資料表]

project.png

[locations table 地點資料表]

locations.png

 

[每個部門的人數]

[每個部門的人數]

select DNAME,count(*)

from employee inner join departmeny on DNO=DNUMBER

group by DNAME

[每個部門薪水第一名的員工]

 

[每個部門薪水第一名的員工]

SELECT DNO, SSN, LNAME, SALARY
FROM employee E1
WHERE SALARY >= ALL (SELECT SALARY
                   FROM employee E2
                   WHERE E2.DNO = E1.DNO)

 

[資料相關參考]

http://goo.gl/5ntqJE

 

 

arrow
arrow
    全站熱搜

    米拉尤咕 發表在 痞客邦 留言(0) 人氣()