Reading Error Messages

When the database can't run a statement, it shows an error in red under the results, such as this one:

Error on line 3: no such column: titel

line 3 is the line where the statement with the mistake starts; you'll find the numbers of the lines on the left of the editor. After the colon comes SQLite's own description of the mistake, in English. The ones you'll meet most often:

  • no such column: titel – the table has no column with this name. Maybe there's a typo in it, or the column is in another table. Compare the name with the Tables tab.
  • no such table: game – there's no table with this name. Here, it's games, with an s.
  • near "customers": syntax error – SQLite didn't understand the statement. The word in quotes is where it got lost, and the mistake is right there or just before it.
  • incomplete input – the statement ended too early, for example because a quote or a bracket isn't closed.

Look at the third one more closely. In SELECT email FORM customers;, FROM has a typo. SQLite read FORM as a new name for the column email (you saw that in the exercise about the missing comma), so it didn't know what to do with customers. That's why the message names customers and not FORM. When the word in quotes looks right, check the words before it.

Statements before the one with the mistake have run, and you see their results. The statement with the mistake doesn't run, and neither does anything after it. So when you get an error, fix it, run the statements again, and if there's another error further down, go on with that one.

Instructions

Each of the three queries in the editor has a mistake. Run them, read the error, fix the mistake and run them again, until all three queries run. The last one then shows the emails of the customers:

email
ava.green@mail.com
emma.clark@mail.com
…

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

5/7