In plain words
SQL is the language Postgres and most other databases understand, and a query is one request written in it, like "give me the ten newest posts".
Where you see it
The SQL Editor in Supabase, or a block in your agent's chat that starts with select. Even when your code uses the Supabase client or an ORM, SQL is what finally reaches the database.
What goes wrong
- An update with no where
Without a where line, an update changes every row in the table, not the one you meant.
update orders set status = 'cancelled'; - Fetching everything and filtering later
Loading all 50,000 orders and filtering them in JavaScript is slow, and can send rows to the browser that the user shouldn't see. Filter in the query.
- Gluing user input into the query
Building SQL by joining strings lets a visitor slip SQL of their own into it. Use parameters, which the Supabase client and ORMs handle for you.
`select * from users where email = '${email}'`
What to tell your agent
Quick check
Sign in to earn +10 XP for itYou ask your agent to cancel order 812, and it runs update orders set status = 'cancelled'. What happened?