From b72d40829bd7ae8d0444ed4bb1e2811a3e41ebea Mon Sep 17 00:00:00 2001
From: Peter Gerwinski <peter.gerwinski@hs-bochum.de>
Date: Thu, 16 Nov 2023 13:03:55 +0100
Subject: [PATCH] weitere Screenshots/Beispiele 16.11.2023

---
 20231116/normalformen-02.txt | 25 ++++++++++++++
 20231116/normalformen-03.txt | 27 +++++++++++++++
 20231116/normalformen-04.txt |  9 +++++
 20231116/normalformen-05.txt | 31 +++++++++++++++++
 20231116/normalformen-06.txt | 67 ++++++++++++++++++++++++++++++++++++
 20231116/normalformen-07.txt | 25 ++++++++++++++
 20231116/normalformen-08.txt | 24 +++++++++++++
 20231116/normalformen-09.txt | 51 +++++++++++++++++++++++++++
 20231116/normalformen-10.txt | 65 ++++++++++++++++++++++++++++++++++
 9 files changed, 324 insertions(+)
 create mode 100644 20231116/normalformen-02.txt
 create mode 100644 20231116/normalformen-03.txt
 create mode 100644 20231116/normalformen-04.txt
 create mode 100644 20231116/normalformen-05.txt
 create mode 100644 20231116/normalformen-06.txt
 create mode 100644 20231116/normalformen-07.txt
 create mode 100644 20231116/normalformen-08.txt
 create mode 100644 20231116/normalformen-09.txt
 create mode 100644 20231116/normalformen-10.txt

diff --git a/20231116/normalformen-02.txt b/20231116/normalformen-02.txt
new file mode 100644
index 0000000..d29b367
--- /dev/null
+++ b/20231116/normalformen-02.txt
@@ -0,0 +1,25 @@
+testdb=> SELECT albumtitel FROM cd;
+     albumtitel
+--------------------
+ Not That Kind
+ Wish You Were Here
+ Freak of Nature
+(3 Zeilen)
+
+testdb=> SELECT cd_id, albumtitel FROM cd;
+ cd_id |     albumtitel
+-------+--------------------
+  4711 | Not That Kind
+  4712 | Wish You Were Here
+  4713 | Freak of Nature
+(3 Zeilen)
+
+testdb=> SELECT * FROM lied WHERE cd_id = 4711;
+ cd_id | track |      titel
+-------+-------+------------------
+  4711 |     1 | Not That Kind
+  4711 |     2 | I'm Otta Love
+  4711 |     3 | Cowboys & Kisses
+(3 Zeilen)
+
+testdb=>
diff --git a/20231116/normalformen-03.txt b/20231116/normalformen-03.txt
new file mode 100644
index 0000000..4974219
--- /dev/null
+++ b/20231116/normalformen-03.txt
@@ -0,0 +1,27 @@
+testdb=> SELECT cd_id FROM cd WHERE albumtitel = 'Not That Kind';
+ cd_id
+-------
+  4711
+(1 Zeile)
+
+testdb=> SELECT * FROM lied WHERE cd_id = 4711;
+ cd_id | track |      titel
+-------+-------+------------------
+  4711 |     1 | Not That Kind
+  4711 |     2 | I'm Otta Love
+  4711 |     3 | Cowboys & Kisses
+(3 Zeilen)
+
+testdb=> SELECT * FROM lied WHERE cd_id = SELECT cd_id FROM cd WHERE albumtitel = 'Not That Kind';
+FEHLER:  Syntaxfehler bei »SELECT«
+ZEILE 1: SELECT * FROM lied WHERE cd_id = SELECT cd_id FROM cd WHERE ...
+                                          ^
+testdb=> SELECT * FROM lied WHERE cd_id = ( SELECT cd_id FROM cd WHERE albumtitel = 'Not That Kind' );
+ cd_id | track |      titel
+-------+-------+------------------
+  4711 |     1 | Not That Kind
+  4711 |     2 | I'm Otta Love
+  4711 |     3 | Cowboys & Kisses
+(3 Zeilen)
+
+testdb=>
diff --git a/20231116/normalformen-04.txt b/20231116/normalformen-04.txt
new file mode 100644
index 0000000..1e34622
--- /dev/null
+++ b/20231116/normalformen-04.txt
@@ -0,0 +1,9 @@
+testdb=> SELECT * FROM cd LEFT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia  |           1999 |             2001 |  4713 |     1 | Paid my Dues
+(5 Zeilen)
diff --git a/20231116/normalformen-05.txt b/20231116/normalformen-05.txt
new file mode 100644
index 0000000..863b09a
--- /dev/null
+++ b/20231116/normalformen-05.txt
@@ -0,0 +1,31 @@
+testdb=> SELECT * FROM cd LEFT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia  |           1999 |             2001 |  4713 |     1 | Paid my Dues
+(5 Zeilen)
+
+testdb=> SELECT * FROM cd JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia  |           1999 |             2001 |  4713 |     1 | Paid my Dues
+(5 Zeilen)
+
+testdb=> SELECT * FROM lied JOIN cd ON cd.cd_id = lied.cd_id;
+ cd_id | track |           titel            | cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr
+-------+-------+----------------------------+-------+--------------------+------------+----------------+------------------
+  4711 |     1 | Not That Kind              |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4711 |     2 | I'm Otta Love              |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4711 |     3 | Cowboys & Kisses           |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4712 |     1 | Shine On You Crazy Diamond |  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975
+  4713 |     1 | Paid my Dues               |  4713 | Freak of Nature    | Anastacia  |           1999 |             2001
+(5 Zeilen)
+
+testdb=>
diff --git a/20231116/normalformen-06.txt b/20231116/normalformen-06.txt
new file mode 100644
index 0000000..f1215ca
--- /dev/null
+++ b/20231116/normalformen-06.txt
@@ -0,0 +1,67 @@
+testdb=> INSERT INTO cd ( cd_id, albumtitel, interpret, gruendungsjahr, erscheinungsjahr ) VALUES ( 4714, 'Queen', 'Songs For The Deaf', 1996, 2002 );
+INSERT 0 1
+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 | Queen              | Songs For The Deaf |           1996 |             2002
+(4 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 lied JOIN cd ON cd.cd_id = lied.cd_id;
+ cd_id | track |           titel            | cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr
+-------+-------+----------------------------+-------+--------------------+------------+----------------+------------------
+  4711 |     1 | Not That Kind              |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4711 |     2 | I'm Otta Love              |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4711 |     3 | Cowboys & Kisses           |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4712 |     1 | Shine On You Crazy Diamond |  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975
+  4713 |     1 | Paid my Dues               |  4713 | Freak of Nature    | Anastacia  |           1999 |             2001
+(5 Zeilen)
+
+testdb=> SELECT * FROM lied LEFT JOIN cd ON cd.cd_id = lied.cd_id;
+ cd_id | track |           titel            | cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr
+-------+-------+----------------------------+-------+--------------------+------------+----------------+------------------
+  4711 |     1 | Not That Kind              |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4711 |     2 | I'm Otta Love              |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4711 |     3 | Cowboys & Kisses           |  4711 | Not That Kind      | Anastacia  |           1999 |             2000
+  4712 |     1 | Shine On You Crazy Diamond |  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975
+  4713 |     1 | Paid my Dues               |  4713 | Freak of Nature    | Anastacia  |           1999 |             2001
+(5 Zeilen)
+
+testdb=> SELECT * FROM lied RIGHT JOIN cd ON cd.cd_id = lied.cd_id;
+ cd_id | track |           titel            | cd_id |     albumtitel     |     interpret      | gruendungsjahr | erscheinungsjahr
+-------+-------+----------------------------+-------+--------------------+--------------------+----------------+------------------
+  4711 |     1 | Not That Kind              |  4711 | Not That Kind      | Anastacia          |           1999 |             2000
+  4711 |     2 | I'm Otta Love              |  4711 | Not That Kind      | Anastacia          |           1999 |             2000
+  4711 |     3 | Cowboys & Kisses           |  4711 | Not That Kind      | Anastacia          |           1999 |             2000
+  4712 |     1 | Shine On You Crazy Diamond |  4712 | Wish You Were Here | Pink Floyd         |           1965 |             1975
+  4713 |     1 | Paid my Dues               |  4713 | Freak of Nature    | Anastacia          |           1999 |             2001
+       |       |                            |  4714 | Queen              | Songs For The Deaf |           1996 |             2002
+(6 Zeilen)
+
+testdb=> UPDATE cd SET gruendungsjahr=1970 WHERE interpret='Queen';
+UPDATE 0
+testdb=>
+testdb=> SELECT * FROM cd LEFT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     |     interpret      | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+--------------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia          |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia          |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia          |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd         |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia          |           1999 |             2001 |  4713 |     1 | Paid my Dues
+  4714 | Queen              | Songs For The Deaf |           1996 |             2002 |       |       |
+(6 Zeilen)
+
+testdb=>
diff --git a/20231116/normalformen-07.txt b/20231116/normalformen-07.txt
new file mode 100644
index 0000000..2e4c483
--- /dev/null
+++ b/20231116/normalformen-07.txt
@@ -0,0 +1,25 @@
+testdb=> SELECT * FROM cd LEFT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     |     interpret      | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+--------------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia          |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia          |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia          |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd         |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia          |           1999 |             2001 |  4713 |     1 | Paid my Dues
+  4714 | Queen              | Songs For The Deaf |           1996 |             2002 |       |       |
+(6 Zeilen)
+
+testdb=> UPDATE cd SET gruendungsjahr = 1970, albumtitel = 'Songs For TRhe Deaf', interpret = 'Queen' WHERE albumtitel = 'Queen';
+UPDATE 1
+testdb=> SELECT * FROM cd LEFT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel      | interpret  | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+---------------------+------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind       | Anastacia  |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind       | Anastacia  |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind       | Anastacia  |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here  | Pink Floyd |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature     | Anastacia  |           1999 |             2001 |  4713 |     1 | Paid my Dues
+  4714 | Songs For TRhe Deaf | Queen      |           1970 |             2002 |       |       |
+(6 Zeilen)
+
+testdb=>
diff --git a/20231116/normalformen-08.txt b/20231116/normalformen-08.txt
new file mode 100644
index 0000000..968f3f6
--- /dev/null
+++ b/20231116/normalformen-08.txt
@@ -0,0 +1,24 @@
+testdb=> UPDATE cd SET interpret = 'Queens of the Stone Age', gruendungsjahr = 1996, albumtitel = 'Songs for the Deaf' WHERE interpret = 'Queen';
+UPDATE 1
+testdb=> SELECT * FROM cd LEFT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     |        interpret        | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+-------------------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd              |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia               |           1999 |             2001 |  4713 |     1 | Paid my Dues
+  4714 | Songs for the Deaf | Queens of the Stone Age |           1996 |             2002 |       |       |
+(6 Zeilen)
+
+testdb=> SELECT * FROM cd JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia  |           1999 |             2001 |  4713 |     1 | Paid my Dues
+(5 Zeilen)
+
+testdb=>
diff --git a/20231116/normalformen-09.txt b/20231116/normalformen-09.txt
new file mode 100644
index 0000000..f445660
--- /dev/null
+++ b/20231116/normalformen-09.txt
@@ -0,0 +1,51 @@
+testdb=> INSERT INTO lied ( cd_id, track, titel ) VALUES ( 4733, 1, '4''33"' );
+INSERT 0 1
+testdb=> SELECT * FROM cd JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia  |           1999 |             2001 |  4713 |     1 | Paid my Dues
+(5 Zeilen)
+
+testdb=> SELECT * FROM cd RIGHT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia  |           1999 |             2001 |  4713 |     1 | Paid my Dues
+       |                    |            |                |                  |  4733 |     1 | 4'33"
+(6 Zeilen)
+
+testdb=> SELECT * FROM cd LEFT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     |        interpret        | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+-------------------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd              |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia               |           1999 |             2001 |  4713 |     1 | Paid my Dues
+  4714 | Songs for the Deaf | Queens of the Stone Age |           1996 |             2002 |       |       |
+(6 Zeilen)
+
+testdb=> SELECT * FROM cd FULL JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     |        interpret        | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+-------------------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd              |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia               |           1999 |             2001 |  4713 |     1 | Paid my Dues
+  4714 | Songs for the Deaf | Queens of the Stone Age |           1996 |             2002 |       |       |
+       |                    |                         |                |                  |  4733 |     1 | 4'33"
+(7 Zeilen)
+
+testdb=> SELECT * FROM cd OUTER JOIN lied ON cd.cd_id = lied.cd_id;
+FEHLER:  Syntaxfehler bei »OUTER«
+ZEILE 1: SELECT * FROM cd OUTER JOIN lied ON cd.cd_id = lied.cd_id;
+                          ^
+testdb=>
diff --git a/20231116/normalformen-10.txt b/20231116/normalformen-10.txt
new file mode 100644
index 0000000..0d1549d
--- /dev/null
+++ b/20231116/normalformen-10.txt
@@ -0,0 +1,65 @@
+testdb=> \d
+         Liste der Relationen
+ Schema | Name |   Typ   | Eigentümer
+--------+------+---------+------------
+ public | cd   | Tabelle | dbs
+ public | lied | Tabelle | dbs
+ public | test | Tabelle | dbs
+ public | tier | Tabelle | postgres
+(4 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=> 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
+  4733 |     1 | 4'33"
+(6 Zeilen)
+
+testdb=> SELECT * FROM cd LEFT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     |        interpret        | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+-------------------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd              |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia               |           1999 |             2001 |  4713 |     1 | Paid my Dues
+  4714 | Songs for the Deaf | Queens of the Stone Age |           1996 |             2002 |       |       |
+(6 Zeilen)
+
+testdb=> SELECT * FROM cd RIGHT JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     | interpret  | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia  |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia  |           1999 |             2001 |  4713 |     1 | Paid my Dues
+       |                    |            |                |                  |  4733 |     1 | 4'33"
+(6 Zeilen)
+
+testdb=> SELECT * FROM cd FULL JOIN lied ON cd.cd_id = lied.cd_id;
+ cd_id |     albumtitel     |        interpret        | gruendungsjahr | erscheinungsjahr | cd_id | track |           titel
+-------+--------------------+-------------------------+----------------+------------------+-------+-------+----------------------------
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     1 | Not That Kind
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     2 | I'm Otta Love
+  4711 | Not That Kind      | Anastacia               |           1999 |             2000 |  4711 |     3 | Cowboys & Kisses
+  4712 | Wish You Were Here | Pink Floyd              |           1965 |             1975 |  4712 |     1 | Shine On You Crazy Diamond
+  4713 | Freak of Nature    | Anastacia               |           1999 |             2001 |  4713 |     1 | Paid my Dues
+  4714 | Songs for the Deaf | Queens of the Stone Age |           1996 |             2002 |       |       |
+       |                    |                         |                |                  |  4733 |     1 | 4'33"
+(7 Zeilen)
+
+testdb=>
-- 
GitLab