Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
SQL Query Design Patterns and Best Practices

You're reading from  SQL Query Design Patterns and Best Practices

Product type Book
Published in Mar 2023
Publisher Packt
ISBN-13 9781837633289
Pages 270 pages
Edition 1st Edition
Languages
Authors (6):
Steve Hughes Steve Hughes
Profile icon Steve Hughes
Dennis Neer Dennis Neer
Profile icon Dennis Neer
Dr. Ram Babu Singh Dr. Ram Babu Singh
Profile icon Dr. Ram Babu Singh
Shabbir H. Mala Shabbir H. Mala
Profile icon Shabbir H. Mala
Leslie Andrews Leslie Andrews
Profile icon Leslie Andrews
Chi Zhang Chi Zhang
Profile icon Chi Zhang
View More author details
Toc

Table of Contents (21) Chapters close

Preface 1. Part 1: Refining Your Queries to Get the Results You Need
2. Chapter 1: Reducing Rows and Columns in Your Result Sets 3. Chapter 2: Efficiently Aggregating Data 4. Chapter 3: Formatting Your Results for Easier Consumption 5. Chapter 4: Manipulating Data Results Using Conditional SQL 6. Part 2: Solving Complex Business and Data Problems in Your Queries
7. Chapter 5: Using Common Table Expressions 8. Chapter 6: Analyze Your Data Using Window Functions 9. Chapter 7: Reshaping Data with Advanced Techniques 10. Chapter 8: Impact of SQL Server Security on Query Results 11. Part 3: Optimizing Your Queries to Improve Performance
12. Chapter 9: Understanding Query Plans 13. Chapter 10: Understanding the Impact of Indexes on Query Design 14. Part 4: Working with Your Data on the Modern Data Platform
15. Chapter 11: Handling JSON Data in SQL Server 16. Chapter 12: Integrating File Data and Data Lake Content with SQL 17. Chapter 13: Organizing and Sharing Your Queries with Jupyter Notebooks 18. Index 19. Other Books You May Enjoy Appendix: Preparing Your Environment

Reducing Rows and Columns in Your Result Sets

Today the sources of data that a data analyst has access to have grown to the point that the amount of data that is available to you is unlimited. The challenge that a data analyst faces today is to determine how to generate a result set that is manageable and has the information that ensures that it will meet the needs of the analyst for their reports and analysis. If there is too much data, the result set will become unmanageable and unusable due to information overload; too little data and the data will have gaps, and the end user will lose trust in the data.

In this chapter, we will review how you determine how much data and what data you should keep in your result set and how to filter that data efficiently. We will also review how to determine which columns you should keep and how you can efficiently select the correct columns. The chapter will then wrap up with a short discussion on how these activities will impact future data aggregations.

By the end of this chapter, you will understand how to identify the data and columns that you need and the most efficient method for getting the data into a usable result set that can easily be recreated.

In this chapter, we will cover the following main topics:

  • Identifying data to be removed from the dataset
  • Understanding the value of creating views versus removing data
  • Exploring the impact of row and column reductions on aggregations
You have been reading a chapter from
SQL Query Design Patterns and Best Practices
Published in: Mar 2023 Publisher: Packt ISBN-13: 9781837633289
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}