Screen Link: https://app.dataquest.io/m/191/guided-project%3A-answering-business-questions-using-sql/6/albums-vs-individual-tracks
I created 2 tables to check how IS NULL clause works.
My Code:
%%sql
(SELECT track_id FROM table_1
EXCEPT
SELECT track_id FROM table_2
) IS NULL
What actually happened:
* sqlite:///chinook.db
(sqlite3.OperationalError) near "(": syntax error
[SQL: (SELECT track_id FROM table_1
EXCEPT
SELECT track_id FROM table_2
) IS NULL]
(Background on this error at: http://sqlalche.me/e/e3q8)
When I change the code to this:
%%sql
SELECT track_id FROM table_1
EXCEPT
SELECT track_id FROM table_2
The result is correct ( ‘track_id’ columns from both tables are the same):
* sqlite:///chinook.db
Done.
track_id