What is SQL?
SQL reads almost like English: select these columns from that table where this is true. The four commands that cover most apps, and how much of it you actually need to know.

Key takeaways
- SQL is a declarative language: you describe the result you want and the database works out how to get it.
- SELECT, INSERT, UPDATE and DELETE cover most of what an app does day to day; JOIN connects tables through their keys.
- You do not need to write SQL to build with Startbase, but reading a short query helps you check data and spot mistakes.
SQL (Structured Query Language, said "S-Q-L" or "sequel") is the standard language for reading and changing data in a relational database such as Postgres, MySQL or SQLite. It has been around since the 1970s, and almost every app with accounts, orders or saved progress runs SQL somewhere under the hood, even when nobody on the team writes it by hand.
SQL reads like a request to a clerk
Imagine asking a records clerk: "From the orders drawer, give me the date and total of every order over $50 from last week, newest first." The SQL is nearly the same sentence:
`SELECT created_at, total FROM orders WHERE total > 50 AND created_at > now() - interval '7 days' ORDER BY created_at DESC;`
Notice what is missing: you never say how to find the rows. SQL is declarative. You describe the result, and the database decides whether to scan the table or use an index. That is why the same query keeps working when the table grows from 100 rows to 10 million.
The four commands behind most apps
- SELECT reads rows: a leaderboard, a product list, a user's bookings.
- INSERT adds rows: a new signup, a new message, a score at the end of a level.
- UPDATE changes rows: a renamed project, a booking moved to Thursday. Forgetting the WHERE part updates every row in the table, the most famous SQL accident.
- DELETE removes rows. Same warning: `DELETE FROM users;` with no WHERE empties the table.
A fifth word, JOIN, is where relational databases earn their name. It combines tables through their primary and foreign keys: `SELECT players.username, scores.points FROM scores JOIN players ON players.id = scores.player_id ORDER BY points DESC LIMIT 10;` gives you a top-10 board with names. Commands like CREATE TABLE and ALTER TABLE define the structure itself, and saved as files they become migrations.
Why it matters when building with Startbase
Startbase Cloud runs on Postgres, and the agent writes the SQL for you: tables as migrations in your project, queries inside your app code. You describe the feature in plain words. Where SQL still pays off is checking your data. The Backend tab has a SQL editor that runs queries against your project's database. Read queries run inside a read-only transaction, so a SELECT can never change data, and anything that changes data or the schema asks you to confirm first. Results show up to 200 rows by default. For schema changes, the docs recommend asking the agent instead, so the change lands as a migration in your code.
Write me a SQL query I can run in the SQL editor to see how many new signups we had per day for the last 14 days, and a second one listing the 10 users with the most orders. Explain each line in one sentence so I can adjust them myself.
If a query returns an error, the raw Postgres message appears in the results panel and you can paste it straight into chat. For the concepts underneath, read database basics for non-developers and what is Supabase.
Common confusions
- SQL is a language, not a product. Postgres, MySQL and SQLite are databases that speak it, each with small dialect differences, like `now()` versus other date functions.
- SQL injection is a bug, not a feature of SQL. It happens when an app glues user input straight into a query string. Parameterized queries, which database client libraries use by default, prevent it.
- Knowing SQL is not the same as designing a database. Deciding which tables exist and how they relate matters more than query syntax.
Frequently asked questions
Is SQL hard to learn?
The basics are not. Most people can read and adapt a SELECT with WHERE, ORDER BY and LIMIT after an afternoon. Joins and grouping take a little longer, and performance tuning is a deeper skill.
Do I need to know SQL to build an app with AI?
No. The agent writes it. Being able to read a short query helps you verify data, understand an error message and ask for precise changes.
What is the difference between SQL and a spreadsheet formula?
A formula calculates inside one sheet. SQL asks questions across many tables at once, handles millions of rows and enforces rules like unique emails that a spreadsheet cannot.

