You want the visitors who went into the room called Vault, so you write:
SELECT name FROM visitors WHERE room = Vault ;
Enter fullscreen mode
Exit fullscreen mode
and SQLite answers:
Error: no such column: Vault
Enter fullscreen mode
Exit fullscreen mode
But Vault isn't supposed to be a column. It's the value you're looking for. That's exactly the problem, and the fix is two small marks.
Try it yourself
Here's a tiny table to run in any SQLite tool, such as DB Browser for SQLite or the sqlite3 command-line shell:
CREATE TABLE visitors ( id INTEGER PRIMARY KEY , name TEXT , room TEXT , entered TEXT ); INSERT INTO visitors ( name , room , entered ) VALUES ( 'Ava Brooks' , 'Lobby' , '21:40' ), ( 'Ben Carter' , 'Vault' , '22:15' ), ( 'Cleo Diaz' , 'Vault' , '22:50' ), ( 'Dan Evans' , 'Cafe' , '23:05' );
Enter fullscreen mode
Exit fullscreen mode
Why SQLite looks for a column
Apart from SQL's own keywords like SELECT and WHERE , a word without quotes is a name: the name of a table, a column or a…