Book description
Gain a solid understanding of T-SQL—and write better queries
Master the fundamentals of Transact-SQL—and develop your own code for querying and modifying data in Microsoft SQL Server 2012. Led by a SQL Server expert, you’ll learn the concepts behind T-SQL querying and programming, and then apply your knowledge with exercises in each chapter. Once you understand the logic behind T-SQL, you’ll quickly learn how to write effective code—whether you’re a programmer or database administrator.
Discover how to:
Work with programming practices unique to T-SQL
Create database tables and define data integrity
Query multiple tables using joins and subqueries
Simplify code and improve maintainability with table expressions
Implement insert, update, delete, and merge data modification strategies
Tackle advanced techniques such as window functions, pivoting and grouping sets
Control data consistency using isolation levels, and mitigate deadlocks and blocking
Take T-SQL to the next level with programmable objects
Table of contents
- Microsoft® SQL Server® 2012 T-SQL Fundamentals
- Dedication
- Foreword
- Introduction
- 1. Background to T-SQL Querying and Programming
-
2. Single-Table Queries
- Elements of the SELECT Statement
- Predicates and Operators
- CASE Expressions
- NULL Marks
- All-at-Once Operations
-
Working with Character Data
- Data Types
- Collation
-
Operators and Functions
- String Concatenation (Plus Sign [+] Operator and CONCAT Function)
- The SUBSTRING Function
- The LEFT and RIGHT Functions
- The LEN and DATALENGTH Functions
- The CHARINDEX Function
- The PATINDEX Function
- The REPLACE Function
- The REPLICATE Function
- The STUFF Function
- The UPPER and LOWER Functions
- The RTRIM and LTRIM Functions
- The FORMAT Function
- The LIKE Predicate
-
Working with Date and Time Data
- Date and Time Data Types
- Literals
- Working with Date and Time Separately
- Filtering Date Ranges
-
Date and Time Functions
- Current Date and Time
- The CAST, CONVERT, and PARSE Functions and Their TRY_ Counterparts
- The SWITCHOFFSET Function
- The TODATETIMEOFFSET Function
- The DATEADD Function
- The DATEDIFF Function
- The DATEPART Function
- The YEAR, MONTH, and DAY Functions
- The DATENAME Function
- The ISDATE Function
- The FROMPARTS Functions
- The EOMONTH Function
- Querying Metadata
- Conclusion
- Exercises
- Solutions
- 3. Joins
- 4. Subqueries
- 5. Table Expressions
- 6. Set Operators
- 7. Beyond the Fundamentals of Querying
- 8. Data Modification
- 9. Transactions and Concurrency
- 10. Programmable Objects
- A. Getting Started
- Index
- About the Author
- Copyright
Product information
- Title: Microsoft® SQL Server® 2012 T-SQL Fundamentals
- Author(s):
- Release date: July 2012
- Publisher(s): Microsoft Press
- ISBN: 9780735673939
You might also like
book
T-SQL Querying
T-SQL insiders help you tackle your toughest queries and query-tuning problems Squeeze maximum performance and efficiency …
book
Exam Ref AZ-900: Microsoft Azure Fundamentals, First Edition
Prepare for Microsoft Exam AZ-900–and help demonstrate your real-world mastery of cloud services and how they …
book
SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition
The #1 Easy, Common-Sense Guide to SQL Queries—Updated with More Advanced Techniques and Solutions Foreword by …
book
SQL Server 2019 Administration Inside Out
Conquer SQL Server 2019 administration–from the inside out Dive into SQL Server 2019 administration–and really put …