--
-- PostgreSQL database dump
--
-- Dumped from database version 12.9 (Ubuntu 12.9-2.pgdg20.04+1)
-- Dumped by pg_dump version 12.9 (Ubuntu 12.9-2.pgdg20.04+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
DROP DATABASE worldcup;
--
-- Name: worldcup; Type: DATABASE; Schema: -; Owner: freecodecamp
--
CREATE DATABASE worldcup WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'C.UTF-8' LC_CTYPE = 'C.UTF-8';
ALTER DATABASE worldcup OWNER TO freecodecamp;
\connect worldcup
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: games; Type: TABLE; Schema: public; Owner: freecodecamp
--
CREATE TABLE public.games (
game_id integer NOT NULL,
year integer NOT NULL,
round character varying NOT NULL,
winner_goals integer NOT NULL,
opponent_goals integer NOT NULL,
winner_id integer NOT NULL,
opponent_id integer NOT NULL
);
ALTER TABLE public.games OWNER TO freecodecamp;
--
-- Name: games_game_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp
--
CREATE SEQUENCE public.games_game_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.games_game_id_seq OWNER TO freecodecamp;
--
-- Name: games_game_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freecodecamp
--
ALTER SEQUENCE public.games_game_id_seq OWNED BY public.games.game_id;
--
-- Name: teams; Type: TABLE; Schema: public; Owner: freecodecamp
--
CREATE TABLE public.teams (
team_id integer NOT NULL,
name character varying NOT NULL
);
ALTER TABLE public.teams OWNER TO freecodecamp;
--
-- Name: teams_team_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp
--
CREATE SEQUENCE public.teams_team_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.teams_team_id_seq OWNER TO freecodecamp;
--
-- Name: teams_team_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freecodecamp
--
ALTER SEQUENCE public.teams_team_id_seq OWNED BY public.teams.team_id;
--
-- Name: games game_id; Type: DEFAULT; Schema: public; Owner: freecodecamp
--
ALTER TABLE ONLY public.games ALTER COLUMN game_id SET DEFAULT nextval('public.games_game_id_seq'::regclass);
--
-- Name: teams team_id; Type: DEFAULT; Schema: public; Owner: freecodecamp
--
ALTER TABLE ONLY public.teams ALTER COLUMN team_id SET DEFAULT nextval('public.teams_team_id_seq'::regclass);
--
-- Data for Name: games; Type: TABLE DATA; Schema: public; Owner: freecodecamp
--
INSERT INTO public.games VALUES (129, 2018, 'Final', 4, 2, 160, 161);
INSERT INTO public.games VALUES (130, 2018, 'Third Place', 2, 0, 162, 163);
INSERT INTO public.games VALUES (131, 2018, 'Semi-Final', 2, 1, 161, 163);
INSERT INTO public.games VALUES (132, 2018, 'Semi-Final', 1, 0, 160, 162);
INSERT INTO public.games VALUES (133, 2018, 'Quarter-Final', 3, 2, 161, 164);
INSERT INTO public.games VALUES (134, 2018, 'Quarter-Final', 2, 0, 163, 165);
INSERT INTO public.games VALUES (135, 2018, 'Quarter-Final', 2, 1, 162, 166);
INSERT INTO public.games VALUES (136, 2018, 'Quarter-Final', 2, 0, 160, 167);
INSERT INTO public.games VALUES (137, 2018, 'Eighth-Final', 2, 1, 163, 168);
INSERT INTO public.games VALUES (138, 2018, 'Eighth-Final', 1, 0, 165, 169);
INSERT INTO public.games VALUES (139, 2018, 'Eighth-Final', 3, 2, 162, 170);
INSERT INTO public.games VALUES (140, 2018, 'Eighth-Final', 2, 0, 166, 171);
INSERT INTO public.games VALUES (141, 2018, 'Eighth-Final', 2, 1, 161, 172);
INSERT INTO public.games VALUES (142, 2018, 'Eighth-Final', 2, 1, 164, 173);
INSERT INTO public.games VALUES (143, 2018, 'Eighth-Final', 2, 1, 167, 174);
INSERT INTO public.games VALUES (144, 2018, 'Eighth-Final', 4, 3, 160, 175);
INSERT INTO public.games VALUES (145, 2014, 'Final', 1, 0, 176, 175);
INSERT INTO public.games VALUES (146, 2014, 'Third Place', 3, 0, 177, 166);
INSERT INTO public.games VALUES (147, 2014, 'Semi-Final', 1, 0, 175, 177);
INSERT INTO public.games VALUES (148, 2014, 'Semi-Final', 7, 1, 176, 166);
INSERT INTO public.games VALUES (149, 2014, 'Quarter-Final', 1, 0, 177, 178);
INSERT INTO public.games VALUES (150, 2014, 'Quarter-Final', 1, 0, 175, 162);
INSERT INTO public.games VALUES (151, 2014, 'Quarter-Final', 2, 1, 166, 168);
INSERT INTO public.games VALUES (152, 2014, 'Quarter-Final', 1, 0, 176, 160);
INSERT INTO public.games VALUES (153, 2014, 'Eighth-Final', 2, 1, 166, 179);
INSERT INTO public.games VALUES (154, 2014, 'Eighth-Final', 2, 0, 168, 167);
INSERT INTO public.games VALUES (155, 2014, 'Eighth-Final', 2, 0, 160, 180);
INSERT INTO public.games VALUES (156, 2014, 'Eighth-Final', 2, 1, 176, 181);
INSERT INTO public.games VALUES (157, 2014, 'Eighth-Final', 2, 1, 177, 171);
INSERT INTO public.games VALUES (158, 2014, 'Eighth-Final', 2, 1, 178, 182);
INSERT INTO public.games VALUES (159, 2014, 'Eighth-Final', 1, 0, 175, 169);
INSERT INTO public.games VALUES (160, 2014, 'Eighth-Final', 2, 1, 162, 183);
--
-- Data for Name: teams; Type: TABLE DATA; Schema: public; Owner: freecodecamp
--
INSERT INTO public.teams VALUES (160, 'France');
INSERT INTO public.teams VALUES (161, 'Croatia');
INSERT INTO public.teams VALUES (162, 'Belgium');
INSERT INTO public.teams VALUES (163, 'England');
INSERT INTO public.teams VALUES (164, 'Russia');
INSERT INTO public.teams VALUES (165, 'Sweden');
INSERT INTO public.teams VALUES (166, 'Brazil');
INSERT INTO public.teams VALUES (167, 'Uruguay');
INSERT INTO public.teams VALUES (168, 'Colombia');
INSERT INTO public.teams VALUES (169, 'Switzerland');
INSERT INTO public.teams VALUES (170, 'Japan');
INSERT INTO public.teams VALUES (171, 'Mexico');
INSERT INTO public.teams VALUES (172, 'Denmark');
INSERT INTO public.teams VALUES (173, 'Spain');
INSERT INTO public.teams VALUES (174, 'Portugal');
INSERT INTO public.teams VALUES (175, 'Argentina');
INSERT INTO public.teams VALUES (176, 'Germany');
INSERT INTO public.teams VALUES (177, 'Netherlands');
INSERT INTO public.teams VALUES (178, 'Costa Rica');
INSERT INTO public.teams VALUES (179, 'Chile');
INSERT INTO public.teams VALUES (180, 'Nigeria');
INSERT INTO public.teams VALUES (181, 'Algeria');
INSERT INTO public.teams VALUES (182, 'Greece');
INSERT INTO public.teams VALUES (183, 'United States');
--
-- Name: games_game_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp
--
SELECT pg_catalog.setval('public.games_game_id_seq', 160, true);
--
-- Name: teams_team_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp
--
SELECT pg_catalog.setval('public.teams_team_id_seq', 183, true);
--
-- Name: games games_pkey; Type: CONSTRAINT; Schema: public; Owner: freecodecamp
--
ALTER TABLE ONLY public.games
ADD CONSTRAINT games_pkey PRIMARY KEY (game_id);
--
-- Name: teams teams_name_key; Type: CONSTRAINT; Schema: public; Owner: freecodecamp
--
ALTER TABLE ONLY public.teams
ADD CONSTRAINT teams_name_key UNIQUE (name);
--
-- Name: teams teams_pkey; Type: CONSTRAINT; Schema: public; Owner: freecodecamp
--
ALTER TABLE ONLY public.teams
ADD CONSTRAINT teams_pkey PRIMARY KEY (team_id);
--
-- Name: games fk_games_opponents; Type: FK CONSTRAINT; Schema: public; Owner: freecodecamp
--
ALTER TABLE ONLY public.games
ADD CONSTRAINT fk_games_opponents FOREIGN KEY (opponent_id) REFERENCES public.teams(team_id);
--
-- Name: games fk_games_teams; Type: FK CONSTRAINT; Schema: public; Owner: freecodecamp
--
ALTER TABLE ONLY public.games
ADD CONSTRAINT fk_games_teams FOREIGN KEY (winner_id) REFERENCES public.teams(team_id);
--
-- PostgreSQL database dump complete
--