levo

SQL, Big Data and Distributed Systems

Retrieving data with SELECT, FROM and WHERE

  • 3 things to know
  • Component 2

Overview

The three clauses of a retrieval query, what each supplies, and writing queries against a stated table to return particular columns and particular rows.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

State the three clauses of a basic SQL retrieval query and what each supplies.

Key term

A table Book holds Title, Author and Price. Write SQL to list every title.

Key term

What does SELECT * FROM Book return?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    State the three clauses of a basic SQL retrieval query and what each supplies.

    Model answer

    SELECT names the columns wanted and FROM names the table they come from. WHERE states the condition a row must satisfy to be returned.

  2. 2

    A table Book holds Title, Author and Price. Write SQL to list every title.

    Model answer

    SELECT Title FROM Book. The query returns one column holding the title of every row in the table.

  3. 3

    What does SELECT * FROM Book return?

    Model answer

    SELECT * FROM Book returns every column of every row in the table Book. The asterisk stands for all columns.

  4. 4

    Book holds Title, Author and Price. Write SQL to list the title and author of books priced below 8.

    Model answer

    SELECT Title, Author FROM Book WHERE Price < 8. Only rows whose Price is less than 8 are returned.

  5. 5

    Book holds Title, Author, Price and YearPub. Write SQL to list all details of books published in 2019.

    Model answer

    SELECT * FROM Book WHERE YearPub = 2019. The asterisk returns every column for each matching row.

  6. 6

    Why does a WHERE clause reduce the work a program has to do?

    Model answer

    The WHERE clause makes the database system filter the rows before returning them. The program then receives only the rows it actually needs.

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

See a huge jump in your memorisation

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

Data Structures: Arrays, Records and Hash Tables
Stacks, Queues, Linked Lists and Trees
Boolean Logic and Simplification
Algorithms, Pseudo-Code and Programming Constructs

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.

KDW to HAT.
decryptsencryptscompresses

Blank Blitz consolidates the facts

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

AThe two are not the same.
BOpen source refers to the availability of the code.
CMuch open source software is free of charge.

Build It trains answer structure

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

Backup means the copy of the data.
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 SQL, Big Data and Distributed Systems, 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.