Data

query

A query is a single request you send to a database — to fetch some data, or to change it. It's one question or one instruction: 'show me all unpaid invoices', or 'mark order 42 as shipped'. The database does it and hands back the answer.

Most queries you write in SQL. A read query asks for rows back (SELECT … WHERE …); a write query adds, edits, or removes them. Either way, one query is one round-trip: you ask, the database answers, done.

Queries are also where speed lives or dies. A query that scans every row in a million-row table is slow; the same query, helped by an index, can feel instant. So when an app drags, the queries are often the first place to look.

SELECT * FROM invoices WHERE paid = false;

One query, one question: which invoices are still unpaid?

A query is the request; the rows that come back are the 'result set'. Same word, two halves.

Also called
db querylookuprequest