← PostgreSQL learning pathPostgreSQL · Module 3 of 10
Querying data
Select, filter, sort and paginate with SQL.
📖 Key ideas
- SELECT name, email FROM users WHERE active = true ORDER BY name LIMIT 10;
- Pattern match: ILIKE '%sharma%' (case-insensitive).
- IN, BETWEEN, IS NULL in WHERE.
- DISTINCT removes duplicates.
- OFFSET skips rows (use keyset pagination for big tables).
💡 Real-life example: SELECT is asking a librarian: which books (columns), from which shelf (table), matching what rule (WHERE).
SELECTReads data
WHEREFilters rows
ILIKECase-insensitive pattern match
LIMITCaps rows returned