Тёмный

SQL Interview Question | Difference between Row Number, Rank and Dense Rank | Tie-breaking scenario 

Learn at Knowstar
Подписаться 44 тыс.
Просмотров 11 тыс.
50% 1

In this video, we discuss another commonly asked SQL interview question - What is the difference between Row_Number, Rank and Dense_Rank functions?
The SQL queries and sample data from the table can be found here -
knowstar.org/sqlpracticequeri...
Check out the complete list of SQL Query Interview Questions -
• SQL Query Interview Qu...
Please do not forget to like, subscribe and share.
For enrolling and enquiries, please contact us at
Website - knowstar.org/
Facebook - / knowstartrainings
Linkedin - www.linkedin.com/company/know...
Email - learn@knowstar.org

Опубликовано:

 

14 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@Faisal1504
@Faisal1504 2 года назад
Thanks.
@briandennehy6380
@briandennehy6380 2 года назад
Best SQL channel on youtube for intermediate to advanced querying 👍
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you so much!
@joeanderson3423
@joeanderson3423 2 года назад
MOST Excellent. Clear and concise.
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you
@gangadharpandey3455
@gangadharpandey3455 9 месяцев назад
wonderful explanation
@LearnatKnowstar
@LearnatKnowstar 9 месяцев назад
Thank you
@hv0032113
@hv0032113 2 года назад
Very helpful. Thanks.
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you
@un_officialmcoc8218
@un_officialmcoc8218 2 года назад
thank you
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you
@Faisal1504
@Faisal1504 2 года назад
Thanks
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you
@Faisal1504
@Faisal1504 2 года назад
Second parameter can be added to dense rank function also?
@Faisal1504
@Faisal1504 2 года назад
Can you add second parameter to row number and dense rank functions like you did to rank ?
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Yes, you can order all functions by the columns that are needed to define a unique record.
@vamshitha449
@vamshitha449 2 года назад
Very useful but please maintain some clarity
@gajalakshmisamayadurai
@gajalakshmisamayadurai 2 года назад
How to solve this problem declare @Country as table (country varchar(20)) insert into @Country select 'INDIA' insert into @Country select 'AUS' insert into @Country select 'Srilanka' insert into @Country select 'England' insert into @Country select 'South Africa' -- Input select * from @Country -- Required Output with single select statement Team_A Team B INDIA AUS INDIA Srilanka INDIA England INDIA South Africa AUS Srilanka AUS England AUS South Africa Srilanka England Srilanka South Africa England South Africa
@pradeepba1439
@pradeepba1439 2 года назад
The output is of two tables or one table
@LearnatKnowstar
@LearnatKnowstar 2 года назад
You can simply use Join between two instances of the same table ex - select * from country a join country b On a.team < b.team
@LearnatKnowstar
@LearnatKnowstar 2 года назад
Thank you for posting this question. It is a good scenario and we will post a video tutorial as well in coming weeks for this scenario.
@saisarandarbha3031
@saisarandarbha3031 2 года назад
declare @country as table (country varchar(20)); insert into @country select 'india'; insert into @country select 'aus'; insert into @country select 'srilanka'; insert into @country select 'england'; insert into @country select 'south africa'; with country as ( select *, row_number() over (order by (select 1)) as r from @country) select a.country,b.country from country a join country b on a.countryb.country where a.r
Далее
Косплей на ГОЛОВОЛОМКА 2!
15:20
Просмотров 601 тыс.
Косплей на ГОЛОВОЛОМКА 2!
15:20
Просмотров 601 тыс.