Question: Each primary key is specified with a key icon. The one - to - many relationships are specified by using Note that in this question,

Each primary key is specified with a key icon.
The one-to-many relationships are specified by using
Note that in this question, the names of foreign key are coincidentally the same as the names
of primary key being referenced.
Write SQL commands to answer the following queries.
(c) Write a query to get the average salary for all departments employing more than 10
employees. List the department ID, average salary for the department and the
number of employees in the department.
(3 marks)
(d) Write a query to find the name (first_name, last_name) and the salary of the
employees who have a higher salary than the employee whose employee ID is 101.
(Hint: use sub-query)
(3 marks)
Each primary key is specified with a key icon.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!