--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;

--
-- Name: authors_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE authors_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: authors; Type: TABLE; Schema: public; Owner: -; Tablespace: 
--

CREATE TABLE authors (
    id integer DEFAULT nextval('authors_id_seq'::regclass) NOT NULL,
    last_name text,
    first_name text,
    birth_year integer,
    death_year integer
);


--
-- Name: books_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE books_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: books; Type: TABLE; Schema: public; Owner: -; Tablespace: 
--

CREATE TABLE books (
    id integer DEFAULT nextval('books_id_seq'::regclass) NOT NULL,
    title text,
    publication_year integer
);


--
-- Name: books_authors; Type: TABLE; Schema: public; Owner: -; Tablespace: 
--

CREATE TABLE books_authors (
    book_id integer,
    author_id integer
);


--
-- Data for Name: authors; Type: TABLE DATA; Schema: public; Owner: -
--

COPY authors (id, last_name, first_name, birth_year, death_year) FROM stdin;
1	Melville	Herman	1819	1891
2	Austen	Jane	1775	1817
3	Christie	Agatha	1890	1976
4	Rushdie	Salman	1947	0
5	Morrison	Toni	1931	0
6	Wodehouse	P.G.	1881	1975
7	Gaiman	Neil	1960	0
8	Pratchett	Terry	1948	2015
9	Willis	Connie	1945	0
10	Lewis	Sinclair	1885	0
\.


--
-- Name: authors_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('authors_id_seq', 10, true);


--
-- Data for Name: books; Type: TABLE DATA; Schema: public; Owner: -
--

COPY books (id, title, publication_year) FROM stdin;
1	Moby Dick	1851
2	Omoo	1847
3	Beloved	1987
4	Sula	1973
5	Midnight's Children	1981
6	The Satanic Verses	1988
7	Emma	1815
8	Pride and Prejudice	1813
9	Sense and Sensibility	1813
10	Right Ho, Jeeves	1934
11	Leave it to Psmith	1923
12	The Code of the Woosters	1938
13	Murder on the Orient Express	1934
14	And Then There Were None	1939
15	Good Omens	1990
16	Neverwhere	1996
17	Thief of Time	1996
18	To Say Nothing of the Dog	1997
19	Blackout	2010
20	All Clear	2010
21	Main Street	1920
22	Elmer Gantry	1927
\.


--
-- Data for Name: books_authors; Type: TABLE DATA; Schema: public; Owner: -
--

COPY books_authors (book_id, author_id) FROM stdin;
1	1
2	1
3	5
4	5
5	4
6	4
7	2
8	2
9	2
10	6
11	6
12	6
13	3
14	3
15	7
15	8
16	7
17	8
18	9
19	9
20	9
21	10
22	10
\.


--
-- Name: books_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('books_id_seq', 22, true);


--
-- Name: authors_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
--

ALTER TABLE ONLY authors
    ADD CONSTRAINT authors_pkey PRIMARY KEY (id);


--
-- Name: books_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
--

ALTER TABLE ONLY books
    ADD CONSTRAINT books_pkey PRIMARY KEY (id);

--
-- PostgreSQL database dump complete
--

