Single-Table Queries Flashcards

1️⃣ Familiarise yourself with the flashcards:

  • Look through all the flashcards to see what's on both sides.
  • Make sure you understand the information on each card. If something's unclear, click the link to the revision notes at the bottom of the page for more details.

2️⃣ Test yourself:

  • Look at the question or prompt on each card and try to remember the answer before flipping it over.
  • Check the answer and make a note of any cards you find challenging and need to go over more.

3️⃣ Consistently Review and Practice:

  • Use spaced repetition: spend more time on the cards you struggle with and go over them more often.
  • Regularly review all the flashcards to help you better understand and retain the information over time.

Note: We may include questions that have multiple correct answers. It's useful to remember specific examples to understand these concepts better.

PERSONALISED 1-TO-1 TUTORING

Need more help on this topic? Get 1-to-1 support

Get support with clear explanations, practice and feedback (Ages 5 to 16).

  • DBS-checked tutors
  • Flexible times
  • Parents can be updated

Want an ad-free experience? Subscribe to remove ads

What does SELECT do in a single-table query?

It picks which columns to show.

What does FROM do in a single-table query?

It names the table to get the data from.

What is the purpose of a WHERE clause?

It filters rows so only those meeting a condition are shown.

How do you sort results in SQL?

Use ORDER BY a column. Add ASC for ascending or DESC for descending.

Which keywords combine or reverse conditions in a WHERE clause?

AND combines, OR allows either, and NOT reverses a condition.

What does LIKE do in a WHERE clause?

It matches text to a pattern.

In a LIKE pattern, what do % and _ mean?

% means any number of characters. _ means one character.

How do you return only unique values from one column?

Use DISTINCT before the column name.

What does COUNT(*) return?

The number of rows that match the query.

What does AVG(column) return?

The average of the numbers in that column.

How can you show a calculated field in the results?

Put an expression in SELECT and name it with AS, for example price*qty AS total.

In a WHERE clause, how should you write text values?

Put text in single quotes, for example 'London'.