0% found this document useful (0 votes)
62 views1 page

SQL Queries for Playlist and Track Data

The document contains SQL queries that perform various joins between tables to retrieve playlist names, track IDs, and composer names. The queries use common table expressions (CTEs) to break the queries into multiple steps and join tables together to link playlists to tracks to composers.

Uploaded by

Dhruvi Zade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views1 page

SQL Queries for Playlist and Track Data

The document contains SQL queries that perform various joins between tables to retrieve playlist names, track IDs, and composer names. The queries use common table expressions (CTEs) to break the queries into multiple steps and join tables together to link playlists to tracks to composers.

Uploaded by

Dhruvi Zade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

select title, length(title) from Album a

order by length(title), title limit 1

select title, length(title) from Album a


order by length(title) desc, title limit 1

with a as (select * from playlist), b as (select*from


PlaylistTrack pt)
select [Link], [Link] from a
left join b on [Link] = [Link]

with c as (with a as (select * from playlist), b as (select


* from PlaylistTrack pt)
select [Link], [Link] from a
left join b on [Link] = [Link]),
d as (select * from Track t)

select [Link], [Link] from c


left join d on [Link] = [Link]

with a as (select * from playlist), b as (select * from


PlaylistTrack pt), c as (select * from Track t)
select [Link], [Link] from a
left join b on [Link] = [Link]
left join c on [Link] = [Link]

You might also like