Data Modeling

So far, you've been working with databases with a single table. This week, you'll work on applications with many tables.

Databases like Postgres and SQLite are called relational databases because they let you express the relationships between data in different tables. The running example this week will involve a products table, which could be related to sellers, categories, orders, and more. You'll learn how to express those kinds of relations in the structure of the table, and how to construct queries that join data from multiple tables together.

Like so many things in programming, there are lots of possible ways to express relationships between data. This week, we'll also focus on some of the rules and principles for designing good data models for applications. Those principles will help you avoid common design issues that lead to inconsistent data and errors.

One powerful tool you'll learn for visualizing application data is diagramming. Diagrams of the entities and relationships in applications are called Entity Relationship Diagrams or ERDs. Drawing these diagrams will help you put the data design principles into practice.