Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Albums with Two Songs | SQL Tasks
Data Manipulation using SQL

book
Challenge: Albums with Two Songs

Congratulations! Now you are ready to create queries in SQL.

We will use the same database with tables songs, singers and albums.

songs

albums

singers

Oppgave

Swipe to start coding

Find the album's ids (id), titles (title) and release dates (year) with number of songs equal to 2. Order these albums from oldest to newest.

Løsning

SELECT albums.id, albums.title, year
FROM albums
INNER JOIN songs
ON songs.album_id = albums.id
GROUP BY albums.id
HAVING count(songs.id) = 2
ORDER BY year

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 1
single

single

SELECT _ _ _
FROM _ _ _
_ _ _
_ _ _ = 2
ORDER BY _ _ _
Query ResultQuery Result
No query executed yet...

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

some-alt