Professional Documents
Culture Documents
Slides Part1 Databases v2.0
Slides Part1 Databases v2.0
Social Computing
Prof. Dr. Georg Groh Research Group Fakultät für Informatik
1
Part 0:
Content and Goals of this Module,
Fundamental Terminology of Informatics
2
Informatics: Fundamental Terminology
● Informatics: subject: information + information processing
(representation, storing, mapping, transmission etc.)
with computer-systems.
(--> theory of Informatics, applied Informatics, Computer Science (hardware etc.))
3
Informatics: Fundamental Terminology
● Informatics: subject: information + information processing
(representation, storing, mapping, transmission etc.)
with computer-systems.
(--> theory of Informatics, applied Informatics, Computer Science (hardware etc.))
● Information
4
Informatics: Fundamental Terminology
● Informatics: subject: information + information processing
(representation, storing, mapping, transmission etc.)
with computer-systems.
(--> theory of Informatics, applied Informatics, Computer Science (hardware etc.))
39
5
Informatics: Fundamental Terminology
● Informatics: subject: information + information processing
(representation, storing, mapping, transmission etc.)
with computer-systems.
(--> theory of Informatics, applied Informatics, Computer Science (hardware etc.))
39 = 3 ∗ 10& + 9 ∗ 10)
6
Informatics: Fundamental Terminology
● Informatics: subject: information + information processing
(representation, storing, mapping, transmission etc.)
with computer-systems.
(--> theory of Informatics, applied Informatics, Computer Science (hardware etc.))
39 = 3 ∗ 10& + 9 ∗ 10)
7
Informatics: Fundamental Terminology
● Informatics: subject: information + information processing
(representation, storing, mapping, transmission etc.)
with computer-systems.
(--> theory of Informatics, applied Informatics, Computer Science (hardware etc.))
8
Informatics: Fundamental Terminology
● Informatics: subject: information + information processing
(representation, storing, mapping, transmission etc.)
with computer-systems.
(--> theory of Informatics, applied Informatics, Computer Science (hardware etc.))
A B C D
3116 3416 2AF16 A316
Mini-Exercise
● 10-system („Decimal Numbers“) (base: 10, ten number symbols:
{0,1,2,3,4,5,6,7,8,9}): example: 4910
A B C D
3116 3416 2AF16 A316
Content and Learning Outcomes of the Lecture
Content
● Datenbases and SQL
Learning Outcomes
A large share of the slides and elements of slides were taken over from Prof. A. Kemper, TUM,
(http://www3.in.tum.de/teaching/) and the book [1]. These will not all be cited separately for reasons of legibility. 18
Books in German
19
Books in English
20
Part I.1: Introduction and
ER-Modelling
21
Database Management Systems (DBMS)
● Expectation / Requirements:
− regarding storage and manipulation of data: e.g. security, safety and
reliability
− regarding query processing: e.g. efficiency
− regarding query results: correctness and completeness (usually both
100 % ßà compare information retrieval (< 100 % precision and
recall)
22
Motivation for Using a DBMS
● security problems
23
Levels of Abstraction of a DBMS
Data Independence
• physical independence
• logical independence
24
Data Modelling
cutout of the
real world
manual/intellectual
modelling
conceptual schema
(ER-schema)
semi-automatic
transformation
25
Data Modelling: Example
Students
Professors
Lectures
real world: university
conceptual modelling
MatrNr PersNr
Students Professors
Name
attend Name
read
LectNr
Lecture
Title 26
Logical Data Models
● Network Model
● XML Schema
27
The Relational Data Model
select Name
from Students, attend, Lectures
where Students.MatrNr = attend.MatrNr and
attend.LectNr = Lectures.LectNr and
Lectures.Title = `Grundzüge´;
update Lectures
set Title = `Grundzüge der Logik´
where LectNr = 5001;
28
Database Design: Abstraction Levels
1. Conceptual Level
3. Physical Level
29
Phases of Database Design
Conceptual Design
ER Schema
DBMS-
Data processing Implementation Design
characteristics
requirements
Logical DB-Structure
4. Collect requirements
(information structure requirements, data processing requirements)
5. Filtering
(e.g. check for completeness, comprehensibility)
6. Classifications
(map information to objects, relations, operations and events)
7. Formalization
(-> result: formal requirements specification)
31
Information Structure Requirements
32
Data Processing Requirements
• frequency: biannual
• required data:
• exams
• examination regulations
• student information
• …
• priority: high
• amount of required data:
• 500 students
• 3000 exams
• 10 examination regulations
33
Phases of Database Design
Conceptual Design
ER Schema
DBMS-
Data processing Implementation Design
characteristics
requirements
Logical DB-Structure
● Entity
MatrNr Name Semester
● Relationship
○ binary, ternary, recursive...
Students
● Attribute audience
● Key enrolledIn
○ unique attribute or course
○ unique combination of attributes
Lectures
● Role
LectNr Title Credits
35
University Schema
isPrerequisiteFor
Predecessor Successor
MatrNr LectNr
Semester Title
EmployeeNr
Rank
Name Assistants workFor Professors Room
ResearchField
EmployeeNr Name
36
Relations as Mathematical Relations
e.g. likes
E1 : Human R E2 : Food
R Í E1 x E2
E1 E2
Hannah Spaghetti
Horst Sushi
Judith R Steak
(Hannah, Sushi)
(Horst, Spaghetti)
37
Functionalities
z.B. marriedTo
1 1
E1 (e.g. Men) R E2 (e.g. Women)
R Í E1 x E2
1:1 E1 E2 1:N
N:M
N:1
38
Functionalities
e.g. memberOfParliament
1 N
E1 (e.g. State) R E2 (e.g. Human)
R Í E1 x E2
1:1 E1 E2 1:N
N:M
N:1
39
Functionalities
e.g. read
N 1
E1 (e.g. Lecture) R E2 (e.g. Professor)
R Í E1 x E2
1:1 E1 E2 1:N
N:M
N:1
40
Functionalities
e.g. enrolledIn
N M
E1 (e.g. Lecture) R E2 (e.g. Students)
R Í E1 x E2
1:1 E1 E2 1:N
N:M
N:1
41
Exercise
A car repair shop needs a database. Create an ER model, such that the following entity-
and relationship types and attributes are modelled correctly:
42
Exercise
vehicle model brand year of
identification manufacture
number
customer family telephone
number name number
car customer
regards
awards
spare part
requires repair order
type
car customer
1
1
regards
awards
N
N
spare part N M
requires repair order
type
(ready to drive)
wheel attachedTo
car
A B C D
wheel 1 attachedTo
1 (ready to drive) wheel N attachedTo
M (ready to drive) wheel
1 attachedTo
N (ready to drive) wheel
N attachedTo
1 (ready to drive)
car car car car
Mini Exercise A
(ready to drive)
wheel attachedTo
car
A B C D
wheel 1 attachedTo
1 (ready to drive) wheel N attachedTo
M (ready to drive) wheel
1 attachedTo
N (ready to drive) wheel
N attachedTo
1 (ready to drive)
car car car car
Mini Exercise B
single
Guest books
room
A B C D
1 1 N M 1 N N 1
guest books single room guest books single room guest books single room guest books single room
Mini Exercise B
single
Guest books
room
A B C D
1 1 N M 1 N N 1
guest books single room guest books single room guest books single room guest books single room
Example:
E1
N
P M
E3 R E2
49
Functionalities of n-ary Relations
or:
E1
N
1 M
E3 R E2
50
Partial Functions
in general:
E1
N
P M
En R E2
1
Ek
Function:
R : E1 x ... x Ek-1 x Ek+1 x ... x En ® Ek right-unique
relation
51
Partial Functions
in general:
for some of these
E1 there could also
N be a 1
P M
En R E2
1
Ek
52
Partial Functions - Example
N 1
FÍXxY ; F: X ® Y X F Y
F Í ℤ x ℤ; N 1
ℤ F ℤ
F = { …, (-3,9), (-2,4), (-1,1),
(0,0), (1,1), (2,4), (3,9), … }
F: ℤ® ℤ
F(x) = x2
53
Partial Functions - Example
N 1
FÍXxY ; F: X ® Y X F Y
F Í ℤ x ℤ; 1 1
ℤ F ℤ
F = { (0,0), (1,1), (2,4), (3,9), … }
F: ℕ ® ℕ
F(x) = x2
(injective Function)
54
Partial Functions - Example
N 1
FÍXxY ; F: X ® Y X F Y
F Í ℤ x ℤ; 1 1
ℤ F ℤ
F = { (0,0), (1,1), (2,4), (3,9), … }
F: ℕ ® ℕ of course ℕ Í ℤ
à we could also model: F Í ℕ x ℕ
F(x) = x2
1 1
ℕ F ℕ
N 1
FÍXxY ; F: X ® Y X F Y
56
Example: ternary relation supervise
1 Professors
Students N supervise
1
SeminarTopics
Mark
57
Example: ternary relation supervise
1 Professors
N
Students supervise
1
Mark SeminarTopics
2. Students may submit the same seminar topic only to one professor – they
may not submit a seminar topic to one professor and later submit the same
seminar topic to a different professor (in order to prevent cheating) (cmp. 1
at Professors)
! ⊆ #1×#2×#3×#4 already contains the tuples (aa, bb, cc, dd) and (aa, gg,
cc, ee). Is it legal to add the tuple (aa, bb, ee, ff) to B ?
A B
yes no
Mini Exercise A
! ⊆ #1×#2×#3×#4 already contains the tuples (aa, bb, cc, dd) and (aa, gg,
cc, ee). Is it legal to add the tuple (aa, bb, ee, ff) to B ?
A B
yes no
Apples Pears
1 1
B
1 N
Oranges Mangos
A B
yes no
Mini Exercise B
Apples Pears
1 1
B
1 N
Oranges Mangos
no: that the tuple (a1, p17, o9, m6) is in B implies that
A B adding (a1, p23, o9, m6) would violate the integrity
condiction specified through the partial function
yes no Apples x Oranges x Mangos à Pears
Mini Exercise B
Apples (a112, p17, o9, m6): adding not allowed; would violate
Pears
the partial fctn. Pears x Oranges x Mangos à Apples
no: that the tuple (a1, p17, o9, m6) is in B implies that
A B adding (a1, p23, o9, m6) would violate the integrity
condiction specified through the partial function
yes no Apples x Oranges x Mangos à Pears
Mini-Assignment: Enter the Functionalities!
isPrerequisiteFor
Predecessor Successor
MatrNr LectNr
Semester Title
EmployeeNr
Rank
Name Assistants workFor Professors Room
ResearchArea
EmployeeNr Name
65
Mini-Assignment: Enter the Functionalities!
isPrerequisiteFor
Predecessor Successor
MatrNr LectNr
N M
N M
Name Students enrolledIn Lectures Credits
N
Semester N Title
M
EmployeeNr 1
1 Rank
Name Assistants workFor Professors Room
N 1
ResearchArea
EmployeeNr Name
66
(min, max)-Notation
R Í E1 x ... x Ei x ... x En
E1
(min1, max1)
(m
in
n, ma m ax 2)
xn ) (m in 2 ,
En R E2
(mini, maxi)
Ei
Polyeder PolyID
1
Example-
Hull
Polyeder:
N Cube
Face FaceID
N
Boundary
M
Edges EdgeID Example-
Polyeder:
N
Tetraeder
StartEnd X
M
Y
Vertices
Z
68
Example for (min, max)-Notation: Polyeder
Polyeder PolyID
1 (4, *)
Example-
Hull
Polyeder:
N (1,1) Cube
Face FaceID
N (3, *)
Boundary
M (2, 2)
Edges EdgeID Example-
(2, 2) Polyeder:
N
Tetraeder
StartEnd X
M (3, *)
Y
Vertices
Z
69
Relation Hull as Table / Mathematical Relation
Polyeder PolyID
1 (4, *)
Hull
N (1,1)
Face FaceID
Hull
PolyID FaceID
Tetraeder_Horst Face_1
Tetraeder_Horst Face_2
Tetraeder_Horst Face_3
Tetraeder_Horst Face_4
Octaeder_Heiner Fc_a
Octaeder_Heiner Fc_b
Octaeder_Heiner Fc_c
... 70
Weak, Existence-Dependent Entities
71
Generalisation
Employees EmployeeNr
Room
Rank Is-a ResearchArea
Professors Assistants
Room EmployeeNr
EmployeeNr
Rank
ResearchArea
Professors Assistants
72
Exercises
73
Exercise A
74
Exercise A
1 1
75
Exercise A
(0,1) (0,1)
1 1
76
Exercise A
1 N
77
Exercise A
(0,*) (0,1)
1 N
78
Exercise A
N 1
79
Exercise A
(0,1) (0,*)
N 1
80
Exercise A
N M
81
Exercise A
(0,*) (0,*)
N M
82
Exercise B
83
Exercise B
à find an
appropriate
example to non-
trivial modelling
overlap between
functionalities and
min-max:
1 Professors
N (0,*)
Students supervise
(0,*) 1
(0,*) SeminarTopics
Mark
1 Professors
N (0,*)
Students supervise
(0,*) 1
(0,*) SeminarTopics
Mark
these have to be like that (e.g. such that
professors can reuse seminar topics) but (as such)
there are two partial functions:
may violate consistency constraints, which can be
supervise: SeminarTopics x Students
modelled®via
Professors
the 1:N:1 functionalities
supervise: Professors x Students ® SeminarTopics
1 Professors
1 (0,*)
Assistants supervise
(0,1) 1
(0,1) DissertationTopics
Mark
87
Exercise C
Model a train information system, in which the most important features are
represented: start and destination stations and stations connected
by the train, including arrival and departure times.
Provide functionalities as well as (min, max)!
88
Exercise C
89
Exercise C
90
Exercise C
N 1
91
Exercise C
N 1
92
Exercise C
N 1
1 1
N N
93
Exercise C
N 1
1 1
N N
94
Exercise C
N 1
1 1
1 1
N N N
95
Exercise C
N 1
1 1
(0,*) 1 1 (0,*)
(1,1)
N N N
(1,1)
96
Exercise C
N 1
(1,1) (0,*)
1 1
(0,*) 1 1 (0,*)
(1,1)
N N N
(1,1)
97
Exercise C
N 1
(1,1) (0,*)
1 1
(0,*) 1 1 (0,*)
(1,*) (1,*)
(1,1) (1,*)
N N N
(1,1)
98
Exercise D
99
Exercise D
N M N M
triangle boundary line boundary point
(3,3) (1,2) (2,2) (2,*)
100
Relational Design
101
Phases of Database Design
Conceptual Design
ER Schema
DBMS-
Data processing Implementation Design
characteristics
requirements
Logical DB-Structure
● Tuple: t Î R
Example: t = („Mickey Mouse“, „Main Street“, 8124711)
103
Foundations of the Relational Model
TelephoneBook
Name:String Street:String TelephoneNo:
integer
Mickey Mouse Main Street 4711
Donald Duck Broadway 95672
... ... ...
EmployeeNr 1
1 Rank
Name Assistants workFor Professors Room
N 1
ResearchArea
EmployeeNr Name
105
Relational Representation of Entities
106
Relational Representation of Relations
A 1k1 ... A11
...
E1
AR1
...
R ARkR
A21 An1
E2 En
...
...
...
A 2k 2 A nkn
... ...
R R
R:{[ A11 ,...., A1k , A 21 ,..., A 2k ,..., An1 ,..., Ank , A ,..., A ]}1 kR
$!#!"1 $!#!"2 $!#!"n $!#!
"
Schlüssel
key ofvon
E1 E1 Schlüssel
key of von
E2 E 2 Schlüssel
key of von
En En Attribute
Attributesvon
of R R
107
Relational Representation of Relations: Example
MatrNr LectNr
Students enrolledIn
Lectures
MatrNr ... MatrNr LectNr
26120 5001 LectNr ...
... ...
27550 5001 5001 ...
26120 ...
27550 4052 ... ...
... ... 28106 5041 4052 ...
27550 ... 28106 5052
... ...
... ... … …
● initial design:
Lectures: {[LectNr, Title, Credits]}
Professors : {[EmployeeNr, Name, Rank, Room]}
read: {[EmployeeNr, LectNr]} ! read: {[LectNr, EmployeeNr]}
110
Refinement of Relational Schemas
EmployeeNr LectNr
Professors read Lectures
... 1 N ...
● initial design:
Lectures: {[LectNr, Title, Credits]}
Professors : {[EmployeeNr, Name, Rank, Room]}
read: {[EmployeeNr, LectNr]} ! read: {[LectNr, EmployeeNr]}
Professors Lectures
Employee Name Rank Room LectNr Title Credits readBy
Nr 5001 Foundations 4 2137
2125 Sokrates C4 226 5041 Ethics 4 2125
2126 Russel C4 232 5043 Epistemology 3 2126
2127 Kopernikus C3 310 5049 Mäeutics 2 2125
2133 Popper C3 52 4052 Logic 4 2125
2134 Augustinus C3 309 5052 Philosophy of Science 3 2126
2136 Curie C4 36 … … … …
2137 Kant C4 7
112
Refinement of Relational Schemas
Professors Lectures
Employee Name Rank Room reads LectNr Title Credits
Nr 5001 Foundations 4
2125 Sokrates C4 226 5041 5041 Ethics 4
2125 Sokrates C4 226 5049 5043 Epistemology 3
2125 Sokrates C4 226 4052 5049 Mäeutics 2
... ... .... ... ... 4052 Logic 4
2134 Augustinus C3 309 5022 5052 Philosophy of Science 3
2136 Curie C4 36 ??? 5022 Advanced Theology 2
... ... .... ... ... … … …
N Mark
1
MatrNr Students take Exams
ExamID
N N
encompass conduct
LectNr M M EmployeeNr
Lectures Professors
114
Relational Modelling of Weak Entities
N Mark
1
MatrNr Students take Exams
ExamID
N N
encompass conduct
LectNr M M EmployeeNr
Lectures Professors
115
Relational Modelling of Weak Entities
N Mark
1
MatrNr Students take Exams
ExamID
N N
encompass conduct
LectNr M M EmployeeNr
Lectures Professors
Foreign key to a weak entity: the (globally unique) key of the weak entity
Exams, that is MatrNr and ExamID, must be taken over as foreign key into the
relations encompass and conduct. 116
Mini-Exercise A
has Room
RoomNr State the relational schema for
NrOfBeds the entity Customer and the
relation booked considering a
possible refinement (that is AFTER
Price booked a possible refinement)! Don’t
forget types!
GivenName
PassportNr Customer
FamilyName
has Room
RoomNr State the relational schema for
NrOfBeds the entity Customer and the
relation booked considering a
possible refinement (that is AFTER
Price booked a possible refinement)! Don’t
forget types!
GivenName
PassportNr Customer
FamilyName
keyOfA keyOfB
A B
1 1
keyOfC C D keyOfD
keyOfA keyOfB
A B
1 1
keyOfC C D keyOfD
121
Exercise C
122
Exercise C
1 electoral N 1 federal
located in
provide an initial district state
relational model 1
and refine!
associated year
N
of 1 N electoral
electoral achieves
sub-district result
voting
Nr is_a
location
# votes # votes
N
receives first vote second vote
1 N
N direct 1 1 political 1
nomination receives
candidate parties
social family
insurance nr name #members
name 126
Exercise D
initial relational model:
131
The Relational Algebra
• s Selection • ÷ Division
• p Projection • Ç Intersection
• x Cartesian Produkt • ⨝ Join
• r Renaming • ⟗ Outer Join
• È Union • ⋉ Semi-Join (right)
• - Set Minus • ⋊ Semi-Join (left)
• ⟕ Left Outer Join
• ⟖ Right Outer Join
• ...
132
Selection
● Constants
134
Projection
Professors
Employee Name Rank Room
Nr PRank(Professors)
2125 Sokrates C4 226
2126 Russel C4 232 PRank Rank
2127 Kopernikus C3 310 C4
2133 Popper C3 52
C3
2134 Augustinus C3 309
2136 Curie C4 36
2137 Kant C4 7
135
Cartesian Product
example: E‘ = Professors x enrolledIn
Professors Assistants
Employee Name
Nr
Rank Room x Employee
Nr
Name ResearchArea Boss
=
... ... ... ... ... ... ... ...
Professoren x Assistants
Professors.Employee Professors.Name Rank Room Assistants.Employee Assistants.Name ResearchArea Boss
Nr Nr
... ... ... ... ... ... ... ...
137
Notations
● e.{A1,A2,...} : (analogous)
139
Renaming
140
Union
(required: identical schema in both relations!)
=
2125 Sokrates 3002 Platon
2126 Russel
!" 3003 Aristoteles 2127 Kopernikus
(analogous to union)
PEmployeeNr(rEmployeeNr¬readBy(Lectures)) Ç PEmployeeNr(sRank=C4(Professors))
R⨝S
R-S RÇS S-R
A1 A2 ... Am B1 B2 ... Bk C1 C2 ... Cn
... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ...
143
Natural Join
Example: Students ⨝ enrolledIn:
Students enrolledIn Students ⨝ enrolledIn
MatrNr Name Semester MatrNr LectNr Name Semester MatrNr LectNr
24002 Xenokrates 18 26120 5001 Fichte 10 26120 5001
Schopenhauer 6 27550 5001
25403 Jonas 12 27550 5001
Schopenhauer 6 27550 4052
26120 Fichte 10 27550 4052
26830 Aristoxenos 8 ⨝ 28106 5041 = Carnap
Carnap
3
3
28106
28106
5041
5052
27550 Schopenhauer 6 28106 5052 Carnap 3 28106 5216
28106 Carnap 3 28106 5216 Carnap 3 28106 5259
29120 Theophrastos 2 28106 5259 Theophrastos 2 29120 5001
29555 Feuerbach 2 29120 5001 Theophrastos 2 29120 5041
29120 5041 Theophrastos 2 29120 5049
Feuerbach 2 29555 5022
29120 5049
Jonas 12 25403 5022
29555 5022
25403 5022
Let us have:
R(A1,..., An)
S(B1,..., Bm)
R ⨝Θ S := $Θ (R x S) R ⨝q S
R S
A1 A2 ... An B1 B2 ... Bm
● Example:
R ⨝A1>B1 ∧ A3<B2 S
145
Relational Division
Example: R S R÷S
M V
÷ V = M
m1 v1 v1 m1
m1 v2 v2
m1 v3
m2 v2
m2 v3
C
Mini-Exercise
C
Grouping and Aggregation
150
Exercise A
Lectures Students
LectlNr Title Credits readBy MatrNr Name Semester
Find all students that got a 1
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 by Sokrates!
5043 Epistemology 3 2126 26120 Fichte 10
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6
5052 Philosophy of Science 3 2126 28106 Carnap 3
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137 isPrerequisiteFor
Predecessor Successor
Professors
5001 5041
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon Ideology 2125 27550 4052
3003 Aristoteles Syllogistics 2125 28106 5041
3004 Wittgenstein Linguistics 2126 28106 5052
3005 Rhetikus Celestial Mechanics 2127
28106 5216
3006 Newton Keplerian Laws 2127
28106 5259
3007 Spinoza God and Nature 2126
29120 5001
examine 29120 5041
29120 5049
MatrNr LectNr EmployeeNr Mark
29555 5022
28106 5001 2126 1 25403 5022
25403 5041 2125 2
27550 4630 2137 2
Lectures Students
LectlNr Title Credits readBy MatrNr Name Semester
Find all students that got a 1
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 by Sokrates!
5043 Epistemology 3 2126 26120 Fichte 10
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6
5052 Philosophy of Science 3 2126 28106 Carnap 3
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137 isPrerequisiteFor
Predecessor Successor
Professors
5001 5041
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon Ideology 2125 27550 4052
3003 Aristoteles Syllogistics 2125 28106 5041
3004 Wittgenstein Linguistics 2126 28106 5052
3005 Rhetikus Celestial Mechanics 2127
28106 5216
3006 Newton Keplerian Laws 2127
28106 5259
3007 Spinoza God and Nature 2126
29120 5001
examine 29120 5041
29120 5049
MatrNr LectNr EmployeeNr Mark
29555 5022
28106 5001 2126 1 25403 5022
25403 5041 2125 2
27550 4630 2137 2
Lectures Students
LectlNr Title Credits readBy MatrNr Name Semester
Find all students that got a 1
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 by Sokrates!
5043 Epistemology 3 2126 26120 Fichte 10
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6
5052 Philosophy of Science 3 2126 28106 Carnap 3
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137 isPrerequisiteFor
Predecessor Successor
Professors
5001 5041
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052
2133 Popper C3 52 5041 5052
2134
2136
● How many columns does the answer-table of this partial expression have?
Augustinus
Curie
C3
C4
309
36
5052 5259
● consists of :
○ Data Definition Language (DDL): creates table structures
○ Data Manipulation Language (DML): delete, insert, modify etc.
‒ Query Language (QL): search
168
Students
Professors Lectures
EmployeeNr Name Rank Room MatrNr Name Semester
LectlNr Title Credits readBy
2125 Sokrates C4 226 24002 Xenokrates 18 5001 Foundations 4 2137
2126 Russel C4 232 25403 Jonas 12 5041 Ethics 4 2125
2127 Kopernikus C3 310 26120 Fichte 10 5043 Epistemology 3 2126
2133 Popper C3 52 26830 Aristoxenos 8 5049 Mäeutics 2 2125
2134 Augustinus C3 309 27550 Schopenhauer 6 4052 Logic 4 2125
2136 Curie C4 36 28106 Carnap 3 5052 Philosophy of Science 3 2126
2137 Kant C4 7 29120 Theophrastos 2 5216 Bio-Ethics 2 2126
29555 Feuerbach 2 5259 The Wiener Circle 2 2133
isPrerequisiteFor 5022 Advanced Theology 2 2134
Predecessor Successor enrolledIn
4630 The Three Critics 4 2137
5001 5041 MatrNr LectNr
5001 5043 26120 5001
5001 5049 27550 5001 Assistants
5041 5216 27550 4052 EmployeeNr Name ResearchArea Boss
5043 5052 28106 5041 3002 Platon Ideology 2125
5041 5052 28106 5052 3003 Aristoteles Syllogistics 2125
5052 5259 28106 5216 3004 Wittgenstein Linguistics 2126
28106 5259 3005 Rhetikus Celestial Mechanics 2127
examine 3006 Newton Keplerian Laws 2127
29120 5001
MatrNr LectNr EmployeeNr Mark 3007 Spinoza God and Nature 2126
29120 5041
28106 5001 2126 1
29120 5049
25403 5041 2125 2
29555 5022
27550 4630 2137 2
25403 5022
Data Definition Language: Data Types
corresponds to
relational modelling up
Data Types in SQL:
to now:
170
Data Definition Language: Create and Alter
alter
• ALTER TABLE Proessors RENAME TO Professors;
• ALTER TABLE Professors ADD familyStatus varchar(50);
• ALTER TABLE Professors DROP COLUMN city;
• ALTER TABLE Professors MODIFY (Name varchar(50));
171
Data Manipulation Language: Insert
value ‘null’
Studenten
MatrNr Name Semester
29120 Theophrastos 2
29555 Feuerbach 2
28121 Archimedes -
172
Data Manipulation Language: delete and update
deletion of tuples
delete from Students
where Semester > 13;
modifying tuples
update Students
set Semester = Semester + 1;
173
Query Language: select
Result:
174
select <---> Translation into Relational Algebra
175
Queries Using Several Relations (Tables)
176
select Name, Title
from Professors, Lectures PName,Title ( sEmployeeNr=readBy !Title=‘Mäeutik’(Professors x Lectures))
where EmployeeNr=readBy and Title=‘Mäeutik’;
Lectures
Professors
VorlNr Title Credits readBy
Employee Name Rank Room
Nr 5001 Foundations 4 2137
2125 Sokrates C4 226 5041 Ethics 4 2125
2126 Russel C4 232 ... ... ... ...
... ... ... ... 5049 Mäeutics 2 2125
... ... ... ... ... ... ... ...
2137 Kant C4 7 4630 The Three Critics 4 2137
x
Professors x Lectures
EmployeeNr Name Rank Room VorlNr Title Credits readBy
2125 Sokrates C4 226 5001 Foundations 4 2137
2125 Sokrates C4 226 5041 Ethics 4 2125
... ... ... ... ... ... ... ...
2125 Sokrates C4 226 5049 Mäeutics 2 2125
2126 Russel C4 232 5001 Foundations 4 2137
... ... ... ... ... ... ... ...
2137 Kant C4 7 4630 The Three Critics 4 2137
177
select Name, Title
from Professors, Lectures PName,Title ( sEmployeeNr=readBy !Title=‘Mäeutik’(Professors x Lectures))
where EmployeeNr=readBy and Title=‘Mäeutik’;
Professors x Lectures
EmployeeNr Name Rank Room VorlNr Title Credits readBy
2125 Sokrates C4 226 5001 Foundations 4 2137
2125 Sokrates C4 226 5041 Ethics 4 2125
... ... ... ... ... ... ... ...
2125 Sokrates C4 226 5049 Mäeutics 2 2125
2126 Russel C4 232 5001 Foundations 4 2137
... ... ... ... ... ... ... ...
2137 Kant C4 7 4630 The Three Critics 4 2137
Selection
sEmployeeNr=readBy !Title=‘Mäeutics’(Professors x Lectures)
EmployeeNr Name Rank Room VorlNr Title Credits readBy
2125 Sokrates C4 226 5049 Mäeutics 2 2125
Projection
Professors
Predecessor Successorwhere p.Name=’Sokrates’
5001 5041 and p.PersNr = e.PersNr
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049 and e.Mark = 1
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052 and e.MatrNr = s.MatrNr;
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon Ideology 2125 27550 4052
3003 Aristoteles Syllogistics 2125 28106 5041
3004 Wittgenstein Linguistics 2126 28106 5052
3005 Rhetikus Celestial Mechanics 2127
28106 5216
3006 Newton Keplerian Laws 2127
28106 5259
3007 Spinoza God and Nature 2126
29120 5001
examine 29120 5041
29120 5049
MatrNr LectNr EmployeeNr Mark
29555 5022
28106 5001 2126 1 25403 5022
25403 5041 2125 2
27550 4630 2137 2
183
Lectures Students
LectlNr Title Credits readBy MatrNr Name Semester
write a select statement to
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 find all students that got a 1
5043 Epistemology 3 2126 26120 Fichte 10 by Sokrates!
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6
5052 Philosophy of Science 3 2126 28106 Carnap 3
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 select s.name, s.MatrNr
Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137
from Students s, examine e, Professors p
isPrerequisiteFor
Professors
Predecessor Successorwhere p.Name=’Sokrates’
5001 5041 and p.PersNr = e.PersNr
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049 and e.Mark = 1
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052 and e.MatrNr = s.MatrNr;
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon Ideology 2125 27550 4052
3003 Aristoteles Syllogistics 2125 28106 5041
3004 Wittgenstein Linguistics 2126 28106 5052
3005 Rhetikus Celestial Mechanics 2127
28106 5216
3006 Newton Keplerian Laws 2127
28106 5259
3007 Spinoza God and Nature 2126
29120 5001
examine 29120 5041
29120 5049
MatrNr LectNr EmployeeNr Mark
29555 5022
28106 5001 2126 1 25403 5022
25403 5041 2125 2
27550 4630 2137 2
184
Set Operations union, intersect, minus
185
Nested Sub-Queries: exists
select p.Name
from Professors p
where not exists ( select *
from Lectures le
where le.readBy = p.EmployeeNr );
186
Nested Sub-Queries: exists
187
Nested Sub-Queries: exists
188
Nested Sub-Queries: in
variant with in
select p.Name
from Professors p
where p.EmployeeNr not in ( select readBy
from Lectures);
189
Nested Sub-Queries: in
variant with in
select p.Name
from Professors p
where not exists ( select *
from examine e
where e.EmployeeNr = p.EmployeeNr );
191
Exercise A
select p.Name
from Professors p
where not exists ( select *
from examine e
where e.EmployeeNr = p.EmployeeNr );
select p.Name
from Professors p
where p.EmployeeNr not in (
select e.EmployeeNr
from examine e );
192
Exercise A
Lectures Students
LectlNr Title Credits readBy MatrNr Name Semester
write a select statement to
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 find names of professors
5043 Epistemology 3 2126 26120 Fichte 10 which lecture “Quantum
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6 Theory” and have already
5052 Philosophy of Science 3 2126 28106 Carnap 3 given a grade of 6 for it!
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137 isPrerequisiteFor
Predecessor Successor
Professors
5001 5041
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon Ideology 2125 27550 4052
3003 Aristoteles Syllogistics 2125 28106 5041
3004 Wittgenstein Linguistics 2126 28106 5052
3005 Rhetikus Celestial Mechanics 2127
28106 5216
3006 Newton Keplerian Laws 2127
28106 5259
3007 Spinoza God and Nature 2126
29120 5001
examine 29120 5041
29120 5049
MatrNr LectNr EmployeeNr Mark
29555 5022
28106 5001 2126 1 25403 5022
25403 5041 2125 2
27550 4630 2137 2
193
Exercise A
Lectures Students
LectlNr Title Credits readBy MatrNr Name Semester
write a select statement to
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 find names of professors
5043 Epistemology 3 2126 26120 Fichte 10 which lecture “Quantum
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6 Theory” and have already
5052 Philosophy of Science 3 2126 28106 Carnap 3 given a grade of 6 for it!
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria
select distinct
4 2137 isPrerequisiteForp.Name
Professors
from Lectures
Predecessor Successor v, Professors p, examine pr
Rank Room where v.readBy = p.employeeNr
5001 5041
EmployeeNr Name
5001 5043
2125 Sokrates C4 226 and 5001
v.Title=’Quantum
5049 Theory’
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 and 5043
v.LectNr 5052 = pr.LectNr
2133 Popper C3 52
2134 Augustinus C3 309
and 5041
Mark=6;
5052
5052
5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
or MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon select p.Name
Ideology
2125 27550 4052
3003 Aristoteles Syllogistics
2125
3004 Wittgenstein
from
Linguistics
2126
Professors p 28106 5041
28106 5052
3005 where exists ( select *
Rhetikus Celestial Mechanics
2127
28106 5216
3006 Newton Keplerian Laws
2127
2126 from Lectures v, examine pr
28106 5259
3007 Spinoza God and Nature
29120 5001
examine where v.readBy = p.employeeNr
29120 5041
29120 5049
MatrNr LectNr EmployeeNr Mark and v.Title=’Quantum Theory’
29555 5022
28106
25403
5001
5041
2126
2125
1
2
and v.LectNr = pr.LectNr
25403 5022
195
Comparison with "all"
Remark: Usually only distinct results are reported automatically. E.g. for the
query select Semester from Students the number ’2’ is only
included once in the result, although there are maybe 500 students in the
second semester. You can enforce this behaviour by stating
select distinct Semester from Students
196
Comparison with "all"
197
Comparison with "all"
198
Comparison with "all"
● Grouping:
Example:
select readBy, sum (Credits)
from Lectures
group by readBy;
200
Aggregate Functions and Grouping
201
Aggregate Functions and Grouping
selects only
as before: selects
certain groups
certain tuples from
the Cartesian
product (Theta Join
or Selection)
202
Lectures x Professors select readBy, Name, sum(Credits)
from Lectures, Professors
LectNr Title Credits readBy EmployeeNr Name Rank Room where readBy = EmployeeNr and Rank = 'C4'
group by readBy, Name
5001 Foundations 4 2137 2125 Sokrates C4 226 having avg(credits) >= 3;
206
σavg(Credits)>3 (greadBy, Name; avg(Credits) (σreadBy= EmployeeNr ∧ Rank = 'C4‘ (Lectures x Professors))) select readBy, Name, sum(Credits
from Lectures, Professors
LectNr Title Credits readBy EmployeeNr Name Rank Room avg(Credits) where readBy = EmployeeNr an
group by readBy, Name
5041 Ethics 4 2125 2125 Sokrates C4 226 having avg(credits) >= 3;
σavg(Credits)>3 (greadBy, Name; avg(Credits), sum(Credits) (σreadBy= EmployeeNr ∧ Rank = 'C4‘ (Lectures x Professors)))
LectNr Title Credits readBy EmployeeNr Name Rank Room avg(Credits) sum(Credits)
5041 Ethics 4 2125 2125 Sokrates C4 226
5049 Mäeutics 2 2125 2125 Sokrates C4 226 3.333 10
4052 Logic 4 2125 2125 Sokrates C4 226
4630 The Three Critics 4 2137 2137 Kant C4 7
4 8
5001 Foundations 4 2137 2137 Kant C4 7
projection
ΠreadBy,Name,sum(Credits) (σavg(Credits)>3 (greadBy, Name; avg(Credits), sum(Credits) (σreadBy= EmployeeNr ∧ Rank = 'C4‘ (Lectures x Professors))))
readBy Name sum(Credits)
2125 Sokrates 10
2137 Kant 8 207
Aggregate Functions and Grouping
208
Exercise A
Lectures Students
LectlNr Title Credits readBy MatrNr Name Semester
write a select statement to
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 find names of professors
5043 Epistemology 3 2126 26120 Fichte 10 which give more than 3
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6 lectures!
5052 Philosophy of Science 3 2126 28106 Carnap 3
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137 isPrerequisiteFor
Predecessor Successor
Professors
5001 5041
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon Ideology 2125 27550 4052
3003 Aristoteles Syllogistics 2125 28106 5041
3004 Wittgenstein Linguistics 2126 28106 5052
3005 Rhetikus Celestial Mechanics 2127
28106 5216
3006 Newton Keplerian Laws 2127
28106 5259
3007 Spinoza God and Nature 2126
29120 5001
examine 29120 5041
29120 5049
MatrNr LectNr EmployeeNr Mark
29555 5022
28106 5001 2126 1 25403 5022
25403 5041 2125 2
27550 4630 2137 2
209
Exercise A
Lectures Students
LectlNr Title Credits readBy MatrNr Name Semester
write a select statement to
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 find names of professors
5043 Epistemology 3 2126 26120 Fichte 10 which give more than 3
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6 lectures!
5052 Philosophy of Science 3 2126 28106 Carnap 3
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137 isPrerequisiteFor
Predecessor Successor
Professors
5001 5041
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon Ideology 2125 27550 4052
3003 Aristoteles Syllogistics 2125 28106 5041
3004
3005
Wittgenstein Linguistics
Rhetikus Celestial Mechanics
2126
2127
28106 select p.Name
5052
28106 5216
3006 Newton Keplerian Laws 2127
28106 5259
from Lectures v, Professors p
3007 Spinoza God and Nature 2126
29120 5001 where v.readBy = p.EmployeeNr
examine 29120 5041
29120 5049 group by v.readBy, p.Name
MatrNr LectNr EmployeeNr Mark
28106 5001 2126 1
29555
25403
5022
5022
having count(*) > 3;
25403 5041 2125 2
27550 4630 2137 2
210
Nested Queries
select *
from examine ex
where ex.Mark < ( select avg (Mark)
from examine );
211
Geschachtelte Anfragen
212
Exercise
213
Exercise
214
Correlated vs Uncorrelated Sub-Queries
● correlated version:
select s.*
from Students s
where exists ( select p.*
from Professors p
where p.BirthYear > s.BirthYear );
● uncorrelated version:
select s.*
from Students s
where s.BirthYear < (select max (p.BirthYear)
from Professors p);
advantage: sub-query has to evaluated only once.
215
Decorrelation of Correlated Sub-Queries via Join
216
Nested Sub-Queries
217
All-Quantification via count-Aggregation
select e.MatrNr
from enrolledIn e
group by e.MatrNr
having count (*) = (select count (*) from Lectures);
218
All-Quantification via count-Aggregation
E.g.: MatrNr of students that are enrolled in all 4 credit lectures:
select s.MatrNr
from Students s
where not exists
( select le.*
from Lectures le
where le.Credits=4 and not exists
( select enrolledIn.*
from enrolledIn e
where e.LectNr = le.LectNr and e.MatrNr = s.MatrNr ) );
219
All-Quantification via count-Aggregation
E.g.: MatrNr of students that are enrolled in all 4 credit lectures:
select s.MatrNr
from Students s
where not exists
( select le.*
from Lectures le
where le.Credits=4 and not exists
( select enrolledIn.*
from enrolledIn e
where e.LectNr = le.LectNr and e.MatrNr = s.MatrNr ) );
or:
select e.MatrNr
from enrolledIn e, Lectures le
where e.LectNr = le.LectNr and le.Credits = 4
group by e.MatrNr
having count (*) = ( select count (*)
from lectures le
where le.Credits = 4 ); 220
Exercises
221
SQL Web-Interface http://hyper-db.com/interface.html
222
XAMPP https://www.apachefriends.org/index.html
223
Lectures Students
VorlNr Title Credits readBy MatrNr Name Semester
Find all professors that in
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 total read more than 10
5043 Epistemology 3 2126 26120 Fichte 10 credits of lectures
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6
5052 Philosophy of Science 3 2126 28106 Carnap 3
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137 isPrerequisiteFor
Predecessor Successor
Professors
5001 5041
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
27550 5001
3002 Platon Ideology 2125 27550 4052
3003 Aristoteles Syllogistics 2125 28106 5041
3004 Wittgenstein Linguistics 2126 28106 5052
3005 Rhetikus Celestial Mechanics 2127
28106 5216
3006 Newton Keplerian Laws 2127
28106 5259
3007 Spinoza God and Nature 2126
29120 5001
examine 29120 5041
29120 5049
MatrNr LectNr EmployeeNr Mark
29555 5022
28106 5001 2126 1 25403 5022
25403 5041 2125 2
27550 4630 2137 2
Lectures Students
VorlNr Title Credits readBy MatrNr Name Semester
Find all professors that in
5001 Foundations 4 2137 24002 Xenokrates 18
5041 Ethics 4 2125 25403 Jonas 12 total read more than 10
5043 Epistemology 3 2126 26120 Fichte 10 credits of lectures
5049 Mäeutics 2 2125 26830 Aristoxenos 8
4052 Logic 4 2125 27550 Schopenhauer 6
5052 Philosophy of Science 3 2126 28106 Carnap 3
5216 Bio-Ethics 2 2126 29120 Theophrastos 2
5259 The Wiener Circle 2 2133 29555 Feuerbach 2
5022 Advanced Theology 2 2134
4630 The Three Criteria 4 2137 isPrerequisiteFor
Predecessor Successor
Professors
5001 5041
EmployeeNr Name Rank Room
5001 5043
2125 Sokrates C4 226 5001 5049
2126 Russel C4 232 5041 5216
2127 Kopernikus C3 310 5043 5052
2133 Popper C3 52 5041 5052
2134 Augustinus C3 309 5052 5259
2136 Curie C4 36
2137 Kant C4 7 enrolledIn
MatrNr LectNr
Assistants
26120 5001
EmployeeNr Name ResearchArea Boss
3002 Platon Ideology 2125
27550 5001 select Name
27550 4052
3003 Aristoteles Syllogistics 2125
3004 Wittgenstein Linguistics 2126
28106 5041 from Lectures, Professors
28106 5052
3005 Rhetikus Celestial Mechanics 2127
3006 Newton Keplerian Laws 2127
28106 5216 where readBy = EmployeeNr
28106 5259
3007 Spinoza God and Nature 2126
29120 5001 group by Name
examine 29120 5041
230
Bibliography
231
Recommendation for Studying
● minimal approach:
understand the slides and practices ER-modelling, translation into the
relational model and SQL select statements with a selection of the
assignments from the assignment sheets!
● standard approach:
minimal approach + read the corresponding parts of [1]: chapter 1, chapter
2: 2.1-2.12, chapter 3: 3.1-3.4, chapter 4: 4.1- 4.12!
If you need to use a corresponding English book, read the correspodning
parts of [3].
Do all the assignments from the assignment sheets!
● interested students:
standard approach + read in [1]: 2.13, 4.13-4.21, Kapitel 6 + do more
assignments from [2]: chapters 2, 3, 4 and 6!
232