SQL is called a declarative language. What does that mean?

You describe the data you want, and the database decides how to get it.

Start playing free

  1. You list each step the computer must follow
  2. You describe the result and the engine picks the steps ✔
  3. You can only declare variables

Why: In a SQL query you say which rows and columns you want. The database engine decides whether to scan the table or use an index and in what order to do the work.

Huh, didn't know that: Procedural languages like C are the opposite: the program is a list of instructions saying exactly what to do.

The dad joke
I wrote a declarative grocery list: I want dinner. The database still did not cook it.
Like this card?
Play the game

References

Answer: You describe the result and the engine picks the steps. In a SQL query you say which rows and columns you want. The database engine decides whether to scan the table or use an index and in what order to do the work.

  1. Python docs: Functional Programming HOWTO docs.python.org/3/howto/functional.html
    a SQL query describes the data set you want to retrieve, and the SQL engine decides whether to scan tables or use indexes
    Checked 2026-10-10.

Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.

Test yourself in the game