diff --git a/20231123/Zeichen_123.pdf b/20231123/Zeichen_123.pdf new file mode 120000 index 0000000000000000000000000000000000000000..fdbc897227df059cfda790a16555e6e417682116 --- /dev/null +++ b/20231123/Zeichen_123.pdf @@ -0,0 +1 @@ +../common/Zeichen_123.pdf \ No newline at end of file diff --git a/20231123/dbs-20231123.pdf b/20231123/dbs-20231123.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6468b0a62ee34e14e606988dcd005a79fb3bb347 Binary files /dev/null and b/20231123/dbs-20231123.pdf differ diff --git a/20231123/dbs-20231123.tex b/20231123/dbs-20231123.tex new file mode 100644 index 0000000000000000000000000000000000000000..bf9e093389a18ed58763628c991b85746797b99d --- /dev/null +++ b/20231123/dbs-20231123.tex @@ -0,0 +1,347 @@ +% dbs-20221123.pdf - Lecture Slides on Databases and Information Security +% Copyright (C) 2023 Peter Gerwinski +% +% This document is free software: you can redistribute it and/or +% modify it either under the terms of the Creative Commons +% Attribution-ShareAlike 3.0 License, or under the terms of the +% GNU General Public License as published by the Free Software +% Foundation, either version 3 of the License, or (at your option) +% any later version. +% +% This document is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this document. If not, see <http://www.gnu.org/licenses/>. +% +% You should have received a copy of the Creative Commons +% Attribution-ShareAlike 3.0 Unported License along with this +% document. If not, see <http://creativecommons.org/licenses/>. + +% README: Relationale Datenbanken: Sichten, Schlüsselfelder, Datensicherung + +\documentclass[10pt,t]{beamer} + +\usepackage{pgslides} + +\newcommand{\vfilll}{\vspace{0pt plus 1filll}} + +\newcommand{\underconstruction}{% + \begin{picture}(0,0) + \put(11,1.2){\makebox(0,0)[b]{\includegraphics[width=1.5cm]{Zeichen_123.pdf}}} + \put(11,0.9){\makebox(0,0)[t]{\shortstack{Änderungen\\vorbehalten}}} + \end{picture}} + +\title{Datenbanken und Datensicherheit} +\author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski} +\date{23.\ November 2023} + +\begin{document} + +\maketitleframe + +\nosectionnonumber{\inserttitle} + +\begin{frame} + + \shownosectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/dbs}}}% + \item[\textbf{2}] \textbf{Kurzeinführung Unix} + \item[\textbf{3}] \textbf{Kurzeinführung TCP/IP} + \item[\textbf{4}] \textbf{Relationale Datenbanken} + \begin{itemize} + \item[4.1] Einführung in DBMS + \item[4.2] Einführung in SQL + \color{medgreen} + \item[4.3] Normalformen + \color{orange} + \item[4.4] Verknüpfungen von Tabellen + \color{red} + \item[4.5] Sichten + \item[4.6] Schlüsselfelder + \item[4.7] Datensicherung + \end{itemize} + \vspace*{-\smallskipamount} + \item[\textbf{\dots}] + \end{itemize} + + \vfilll + \underconstruction + +\end{frame} + +\setcounter{section}{3} +\section{Relationale Datenbanken} +\setcounter{subsection}{1} +\subsection{Einführung in SQL} + +\begin{frame} + + \showsection + \showsubsection + + Datenbank-Abfragesprache: Structured Query Language (SQL) + + \bigskip + + Literatur: z.\,B.\ \url{https://de.wikibooks.org/wiki/Einführung_in_SQL} + + \bigskip + + Wichtige SQL-Befehle: + \begin{itemize} + \item + \lstinline[style=cmd]{CREATE} -- Datenbanken, Tabellen usw.\ anlegen + \item + \lstinline[style=cmd]{DROP} -- Datenbanken, Tabellen usw.\ löschen + \item + \lstinline[style=cmd]{SELECT} -- Daten abfragen + \item + \lstinline[style=cmd]{INSERT INTO ... VALUES} -- Daten eingeben + \item + \lstinline[style=cmd]{UPDATE} -- Daten ändern + \item + \lstinline[style=cmd]{DELETE FROM} -- Daten löschen + \end{itemize} + +\end{frame} + +\subsection{Normalformen} + +\begin{frame} + + \showsection + \showsubsection + + Problem: Schlecht angelegte Datenbanken werden schnell inkonsistent.\\ + Beliebte Fehler: + \begin{itemize} + \item + Speichern von mehreren Daten in demselben Tabelleneintrag\\ + {\only<2->{\color{red}\textarrow\ 1.~Normalform}} + \item + Speichern von denselben Daten in verschiedenen Tabelleneinträgen\\ + {\only<2->{\color{red}\textarrow\ 2.~Normalform}} + \item + implizite Zusammenhänge\\ + {\only<2->{\color{red}\textarrow\ 3.~Normalform und Boyce-Codd-Normalform}} + \item + voneinander unabhängige Zusammenhänge in derselben Tabelle\\ + {\only<2->{\color{red}\textarrow\ 4.~und 5.~Normalform}} + \end{itemize} + + \begin{onlyenv}<2-> + \medskip + + {\color{red}Lösung: Normalformen} + \end{onlyenv} + + \bigskip + + Literatur: z.\,B.\ \url{https://de.wikipedia.org/wiki/Normalisierung_(Datenbank)} + +\end{frame} + +\subsection{Verknüpfungen von Tabellen} + +\begin{frame} + + \showsection + \showsubsection + + Problem: Gut angelegte Datenbanken ({\color{red}\textarrow\ Normalformen})\\ + sind stark aufgesplittet.\\ + Wie kann man sie weiterhin effizient benutzen? + + \bigskip + + Lösung: Verknüpfungen von Tabellen + + \bigskip + + SQL-Befehl: \lstinline[style=cmd]{JOIN} + + \bigskip + + Literatur: z.\,B.\ \url{https://de.wikipedia.org/wiki/SQL} + +\end{frame} + +\begin{frame}[fragile] + + \showsection + \showsubsection + + Was machen wir mit Tabelleneinträgen,\\ + bei denen die \lstinline[style=cmd]{ON}-Bedingung + nicht erfüllt ist? + + \medskip + + \begin{lstlisting}[style=terminal] + ¡SELECT <Feld[er]> FROM <Tabelle1> [INNER] JOIN <Tabelle2> + ON <Tabelle1>.<Feld> = <Tabelle2>.<Feld>;¿ + \end{lstlisting} + + \smallskip + + \begin{itemize} + \arrowitem + weglassen: \lstinline[style=cmd]{[INNER] JOIN} + \end{itemize} + + \medskip + + \begin{lstlisting}[style=terminal] + ¡SELECT <Feld[er]> FROM <Tabelle1> LEFT JOIN <Tabelle2> + ON <Tabelle1>.<Feld> = <Tabelle2>.<Feld>;¿ + \end{lstlisting} + + \smallskip + + \begin{itemize} + \arrowitem + linke Tabelle trotzdem anzeigen + (mit \lstinline[style=cmd]{NULL}-Einträgen): + \lstinline[style=cmd]{LEFT JOIN}\\ + (analog: \lstinline[style=cmd]{RIGHT JOIN} für rechte Tabelle) + \end{itemize} + + \medskip + + \begin{lstlisting}[style=terminal] + ¡SELECT <Feld[er]> FROM <Tabelle1> FULL JOIN <Tabelle2> + ON <Tabelle1>.<Feld> = <Tabelle2>.<Feld>;¿ + \end{lstlisting} + + \smallskip + + \begin{itemize} + \arrowitem + beide Tabellen trotzdem anzeigen + (mit \lstinline[style=cmd]{NULL}-Einträgen): + \lstinline[style=cmd]|FULL JOIN| + \end{itemize} + +\end{frame} + +\subsection{Sichten} + +\begin{frame}[fragile] + + \showsection + \showsubsection + + \begin{lstlisting}[style=terminal] + ¡SELECT <Feld[er]> FROM <Tabelle1> [INNER] JOIN <Tabelle2> + ON <Tabelle1>.<Feld> = <Tabelle2>.<Feld>;¿ + \end{lstlisting} + + \smallskip + + \begin{itemize} + \arrowitem + Wir betrachten beide Tabellen zusammen als eine große Tabelle. + \end{itemize} + + \medskip + + \begin{lstlisting}[style=terminal] + ¡CREATE VIEW <Sicht> AS + SELECT <Feld[er]> FROM <Tabelle1> JOIN <Tabelle2> + ON <Tabelle1>.<Feld> = <Tabelle2>.<Feld>; + SELECT <Feld[er]> FROM <Sicht> [WHERE ...];¿ + \end{lstlisting} + + \smallskip + + \begin{itemize} + \arrowitem + Wir sprechen das Ergebnis genau wie eine Tabelle an. + \bigskip + \arrowitem + Es ist möglich, ohne Verlust an Komfort alle Daten in Normalform zu halten. + \end{itemize} + +\end{frame} + +\subsection{Schlüsselfelder} + +\begin{frame}[fragile] + + \showsection + \showsubsection + + \begin{lstlisting}[style=terminal] + ¡CREATE TABLE tabelle1 ( + id INT PRIMARY KEY AUTO_INCREMENT, + ... + ); + CREATE TABLE tabelle2 ( + ... + tabelle1_id INT, + ... + FOREIGN KEY(tabelle1_id) REFERENCES tabelle1(id) + ); + \end{lstlisting} + + \smallskip + + \begin{itemize} + \arrowitem + Dem DBMS mitteilen, welche Felder für \lstinline[style=cmd]{JOIN} + vorgesehen sind. + \arrowitem + Das DBMS kann mit auf Konsistenz achten. + \end{itemize} + +\end{frame} + +\subsection{Datensicherung} + +\begin{frame}[fragile] + + \showsection + \showsubsection + + \begin{lstlisting}[style=terminal] + $ ¡pg_dump --clean -h <Rechner> -U <User> -W <Datenbank>¿ + \end{lstlisting} + + \smallskip + + \begin{itemize} + \item + Ausgabe des gesamten Datenbankinhalts\\ + als SQL-Quelltext zur Standardausgabe + \arrowitem + keine Probleme mit sich evtl.\ ändernden Binärformaten + \item + Es ist möglich, den Inhalt direkt in einer Pipe weiterzuverarbeiten\\ + (z.\,B.\ zu komprimieren). + \item + Zurückspielen: mit \lstinline[style=cmd]{psql} + \end{itemize} + + \smallskip + + \begin{lstlisting}[style=terminal] + $ ¡psql -h <Rechner> -U <User> -W <Datenbank> \ + < <Ausgabe von pg_dump>¿ + \end{lstlisting} + + \smallskip + + \begin{itemize} + \item + analog für \file{MariaDB}: \lstinline[style=cmd]{mariadb-dump} + \end{itemize} + +\end{frame} + +\end{document} diff --git a/20231123/dbs-2023ws-p2.tex b/20231123/dbs-2023ws-p2.tex new file mode 100644 index 0000000000000000000000000000000000000000..43e4512a7bf06ea5d7a3999fa972a4255be17345 --- /dev/null +++ b/20231123/dbs-2023ws-p2.tex @@ -0,0 +1,102 @@ +% dbs-2023ws-p2.pdf - Labor Notes on Databases and Information Security +% Copyright (C) 2023 Peter Gerwinski +% +% This document is free software: you can redistribute it and/or +% modify it either under the terms of the Creative Commons +% Attribution-ShareAlike 3.0 License, or under the terms of the +% GNU General Public License as published by the Free Software +% Foundation, either version 3 of the License, or (at your option) +% any later version. +% +% This document is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this document. If not, see <http://www.gnu.org/licenses/>. +% +% You should have received a copy of the Creative Commons +% Attribution-ShareAlike 3.0 Unported License along with this +% document. If not, see <http://creativecommons.org/licenses/>. + +% README: Versuch 2: Relationale Datenbanken + +\documentclass[a4paper]{article} + +\usepackage{pgscript} +\usepackage{multicol} +\usepackage{sfmath} + +\sloppy +\pagestyle{empty} +\addtolength{\textheight}{1cm} +\newcommand{\sep}{~$\cdot$~} +\newcommand{\mylicense}{CC BY-SA (Version 4.0) oder GNU GPL (Version 3 oder höher)} + +\begin{document} + + \makebox(0,0.005)[tl]{\includegraphics[scale=0.72]{logo-hochschule-bochum-cvh-text-v2.pdf}}\hfill + \makebox(0,0)[tr]{\includegraphics[scale=0.5]{logo-hochschule-bochum.pdf}} + \par\bigskip\bigskip + \begin{center} + \Large\textbf{Praktikumsversuch 2: Relationale Datenbanken} + \par\medskip + \normalsize Datenbanken und Datensicherheit\sep + Wintersemester 2023/24\sep + Prof.~Dr.~Peter Gerwinski + \end{center} + + Aufgabe: Schreiben Sie ein Programm, das auf strukturierte Daten zugreift + und diese per TCP/IP kontrolliert zur Verfügung stellt. + + \begin{multicols}{2} + \begin{itemize} + \item + Die strukturierten Daten sollen in Gestalt einer Text-Datei zur Verfügung stehen, + z.\,B.\ einer CSV-Datei. Einschränkungen hinsichtlich der Daten, + z.\,B.\ das Ausschließen bestimmter Zeichen aus Strings, sind erlaubt. + \item + Ihr Programm soll über einem TCP-Port + Befehle zur selektiven Datenabfrage entgegennehmen + und die angeforderten Daten über dieselbe TCP-Verbindung ausliefern. + \item + Das Definieren einer für diese Situation angemessenen Abfragesprache + ist Teil der Praktikumsaufgabe. + \item + Implementieren Sie eine Passwort-Abfrage, + über die sich berechtigte Benutzer Ihres Informationssystems + authentifizieren können. + \item + Zusatzaufgabe 1: Implementieren Sie auch Schreibzugriff auf die Text-Datei. + \item + Zusatzaufgabe 2: Demonstrieren Sie, wie sich die Authentifizerung + durch Mitlesen des Netzwerkverkehrs umgehen läßt. + \item + Zusatzaufgabe 3: Gestalten Sie die Authentifizierung so, daß sie sich + durch Mitlesen des Netzwerkverkehrs nicht mehr umgehen läßt. + \end{itemize} + \end{multicols} + + \strut\hfill\emph{Viel Erfolg!} + + \vfill + + \begingroup + + \small + + \setlength{\leftskip}{3cm} + + Stand: 22.\ November 2023 + + Copyright \copyright\ 2023\quad Peter Gerwinski\\ + Lizenz: \mylicense + + Sie können diese Praktikumsunterlagen einschließlich \LaTeX-Quelltext + herunterladen unter:\\ + \url{https://gitlab.cvh-server.de/pgerwinski/dbs} + + \endgroup + +\end{document} diff --git a/20231123/foreign-key-01.txt b/20231123/foreign-key-01.txt new file mode 100644 index 0000000000000000000000000000000000000000..26336ac0dba8c07d6200204d760c7c241110e022 --- /dev/null +++ b/20231123/foreign-key-01.txt @@ -0,0 +1,32 @@ +testdb=> select * from lied_auf_cd; + cd_id | albumtitel | interpret | gruendungsjahr | erscheinungsjahr | track | titel +-------+--------------------+------------+----------------+------------------+-------+---------------------------- + 4711 | Not That Kind | Anastacia | 1999 | 2000 | 1 | Not That Kind + 4711 | Not That Kind | Anastacia | 1999 | 2000 | 2 | I'm Otta Love + 4711 | Not That Kind | Anastacia | 1999 | 2000 | 3 | Cowboys & Kisses + 4712 | Wish You Were Here | Pink Floyd | 1965 | 1975 | 1 | Shine On You Crazy Diamond + 4713 | Freak of Nature | Anastacia | 1999 | 2001 | 1 | Paid my Dues +(5 Zeilen) + +testdb=> select * from lied; + cd_id | track | titel +-------+-------+---------------------------- + 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 +(5 Zeilen) + +testdb=> select * from cd; + cd_id | albumtitel | interpret | gruendungsjahr | erscheinungsjahr +-------+--------------------+-------------------------+----------------+------------------ + 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 +(4 Zeilen) + +testdb=> INSERT INTO lied ( cd_id, track, titel ) VALUES ( 4733, 1, '4''33"' ); FEHLER: Einfügen oder Aktualisieren in Tabelle »lied« verletzt Fremdschlüssel-Constraint »lied_fkey_cd_id« +DETAIL: Schlüssel (cd_id)=(4733) ist nicht in Tabelle »cd« vorhanden. +testdb=> diff --git a/20231123/foreign-key-02.txt b/20231123/foreign-key-02.txt new file mode 100644 index 0000000000000000000000000000000000000000..6f6271018ebbae4ddcad2e7960c4be8d94cdef75 --- /dev/null +++ b/20231123/foreign-key-02.txt @@ -0,0 +1,25 @@ +testdb=> \d cd + Tabelle »public.cd« + Spalte | Typ | Sortierfolge | NULL erlaubt? | Vorgabewert +------------------+---------+--------------+---------------+----------------------------------- + cd_id | integer | | not null | nextval('cd_cd_id_seq'::regclass) + albumtitel | text | | | + interpret | text | | | + gruendungsjahr | integer | | | + erscheinungsjahr | integer | | | +Indexe: + "cd_pkey" PRIMARY KEY, btree (cd_id) +Fremdschlüsselverweise von: + TABLE "lied" CONSTRAINT "lied_fkey_cd_id" FOREIGN KEY (cd_id) REFERENCES cd(cd_id) + +testdb=> \d lied + Tabelle »public.lied« + Spalte | Typ | Sortierfolge | NULL erlaubt? | Vorgabewert +--------+---------+--------------+---------------+------------- + cd_id | integer | | | + track | integer | | | + titel | text | | | +Fremdschlüssel-Constraints: + "lied_fkey_cd_id" FOREIGN KEY (cd_id) REFERENCES cd(cd_id) + +testdb=> diff --git a/20231123/logo-hochschule-bochum-cvh-text-v2.pdf b/20231123/logo-hochschule-bochum-cvh-text-v2.pdf new file mode 120000 index 0000000000000000000000000000000000000000..4aa99b8f81061aca6dcaf43eed2d9efef40555f8 --- /dev/null +++ b/20231123/logo-hochschule-bochum-cvh-text-v2.pdf @@ -0,0 +1 @@ +../common/logo-hochschule-bochum-cvh-text-v2.pdf \ No newline at end of file diff --git a/20231123/logo-hochschule-bochum.pdf b/20231123/logo-hochschule-bochum.pdf new file mode 120000 index 0000000000000000000000000000000000000000..b6b9491e370e499c9276918182cdb82cb311bcd1 --- /dev/null +++ b/20231123/logo-hochschule-bochum.pdf @@ -0,0 +1 @@ +../common/logo-hochschule-bochum.pdf \ No newline at end of file diff --git a/20231123/pgslides.sty b/20231123/pgslides.sty new file mode 120000 index 0000000000000000000000000000000000000000..5be1416f4216f076aa268901f52a15d775e43f64 --- /dev/null +++ b/20231123/pgslides.sty @@ -0,0 +1 @@ +../common/pgslides.sty \ No newline at end of file diff --git a/20231123/testdb-20231123-01.sql b/20231123/testdb-20231123-01.sql new file mode 100644 index 0000000000000000000000000000000000000000..0a8b8a9a1b46654310fdd32698753b1324d7f459 --- /dev/null +++ b/20231123/testdb-20231123-01.sql @@ -0,0 +1,153 @@ +-- +-- 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; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cd; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.cd ( + cd_id integer, + albumtitel text, + interpret text, + gruendungsjahr integer, + erscheinungsjahr integer +); + + +ALTER TABLE public.cd OWNER TO dbs; + +-- +-- Name: lied; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.lied ( + cd_id integer, + track integer, + titel text +); + + +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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_id))); + + +ALTER TABLE public.lied_auf_cd OWNER TO dbs; + +-- +-- Name: test; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.test ( + id integer, + s text +); + + +ALTER TABLE public.test OWNER TO dbs; + +-- +-- Name: tier; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.tier ( + name character(30), + tierart character(30), + id integer +); + + +ALTER TABLE public.tier OWNER TO postgres; + +-- +-- 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 +4733 1 4'33" +\. + + +-- +-- Data for Name: test; Type: TABLE DATA; Schema: public; Owner: dbs +-- + +COPY public.test (id, s) FROM stdin; +7 Zwerge +\. + + +-- +-- Data for Name: tier; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +COPY public.tier (name, tierart, id) FROM stdin; +Esmeralda Spinne 1 +Timmy Hund 2 +Dio Katze 3 +Tusnelda Spinne 4 +Ragnar Katze \N +Putzi Ratte \N +\. + + +-- +-- Name: TABLE tier; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.tier TO dbs; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/20231123/testdb-20231123-02.sql b/20231123/testdb-20231123-02.sql new file mode 100644 index 0000000000000000000000000000000000000000..150e2532070ec8f7265afe84cde54b118f5a7244 --- /dev/null +++ b/20231123/testdb-20231123-02.sql @@ -0,0 +1,155 @@ +-- +-- 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; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cd; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.cd ( + cd_id integer, + albumtitel text, + interpret text, + gruendungsjahr integer, + erscheinungsjahr integer +); + + +ALTER TABLE public.cd OWNER TO dbs; + +-- +-- Name: lied; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.lied ( + cd_id integer, + track integer, + titel text +); + + +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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_id))); + + +ALTER TABLE public.lied_auf_cd OWNER TO dbs; + +-- +-- Name: test; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.test ( + id integer, + s text +); + + +ALTER TABLE public.test OWNER TO dbs; + +-- +-- Name: tier; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.tier ( + name character(30), + tierart character(30), + id integer +); + + +ALTER TABLE public.tier OWNER TO postgres; + +-- +-- 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 +4733 1 4'33" +\. + + +-- +-- Data for Name: test; Type: TABLE DATA; Schema: public; Owner: dbs +-- + +COPY public.test (id, s) FROM stdin; +7 Zwerge +\. + + +-- +-- Data for Name: tier; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +COPY public.tier (name, tierart, id) FROM stdin; +Esmeralda Spinne 1 +Timmy Hund 2 +Dio Katze 3 +Tusnelda Spinne 4 +Ragnar Katze \N +Putzi Ratte \N +Felix Troll \N +Rex Ameise \N +\. + + +-- +-- Name: TABLE tier; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.tier TO dbs; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/20231123/testdb-20231123-03.sql b/20231123/testdb-20231123-03.sql new file mode 100644 index 0000000000000000000000000000000000000000..cfa13aba0e211ca18070d7da4cc68ef9e22cddab --- /dev/null +++ b/20231123/testdb-20231123-03.sql @@ -0,0 +1,160 @@ +-- +-- 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 public.tier; +DROP TABLE public.test; +DROP VIEW public.lied_auf_cd; +DROP TABLE public.lied; +DROP TABLE public.cd; +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cd; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.cd ( + cd_id integer, + albumtitel text, + interpret text, + gruendungsjahr integer, + erscheinungsjahr integer +); + + +ALTER TABLE public.cd OWNER TO dbs; + +-- +-- Name: lied; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.lied ( + cd_id integer, + track integer, + titel text +); + + +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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_id))); + + +ALTER TABLE public.lied_auf_cd OWNER TO dbs; + +-- +-- Name: test; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.test ( + id integer, + s text +); + + +ALTER TABLE public.test OWNER TO dbs; + +-- +-- Name: tier; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.tier ( + name character(30), + tierart character(30), + id integer +); + + +ALTER TABLE public.tier OWNER TO postgres; + +-- +-- 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 +4733 1 4'33" +\. + + +-- +-- Data for Name: test; Type: TABLE DATA; Schema: public; Owner: dbs +-- + +COPY public.test (id, s) FROM stdin; +7 Zwerge +\. + + +-- +-- Data for Name: tier; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +COPY public.tier (name, tierart, id) FROM stdin; +Esmeralda Spinne 1 +Timmy Hund 2 +Dio Katze 3 +Tusnelda Spinne 4 +Ragnar Katze \N +Putzi Ratte \N +Felix Troll \N +Rex Ameise \N +\. + + +-- +-- Name: TABLE tier; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.tier TO dbs; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/20231123/testdb-20231123-04.sql b/20231123/testdb-20231123-04.sql new file mode 100644 index 0000000000000000000000000000000000000000..4d08542096b1a7a614a31a720952cdfbb53113a6 --- /dev/null +++ b/20231123/testdb-20231123-04.sql @@ -0,0 +1,132 @@ +-- +-- 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 public.tier; +DROP VIEW public.lied_auf_cd; +DROP TABLE public.lied; +DROP TABLE public.cd; +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cd; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.cd ( + cd_id integer PRIMARY KEY AUTO_INCREMENT, + albumtitel text, + interpret text, + gruendungsjahr integer, + erscheinungsjahr integer +); + + +ALTER TABLE public.cd OWNER TO dbs; + +-- +-- Name: lied; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.lied ( + cd_id integer, + track integer, + titel text, + FOREIGN KEY(cd_id) REFERENCES cd(cd_id) +); + + +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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_id))); + + +ALTER TABLE public.lied_auf_cd OWNER TO dbs; + +-- +-- Name: test; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.tier ( + id integer PRIMARY KEY AUTO_INCREMENT, + 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 +4733 1 4'33" +\. + + +-- +-- 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 \N +Putzi Ratte \N +Felix Troll \N +Rex Ameise \N +\. + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/20231123/testdb-20231123-05.sql b/20231123/testdb-20231123-05.sql new file mode 100644 index 0000000000000000000000000000000000000000..7a5b5125ed2e88b2337ec2a8190c54549a2a2ca4 --- /dev/null +++ b/20231123/testdb-20231123-05.sql @@ -0,0 +1,132 @@ +-- +-- 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 public.tier; +DROP VIEW public.lied_auf_cd; +DROP TABLE public.lied; +DROP TABLE public.cd; +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cd; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.cd ( + cd_id integer SERIAL PRIMARY KEY; + albumtitel text, + interpret text, + gruendungsjahr integer, + erscheinungsjahr integer +); + + +ALTER TABLE public.cd OWNER TO dbs; + +-- +-- Name: lied; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.lied ( + cd_id integer, + track integer, + titel text, + FOREIGN KEY(cd_id) REFERENCES cd(cd_id) +); + + +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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_id))); + + +ALTER TABLE public.lied_auf_cd OWNER TO dbs; + +-- +-- Name: test; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.tier ( + id integer 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 +4733 1 4'33" +\. + + +-- +-- 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 \N +Putzi Ratte \N +Felix Troll \N +Rex Ameise \N +\. + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/20231123/testdb-20231123-06.sql b/20231123/testdb-20231123-06.sql new file mode 100644 index 0000000000000000000000000000000000000000..46c9241dceffbe62a9d36ec554d910755ae42be0 --- /dev/null +++ b/20231123/testdb-20231123-06.sql @@ -0,0 +1,133 @@ +-- +-- 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; +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cd; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.cd ( + cd_id SERIAL PRIMARY KEY, + albumtitel text, + interpret text, + gruendungsjahr integer, + erscheinungsjahr integer +); + + +ALTER TABLE public.cd OWNER TO dbs; + +-- +-- Name: lied; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.lied ( + cd_id integer, + track integer, + titel text +); + +ALTER TABLE public.lied + ADD CONSTRAINT FOREIGN KEY(cd_id) REFERENCES public.cd(cd_id); + +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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_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 +4733 1 4'33" +\. + + +-- +-- 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 \N +Putzi Ratte \N +Felix Troll \N +Rex Ameise \N +\. + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/20231123/testdb-20231123-07.sql b/20231123/testdb-20231123-07.sql new file mode 100644 index 0000000000000000000000000000000000000000..ab364e0bfa00ad9531a77263496735b694e8df9e --- /dev/null +++ b/20231123/testdb-20231123-07.sql @@ -0,0 +1,133 @@ +-- +-- 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; +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cd; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.cd ( + cd_id SERIAL PRIMARY KEY, + albumtitel text, + interpret text, + gruendungsjahr integer, + erscheinungsjahr integer +); + + +ALTER TABLE public.cd OWNER TO dbs; + +-- +-- Name: lied; Type: TABLE; Schema: public; Owner: dbs +-- + +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.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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_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 +4733 1 4'33" +\. + + +-- +-- 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 +-- + diff --git a/20231123/testdb-20231123-08.sql b/20231123/testdb-20231123-08.sql new file mode 100644 index 0000000000000000000000000000000000000000..99eb44c962648ecd447f0c55d424f3a3fd2d6a10 --- /dev/null +++ b/20231123/testdb-20231123-08.sql @@ -0,0 +1,132 @@ +-- +-- 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; +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cd; Type: TABLE; Schema: public; Owner: dbs +-- + +CREATE TABLE public.cd ( + cd_id SERIAL PRIMARY KEY, + albumtitel text, + interpret text, + gruendungsjahr integer, + erscheinungsjahr integer +); + + +ALTER TABLE public.cd OWNER TO dbs; + +-- +-- Name: lied; Type: TABLE; Schema: public; Owner: dbs +-- + +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.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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_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 +-- + diff --git a/20231123/testdb-20231123-09.sql b/20231123/testdb-20231123-09.sql new file mode 100644 index 0000000000000000000000000000000000000000..73887180df2e29bb11293b81366dc5afed35b9b8 --- /dev/null +++ b/20231123/testdb-20231123-09.sql @@ -0,0 +1,127 @@ +-- +-- 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; +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 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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_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 +-- + diff --git a/20231123/testdb-20231123-10.sql b/20231123/testdb-20231123-10.sql new file mode 100644 index 0000000000000000000000000000000000000000..8e2e84315c55457c2776fcd180b1d9ea392d5822 --- /dev/null +++ b/20231123/testdb-20231123-10.sql @@ -0,0 +1,130 @@ +-- +-- 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; +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, + cd.gruendungsjahr, + cd.erscheinungsjahr, + lied.track, + lied.titel + FROM (public.cd + JOIN public.lied ON ((cd.cd_id = lied.cd_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 +-- + diff --git a/20231123/testdb-20231123-11.sql b/20231123/testdb-20231123-11.sql new file mode 100644 index 0000000000000000000000000000000000000000..ec85a21edbebc319b574107e5d782fc423ac7984 --- /dev/null +++ b/20231123/testdb-20231123-11.sql @@ -0,0 +1,130 @@ +-- +-- 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; +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))); + + +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 +-- + diff --git a/20231123/testdb-20231123-12.sql b/20231123/testdb-20231123-12.sql new file mode 100644 index 0000000000000000000000000000000000000000..fd5482dbe0b1f23257fd51277f1d18a047be39f1 --- /dev/null +++ b/20231123/testdb-20231123-12.sql @@ -0,0 +1,133 @@ +-- +-- 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.interpret; +DROP TABLE IF EXISTS public.cd; +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 +-- + diff --git a/20231123/testdb-20231123-13.sql b/20231123/testdb-20231123-13.sql new file mode 100644 index 0000000000000000000000000000000000000000..c94478ab5b065cf11665e1fead5f614178d3f955 --- /dev/null +++ b/20231123/testdb-20231123-13.sql @@ -0,0 +1,133 @@ +-- +-- 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 +-- + diff --git a/20231123/testdb-20231123-14.sql b/20231123/testdb-20231123-14.sql new file mode 100644 index 0000000000000000000000000000000000000000..ad68adecb1f272bcf1d61a023872a2eaeeeedda1 --- /dev/null +++ b/20231123/testdb-20231123-14.sql @@ -0,0 +1,127 @@ +-- +-- 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); + +CREATE VIEW public.lied_auf_cd AS + SELECT cd.cd_id, + cd.albumtitel, + interpret.name, + interpret.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.cd OWNER TO dbs; +ALTER TABLE public.lied OWNER TO dbs; +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 +-- + diff --git a/20231123/testdb-20231123-15.sql b/20231123/testdb-20231123-15.sql new file mode 100644 index 0000000000000000000000000000000000000000..1141301dabb812a911a412495e3ba70dfa9a7d53 --- /dev/null +++ b/20231123/testdb-20231123-15.sql @@ -0,0 +1,124 @@ +-- +-- 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); + +CREATE VIEW public.lied_auf_cd AS + SELECT cd.cd_id, + cd.albumtitel, + interpret.name, + interpret.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.cd OWNER TO dbs; +ALTER TABLE public.lied OWNER TO dbs; +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; + +COPY public.interpret (id, name, gruendungsjahr) FROM stdin; +1 Anastacia 1999 +2 Pink Floyd 1965 +3 Queens of the Stone Age 1996 +\. + +COPY public.cd (cd_id, albumtitel, interpret_id, erscheinungsjahr) FROM stdin; +4711 Not That Kind 1 2000 +4712 Wish You Were Here 2 1975 +4713 Freak of Nature 1 2001 +4714 Songs for the Deaf 3 2002 +\. + +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 +-- +