Databases and SQL - Cambridge IGCSE Class 10 Computer Science Notes, Diagrams and Solved Questions

Design a single-table database with fields, records, data types, a primary key and validation, then read, complete and write SQL queries with SELECT, FROM, WHERE, ORDER BY, AND, OR, SUM and COUNT, and work out their exact output.

In this chapter

  • Single-table databases: tables, fields and records
  • Choosing data types: text, character, Boolean, integer, real and date/time
  • What a primary key is and how to choose one
  • Validation checks when data is entered: range, length, type, presence, format and check digit
  • SQL queries with SELECT, FROM and WHERE
  • Sorting with ORDER BY ascending or descending, and combining conditions with AND and OR
  • Counting and totalling with COUNT and SUM, and working out a query's output
  • Defining a table from a description and completing SQL scripts, exam style