Last active
January 31, 2024 02:51
-
-
Save ruthlessfish/7382e09c7491821b31c5e8424c4d2301 to your computer and use it in GitHub Desktop.
This file contains 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.17 (Ubuntu 12.17-0ubuntu0.20.04.1) | |
-- Dumped by pg_dump version 12.17 (Ubuntu 12.17-0ubuntu0.20.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 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: black_hole; Type: TABLE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE TABLE public.black_hole ( | |
black_hole_id integer NOT NULL, | |
name character varying(30), | |
active character varying(10) NOT NULL, | |
dying boolean | |
); | |
ALTER TABLE public.black_hole OWNER TO freecodecamp; | |
-- | |
-- Name: galaxy; Type: TABLE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE TABLE public.galaxy ( | |
galaxy_id integer NOT NULL, | |
name character varying(255) NOT NULL, | |
size integer NOT NULL, | |
age numeric, | |
is_visible boolean | |
); | |
ALTER TABLE public.galaxy OWNER TO freecodecamp; | |
-- | |
-- Name: galaxy_galaxy_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE SEQUENCE public.galaxy_galaxy_id_seq | |
AS integer | |
START WITH 1 | |
INCREMENT BY 1 | |
NO MINVALUE | |
NO MAXVALUE | |
CACHE 1; | |
ALTER TABLE public.galaxy_galaxy_id_seq OWNER TO freecodecamp; | |
-- | |
-- Name: galaxy_galaxy_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freecodecamp | |
-- | |
ALTER SEQUENCE public.galaxy_galaxy_id_seq OWNED BY public.galaxy.galaxy_id; | |
-- | |
-- Name: moon; Type: TABLE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE TABLE public.moon ( | |
moon_id integer NOT NULL, | |
name character varying(255) NOT NULL, | |
planet_id integer NOT NULL, | |
is_inhabited boolean, | |
radius numeric | |
); | |
ALTER TABLE public.moon OWNER TO freecodecamp; | |
-- | |
-- Name: moon_moon_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE SEQUENCE public.moon_moon_id_seq | |
AS integer | |
START WITH 1 | |
INCREMENT BY 1 | |
NO MINVALUE | |
NO MAXVALUE | |
CACHE 1; | |
ALTER TABLE public.moon_moon_id_seq OWNER TO freecodecamp; | |
-- | |
-- Name: moon_moon_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freecodecamp | |
-- | |
ALTER SEQUENCE public.moon_moon_id_seq OWNED BY public.moon.moon_id; | |
-- | |
-- Name: planet; Type: TABLE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE TABLE public.planet ( | |
planet_id integer NOT NULL, | |
name character varying(255) NOT NULL, | |
star_id integer NOT NULL, | |
has_life boolean, | |
mass numeric NOT NULL, | |
description text | |
); | |
ALTER TABLE public.planet OWNER TO freecodecamp; | |
-- | |
-- Name: planet_planet_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE SEQUENCE public.planet_planet_id_seq | |
AS integer | |
START WITH 1 | |
INCREMENT BY 1 | |
NO MINVALUE | |
NO MAXVALUE | |
CACHE 1; | |
ALTER TABLE public.planet_planet_id_seq OWNER TO freecodecamp; | |
-- | |
-- Name: planet_planet_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freecodecamp | |
-- | |
ALTER SEQUENCE public.planet_planet_id_seq OWNED BY public.planet.planet_id; | |
-- | |
-- Name: star; Type: TABLE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE TABLE public.star ( | |
star_id integer NOT NULL, | |
name character varying(255) NOT NULL, | |
galaxy_id integer NOT NULL, | |
temperature integer, | |
is_bright boolean | |
); | |
ALTER TABLE public.star OWNER TO freecodecamp; | |
-- | |
-- Name: star_star_id_seq; Type: SEQUENCE; Schema: public; Owner: freecodecamp | |
-- | |
CREATE SEQUENCE public.star_star_id_seq | |
AS integer | |
START WITH 1 | |
INCREMENT BY 1 | |
NO MINVALUE | |
NO MAXVALUE | |
CACHE 1; | |
ALTER TABLE public.star_star_id_seq OWNER TO freecodecamp; | |
-- | |
-- Name: star_star_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freecodecamp | |
-- | |
ALTER SEQUENCE public.star_star_id_seq OWNED BY public.star.star_id; | |
-- | |
-- Name: galaxy galaxy_id; Type: DEFAULT; Schema: public; Owner: freecodecamp | |
-- | |
ALTER TABLE ONLY public.galaxy ALTER COLUMN galaxy_id SET DEFAULT nextval('public.galaxy_galaxy_id_seq'::regclass); | |
-- | |
-- Name: moon moon_id; Type: DEFAULT; Schema: public; Owner: freecodecamp | |
-- | |
ALTER TABLE ONLY public.moon ALTER COLUMN moon_id SET DEFAULT nextval('public.moon_moon_id_seq'::regclass); | |
-- | |
-- Name: planet planet_id; Type: DEFAULT; Schema: public; Owner: freecodecamp | |
-- | |
ALTER TABLE ONLY public.planet ALTER COLUMN planet_id SET DEFAULT nextval('public.planet_planet_id_seq'::regclass); | |
-- | |
-- Name: star star_id; Type: DEFAULT; Schema: public; Owner: freecodecamp | |
-- | |
ALTER TABLE ONLY public.star ALTER COLUMN star_id SET DEFAULT nextval('public.star_star_id_seq'::regclass); | |
-- | |
-- Data for Name: black_hole; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
-- | |
INSERT INTO public.black_hole VALUES (1, NULL, 'yes', NULL); | |
INSERT INTO public.black_hole VALUES (2, NULL, 'no', NULL); | |
INSERT INTO public.black_hole VALUES (3, NULL, 'no', NULL); | |
-- | |
-- Data for Name: galaxy; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
-- | |
INSERT INTO public.galaxy VALUES (1, 'Andromeda', 1000000, 2.537, true); | |
INSERT INTO public.galaxy VALUES (2, 'Milky Way', 100000, 13.51, true); | |
INSERT INTO public.galaxy VALUES (3, 'Triangulum', 60000, 2.72, false); | |
INSERT INTO public.galaxy VALUES (4, 'Pinwheel', 170000, 21.0, true); | |
INSERT INTO public.galaxy VALUES (5, 'Whirlpool', 60000, 23.16, false); | |
INSERT INTO public.galaxy VALUES (6, 'Sombrero', 50000, 28.0, true); | |
-- | |
-- Data for Name: moon; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
-- | |
INSERT INTO public.moon VALUES (1, 'Moon', 1, false, 1737.1); | |
INSERT INTO public.moon VALUES (2, 'Phobos', 2, false, 11.267); | |
INSERT INTO public.moon VALUES (3, 'Deimos', 2, false, 6.2); | |
INSERT INTO public.moon VALUES (4, 'Io', 5, false, 1818.1); | |
INSERT INTO public.moon VALUES (5, 'Europa', 5, false, 1560.8); | |
INSERT INTO public.moon VALUES (6, 'Ganymede', 5, false, 2634.1); | |
INSERT INTO public.moon VALUES (7, 'Callisto', 5, false, 2410.3); | |
INSERT INTO public.moon VALUES (8, 'Titan', 6, false, 2575.5); | |
INSERT INTO public.moon VALUES (9, 'Rhea', 6, false, 763.8); | |
INSERT INTO public.moon VALUES (10, 'Iapetus', 6, false, 734.5); | |
INSERT INTO public.moon VALUES (11, 'Dione', 6, false, 561.4); | |
INSERT INTO public.moon VALUES (12, 'Tethys', 6, false, 531.1); | |
INSERT INTO public.moon VALUES (13, 'Enceladus', 6, false, 252.1); | |
INSERT INTO public.moon VALUES (14, 'Mimas', 6, false, 198.2); | |
INSERT INTO public.moon VALUES (15, 'Oberon', 7, false, 761.4); | |
INSERT INTO public.moon VALUES (16, 'Titania', 7, false, 788.9); | |
INSERT INTO public.moon VALUES (17, 'Umbriel', 7, false, 584.7); | |
INSERT INTO public.moon VALUES (18, 'Ariel', 7, false, 578.9); | |
INSERT INTO public.moon VALUES (19, 'Miranda', 7, false, 235.8); | |
INSERT INTO public.moon VALUES (20, 'Triton', 8, false, 1353.4); | |
-- | |
-- Data for Name: planet; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
-- | |
INSERT INTO public.planet VALUES (1, 'Earth', 1, true, 5.972, NULL); | |
INSERT INTO public.planet VALUES (2, 'Mars', 1, false, 0.64171, NULL); | |
INSERT INTO public.planet VALUES (3, 'Venus', 1, false, 4.867, NULL); | |
INSERT INTO public.planet VALUES (4, 'Mercury', 1, false, 0.33011, NULL); | |
INSERT INTO public.planet VALUES (5, 'Jupiter', 2, false, 1898.19, NULL); | |
INSERT INTO public.planet VALUES (6, 'Saturn', 2, false, 568.34, NULL); | |
INSERT INTO public.planet VALUES (7, 'Uranus', 3, false, 86.813, NULL); | |
INSERT INTO public.planet VALUES (8, 'Neptune', 3, false, 102.413, NULL); | |
INSERT INTO public.planet VALUES (9, 'Pluto', 4, false, 0.01303, NULL); | |
INSERT INTO public.planet VALUES (10, 'Haumea', 4, false, 0.004006, NULL); | |
INSERT INTO public.planet VALUES (11, 'Makemake', 5, false, 0.00067, NULL); | |
INSERT INTO public.planet VALUES (12, 'Eris', 5, false, 0.0167, NULL); | |
-- | |
-- Data for Name: star; Type: TABLE DATA; Schema: public; Owner: freecodecamp | |
-- | |
INSERT INTO public.star VALUES (1, 'Sun', 2, 5778, true); | |
INSERT INTO public.star VALUES (2, 'Sirius', 1, 9940, true); | |
INSERT INTO public.star VALUES (3, 'Canopus', 3, 7350, false); | |
INSERT INTO public.star VALUES (4, 'Arcturus', 4, 4290, true); | |
INSERT INTO public.star VALUES (5, 'Vega', 5, 9602, false); | |
INSERT INTO public.star VALUES (6, 'Capella', 6, 5700, true); | |
-- | |
-- Name: galaxy_galaxy_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
-- | |
SELECT pg_catalog.setval('public.galaxy_galaxy_id_seq', 6, true); | |
-- | |
-- Name: moon_moon_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
-- | |
SELECT pg_catalog.setval('public.moon_moon_id_seq', 20, true); | |
-- | |
-- Name: planet_planet_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
-- | |
SELECT pg_catalog.setval('public.planet_planet_id_seq', 12, true); | |
-- | |
-- Name: star_star_id_seq; Type: SEQUENCE SET; Schema: public; Owner: freecodecamp | |
-- | |
SELECT pg_catalog.setval('public.star_star_id_seq', 6, true); | |
-- | |
-- Name: black_hole black_hole_pkey; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
-- | |
ALTER TABLE ONLY public.black_hole | |
ADD CONSTRAINT black_hole_pkey PRIMARY KEY (black_hole_id); | |
-- | |
-- Name: black_hole black_hole_unique; Type: CONSTRAINT; Schema: public; Owner: freecodecamp | |
-- | |
ALTER TABLE ONLY public.black_hole | |
ADD CONSTRAINT black_hole_unique UNIQUE (name); | |
-- | |
-- 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: 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