Databases: queries, calculations and reports Cambridge IGCSE Information & Communication Technology revision

Not started

Learn it

In plain words

Putting data into a database is only worth doing if you can get answers out. A query asks the question. A report presents the answer neatly enough to print.

8 things to know

  1. A query selects the records that match one or more criteria.
  2. Operators used in criteria: = equal to, <> not equal to, > greater than, < less than, >= greater than or equal to, <= less than or equal to.
  3. AND means both criteria must be true. OR means at least one must be true. NOT excludes records that match.
  4. LIKE is used with wildcards. An asterisk stands for any number of characters: LIKE "S*" finds everything beginning with S. A question mark stands for a single character.
  5. Records can be sorted in ascending or descending order, on one field or on several.
  6. A calculated field works out a new value for each record, such as Price multiplied by Quantity. Functions calculated when a report is run include sum, average, maximum, minimum and count.
  7. A report presents data for printing. The report header appears once at the start and the report footer once at the end. The page header and page footer appear on every page.
  8. In a report, all data and labels must be visible in full. Numbers are aligned to the right, with currency symbols and decimal places set.

Worked example

A table of cars has the fields Make, Colour and Price. Write the criteria to find all red cars costing less than 5000.

  1. Both conditions must be true, so AND is needed.
  2. Colour = "Red" AND Price < 5000.
  3. Text values go in quotation marks. Numbers do not.

Tips and tricks

  • AND narrows a search: fewer records. OR widens it: more records.
  • A total for the whole report belongs in the report footer. Column headings belong in the page header, so that they appear on every page.
6 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Databases: queries, calculations and reports: 6 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. Which operator means "not equal to"?
    • >=
    • <> (the answer)
    • =<
    • !

    For example, Colour <> "Blue".

  2. Which records does Age > 12 AND Age < 16 select?
    • those aged 12 to 16 inclusive
    • those aged 13, 14 or 15 (the answer)
    • those aged under 12 or over 16
    • every record

    Both conditions must be true, and neither limit is included.

  3. What does the wildcard * stand for?
    • exactly one character
    • any number of characters (the answer)
    • a space
    • a number only

    A question mark stands for exactly one character.

  4. Where does a page header appear in a report?
    • once at the start
    • once at the end
    • at the top of every page (the answer)
    • at the bottom of every page

    It usually holds the column headings.

  5. What is a calculated field?
    • a field that is always empty
    • a field whose value is worked out from other fields (the answer)
    • a primary key
    • a field containing text only

    For example, Price multiplied by Quantity.

  6. Using OR in place of AND between two criteria will usually:
    • find fewer records
    • find more records (the answer)
    • find no records
    • cause an error

    A record needs to match only one of the criteria.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf