Practice Activity: How to retrieve the top 80% of items in SQL Server (the Pareto principle)



Practice Activity: How to retrieve the top 80% of items in SQL Server (the Pareto principle)

Practice Activity: How to retrieve the top 80% of items in SQL Server (the Pareto principle)

Let’s calculate the top 80% of items, and limit the results to these items.
My SQL Server Udemy courses are:
70-461, 70-761 Querying Microsoft SQL Server with T-SQL: https://rebrand.ly/querying-microsoft-sql-server
98-364: Database Fundamentals (Microsoft SQL Server): https://rebrand.ly/database-fundamentals
70-462 SQL Server Database Administration (DBA): https://rebrand.ly/sql-server-dba
Microsoft SQL Server Reporting Services (SSRS): https://rebrand.ly/sql-server-ssrs
SQL Server Integration Services (SSIS): https://rebrand.ly/sql-server-ssis
SQL Server Analysis Services (SSAS): https://rebrand.ly/sql-server-ssas-mdx
Microsoft Power Pivot (Excel) and SSAS (Tabular DAX model): https://rebrand.ly/microsoft-powerpivot-ssas-tabular-dax
—-
In this video, we’ll take a look at the Pareto principle, also known as the 80% rule. The Pareto principle states that basically 80% of the effects come from 20% of the causes – so concentrate of those 80% of effects or the 20% of courses.

This rule can be applied to anything in life, and is especially relevant to SQL Server. By understanding the Pareto principle, you can optimize your SQL Server database to achieve the highest possible performance. This video will help you apply the Pareto principle to your SQL Server data, and achieve the top 80% of performance!
—-
The starting code is as follows:
DROP TABLE IF EXISTS Inventory
GO

CREATE TABLE Inventory
(FoodName varchar(30),
Quantity int)

INSERT INTO Inventory
VALUES (‘Apple’, 198), (‘Banana’, 2000),
(‘Carrot’, 385), (‘Durian’, 248),
(‘Eggplant’, 127), (‘Fig’, 36),
(‘Grapes’, 90), (‘Honeydew melon’, 1036),
(‘Ice cream’, 64), (‘Jackfruit’, 1296),
(‘Kiwi’, 1800), (‘Lemon’, 142),
(‘Mango’, 1440), (‘Nectarine’, 536),
(‘Orange’, 276), (‘Pineapple’, 178),
(‘Quince’, 101), (‘Raspberry’, 670),
(‘Strawberry’, 51), (‘Tomato’, 45),
(‘Ugli fruit’, 482), (‘Vanilla’, 72),
(‘Watermelon’, 745), (‘Xigua (Chinese watermelon)’, 346),
(‘Yam’, 32), (‘Zucchini’, 932)
—-
Links to my website are:
70-461, 70-761 Querying Microsoft SQL Server with T-SQL: http://idodata.com/querying-microsoft-sql-server-with-t-sql/
98-364: Database Fundamentals (Microsoft SQL Server): http://idodata.com/database-fundamentals-it-specialist-its-201-certification/
SQL Server Essential in an Hour: http://idodata.com/sql-server-essentials-in-an-hour-the-select-statement/
70-462 SQL Server Database Administration (DBA): http://idodata.com/sql-server-database-administration-dba/
DP-300: Administering Relational Databases: http://idodata.com/dp-300-administering-relational-databases/
Microsoft SQL Server Reporting Services (SSRS): http://idodata.com/microsoft-sql-server-reporting-services-ssrs/
SQL Server Integration Services (SSIS): http://idodata.com/sql-server-integration-services-ssis-an-introduction/
SQL Server Analysis Services (SSAS): http://idodata.com/sql-server-ssas-multidimensional-mdx-an-introduction/
Microsoft Power Pivot (Excel) and SSAS (Tabular DAX model): https://rebrand.ly/microsoft-powerpivot-ssas-tabular-dax
1Z0-071 Oracle SQL Developer – certified associate: http://idodata.com/iz0-071-oracle-sql-developer-certified-associate/
SQL for Microsoft Access: http://idodata.com/sql-for-microsoft-access/
DP-900: Microsoft Azure Data Fundamentals: http://idodata.com/dp-900-microsoft-azure-data-fundamentals/