Комментарии •

  • @hairavyadav6579
    @hairavyadav6579 12 дней назад +1

    if someone inserting value may you get error for the column rank because it is function , so if we want to use rank as a column name use this
    `rank` then you can able to insert value in rank column ... ` this symbol is above the tab key in keyboard

  • @hairavyadav6579
    @hairavyadav6579 12 дней назад

    My approach
    with cte as (select a.artist_name as name,s.song_id from artists as a join songs as s on a.artist_id = s.artist_id),
    cte2 as(select c.name,count(*) as number_of_time from cte as c join global_song_rank as gr on c.song_id = gr.song_id where gr.rank

  • @HARSHRAJ-gp6ve
    @HARSHRAJ-gp6ve 18 дней назад +1

    with cte as(
    select artist_name,song_id FROM artists JOIN songs ON artists.artist_id=songs.artist_id
    ),cte1 as(
    select cte.*,rank1 from cte JOIN global_song_rank ON cte.song_id=global_song_rank.song_id
    ),cte2 as(
    select artist_name,COUNT(*) as x1 FROM cte1 where rank1

  • @pratyushkumar8567
    @pratyushkumar8567 18 дней назад

    with cte as(
    select artist_name ,g.song_id,g.rank,count(g.song_id) over(partition by artist_name) as cnt_
    from artists as a join songs as s on a.artist_id=s.artist_id
    join global_song_rank as g on s.song_id=g.song_id
    where rank

  • @Naliyadav
    @Naliyadav 15 дней назад +1

    With CTE AS
    (
    select A.Artist_Id,A.Artist_name ,
    CounT(rank) As cnt
    from Artists A
    join Songs S
    on S.artist_id=A.Artist_id
    join global_song_rank G
    on G.Song_Id=S.Song_Id
    where g.rank

  • @prajju8114
    @prajju8114 10 дней назад

    with cte_songs as
    (
    select s.song_id,a.artist_id,a.artist_name,a.label_owner,s.name,g.day,g.rank from songs as s join artists as a on s.artist_id=a.artist_id join global_song_rank as g on s.song_id=g.song_id
    ),
    cte_2 as
    (
    select artist_name, count(song_id) as artist_count from cte_songs group by artist_name
    )
    select artist_name,dense_rank() over(order by artist_count desc) as 'rank' from cte_2

  • @Savenature635
    @Savenature635 3 дня назад

    with cte as (select distinct a.artist_name,s.artist_id,count(g.song_id) as number_of_appearances
    from artists a
    join songs s
    on a.artist_id=s.artist_id
    join global_song_rank g
    on s.song_id=g.song_id
    where g.rankk

  • @saikatmazumder206
    @saikatmazumder206 12 дней назад

    with cte as (select a.artist_id,a.artist_name,s.song_id,s.name,g.day,g.rnk from artists as a
    join songs as s on a.artist_id=s.artist_id join global_song_rank as g on s.song_id=g.song_id)
    select artist_name,dense_rank()over(order by count(rnk)desc) as artist_rank
    from cte group by 1 having count(rnk)

    • @prajju8114
      @prajju8114 10 дней назад

      query is incorrect, with cte as
      (
      select a.artist_id,a.artist_name,s.song_id,s.name,g.day,g.rank as rnk from artists as a
      join songs as s on a.artist_id=s.artist_id join global_song_rank as g on s.song_id=g.song_id
      )
      select artist_name,dense_rank()over(order by count(rnk) desc) as artist_rank
      from cte group by artist_name having count(rnk)

  • @rohit_vora
    @rohit_vora 6 дней назад

    with cte as
    (select artist_name, count(1) cnt
    from
    (select artist_name, s.song_id , a.artist_id, rank from artists a
    join songs s on s.artist_id = a.artist_id
    join global_song_rank gr on gr.song_id = s.song_id
    where rank