Day 1: Relations, CRUD, and Joins

While we won’t assume you’re a relational database expert, we do assume you have confronted a database or two in the past. Odds are good that the database was relational. We’ll start with creating our own schemas and populating them. Then we’ll take a look at querying for values and finally what makes relational databases so special: the table join.

Like most databases we’ll read about, Postgres provides a back-end server that does all of the work and a command-line shell to connect to the running server. The server communicates through port 5432 by default, which you can connect to with the psql shell.

 
$ ​psql book

PostgreSQL prompts with the name of the database followed by a hash mark if you run as ...

Get Seven Databases in Seven Weeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.