HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Databases and SQL
  2. /Computer Science
  3. /SQL Queries: SELECT, WHERE and ORDER BY
Chapter 9 · Part 2 of 3Databases and SQL
← Previous part: Database Tables, Data Types and Primary KeysNext part: SQL: SUM, COUNT, AND, OR and Reading Query Output →
High School (9–10)Computer Science › Databases and SQLFree course

SQL Queries: SELECT, WHERE and ORDER BY

How does a library find every book by one author, with the newest first?

  • It asks its database a question written in SQL.
  • You write SQL scripts with SELECT and FROM to choose the fields, WHERE to choose the records and ORDER BY to sort them in ascending or descending order.
  • For each script you work out the exact output, and you run it in Python to check.

3 lessons, about 1 h 15 min3 simulations10 problems3 practice questionsPython in every lesson

StemPy LabCreated by StemPy Lab

Free

Every lesson is open to read. Enroll to keep your place in the course. No payment needed.

This course includes

  • 3 lessons, about 1 h 15 min
  • 3 simulations with sliders
  • 3 practice questions with new numbers each time
  • 3 Python programs to run
  • 10 problems with worked solutions
  • 2 Python labs
1 question set
  • 1 revision note
  • 1 test
  • Log in to save

    Course outline (3 lessons)

    1. 1
      Lesson 1about 25 min

      SELECT and FROM: choosing the fields

      SQL is the language we use to ask a database for data. A script starts with SELECT, which names the fields to show, and FROM, which names the table. You write such scripts, read them, and work out their exact output.

      1 simulation1 practice question1 Python program3 problems
      Read the lesson
    2. 2
      Lesson 2about 25 min

      WHERE: choosing the records

      WHERE keeps only the records that meet a condition. You write conditions with the comparison operators, put text in quotes, use TRUE and FALSE for a Boolean field, and work out exactly which records a script outputs.

      1 simulation1 practice question1 Python program4 problems1 Python lab
      Read the lesson
    3. 3
      Lesson 3about 25 min

      ORDER BY: sorting the output

      ORDER BY sorts the output of a query by one field, in ascending (ASC) or descending (DESC) order. You sort numbers, text and dates, put ORDER BY together with WHERE, and work out the exact order of the output.

      1 simulation1 practice question1 Python program3 problems1 Python lab1 question set1 note
      Read the lesson

    Test Your Learning

    SQL Queries: Timed Test
    IGCSE format20 questions · 25 min
    Not started

    Your teacher

    StemPy LabStemPy Lab

    1 follower

    Loading…

    ← All Courses
    ← Database Tables, Data Types and Primary KeysSQL: SUM, COUNT, AND, OR and Reading Query Output →
    More onComputer Science › Databases and SQL

    Discussion (0)

    Log in to join the discussion.

    Loading…