Skip to content
Advertisement

Three-table join with NO EXISTS

I have three tables and would like to answer the following question in SQL:

“Who has only certifications that do NOT have scores?”

For instance, in the setup below, the query would return “John” only. Joana has the “AWS Certification”, which is in SCORE table (id 57). Marry has the “ITIL V3 Certification” which is not in the SCORE table, but she also has “Professional Python Dev”, which is in thee SCORE table.

I am trying to implement this in SQL only without having to iterate over the records and without using stored procedures.

SQL for creating these tables and adding the data in case anyone needs it:

Advertisement

Answer

You can use following query

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement