Select Git revision
arrays-and-pointers-22.s
testdb-20231123-13.sql 3.20 KiB
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.5 (Debian 15.5-0+deb12u1)
-- Dumped by pg_dump version 15.5 (Debian 15.5-0+deb12u1)
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 TABLE IF EXISTS public.tier;
DROP VIEW IF EXISTS public.lied_auf_cd;
DROP TABLE IF EXISTS public.lied;
DROP TABLE IF EXISTS public.cd;
DROP TABLE IF EXISTS public.interpret;
SET default_tablespace = '';
SET default_table_access_method = heap;
CREATE TABLE public.cd (
cd_id SERIAL PRIMARY KEY,
albumtitel text,
interpret_id integer,
erscheinungsjahr integer
);
CREATE TABLE public.interpret (
id SERIAL PRIMARY KEY,
name Text,
gruendungsjahr INTEGER
);
CREATE TABLE public.lied (
cd_id integer,
track integer,
titel text
);
ALTER TABLE public.lied
ADD CONSTRAINT lied_fkey_cd_id FOREIGN KEY(cd_id) REFERENCES public.cd(cd_id);
ALTER TABLE public.cd
ADD CONSTRAINT cd_fkey_interpret_id FOREIGN KEY(interpret_id) REFERENCES public.interpret(id);
ALTER TABLE public.cd OWNER TO dbs;
ALTER TABLE public.lied OWNER TO dbs;
--
-- Name: lied_auf_cd; Type: VIEW; Schema: public; Owner: dbs
--
CREATE VIEW public.lied_auf_cd AS
SELECT cd.cd_id,
cd.albumtitel,
cd.interpret_id,
cd.gruendungsjahr,
cd.erscheinungsjahr,
lied.track,
lied.titel
FROM (public.cd
JOIN public.lied ON ((cd.cd_id = lied.cd_id))
JOIN public.interpret ON ((cd.interpret_id = interpret.id))
);
ALTER TABLE public.lied_auf_cd OWNER TO dbs;
--
-- Name: test; Type: TABLE; Schema: public; Owner: dbs
--
CREATE TABLE public.tier (
id SERIAL PRIMARY KEY,
name text,
tierart text
);
ALTER TABLE public.tier OWNER TO dbs;
--
-- Data for Name: cd; Type: TABLE DATA; Schema: public; Owner: dbs
--
COPY public.cd (cd_id, albumtitel, interpret, gruendungsjahr, erscheinungsjahr) FROM stdin;
4711 Not That Kind Anastacia 1999 2000
4712 Wish You Were Here Pink Floyd 1965 1975
4713 Freak of Nature Anastacia 1999 2001
4714 Songs for the Deaf Queens of the Stone Age 1996 2002
\.
--
-- Data for Name: lied; Type: TABLE DATA; Schema: public; Owner: dbs
--
COPY public.lied (cd_id, track, titel) FROM stdin;
4711 1 Not That Kind
4711 2 I'm Otta Love
4711 3 Cowboys & Kisses
4712 1 Shine On You Crazy Diamond
4713 1 Paid my Dues
\.
--
-- Data for Name: tier; Type: TABLE DATA; Schema: public; Owner: dbs
--
COPY public.tier (name, tierart, id) FROM stdin;
Esmeralda Spinne 1
Timmy Hund 2
Dio Katze 3
Tusnelda Spinne 4
Ragnar Katze 5
Putzi Ratte 6
Felix Troll 7
Rex Ameise 8
\.
--
-- PostgreSQL database dump complete
--