If you are asked to find top 5 top selling product and you have used Limit 5
Well this seems technically right! But if you think from business perspective, there are two major issues -
1. There can more than 5 products which can be in the top 5 list. But putting a limit, you restrict to only 5. So, that’s an incomplete solution. 2. this code is not optimised for production because it will take more time to execute in a large dataset resulting in inefficient implementation.
Better to use window functions like dense_rank to solve this problem.
These are small but very crucial nuances that proves to be make or break in the interview.
SQL as a language is simple but without right business understanding, you might not solve the right problem.
I am conducting the a business analysis with SQL bootcamp to help you incorporate business fundamentals to your sql knowledge.
The Data Millennials
If you are asked to find top 5 top selling product and you have used Limit 5
Well this seems technically right! But if you think from business perspective, there are two major issues -
1. There can more than 5 products which can be in the top 5 list. But putting a limit, you restrict to only 5. So, that’s an incomplete solution.
2. this code is not optimised for production because it will take more time to execute in a large dataset resulting in inefficient implementation.
Better to use window functions like dense_rank to solve this problem.
These are small but very crucial nuances that proves to be make or break in the interview.
SQL as a language is simple but without right business understanding, you might not solve the right problem.
I am conducting the a business analysis with SQL bootcamp to help you incorporate business fundamentals to your sql knowledge.
Start learning at just 999/-.
Register here - pages.razorpay.com/advancedsqlbasicplan
1 year ago | [YT] | 0