Reading results and errors
Read the result
A query result contains columns and zero or more rows. A result with zero rows is not necessarily an error; it can mean no data matches the request. In the example below, the column name is name and four values are returned.
Diagnose an error
If you type SELECT product_name FROM products; the fixture has no column called product_name. SQLite reports a missing-column error. Check the table definition and replace product_name with name. Other engines may use different diagnostic wording. A failed query is not the same as an empty result.
Practice
Predict the number of rows before running the corrected query. If an error occurs, read its message, check the names and change only the suspected mistake. Avoid changing the schema just to make a misspelled query run.
Try the examples
Static SQL — run in the prepared lab.
SELECT name FROM products ORDER BY id;Expected rows (JSON notation):
[["Notebook"], ["Pen"], ["Bag"], ["Pencil"]]