You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
295 B

3 years ago
  1. create table authors (
  2. id SERIAL PRIMARY KEY,
  3. name VARCHAR(15) NOT NULL
  4. );
  5. create table books (
  6. id SERIAL PRIMARY KEY,
  7. title VARCHAR(50) NOT NULL,
  8. author_id INTEGER NOT NULL,
  9. FOREIGN KEY(author_id) REFERENCES authors(id),
  10. created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
  11. );