w3resource
SQL exercises

SQL exercises on hospital Database: Find the name of the nurse who are the head of their department

SQL hospital Database: Exercise-2 with Solution

2. Write a query in SQL to find the name of the nurse who are the head of their department.

Sample table: nurse


Sample Solution:

SELECT name AS "Name",
       POSITION AS "Position"
FROM nurse
WHERE POSITION='Head Nurse';

Sample Output:

      Name      |  Position
----------------+------------
 Carla Espinosa | Head Nurse
(1 row)

Practice Online


E R Diagram of Hospital Database:

E R Diagram: SQL Hospital Database.

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query in SQL to find all the information of the nurses who are yet to be registered.
Next: Write a query in SQL to obtain the name of the physicians who are the head of the department.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming