Identifiers and literals
Core idea
An identifier names a database object, such as products or price_cents. A literal supplies a value directly, such as 150 or the string 'Pen'. Single quotes enclose string literals; double quotes delimit identifiers in standard-oriented SQL. Prefer simple lowercase names with underscores for portable examples.
Minimal example
SELECT name, 150 FROM products ORDER BY id;Expected rows (in order):
Notebook | 150Pen | 150Bag | 150Pencil | 150How it works
The first column comes from each stored row; the second is the same literal for every row. An apostrophe in a string is represented by two single quotes. PostgreSQL folds unquoted identifiers to lowercase; other engines may differ. SQLite can accept some double-quoted strings as a legacy extension, so do not rely on that behavior.
Practical example
SELECT 'Sara''s notebook', 150;Expected rows (in order):
Sara's notebook | 150Practice
Retrieve name and a constant string indicating the currency unit. Explain which is the identifier.