SQL exercises on hospital Database: Find the names of all the physicians performed a medical procedure but they are not ceritifed to perform
SQL hospital Database: Exercise-31 with Solution
31. Write a SQL query to obtain the names of all the physicians performed a medical procedure but they are not ceritifed to perform.
Sample table: physician
Sample table: undergoes
Sample table: trained_in
SELECT name AS "Physician" FROM physician WHERE employeeid IN ( SELECT undergoes.physician FROM undergoes LEFT JOIN trained_In ON undergoes.physician=trained_in.physician AND undergoes.procedure=trained_in.treatment WHERE treatment IS NULL );
Physician ------------------ Christopher Turk (1 row)
E R Diagram of Hospital Database:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?