SQL prompt not recognizing semi-colon to execute

Screen Link: https://app.dataquest.io/m/192/table-relations-and-normalization/5/inserting-and-deleting-rows

Your Code: Enclose your code in 3 backticks like this to format properly: your code

What I expected to happen: sqlite> INSERT INTO wishlist VALUES (1, 34, Joao's awesome wishlist);

What actually happened: The prompt does not recognize the semi-colon ; to execute the code. I get stuck entering values and have no way to force the shell to execute the command.

Other details:

Hey, Butler.

This is happening because SQLite isn’t recognizing the semicolon as such, and the reason for this is that it is seeing as part of a string.

You’d like the third value to be "Joao's awesome wishlist", but you forgot the outer quotes. This makes it so that the shell thinks that ' in Joao's is signaling the beginning of a string, and it never encounters its end, hence this behavior.

I hope this helps.

6 Likes

Thanks so much Bruno! Sems obvious now… appreciate the quick help!

2 Likes