Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE BOOK (
- id INT PRIMARY KEY,
- title VARCHAR(255),
- publication_year INT,
- genre VARCHAR(255),
- ISBN VARCHAR(255)
- );
- CREATE TABLE AUTHOR (
- id INT PRIMARY KEY,
- name VARCHAR(255),
- birth_date DATE
- );
- CREATE TABLE BOOK_AUTHOR (
- book_id INT,
- author_id INT,
- PRIMARY KEY (book_id, author_id),
- FOREIGN KEY (book_id) REFERENCES BOOK(id),
- FOREIGN KEY (author_id) REFERENCES AUTHOR(id)
- );
- /**
- TASKS
- When was 'Pebble in the sky' published?
- Who was the author of the book titled 'Pebble in the sky' ?
- Show how many books each genre has!
- Which author has the most books?
- What is the title of the book that was republished the most amount of times?
- Design a query to display how many books were written over time, how book writing became more and more popular!
- */
Advertisement
Add Comment
Please, Sign In to add comment