Databases
Section: Applications | Syllabus: Cambridge IGCSE Information and Communication Technology (0417)
Create a Database Structure
- Import data from existing files (including .csv, .txt) using specified field names to create tables
- Set appropriate data types to fields: text, numeric (integer, decimal, currency), date/time, Boolean/logical
- Numeric sub-types include percentage and number of decimal places
- A Boolean/logical field's display format can be yes/no, true/false or a checkbox
- Create and edit primary and foreign keys, and create relationships between tables
- A primary key uniquely identifies each record in a table
- A foreign key is a field in one table that links to the primary key of another table, creating the relationship between them
- Create and use a data entry form: specified fields, appropriate font styles and sizes, appropriate spacing between fields, character spacing of individual fields, use of white space, radio buttons, check boxes, drop-down menus
- Good form design groups related fields logically, uses clear labels, and uses the most suitable control for each field (e.g. a drop-down menu when only a fixed list of valid answers exists)
| Flat-File Database | Relational Database |
|---|---|
| Stores all data in a single table | Stores data across multiple linked tables |
| Simple to set up and understand | Reduces data duplication by storing each fact once and linking to it |
| Data (e.g. a customer's address) may be duplicated every time it's needed | More complex to design, but much less duplicated/inconsistent data |
Manipulate Data
- Perform calculations using arithmetic operations or numeric functions, including calculated fields and calculated controls
- Use formulae and functions to perform calculations at run time: addition, subtraction, multiplication, division, sum, average, maximum, minimum, count
- Sort data using a single criterion, or multiple criteria, into ascending or descending order
- Search and select data using a single criterion or multiple criteria to select subsets of data using a query
- Operators used in searches: AND, OR, NOT, LIKE, >, <, =, >=, <=, <>
- Searches can also use wildcards to match a pattern rather than an exact value
Present Data
- Produce reports displaying all the required data and labels in full — nothing should be truncated or cut off
- Use appropriate headers and footers within a database report: report header, report footer, page header, page footer
- Set report titles, and produce different output layouts: controlling the display of data/labels, tabular or columnar format
- Align data and labels appropriately, including right-aligning numeric data and decimal alignment
- Control the display format of numeric data: number of decimal places, currency symbol, percentage
Question: A school's database stores student records with fields StudentName, Year (numeric) and Club (text). State the criteria needed for a query to find all students in Year 9 or Year 10 who are members of the "Chess" club.
The student must be in the Chess club, and separately, in either of two possible years — so the year condition needs OR between the two allowed values, while the club condition is a separate, additional requirement joined with AND. Writing this clearly as criteria: Club = "Chess" AND (Year = 9 OR Year = 10). AnswerClub = "Chess" AND (Year = 9 OR Year = 10) — the brackets group the two acceptable years together so that the "AND Club = Chess" condition correctly applies to both of them.
Common Mistakes
MistakeUsing AND where OR is needed when a field must match one of several possible values
Fix"Year = 9 AND Year = 10" can never be true for a single record, since one field cannot hold two different values at once — matching either of two values needs OR, not AND
MistakeLetting a report print with column headings or data cut off at the edge of the page
Fixa report must display all the required data and labels in full — check column widths and page orientation/size before printing so nothing is truncated
Interactive revision notes, videos and practice questions load below.