Library DB

Schema

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

Seed

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

Exercises

There are two exercises: