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: SUM, COUNT, AND, OR and Reading Query Output
Chapter 9 · Part 3 of 3Databases and SQL
← Previous part: SQL Queries: SELECT, WHERE and ORDER BY
High School (9–10)Computer Science › Databases and SQLFree course

SQL: SUM, COUNT, AND, OR and Reading Query Output

How many tickets were sold on Saturday, and how much money did they bring in?

  • SQL can answer both in one line each.
  • You use COUNT to count records and SUM to add up a field, and you join two conditions with AND or OR.
  • Then you practise the examination skills: reading a script and giving its output, completing a script with missing parts, and finding the error in a script.

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

      Counting and adding with COUNT and SUM

      A query can give one number instead of a list: how many records pass, or the total of a field. COUNT counts the records and SUM adds up a numeric field. You use both with and without WHERE and work out the single value a script outputs.

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

      Joining conditions with AND and OR

      Real questions often have two conditions: Saturday sales of evening shows, or members who are under 12 or over 65. AND needs both conditions to be true, OR needs at least one. You join conditions, find a range with AND, and count and add the records that pass.

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

      Reading, completing and correcting SQL scripts

      In the examination you read a script and give its exact output, complete a script that has gaps, and find and correct the errors in a script. This lesson gives you a method for each task and practises it on the Tickets table.

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

    Test Your Learning

    Counting, Totals and Conditions in SQL: Chapter Test
    IGCSE format20 questions · 25 min
    Not started

    Your teacher

    StemPy LabStemPy Lab

    1 follower

    Loading…

    ← All Courses
    ← SQL Queries: SELECT, WHERE and ORDER BYNext →
    More onComputer Science › Databases and SQL

    Discussion (0)

    Log in to join the discussion.

    Loading…