commit 37c749c03048689865b77dbcffceb6cda67b991f Author: Jacob Fritsche Date: Sat Jan 25 15:58:57 2025 +0100 Tutorium 3 reationships diff --git a/tutorium_3_relationships b/tutorium_3_relationships new file mode 100644 index 0000000..3bfe052 --- /dev/null +++ b/tutorium_3_relationships @@ -0,0 +1,23 @@ +-- 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 +;