Structured persistent collections of data that allow us to arrange and store data into a series of tables for further querying and manipulation
Types of databases
Single table or flat file databases
Relational databases
Flat file database
Consists of one or more tables, each table consists of many separate records or rows, and each record is identical in its structure though its contents will vary, each record consists of a number of separate Fields or columns
Relational database
Consists of multiple related tables, changing the lecturer code for a course will update the associated field for all students on that course
Linking separate database tables to create a relational database is beyond the scope of the IGCSE course
Field type
Defined data types in a database, similar to data types in programming languages, can choose from text, alphanumeric, characters, booleans, integers, reals, or date time
Primary key
At least one field in each record that is guaranteed to be unique
Primary key
Car registration number
Student ID
Validation rules
Can be assigned to any field of a table, including length checks, format checks, range checks, presence checks, and customizable rules
Validation methods were discussed in detail in a previous video
SQL
Structured Query Language, a programming language for manipulating data in a database
SQL statements
Support a wide variety of commands for manipulating a database
Select statement
1. Select fields
2. From table
3. Where criteria
4. Order by
The select statement is the one you need to be familiar with for the IGCSE
SQL commands
Select population from world where name equals Albania
Select name, continent, area, population, GDP, capital from world where name equals Algeria
Select * from world where name like 'A%' and population > 1000000 order by name
Select count(*) from world where continent equals Asia
Select sum(population) from world where continent equals Europe
Most of the code in the Python program is beyond the IGCSE syllabus
The part of the program you do need to know about is where the SQL command is issued to the database