Skip to content

Commit

Permalink
fixed query
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
dtauer authored Feb 25, 2025
1 parent fc54490 commit 70720c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lessons/04-intermediate-sql/B-other-types-of-joins.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ SELECT
B.Name, A.Title
FROM
Album A
RIGHT OUTER JOIN
RIGHT JOIN
Artist B ON
A.ArtistId = B.ArtistId;
A.ArtistId = B.ArtistId
WHERE A.ArtistId IS NULL;

```

That OUTER part means _only_ take things that don't have anything in the Album table, so it will only give us artists with no albums in the albums table.
The `WHERE A.ArtistId IS NULL` makes this an `RIGHT OUTER JOIN`. So _only_ take things that don't have anything in the Album table, so it will only give us artists with no albums in the albums table.

## NATURAL JOIN

Expand Down

0 comments on commit 70720c9

Please sign in to comment.