Unit 05: Databases
Overview
The focus this unit is:
- More server-side development
- Using databases for persistence
- Data modelling entity relationships
- Using knex to interact with the SQL query and manipulation language
- Migrations and seeding databases with data
This unit we'll be swapping out the file-based persistence we used last unit for a storage solution that scales to many users over a long period of time: Databases! After we come to terms with basic database concepts, we'll connect a database to our server-side application and learn how to save and retrieve data to and from it.
Core concepts
- Introduction to Databases
- Database Keys and Migrations
- Database Joins
- Database Routes
- Database Relationships
- Deploying with a Database
Exercises
*Note: If any of these exercise links are sending you to a 404, it means the challenge hasn't been made available yet. You will get access to challenges alongside the material in bootcamp. Please let an instructor know if something should be available that isn't.
Introduction to Databases
- knex-todo-cli (select your cohort for a link)
Database Joins
- flight-club (select your cohort for a link) or art-rover (select your cohort for a link)
Database Routes
- dreamfest (select your cohort for a link)
Learning Outcomes
Tech Skills
Core
I can...
- Build and run migrations and seeds for two tables with a one-to-many relationship (e.g. owners and vehicles, or wombles and rubbish)
- Select, insert, update and delete for a single table
- Use a join to select from two related tables
Core+
I can...
- Write basis tests for database functions
Stretch
I can...
- Deploy a database app
- Test a function that calls a database function (i.e. mocking the db function)
- Build and run migrations and seeds for a many-to-many relationship (e.g. authors, books, authors_books)
- Do a select for a many-to-many relationship (joining across three tables)
- Insert and delete across 2 or 3 related tables