Category: Coding
-
Advanced SQL: Using Pivot

365 Days of Daily Coding: Day 121 I felt a little sick today cause last night I did not get quality sleep. I ate a spicy meal for my dinner and I had a burning sensation in my stomach in the early morning so I am sleep deprived as well. I realised that this is…
-
Advanced SQL: Using Inner Join

365 Days of Daily Coding: Day 120 I woke up quite early today and felt like I had to be productive. So I am completing this challenge very early in the day unlike most of the time. hehe! I hope those reading this blog posts out there, please know that the beginning is the only…
-
Advanced SQL: Using Constraints in Oracle

365 Days of Daily Coding: Day 119 It’s been a slow and steady few days. I have been wishing to go back home especially because my brother is getting married next month. Unfortunately, I do not have many annual leaves this year so I will have to wait until next year to go back home.…
-
Advanced SQL: Using Recursion in Oracle?

365 Days of Daily Coding: Day 118 Yay to me for the consistency. If you are reading this, know that it’s difficult but it’s going to be absolutely rewarding one day and you are going to achieve all your ambitions. Puzzle 2: Managers and Employees I tried the solution in the live oracle environment which…
-
Advanced SQL: Using Full Outer Joins

365 Days of Daily Coding: Day 117 The entire advanced sql site has been completely revamped which is nice but also quite a bummer as the previous questions have been replaced with new questions. So that means I will have to work my way through solution 1 again, just as I was determined to complete…
-
SQL Interview Prep 8: When is subquery a bad idea? A good idea?

365 Days of Daily Coding: Day 116 I happened to come across a superb way to boost your linkedin profile. Do follow wonsulting’s resources on how you can get your dream job. I absolutely love their resources. Here is the link to their website. As for the question, it is a bit tricky and not…
-
SQL Interview Prep 7: Do temp tables make your code cleaner and faster, one of the two, or none? Why?

365 Days of Daily Coding: Day 115 I have been trying to stay consistent with my morning workouts but alas, I have been very lazy to follow through my goal. Hoping that tomorrow I have the will to resume it again. As for the question, I read few articles to understand why temp tables should…
-
SQL Interview Prep 6: For dealing with NULL values, why would I choose to use IFNULL vs. CASE WHEN?

365 Days of Daily Coding: Day It’s been a wild ride since I started working on this daily coding challenge. I have not been able to be consistent. As with any humans, there are days I just do not feel like it or that I wanna pore my limited resource over other burning matters. What’s…
-
SQL Interview Prep 5: LAG and LEAD are especially useful in what type of scenarios?

365 Days of Daily Coding: Day 113 LAG and LEAD are window functions that is always followed by an OVER clause. LAG function returns the preceeding value from the current row whereas LEAD function returns the succeeding value from the current row. The syntax for both LAG and LEAD are as follows: Both the function…
-
SQL Interview Prep 4: What happens if I GROUP BY a column that is not in the SELECT statement? Why does this happen?

365 Days of Daily Coding: Day 112 Part 1 What happens if I GROUP BY a column that is not in the SELECT statement? Why does this happen? When a GROUP BY column that is not in the SELECT statement is used, it will throw an error. By the order of operations in SQL, SELECT…