Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can use SQL to retrieve data from a relational database.

      Key learning points

      1. SQL stands for Structured Query Language. It is a language used to communicate with a database.
      2. You can use SQL to manipulate databases and retrieve records.
      3. An SQL SELECT statement allows you to retrieve data from a database.
      4. The SQL SELECT * statement allows you to return all the data and fields from a table.

      Keywords

      • SELECT - allows you to retrieve data from a database

      • SELECT * - allows you to return all the columns from a database table

      Common misconception

      Using SELECT * is always the best method for returning data from a database table.

      You should only use the SELECT * query when all fields are needed. Including unnecessary data can be frustrating for the person viewing and working with the results.

      Teacher tip

      This lesson can be completed without using a DBMS, but pupils could complete the activities practically using MySQL. Modelling concepts using software helps pupils appreciate why they are learning particular concepts.

      Equipment

      Pupils will need access to a device that can open a relational database and run SQL queries. Examples in this lesson use a database created using DB Browser for SQLite https://oak.link/sqlite

      File needed for this lesson

      dbMusic 120 KB (DB)

      Download this file to use in the lesson.

      Licence

      This content is © Oak National Academy Limited (2026), licensed on Open Government Licence version 3.0
      except where otherwise stated. See Oak's terms & conditions
      (Collection 2).

      Lesson video

      Loading...

      Prior knowledge starter quiz

      5 Questions

      Q1.
      What is SQL mainly used for?

      designing graphics
      writing essays
      creating presentations
      Correct answer: communicating with databases

      Q2.
      Which of these is NOT a function of SQL?

      Correct answer: drawing diagrams
      adding data to a table
      changing data in a table
      retrieving data from a database

      Q3.
      What does the acronym SQL stand for?

      Simple Question Language
      Correct answer: Structured Query Language
      Secure Quick Link
      Standard Quality List

      Q4.
      Match the example to the correct keyword

      Correct Answer:add a new student’s details,INSERT

      INSERT

      Correct Answer:change a student’s address,UPDATE

      UPDATE

      Correct Answer:store all student information,Database

      Database

      Correct Answer:use a language to talk to the database,SQL

      SQL

      Q5.
      Arrange these actions for adding data to a table:

      1 - decide what data to add
      2 - use the INSERT statement
      3 - enter the new data
      4 - confirm the addition

      6 Questions

      Q1.
      What does the SQL SELECT statement do?

      deletes data
      adds new data
      Correct answer: retrieves data
      updates data

      Q2.
      What SQL command would you use to return every field and all data from a table at once?

      Correct Answer: SELECT *

      Q3.
      Match each SQL keyword or clause to its function:

      Correct Answer:SELECT,retrieve data from a database

      retrieve data from a database

      Correct Answer:SELECT *,retrieve all columns and rows from a table

      retrieve all columns and rows from a table

      Correct Answer:FROM,specify which table to get data from

      specify which table to get data from

      Correct Answer:WHERE,filter results to match certain criteria

      filter results to match certain criteria

      Q4.
      Arrange these actions for using SELECT * in a database:

      1 - Decide if you really need every field.
      2 - Write SELECT * FROM table.
      3 - Run the query.
      4 - Look at all the data returned.

      Q5.
      Which of these is the best practice when you only need a few fields from a table?

      use SELECT *
      Correct answer: list only the fields you need after SELECT
      use DELETE
      use all tables at once

      Q6.
      Which SQL statement is used to retrieve data from more than one table?

      Correct answer: SELECT with a JOIN
      DELETE
      UPDATE
      INSERT

      To help you plan your 11 computer science lesson on: SQL searches, download all teaching resources for free and adapt to suit your pupils' needs...