AQA Computer Science GCSE
More Complex SQL
SQL becomes a little more complex when you want to get data from multiple tables.
The key is to remember how the tables are joined together.
Airport database - a relational database with two tables
You can get experiment with this database with SQLite online.
Here's the database creation code so that you can try it out in SQLite.
Airports database code - copy and paste the code. Don't forget to use DROP TABLE demo; to remove the demo table
Part 1: Some simple queries
The database contents and some simple queries to think about first:
Part 2: Introducing multi-table queries
The slides from class introduce the idea of using queries across multiple tables:
Multi-table queries - slides from class
And some exercises to try using a mix of single table and multi-table queries:
Airport database questions - questions from class
Slides with the questions on from class (but not the answers...)
Here are those SQL syntax rules again:
A data problem
This is an idea I want to think about at the end of the unit: