SQL Query Design Patterns and Best Practices A Practical Guide to Writing Readable and Maintainable SQL Queries Using Its Design Patterns /
Enhance your SQL query writing skills to provide greater business value using advanced techniques such as common table expressions, window functions, and JSON Purchase of the print or Kindle book includes a free PDF eBook Key Features Examine query design and performance using query plans and indexe...
Clasificación: | Libro Electrónico |
---|---|
Autores principales: | , , , , , |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing, Limited,
2023.
|
Edición: | 1st edition. |
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Contributors
- Table of Contents
- Preface
- Part 1: Refining Your Queries to Get the Results You Need
- Chapter 1
- Reducing Rows and Columns in Your Result Sets
- Technical requirements
- Identifying data to remove from the dataset
- Reducing the amount of data
- Understanding the value of creating views versus removing data
- Exploring the impact of row and column reductions on aggregations
- Summary
- Chapter 2
- Efficiently Aggregating Data
- Technical requirements
- Identifying data to be aggregated
- Determining when data should be aggregated
- The AVG() function
- The SUM() function
- The COUNT() function
- The MAX() function
- The MIN() Function
- Improving performance when aggregating data
- Summary
- Chapter 3
- Formatting Your Results for Easier Consumption
- Technical requirements
- Using the FORMAT() function
- Format() with culture
- Format() with custom formatting strings
- Formatting dates and numbers with functions
- Formatting dates and numbers with CONVERT() and CAST()
- Formatting numbers with ROUND() and CEILING()
- Comparing FORMAT(), CONVERT(), and CAST()
- Alias columns with meaningful names
- Summary
- Chapter 4
- Manipulating Data Results Using Conditional SQL
- Technical requirements
- Using the CASE statement
- Using a simple CASE expression in a SELECT statement
- Using a searched CASE expression in a SELECT statement
- Using CASE in an ORDER BY statement
- Using CASE in an UPDATE statement
- Using CASE in a HAVING statement
- Using the COALESCE() expression
- How to use COALESCE()
- Comparing COALESCE() and CASE()
- Using ISNULL() function
- How to use ISNULL()
- Comparing ISNULL() and COALESCE()
- Summary
- Part 2: Solving Complex Business and Data Problems in Your Queries
- Chapter 5
- Using Common Table Expressions
- Technical requirements
- Creating CTEs
- Set theory for queries
- Creating a more complex CTE
- Creating a recursive CTE
- Creating the hierarchical data
- Creating the recursive CTE
- Recursive alternative
- Summary
- Chapter 6
- Analyze Your Data Using Window Functions
- Technical requirements
- Understanding window functions
- Using a window function in a query
- Adding a partition to the results
- Window functions with frames
- Scenarios and business problems
- Days between orders
- Finding a pattern
- Finding first N records of every group
- Running totals
- First and last record in the partition
- Year-over-year growth
- Chapter 7
- Reshaping Data with Advanced Techniques
- Technical requirements
- Working with the PIVOT operator
- Using PIVOT dynamically
- Working with the UNPIVOT operator
- Understanding hierarchical data
- Summary
- Chapter 8
- Impact of SQL Server Security on Query Results
- Technical requirements
- Why is data missing from my result set?
- Understanding SQL Server security
- Validating security settings