Files
Datenbankmodellierung_IU/tutorium_3_relationships

24 lines
571 B
Plaintext

-- 1-to-1-relationship
SELECT *
FROM "IDBS01_Q12025"."Population" AS population
inner join "IDBS01_Q12025"."Country" as ctry
on ctry.code = population.country
;
-- 1-to-cn-relationship
SELECT *
FROM "IDBS01_Q12025"."Country" as ctry
FULL OUTER JOIN "IDBS01_Q12025".borders as borders
ON ctry.code = borders.country1
;
-- 1-to-cn-relationship
SELECT *
FROM "IDBS01_Q12025"."Country" as ctry
LEFT OUTER JOIN "IDBS01_Q12025"."geo_Desert" AS geodes
ON ctry.code = geodes.country
LEFT OUTER JOIN "IDBS01_Q12025"."Desert" AS des
on geodes.desert = des.name
;