Displaying airport dataΒΆ
You have been provided a database built on SQLite which contains information about airports. The schema is displayed below. You will use the SQLite extension in Visual Studio Code to display information about different citiesβ airports.
InstructionsΒΆ
To get started with the assignment, youβll need to perform a couple of steps. Youβll need to install a bit of tooling and download the sample database.
Setup your systemΒΆ
You can use Visual Studio Code and the SQLite extension to interact with the database.
Navigate to code.visualstudio.com and follow the instructions to install Visual Studio Code
Install the SQLite extension extension as instructed on the Marketplace page
Download and open the databaseΒΆ
Next you will download an open the database.
Download the database file from GitHub and save it to a directory
Open Visual Studio Code
Open the database in the SQLite extension by selecting Ctl-Shift-P (or Cmd-Shift-P on a Mac) and typing
SQLite: Open databaseSelect Choose database from file and open the airports.db file you downloaded previously
After opening the database (you wonβt see an update on the screen), create a new query window by selecting Ctl-Shift-P (or Cmd-Shift-P on a Mac) and typing
SQLite: New query
Once open, the new query window can be used to run SQL statements against the database. You can use the command Ctl-Shift-Q (or Cmd-Shift-Q on a Mac) to run queries against the database.
[!NOTE] For more information about the SQLite extension, you can consult the documentation
Database schemaΒΆ
A databaseβs schema is its table design and structure. The airports database as two tables, cities, which contains a list of cities in the United Kingdom and Ireland, and airports, which contains the list of all airports. Because some cities may have multiple airports, two tables were created to store the information. In this exercise you will use joins to display information for different cities.
Cities |
|---|
id (PK, integer) |
city (text) |
country (text) |
Airports |
|---|
id (PK, integer) |
name (text) |
code (text) |
city_id (FK to id in Cities) |
AssignmentΒΆ
Create queries to return the following information:
all city names in the
Citiestableall cities in Ireland in the
Citiestableall airport names with their city and country
all airports in London, United Kingdom
RubricΒΆ
Exemplary |
Adequate |
Needs Improvement |
|---|