Ask the database
Answers are for parents and teachers.
1
A teacher wants a form to collect each child’s first name, class and favourite sport. Plan the fields: give each a data type and a character limit.
FirstName: Text, 20. Class: Text, 5. FavouriteSport: Text, 20 (or a multiple-choice tick box). Any sensible limits are correct.
2
Use the Books table. Write the design table row for ‘the titles and pages of all Adventure books’, and list the results.
| BookID | Title | Genre | Pages | Year | OnLoan |
|---|---|---|---|---|---|
| 1 | River Maps | Adventure | 210 | 2018 | Yes |
| 2 | The Quiet Kite | Story | 96 | 2020 | No |
| 3 | Space Atlas | Science | 320 | 2021 | Yes |
| 4 | Tiny Machines | Science | 148 | 2019 | No |
| 5 | Desert Wind | Adventure | 275 | 2016 | No |
| 6 | The Baking Club | Story | 184 | 2022 | Yes |
| 7 | Rock and Rain | Science | 412 | 2015 | No |
| 8 | Night Train | Adventure | 350 | 2020 | Yes |
Fields: Title, Pages, Genre. Criteria: Genre = Adventure. Results: River Maps (210), Desert Wind (275) and Night Train (350).
3
Use the Books table. Is the condition Year >= 2021 TRUE for exactly two records? Name the books it selects.
| BookID | Title | Genre | Pages | Year | OnLoan |
|---|---|---|---|---|---|
| 1 | River Maps | Adventure | 210 | 2018 | Yes |
| 2 | The Quiet Kite | Story | 96 | 2020 | No |
| 3 | Space Atlas | Science | 320 | 2021 | Yes |
| 4 | Tiny Machines | Science | 148 | 2019 | No |
| 5 | Desert Wind | Adventure | 275 | 2016 | No |
| 6 | The Baking Club | Story | 184 | 2022 | Yes |
| 7 | Rock and Rain | Science | 412 | 2015 | No |
| 8 | Night Train | Adventure | 350 | 2020 | Yes |
Yes. Year >= 2021 is TRUE for Space Atlas (2021) and The Baking Club (2022). All other years are before 2021.
4
A library keeps a list of books and their borrowers. Why should a query that lists overdue books not show the borrower’s phone number, and why should a password never be stored in a table that anyone can search?
Only the fields that are needed should be shown, because personal data must be protected. Passwords are secret: if they are in a table that people can search or read, anyone could see them, so they must never be kept there in plain form.
5
Design a conditional formatting rule for a table of plants so that plants costing less than 3 are highlighted. Which of the prices 5, 2, 3, 1, 4 are highlighted?
Field Price, condition less than 3, format a colour and bold. The prices 2 and 1 are highlighted. The price 3 is not less than 3.