Week 5 - Database design

Relational Databases

Primary Keys and Foreign Keys

Constraints

Database normalization

PostgreSQL setup

Joins

Java and databases

Practice

Assignment

Back end Track

Content

Let’s get practical

πŸ”‘ Primary Keys and Foreign Keys β€” exercises

Exercise: Identify the Primary Key

Exercise: Relationships and Foreign Keys

πŸ›ƒ Constraints β€” exercises

Exercise: Choose the right constraint

Exercise: Spot the constraint violations (data audit)

Exercise: Design constraints for a mini schema

πŸ’Ύ Database normalization β€” exercises

Exercise: Spot repeating groups + anomalies

Exercise: Normalize to 1NF (atomic values)

Exercise: Normalize to 2NF + 3NF (decompose)

Exercise: Functional dependencies (quick check)

πŸ«‚ Joins β€” exercises

Exercise: Album, track, and artist names

Exercise: Labels and albums

Exercise: Looking for friends

πŸ§‘β€πŸ’» Java and Databases β€” exercises

Exercise: Set up JDBC and test the connection

Exercise: CRUD with PreparedStatement

Exercise: Mapping rows to objects (1:N)

Exercise: SQL injection awareness

Submission / self-check


The HackYourFuture curriculum is licensed underΒ CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

CC BY-NC-SA 4.0 Icons

Built with ❀️ by the HackYourFuture community · Thank you, contributors

Found a mistake or have a suggestion? Let us know in the feedback form.