Skip to Main Content

Splitting rows into buckets with SQL

Often you want to split rows into consistent groups of equal size or range. For example, to create histograms, compare periods or view spread in data Join this session to learn how you can use NTILE to create groups with an equal number of rows WIDTH_BUCKET to make each group cover an equal range of values Formulas to define fixed ranges Highlights from this session include: 02:30 - Splitting rows into quartiles using NTILE 06:30 - Creating histograms with equal-sized intervals using WIDTH_BUCKET 10:00 - Group strings together by starting letter with WIDTH_BUCKET 13:00 - Demo of using NTILE 15:30 - Demo of using WIDTH_BUCKET 22:00 - Demo of ways to group character values 27:30 - Recap of differences between NTILE and WIDTH_BUCKET 31:40 - Grouping rows into 5-minute intervals 33:20 - Demo of splitting data into groups of five rows each 35:45 - Demo of grouping rows in 5-minute intervals 42:30 - Demo of RATIO_TO_REPORT 44:45 - Review of different ways to group rows into "consistent" sized bins Get the scripts for this session https://livesql.oracle.com/apex/livesql/file/content_MD0J8KLQAKL6SOC2UGNCC3VSR.html Practice your SQL skills with free quizzes https://devgym.oracle.com/pls/apex/dg/competition/sql

Resources

Workshop Info

Session Has Completed - 21 September 2021
1 Hour
English
SQL

Other Upcoming Sessions