Created
December 26, 2025 01:08
-
-
Save wblondel/60dc690a9cc12caacad991665e3ffc75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- PostgreSQL database dump | |
| -- | |
| -- Dumped from database version 12.22 (Ubuntu 12.22-0ubuntu0.20.04.4) | |
| -- Dumped by pg_dump version 12.22 (Ubuntu 12.22-0ubuntu0.20.04.4) | |
| 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 universe; | |
| -- | |
| -- Name: universe; Type: DATABASE; Schema: -; Owner: freecodecamp | |
| -- | |
| CREATE DATABASE universe WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'C.UTF-8' LC_CTYPE = 'C.UTF-8'; | |
| ALTER DATABASE universe OWNER TO freecodecamp; | |
| \connect universe | |
| 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: constellation; Type: TABLE; Schema: public; Owner: freecodecamp | |
| -- | |
| CREATE TABLE public.constellation ( | |
| constellation_id integer NOT NULL, | |
| name character varying NOT NULL, | |
| year_discovered integer | |
| ); | |
| ALTER TABLE public.constellation OWNER TO freecodecamp; | |
| -- | |
| -- Name: constellation_constellation_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE public.constellation ALTER COLUMN constellation_id ADD GENERATED ALWAYS AS IDENTITY ( | |
| SEQUENCE NAME public.constellation_constellation_id_seq | |
| START WITH 1 | |
| INCREMENT BY 1 | |
| NO MINVALUE | |
| NO MAXVALUE | |
| CACHE 1 | |
| ); | |
| -- | |
| -- Name: galaxy; Type: TABLE; Schema: public; Owner: freecodecamp | |
| -- | |
| CREATE TABLE public.galaxy ( | |
| galaxy_id integer NOT NULL, | |
| name character varying NOT NULL, | |
| description text, | |
| year_discovered integer, | |
| is_visible_to_naked_eye boolean NOT NULL, | |
| constellation_id integer | |
| ); | |
| ALTER TABLE public.galaxy OWNER TO freecodecamp; | |
| -- | |
| -- Name: galaxy_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE public.galaxy ALTER COLUMN galaxy_id ADD GENERATED ALWAYS AS IDENTITY ( | |
| SEQUENCE NAME public.galaxy_id_seq | |
| START WITH 1 | |
| INCREMENT BY 1 | |
| NO MINVALUE | |
| NO MAXVALUE | |
| CACHE 1 | |
| ); | |
| -- | |
| -- Name: moon; Type: TABLE; Schema: public; Owner: freecodecamp | |
| -- | |
| CREATE TABLE public.moon ( | |
| moon_id integer NOT NULL, | |
| name character varying NOT NULL, | |
| description text, | |
| year_discovered integer, | |
| planet_id integer | |
| ); | |
| ALTER TABLE public.moon OWNER TO freecodecamp; | |
| -- | |
| -- Name: moon_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE public.moon ALTER COLUMN moon_id ADD GENERATED ALWAYS AS IDENTITY ( | |
| SEQUENCE NAME public.moon_id_seq | |
| START WITH 1 | |
| INCREMENT BY 1 | |
| NO MINVALUE | |
| NO MAXVALUE | |
| CACHE 1 | |
| ); | |
| -- | |
| -- Name: planet; Type: TABLE; Schema: public; Owner: freecodecamp | |
| -- | |
| CREATE TABLE public.planet ( | |
| planet_id integer NOT NULL, | |
| name character varying NOT NULL, | |
| description text, | |
| has_life boolean, | |
| is_spherical boolean, | |
| year_discovered integer, | |
| star_id integer | |
| ); | |
| ALTER TABLE public.planet OWNER TO freecodecamp; | |
| -- | |
| -- Name: planet_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE public.planet ALTER COLUMN planet_id ADD GENERATED ALWAYS AS IDENTITY ( | |
| SEQUENCE NAME public.planet_id_seq | |
| START WITH 1 | |
| INCREMENT BY 1 | |
| NO MINVALUE | |
| NO MAXVALUE | |
| CACHE 1 | |
| ); | |
| -- | |
| -- Name: star; Type: TABLE; Schema: public; Owner: freecodecamp | |
| -- | |
| CREATE TABLE public.star ( | |
| star_id integer NOT NULL, | |
| name character varying NOT NULL, | |
| description text, | |
| year_discovered integer, | |
| brightness numeric(3,2), | |
| galaxy_id integer | |
| ); | |
| ALTER TABLE public.star OWNER TO freecodecamp; | |
| -- | |
| -- Name: star_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE public.star ALTER COLUMN star_id ADD GENERATED ALWAYS AS IDENTITY ( | |
| SEQUENCE NAME public.star_id_seq | |
| START WITH 1 | |
| INCREMENT BY 1 | |
| NO MINVALUE | |
| NO MAXVALUE | |
| CACHE 1 | |
| ); | |
| -- | |
| -- Data for Name: constellation; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
| -- | |
| INSERT INTO public.constellation OVERRIDING SYSTEM VALUE VALUES (1, 'Const 1', 1950); | |
| INSERT INTO public.constellation OVERRIDING SYSTEM VALUE VALUES (2, 'Const 2', 1923); | |
| INSERT INTO public.constellation OVERRIDING SYSTEM VALUE VALUES (3, 'Const 3', 1872); | |
| INSERT INTO public.constellation OVERRIDING SYSTEM VALUE VALUES (4, 'Const 4', 1912); | |
| -- | |
| -- Data for Name: galaxy; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
| -- | |
| INSERT INTO public.galaxy OVERRIDING SYSTEM VALUE VALUES (1, 'Galaxy 1', NULL, 1912, true, 1); | |
| INSERT INTO public.galaxy OVERRIDING SYSTEM VALUE VALUES (2, 'Galaxy 2', NULL, 1780, false, 2); | |
| INSERT INTO public.galaxy OVERRIDING SYSTEM VALUE VALUES (3, 'Galaxy 3', NULL, 1939, true, 3); | |
| INSERT INTO public.galaxy OVERRIDING SYSTEM VALUE VALUES (4, 'Galaxy 4', NULL, 1920, true, 2); | |
| INSERT INTO public.galaxy OVERRIDING SYSTEM VALUE VALUES (5, 'Galaxy 5', NULL, 1291, false, 4); | |
| INSERT INTO public.galaxy OVERRIDING SYSTEM VALUE VALUES (8, 'Galaxy 6', NULL, 1823, false, 4); | |
| -- | |
| -- Data for Name: moon; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
| -- | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (1, 'Moon 1', NULL, NULL, 1); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (2, 'Moon 2', NULL, NULL, 2); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (3, 'Moon 3', NULL, NULL, 3); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (4, 'Moon 4', NULL, NULL, 4); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (5, 'Moon 5', NULL, NULL, 5); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (6, 'Moon 6', NULL, NULL, 6); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (7, 'Moon 7', NULL, NULL, 7); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (8, 'Moon 8', NULL, NULL, 8); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (9, 'Moon 9', NULL, NULL, 9); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (10, 'Moon 10', NULL, NULL, 10); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (11, 'Moon 11', NULL, NULL, 11); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (12, 'Moon 12', NULL, NULL, 12); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (13, 'Moon 13', NULL, NULL, 1); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (14, 'Moon 14', NULL, NULL, 2); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (15, 'Moon 15', NULL, NULL, 3); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (16, 'Moon 16', NULL, NULL, 4); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (17, 'Moon 17', NULL, NULL, 5); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (18, 'Moon 18', NULL, NULL, 6); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (19, 'Moon 19', NULL, NULL, 7); | |
| INSERT INTO public.moon OVERRIDING SYSTEM VALUE VALUES (20, 'Moon 20', NULL, NULL, 8); | |
| -- | |
| -- Data for Name: planet; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
| -- | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (1, 'Planet 1', NULL, NULL, NULL, NULL, 1); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (2, 'Planet 2', NULL, NULL, NULL, NULL, 2); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (3, 'Planet 3', NULL, NULL, NULL, NULL, 3); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (4, 'Planet 4', NULL, NULL, NULL, NULL, 4); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (5, 'Planet 5', NULL, NULL, NULL, NULL, 5); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (6, 'Planet 6', NULL, NULL, NULL, NULL, 6); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (7, 'Planet 7', NULL, NULL, NULL, NULL, 7); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (8, 'Planet 8', NULL, NULL, NULL, NULL, 1); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (9, 'Planet 9', NULL, NULL, NULL, NULL, 2); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (10, 'Planet 10', NULL, NULL, NULL, NULL, 3); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (11, 'Planet 11', NULL, NULL, NULL, NULL, 4); | |
| INSERT INTO public.planet OVERRIDING SYSTEM VALUE VALUES (12, 'Planet 12', NULL, NULL, NULL, NULL, 5); | |
| -- | |
| -- Data for Name: star; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
| -- | |
| INSERT INTO public.star OVERRIDING SYSTEM VALUE VALUES (1, 'Star 1', NULL, NULL, NULL, 1); | |
| INSERT INTO public.star OVERRIDING SYSTEM VALUE VALUES (2, 'Star 2', NULL, NULL, NULL, 2); | |
| INSERT INTO public.star OVERRIDING SYSTEM VALUE VALUES (3, 'Star 3', NULL, NULL, NULL, 3); | |
| INSERT INTO public.star OVERRIDING SYSTEM VALUE VALUES (4, 'Star 4', NULL, NULL, NULL, 4); | |
| INSERT INTO public.star OVERRIDING SYSTEM VALUE VALUES (5, 'Star 5', NULL, NULL, NULL, 5); | |
| INSERT INTO public.star OVERRIDING SYSTEM VALUE VALUES (6, 'Star 6', NULL, NULL, NULL, 5); | |
| INSERT INTO public.star OVERRIDING SYSTEM VALUE VALUES (7, 'Star 7', NULL, NULL, NULL, 8); | |
| -- | |
| -- Name: constellation_constellation_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
| -- | |
| SELECT pg_catalog.setval('public.constellation_constellation_id_seq', 4, true); | |
| -- | |
| -- Name: galaxy_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
| -- | |
| SELECT pg_catalog.setval('public.galaxy_id_seq', 8, true); | |
| -- | |
| -- Name: moon_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
| -- | |
| SELECT pg_catalog.setval('public.moon_id_seq', 20, true); | |
| -- | |
| -- Name: planet_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
| -- | |
| SELECT pg_catalog.setval('public.planet_id_seq', 12, true); | |
| -- | |
| -- Name: star_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
| -- | |
| SELECT pg_catalog.setval('public.star_id_seq', 7, true); | |
| -- | |
| -- Name: constellation constellation_name_key; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.constellation | |
| ADD CONSTRAINT constellation_name_key UNIQUE (name); | |
| -- | |
| -- Name: constellation constellation_pkey; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.constellation | |
| ADD CONSTRAINT constellation_pkey PRIMARY KEY (constellation_id); | |
| -- | |
| -- Name: galaxy galaxy_name_key; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.galaxy | |
| ADD CONSTRAINT galaxy_name_key UNIQUE (name); | |
| -- | |
| -- Name: galaxy galaxy_pkey; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.galaxy | |
| ADD CONSTRAINT galaxy_pkey PRIMARY KEY (galaxy_id); | |
| -- | |
| -- Name: moon moon_name_key; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.moon | |
| ADD CONSTRAINT moon_name_key UNIQUE (name); | |
| -- | |
| -- Name: moon moon_pkey; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.moon | |
| ADD CONSTRAINT moon_pkey PRIMARY KEY (moon_id); | |
| -- | |
| -- Name: planet planet_name_key; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.planet | |
| ADD CONSTRAINT planet_name_key UNIQUE (name); | |
| -- | |
| -- Name: planet planet_pkey; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.planet | |
| ADD CONSTRAINT planet_pkey PRIMARY KEY (planet_id); | |
| -- | |
| -- Name: star star_name_key; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.star | |
| ADD CONSTRAINT star_name_key UNIQUE (name); | |
| -- | |
| -- Name: star star_pkey; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.star | |
| ADD CONSTRAINT star_pkey PRIMARY KEY (star_id); | |
| -- | |
| -- Name: galaxy galaxy_constellation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.galaxy | |
| ADD CONSTRAINT galaxy_constellation_id_fkey FOREIGN KEY (constellation_id) REFERENCES public.constellation(constellation_id); | |
| -- | |
| -- Name: moon moon_planet_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.moon | |
| ADD CONSTRAINT moon_planet_id_fkey FOREIGN KEY (planet_id) REFERENCES public.planet(planet_id); | |
| -- | |
| -- Name: planet planet_star_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.planet | |
| ADD CONSTRAINT planet_star_id_fkey FOREIGN KEY (star_id) REFERENCES public.star(star_id); | |
| -- | |
| -- Name: star star_galaxy_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freecodecamp | |
| -- | |
| ALTER TABLE ONLY public.star | |
| ADD CONSTRAINT star_galaxy_id_fkey FOREIGN KEY (galaxy_id) REFERENCES public.galaxy(galaxy_id); | |
| -- | |
| -- PostgreSQL database dump complete | |
| -- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment