Repaso
EspaƱol
Databases & SQLFoundationsDB-55

In database language, what is a 'query'?

Options

  1. A bug that appears inside the database when it is overloaded
  2. A request to the database to get or change data, like SELECT (Correct option)
  3. A backup file that is created by the database every night
  4. A type of table that is used to store temporary rows

Answer

A request written to the database to get or change data, such as SELECT name FROM users

Why

To query means to ask the database a question or give it an instruction.

A read query uses SELECT and returns rows. A write query uses INSERT, UPDATE or DELETE and changes data.

Slow queries are a common cause of slow applications, which is why indexes and EXPLAIN matter later.

Remember

Query = a request to the database.

Key terms

Practice this question in Repaso