Professional Documents
Culture Documents
Les 4 Data en Informatie JOIN
Les 4 Data en Informatie JOIN
SELECT KAMER.Grootte
FROM KAMER, VERKOPER
WHERE VERKOPER.VerkoperNaam = ‘Baker’ ;
VERKOPER KAMER
VerkoperNr VerkoperNaam CommPerc JaarinDiens KamerNumme KamerN Telefoon Grootte
t t r r
137 Baker 10 1995 1284 1253 901-555- 120
4276
186 Adams 15 2001 1253
1227 901-555- 100
204 Dickens 10 1998 1209 0364
361 Carlyle 20 2001 1227 1284 901-555- 120
7335
Data & Informatie 1209 901-555- 95 |4
3108
Join: Goede Poging
SELECT KAMER.Grootte
FROM KAMER, VERKOPER
WHERE VERKOPER.KamerNummer = KAMER.KamerNr
AND VERKOPER.VerkoperNaam = ‘Baker’ ;
VERKOPER KAMER
VerkoperNr VerkoperNaam CommPerc JaarinDiens KamerNumme KamerN Telefoon Grootte
t t r r
137 Baker 10 1995 1284 1253 901-555- 120
4276
186 Adams 15 2001 1253
1227 901-555- 100
204 Dickens 10 1998 1209 0364
361 Carlyle 20 2001 1227 1284 901-555- 120
7335
Data & Informatie 1209 901-555- 95 |5
3108
Different Types of SQL JOINs
•Er zijn meerdere mogelijkheden om tabellen te joinen. We behandelen en
gebruiken alleen de INNER JOIN!
•(INNER) JOIN: Returns records that have matching values in both tables
•LEFT (OUTER) JOIN: Returns all records from the left table, and the matched
records from the right table
•RIGHT (OUTER) JOIN: Returns all records from the right table, and the
matched records from the left table
•FULL (OUTER) JOIN: Returns all records when there is a match in either left
or right table
SELECT VERKOPER.Naam
VerkoperNaam
FROM VERKOPER, KLANT Carlyle
Geef de namen van producten waarvan verkoper Adams er meer dan 2.000
heeft verkocht.
SELECT PRODUCT.ProductNaam
• Wat was het jaar waarin de starwars film “Star Wars: Episode V - The
Empire Strikes Back” werd gereleased?
• In hoeveel films ouder dan 1986 speelde Harrison Ford een rol? (Bonus)