Relationale Datenbanken Kontrolle Übung
Aufgabe 3
Gib alle Länder aus. Dabei sollen Name, Einwohner, Hauptstadt angezeigt und nach Einwohner absteigend sortiert werden.
SELECT
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
FROM
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
ORDER BY
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
--------------------------------------------------------------------------------------------
Aufgabe 4
Gib alle Länder in Europa aus. Anzeige nur der Namen.
SELECT
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
FROM
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
WHERE
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
--------------------------------------------------------------------------------------------
Aufgabe 5
Welche Länder haben zwischen 10 und 100 Mio. Einwohner? Absteigend nach Einwohner sortiert.
SELECT Name, Einwohner
FROM
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
WHERE 10 < Einwohner
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
Einwohner
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
--------------------------------------------------------------------------------------------
Aufgabe 6
Welche Länder [Orte] haben einen "Arm" oder ein "Bein" im Namen?
SELECT Name
FROM land
WHERE Name
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
'%arm%'
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
Name
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
'%bein%'
SELECT Name
FROM ort
WHERE Name
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
'%arm%'
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
Name
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
'%bein%'
--------------------------------------------------------------------------------------------
Aufgabe 7
Welche Orte in Deutschland liegen weiter westlich als Kaiserslautern (7.768° Ost)?
SELECT Name
FROM
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
WHERE
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
Land =
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
--------------------------------------------------------------------------------------------
Aufgabe 8
Welche Länder liegen in Asien und Australien?
SELECT Name
FROM land
WHERE
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
= 'Asien'
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
AND
DESC
'Deutschland'
einwohner
Einwohner < 100
Kontinent
Kontinent = 'Europa'
Laenge < 7.768
land
LIKE
Name
Name, Einwohner, Hauptstadt
OR
ORDER BY
ort
= 'Australien'
Check
OK