cat_owners
.CREATE TABLE
statements in a file init_tables.sql
for debugging purposes.psql -f <PATH_TO_FILE>
owners
)cats
)SERIAL
is "the same as integer except that PostgreSQL will automatically generate and populate values into the SERIAL
column." - postgresqltutorial.comowner_id
is a reference to the id
column in the owners
table. This is to represent in SQL the relationship where owners can have many cats and each cat belongs to a single owner.pg
library with NPM.index.js
. Reminder to update pgConnectionConfigs
to reference the new DB name.owners
table.owner_id
column in the cats
table corresponds to the id
of the relevant owner's row in the owners
table.owners
feature. Get all the owners with NUM_CATS_OWNED
cats.NUM_CATS_OWNED
cats.NUM_CATS_OWNED
cats.