levo

Databases

Structured Query Language: retrieving data

  • 3 things to know
  • A2 Unit 1

Overview

Difference between WHERE and HAVING and difference between an inner join and a left outer join.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What does the ORDER BY clause do?

Key term

What is the difference between WHERE and HAVING?

Key term

What is the difference between an inner join and a left outer join?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    Write the SQL to list every column of every row in the Member table.

    Model answer

    The statement is SELECT * FROM Member; where the asterisk stands for every column and the absence of a WHERE clause means every row.

  2. 2

    Write the SQL to list the surnames of members who joined after the first of January 2026.

    Model answer

    The statement is SELECT Surname FROM Member WHERE JoinDate > '2026-01-01'; which returns one column and only the rows meeting the condition.

  3. 3

    What does the ORDER BY clause do?

    Model answer

    ORDER BY sorts the rows returned by a query on one or more columns, ascending by default and descending when DESC is added, without changing how the rows are stored.

  4. 4

    Write the SQL to list members in surname order, latest joiners first within each surname.

    Model answer

    The statement is SELECT * FROM Member ORDER BY Surname ASC, JoinDate DESC; where the second sort column breaks ties within the first.

  5. 5

    What does the LIKE operator do?

    Model answer

    LIKE matches a text value against a pattern, where the percent sign stands for any sequence of characters and the underscore for a single character, so LIKE 'Mc%' finds every surname beginning Mc.

  6. 6

    Write the SQL to count how many members there are.

    Model answer

    The statement is SELECT COUNT(*) FROM Member; which returns a single number, the count of rows in the table.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Systems Analysis and Development Approaches
Design, Development and Testing
Implementation and System Security
Programming

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A check requires a value.
presencerangeformat

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

ANormal data is 12, which should be accepted.
BBoundary data is 1 and 50, which should be accepted.
C0 and 51, just outside the limits, should be rejected.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

One byte is made up of 8 bits.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Databases, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.