Category: Coding
-
SQL Interview Prep 3: Why would I use DENSE_RANK instead of RANK? What about RANK instead of DENSE_RANK?

365 Days of Daily Coding: Day 111 Why would I use DENSE_RANK instead of RANK? What about RANK instead of DENSE_RANK? DENSE_RANK and RANK are functions used to rank records. The only key difference between them is that while RANK skips numbers/rank in case of ties whereas DENSE_RANK doesn’t skip numbers/rank and assigns consecutive numbers.…
-
SQL Interview Prep 2: Is it possible for LEFT JOIN and FULL OUTER JOIN to produce the same results? Why or why not?

365 Days of Daily Coding: Day 110 Is it possible for LEFT JOIN and FULL OUTER JOIN to produce the same results? Why or why not? LEFT JOIN: Returns all the records that are common between Table 1 and Table 2 as well as the non-matching records from Table 1. FULL OUTER JOIN: Returns all…
-
SQL Interview Prep 1: When will ROW_NUMBER and RANK give different results? Give an example.

365 Days of Daily Coding: Day 109 When will ROW_NUMBER and RANK give different results? Give an example. Both the functions ROW_NUMBER and RANK return an integer value that are incremental in nature. ROW_NUMBER as the name suggests assigns an incremental number to each subsequent rows whereas RANK functions ranks the records by values imposed…
-
Advance SQL Challenge: Using LEAD()

365 Days of Daily Coding: Day 108 Hello All, Posting this after much sometime. Mainly because I couldn’t wrap my head around the solution of this challenge. And then I was like “Hey, let’s try another challenge. And then it occured to me that there’s a solution to all the challenges in the site too.”…
-
Advanced SQL Challenge: Using LEVEL and CONNECT BY again

365 Days of Daily Coding: Day 107 I would have liked to say that I had a very happy time today but I won’t cause I am feeling extremely frustrated and angry right now. I used to think these emotions were invalid and unnecessary and cause more harm than good. Naturally, being an avid reader…
-
Advanced SQL Challenge: Using MOD()

365 Days of Daily Coding: Day 106 I rested and napped today. Isn’t it amazing that as an adult, you love napping more than anything? Oh, I also restarted my Korean classes which is a lot of fun. Although, I wonder when I would be able to speak fluently. I watch a lot of Korean…
-
Advanced SQL Challenge: Using LEVEL AND CONNECT BY

365 Days of Daily Coding Challenge: Day 105 I had a fantastic day today. I finished watching a Korean drama called “Hwarang”. Half of the time, I was pressing the right arrow key to finish the drama quickly lol. I also cooked momo which is one of the most popular fast food in Nepal. Every…
-
Advanced SQL Challenge: Using LISTAGG() again

365 Days of Daily Coding: Day 104 It’s TGIF. We have a long weekend since Monday is a public holiday. I am going to utilise my time to prepare for my tableau cert as well as on my long awaited data viz project. I just don’t understand what my roadblock is. I guess it is…
-
Advanced SQL Challenge: Using LISTAGG()

365 Days of Daily Coding: Day 103 I took leave today from work in the middle of the week. Normally, I prefer taking holiday on Friday so that I can enjoy longer weekends. I absolutely enjoyed it to the fullest. I like cleaning and completely decluttered my space from ever increasing hoardings of 3 years.…
-
Pandas and SQL Cook Book

365 Days of Daily Coding: Day 102 I have been reading a lot lately as I am trying to reduce my screen time. Too much screen time has been causing me headaches and eye pain. My latest read is a book called “Invisible Women: Exposing Data Bias in a World Designed for Men”. This piqued…