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
- Table of Contents
- 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
Python Crash Course, 3rd Edition
Python Crash Course is the world's best-selling guide to the Python guide programming language, with over …
book
Python Crash Course, 2nd Edition
This is the second edition of the best selling Python book in the world. Python Crash …
book
Professional C# and .NET, 2021st Edition
Get the latest coverage of the newest features in C#9 and .NET 5 In Professional C# …
book
Total Quality Management
Total Quality Management: Key Concepts and Case Studies provides the full range of management principles and …