A schema has been provided with the following structure:
-
authors
- id
- name TEXT
- nationality TEXT
- birth_year INTEGER
-
books
- id
- title TEXT
- publication_date INTEGER
- author_id INTEGER (Foreign key)
Load the schema into your DB:
$ psql -d library < schema.sql
Load the given seed file into your db. Take a look at it, and note how authors and books are related.
$ psql -d library < seed.sql
There are two exercises:
- Basic Queries - SELECT, INSERT, UPDATE, DELETE
- Advanced Queries - JOINS