Given the following two relational schemas, the EMPLOYEE relational schema records the employee number (ssn), age (age) and the department (dno), the primary key is ssn, and the DEPARTMENT relational schema records the department number (dnum ) and name (dname), The primary key is dnum, in which the foreign key "dno" of EMPLOYEE refers to the primary key "dnum" of DEPARTMENT,
please use SQL GROUP BY to write the query ”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)”.
Thank you guys
2
Answers
You can use as approach. It’s not exactly your tables but you can easy match it tot your structure:
format sql online