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. Problems
  2. /A school weather station stores one record a day in a table Weather: the rainfall in millimetres…
MediumComputer ScienceHigh School (9–10)Computer Science › Databases and SQLNumericalIGCSE

A school weather station stores one record a day in a table Weather: the rainfall in millimetres…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A school weather station stores one record a day in a table Weather: the rainfall in millimetres, the temperature at noon in degrees Celsius and whether it was windy.

table
Day  RainMm  TempC  Windy
Mon  0       15     FALSE
Tue  6       11     TRUE
Wed  12      9      TRUE
Thu  3       14     FALSE
Fri  0       19     FALSE
Sat  8       13     TRUE
Sun  1       18     FALSE
  1. Write a condition for the days with a temperature from 121212 to 181818 degrees Celsius, including both ends. How many days pass?
  1. Write a condition for the other days, outside that range. How many days pass?

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

With AND a record passes only if both conditions are true; with OR it passes if at least one is true. A range is Field >= low AND Field <= high; outside a range is Field < low OR Field > high. Each part needs its own field name.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Step 1. Inside. WHERE TempC >= 12 AND TempC <= 18. Mon (151515), Thu (141414), Sat (131313) and Sun (181818) pass: 444 days. Sunday is exactly 181818, so it passes <=.

Step 2. Outside. WHERE TempC < 12 OR TempC > 18. Tue (111111), Wed (999) and Fri (191919) pass: 333 days.

Check. 4+3=74 + 3 = 74+3=7, every day once.

Watch out. TempC < 12 AND TempC > 18 gives no days at all: no temperature is both.

Answer: (a) 444 days. (b) 333 days.

Log in to save this for later
← All Problems
← A camera club lends out equipment and stores each loan in a table Loans…A school garden club records each plot in a table Plots: the water it needs each day in litres, its… →
More onComputer Science › Databases and SQL

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Joining conditions with AND and ORSQL: SUM, COUNT, AND, OR and Reading Query Output

More on this topic

  1. A restaurant stores its staff in a table Staff…Hard
  2. A town library stores its readers in a table Readers…Medium
  3. A gym stores its members in a table Gym…Easy
  4. A school garden club records each plot in a table Plots: the water it needs each day in litres, its…
Hard
  • A camera club lends out equipment and stores each loan in a table Loans…Medium
  • All problems on this topic →