It's as simple as the wrong type of quote marks. You wanted:
SELECT * FROM grades
WHERE subject = 'latin';
To explain:
- Single quotes, like
'latin'
, are the standard way to write a string in standard SQL, and should work on all DBMSes.
- Double quotes, in Postgres and some other DBMSes, are a way of quoting identifiers - so if your column name had a space in for some reason (there's not many good reasons to do it, but it's possible), then you might write
SELECT * FROM grades WHERE "subject name" = 'latin'
- "subject name"
is the name of the column, 'latin'
is a string.
Although double quotes are in the SQL standard, other DBMSes use different syntax for quoting identifiers, so may treat double quotes as an alternative for writing strings.
-- Postgres (also works in Microsoft SQL Server, but isn't the default style)
SELECT * FROM grades WHERE "subject name" = 'latin'
-- MySQL
SELECT * FROM grades WHERE `subject name` = 'latin'
-- Microsoft SQL Server
SELECT * FROM grades WHERE [subject name] = 'latin'
But if you always use single quotes for strings, and avoid names that need quoting, you'll run into fewer problems.
-- Works pretty much everywhere
SELECT * FROM grades WHERE subject = 'latin'