T-SQL Fundamentals

by Itzik Ben-Gan

Data Science

Book Details

Book Title

T-SQL Fundamentals

Author

Itzik Ben-Gan

Publisher

Microsoft Press

Publication Date

2023

ISBN

9780138102104

Number of Pages

601

Language

English

Format

PDF

File Size

6.08MB

Subject

Computers > Databases

Table of Contents

  • Contents
  • Cover
  • Title Page
  • Copyright Page
  • Contents at a Glance
  • Contents
  • Acknowledgments
  • About the Author
  • Introduction
  • Chapter 1: Background to T-SQL querying and programming
  • Theoretical background
  • SQL Server architecture
  • Creating tables and defining data integrity
  • Conclusion
  • Chapter 2: Single-table queries
  • Elements of the SELECT statement
  • Predicates and operators
  • CASE expressions
  • NULLs
  • The GREATEST and LEAST functions
  • All-at-once operations
  • Woring with character data
  • Woring with date and time data
  • Querying metadata
  • Conclusion
  • Exercises
  • Solutions
  • Chapter 3: Joins
  • Cross joins
  • Inner joins
  • More join examples
  • Outer joins
  • Conclusion
  • Exercises
  • Solutions
  • Chapter 4: Subqueries
  • Self-contained subqueries
  • Correlated subqueries
  • Returning previous or next values
  • Using running aggregates
  • Dealing with misbehaving subqueries
  • Conclusion
  • Exercises
  • Solutions
  • Chapter 5: Table expressions
  • Derived tables
  • Common table expressions
  • Views
  • Inline table-valued functions
  • The APPLY operator
  • Conclusion
  • Exercises
  • Solutions
  • Chapter 6: Set operators
  • The UNION operator
  • The INTERSECT operator
  • The EXCEPT operator
  • Precedence
  • Circumventing unsupported logical phases
  • Conclusion
  • Exercises
  • Solutions
  • Chapter 7: T-SQL for data analysis
  • Window functions
  • Pivoting data
  • Unpivoting data
  • Grouping sets
  • Time series
  • Conclusion
  • Exercises
  • Solutions
  • Chapter 8: Data modification
  • Inserting data
  • Deleting data
  • Updating data
  • Merging data
  • Modifying data through table expressions
  • Modifications with TOP and OFFSET-FETCH
  • The OUTPUT clause
  • Conclusion
  • Exercises
  • Solutions
  • Chapter 9: Temporal tables
  • Creating tables
  • Modifying data
  • Querying data
  • Conclusion
  • Exercises
  • Solutions
  • Chapter 10: Transactions and concurrency
  • Transactions
  • Locks and blocking
  • Isolation levels
  • Deadlocks
  • Conclusion
  • Exercises
  • Chapter 11: SQL Graph
  • Creating tables
  • Querying data
  • Data modification considerations
  • Conclusion
  • Exercises
  • Solutions
  • Cleanup
  • Chapter 12: Programmable objects
  • Variables
  • Batches
  • Flow elements
  • Cursors
  • Temporary tables
  • Dynamic SQL
  • Routines
  • Error handling
  • Conclusion
  • Appendix
  • Getting started
  • Index