Showing posts with label Data Analysis. Show all posts
Showing posts with label Data Analysis. Show all posts

Saturday, August 8, 2020

Best Usage of NTILE function in SQL Server and other RDBMSs

SQL Server NTILE() is a window function that distributes rows of an ordered partition right into a unique quantity of approximately same partition or group or buckets. The use of the function is described with a real time problem scenario. 

Problem Scenario: An agency is doing unique sort of promotional events on 1st of each month. The administration wanted to peer, which promotional event has benefited the organization in each region. 

The above code helps to create the table and insert  the data to examine the behavior of NTILE function.    

If you look at the results, the maximum sales from every quarter has been retrieved. This function is available in most of the RDBMS applications. 

Hope you like this article.

Big Data & SQL

Hi Everybody, Please do visit my new blog that has much more information about Big Data and SQL. The site covers big data and almost all the...