-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.sql
More file actions
18 lines (13 loc) · 882 Bytes
/
data.sql
File metadata and controls
18 lines (13 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
\c my_first_db
insert into authors (first_name, last_name) values ('James', 'S. A. Corey');
insert into authors (first_name, last_name) values ('Craig', 'Alanson');
insert into authors (first_name, last_name) values ('Cixin', 'Liu');
insert into genres (name) values ('Sience Fiction');
insert into genres (name) values ('Fantasy');
insert into genres (name) values ('Romance');
insert into genres (name) values ('Mystery');
insert into genres (name) values ('Horror');
insert into books (title, publishing_year, genre_id) values ('Leviathan Wakes', 2011, (select id from genres where name = 'Sience Fiction'));
insert into books (title, publishing_year, genre_id) values ('Caliban’s War', 2012, (select id from genres where name = 'Sience Fiction'));
INSERT into authors_books (author_id, book_id) values (1, 1);
INSERT into authors_books (author_id, book_id) values (1, 2);