Skip to content
Advertisement

Is there something wrong with this SQL query

I am new to SQL queries and trying to understand it a little better. Is this SQL query valid regarding the picture below The question I was given was:

“For each book authored (or co-authored) by “Stephen King”, retrieve the title and the number of copies owned by the librarybranch whose name is “Central”

enter image description here

Advertisement

Answer

Please use below query, but the right approach is to use joins instead of multiple sub queries

Joins

Subquery

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