Comments in Jupyter with SQL

It appears that comment lines cannot be made in Jupyter in conjunction with SQLite commands/queries.
Yes? No?

I think the answer is “No”. :sunglasses:

Are you getting an error when you try to run the cell with comments? Does it look something like this:

(sqlite3.OperationalError) unrecognized token: "#"

If so, try making a comment using this syntax instead:

%%sql
/* Your comments go here */
SELECT * 
FROM table_name
LIMIT 5;

If this is not what you are experiencing, can you please provide the error you are getting and the code you are using to generate the error so that others can reproduce it on their end?

Also, when asking questions in the community, can you please provide the link to the mission as suggested in this post, thanks!

Thanks Mike!
Your example gave me a clue.
I had placed the comment line before the %%sql line as shown:
/* Your comments go here */
%%sql
SELECT *
FROM sqlite_master
WHERE type=‘table’;

and got this error:
File “”, line 1
*(Your, comments, go, here, */)
^
SyntaxError: invalid syntax

Once I placed the comment line AFTER the %%sql line, the error went away. Thanks!

Regards, Bruce

@sbgraham72: jupyter will not be able to interpret your sql comments unless u explicitly specify the %%sql syntax - tells the interpreter to treat the upcoming syntax as sql. So when you try to but the comments before that, you will get the error as described.