Beginning T-SQL with Microsoft SQL Server 2005 and 2008

Beginning T-SQL with Microsoft SQL Server 2005 and 2008

3.21 (14 ratings by Goodreads)
By (author)  , By (author) 

Free delivery worldwide

Available. Expected delivery to the United States in 10-15 business days.

Not ordering to the United States? Click here.


If you have never programmed with T-SQL but have some background programming knowledge and experience, "Beginning T-SQL with Microsoft SQL Server 2005 and 2006" will provide you with an overview of SQL Server query operations and tools used with T-SQL, Microsoft's implementation of the SQL database query language. You can review basic query language commands and syntax, learn how to design and build applications, and understand how to optimize query performance. You can improve your skills with the most up-to-date T-SQL guide, which provides hands-on examples and instructions to guide you through the process.
show more

Product details

  • Paperback | 676 pages
  • 187 x 234 x 33mm | 1,003g
  • Indianapolis, IN, United States
  • English
  • 0470257032
  • 9780470257036
  • 663,758

Back cover copy

Beginning T-SQL with Microsoft(R) SQL Server(R) 2005 and 2008

Nearly all business applications read, store, and manipulate data stored in relational databases. If you use Microsoft SQL Server in any way, you need to learn and use T-SQL, ?Microsoft's powerful implementation of the ANSI-standard SQL database query language.

This book teaches all of the basics of T-SQL as it's used with SQL Server 2005 and 2008 databases. The authors, leading T-SQL experts, begin with the essentials of SQL Server that are needed to get the most from T-SQL. They then quickly move on to introduce T-SQL itself, including the core elements of data retrieval, SQL functions, aggregation and grouping, and multi-table queries, and they fully explain transaction processing and data manipulation using T-SQL.

The authors also show you how to create and manage T-SQL programming objects, including views, functions, and stored procedures. They detail how to optimize T-SQL query performance and design queries for real-world business applications. All of the methods and techniques in this book can be used with both Microsoft SQL Server 2005 and 2008 databases.

In addition, the book includes a comprehensive set of reference appendices, including T-SQL command syntax, system variables and functions, system stored procedures, information schema views, and FileStream objects.

What you will learn from this book

How to add, modify, and remove records

How to query multiple tables

Ways to use views to modify data

How to create tools for managing databases using T-SQL

T-SQL programming techniques using views, user-defined functions, and stored procedures

Methods for optimizing?query performance

How to use?SQL Server Reporting Services to visualize T-SQL query results

Who this book is for
This book is for beginning SQL Server developers and administrators who need to learn how to use T-SQL. Basic familiarity with relational databases and a general understanding of?basic SQL functions is necessary.

"Wrox Beginning guides" are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved.
show more

Table of contents

Introduction. Chapter 1: Introducing T-SQL and Data Management Systems. T-SQL Language. Programming Language or Query Language? What's New in SQL Server 2008. Database Management Systems. SQL Server as a Relational Database Management System. Tables. Relationships. RDBMS and Data Integrity. SQL Server and Other Products. Microsoft SQL Server. Oracle. IBM DB2. Informix. Sybase SQLAnywhere. Microsoft Access (Jet). MySQL. Summary. Chapter 2: SQL Server Fundamentals. Who Uses SQL Server? SQL Server Editions and Features. SQL Server Compact Edition. SQL Server Express Edition. SQL Server Workgroup Edition. SQL Server Standard Edition. SQL Server Enterprise Edition. Relational Database Engine. Semantics. Changing Terminology. Relationships. Primary Keys. Foreign Keys. Normalization Rules. First Normal Form. Second Normal Form. Third Normal Form. Boyce-Codd Normal Form, Fourth and Fifth Normal Form. Other Normal Forms. Transforming Information into Data. Applying Normalization Rules. Thinking Ahead. Multiple Associations. Multi-Valued Columns. To Normalize or To De-normalize? Question Authority. The Mechanics of Query Processing. The AdventureWorks Databases. Summary. Chapter 3: SQL Server Tools. Common SQL Server Tasks. SQL Server Management Studio. Tool Windows. Toolbars. SQL Server Management Studio Configuration. SQL Server Business Intelligence Development Studio. SQL Server Profiler. Database Tuning Advisor. SQL Server Configuration Manager. Command-Line Tools. SQLCMD. Writing Queries. Scripting Options. Using the Graphical Query Designer. Using Templates. Using the Debug Feature. Summary. Exercises. Exercise. Exercise 2. Exercise 3. Exercise 4. Chapter 4: Introducing the T-SQL Language. The Nature of SQL. Where to Begin? Data Manipulation Language. Queries Have Layers. Set-Based Operations. Row-Based Operations. Query Syntax Basics. Naming Conventions. Object Delimiting. Commenting Script. Using Templates. Generating Script. Managing Script. Version Control. Data Definition Language. Creating a Table. Creating a View. Creating a Stored Procedure. Creating a Trigger. Creating a User-Defined Function. Scripting Practices. Data Control Language. Summary. Exercises. Exercise 1. Exercise 2. Chapter 5: Data Retrieval. Storage and Retrieval. The SELECT Statement. Choosing Columns. Column Aliasing. Calculated and Derived Columns. Filtering Rows. The WHERE Clause. Using Parentheses. Sorting Results. Top Values. Summary. Exercises. Exercise 1. Exercise 2. Exercise 3. Exercise 4. Chapter 6: SQL Functions. The Anatomy of a Function. I'd Like to Have an Argument. Deterministic Functions. Using User Variables with Functions. Using Functions in Queries. Nested Functions. Aggregate Functions. The AVG() Function. The COUNT() Function. The MIN() and MAX() Functions. The SUM() Function. Configuration Variables. The @@ERROR Variable. The @@SERVICENAME Variable. The @@TOTAL-ERRORS Variable. The @@TOTAL-READ Variable. The @@VERSION Variable. Error Functions. Conversion Functions. The CAST() Function. The CONVERT() Function. The STR() Function. 1.0000. Cursor Functions and Variables. The CURSOR-STATUS() Function. The @@CURSOR-ROWS Global Variable. The @@FETCH-STATUS Global Variable. Date Functions. The DATEADD() Function. The DATEDIFF() Function. The DATEPART() and DATENAME() Functions. The GETDATE() and GETUTCDATE() Functions. The SYSDATETIME() and SYSUTCDATETIME() Functions. The DAY(), MONTH(), and YEAR() Functions. String Manipulation Functions. The ASCII(), CHAR(), UNICODE(), and NCHAR() Functions. The CHARINDEX() and PATINDEX() Functions. The LEN() Function. The LEFT() and RIGHT() Functions. The SUBSTRING() Function. The LOWER() and UPPER() Functions. The LTRIM() and RTRIM() Functions. The REPLACE() Function. The REPLICATE() and SPACE() Functions. The REVERSE() Function. The STUFF() Function. The QUOTENAME() Function. Mathematical Functions. Metadata Functions. Ranking Functions. The ROW-NUMBER() Function. The RANK() and DENSE-RANK() Functions. The NTILE(n) Function. Security Functions. System Functions and Variables. The COALESCE() Function. The DATALENGTH() Function. Global System Statistical Variables. Summary. Exercises. Exercise 1. Exercise 2. Exercise 3. Exercise 4. Exercise 5. Chapter 7: Aggregation and Grouping. To Group or Not to Group. Using Aggregate Functions. The COUNT() Function. The SUM() Function. The AVG() Function. Understanding Statistical Functions. The STDEV() Function. The STDEVP() Function. The VAR() Function. The VARP() Function. User-Defined Aggregate Functions. Grouping Data. The GROUP BY Clause. The HAVING Clause. Total and Subtotal Group Modifiers. Subgrouping. The ROLLUP Clause. The CUBE Clause. The GROUPING() Function. The COMPUTE and COMPUTE BY Clauses. Summary. Exercises. Exercise 1. Exercise 2. Exercise 3. Chapter 8: Multi-Table Queries. Understanding Subqueries and Joins. Joining Tables in the WHERE Clause. Joining Tables in the FROM Clause. Types of Joins. Inner Joins. Outer Joins. Multicolumn Joins. Non-Equijoins. Special-Purpose Join Operations. Union Queries. Summary. Exercises. Exercise 1. Exercise 2. Exercise 3. Chapter 9: Advanced Queries and Scripting. Subqueries. Scalar Expressions. Alternate Join Operations. Correlated Subqueries. Business Cases for Subqueries. Common Table Expressions. Cursors. Rowset Versus Cursor Operations. Creating and Navigating a Cursor. Summary. Exercises. Exercise 1. Exercise 2. Exercise 3. Chapter 10: Transactions. Introducing Transactions. Transaction Types. The ACID Test. The Transaction Log. Logged Operations. Let's Do CRUD with Data. Adding Records. Modifying Records. Removing Records. Automating Inserts, Updates, and Deletes with the MERGE Command. Explicit Transactions. Summary. Exercises. Exercise 1. Exercise 2. Exercise 3. Chapter 11: Advanced Capabilities. Pivoting Data. The PIVOT Operator. The UNPIVOT Operator. Full-Text Queries and Approximation Matching. Microsoft Search Service. Soundex Matching. The DIFFERENCE() Function. Managing and Populating Catalogs. Full-Text Query Expressions. Summary. Exercises. Exercise 1. Exercise 2. Exercise 3. Chapter 12: T-SQL Programming Objects. Views. Virtual Tables. Creating a View. Securing Data. Hiding Complexity. Modifying Data Through Views. Stored Procedures. Stored Procedures as Parameterized Views. Using Parameters. Returning Values. Record Maintenance. Handling and Raising Errors. Error Messages. Processing Business Logic. Looping. User-Defined Functions. Scalar Functions. Inline Table-Valued Functions. Multi-Statement Table-Valued Functions. Transaction Management. Locking Options. Summary. Exercises. Exercise 1. Exercise 2. Exercise 3. Chapter 13: Creating and Managing Database Objects. Data Definition Language. Creating Objects. Altering Objects. Dropping Objects. Naming Objects. Creating DDL Scripts. CREATE TABLE Unique Identifiers. Constraints. CREATE VIEW. Indexed Views. CREATE PROCEDURE. CREATE FUNCTION. IF EXISTS. Securing Database Objects. Managing Security Objects. Data Control Language. Summary. Exercises. Exercise 1. Exercise 2. Chapter 14: Analyzing and Optimizing Query Performance. Data Retrieval. Analyzing Queries. Session Options. Graphical Execution Plans. Writing Efficient T-SQL (Best Practices). Writing Efficient Filters. Summary. Exercises. Exercise 1. Chapter 15: T-SQL in Applications and Reporting. Application Programming Models. Selecting a Model. Desktop Database Applications. Client/Server Database Solutions. n-tier Component Solutions. Web Server Applications. Multi-Tier Web Service Solutions. Multi-System Integrated Solutions. SQL Server 2008 Reporting Services. Reporting Services Architecture. SQL Server 2008 Report Design. Deploying the Report. Viewing the Report with Report Manager. Report Data Caching. Business Intelligence and Business Reporting. Report Application Integration. Summary. Appendix A: Command Syntax Reference. Appendix B: System Variables and Functions Reference. Appendix C: System Stored Procedure Reference. Appendix D: Information Schema Views Reference. Appendix E: FileStream Objects and Syntax. Appendix F: Answers to Exercises. Index.
show more

About Paul Turley

Paul Turley (Vancouver, WA) is a Manager of Specialized
Services for Hitachi Consulting Education Services. Paul manages
the Business Intelligence training team and teaches classes for
companies throughout the world on Microsoft SQL Server
technologies. He works with companies to architect and build BI and
reporting solutions. He has been developing business database
solutions since 1991 for companies like Microsoft, Disney, Nike,
and Hewlett - Packard. He has been a Microsoft Certified Trainer
since 1996 and holds several industry certifications, including
MCTS and MCITP for BI, MCSD, MCDBA, MSF Practitioner, and IT

Paul has authored and co - authored several books and courses on
database, business intelligence, and application development
technologies. He is the lead courseware developer for the Hitachi
Consulting courses: SQL Server 2008 Business Intelligence Solutions
and SQL Server 2008 Reporting Services Solutions. Books include the
prior edition of this book, the 2008, 2005 and 2000 editions of
Professional SQL Server Reporting Services , Beginning
SQL Server 2005 Administration , Beginning Access 2002
VBA , Data Warehousing with SQL Server 2000 Analysis
Services , and Professional Access 2000 Programming
? all from Wrox. He is also a contributing author for SQL
Server 2005 Integration Services Step by Step from Microsoft
Dan Wood (Silverdale, WA) is the senior database
administrator for Avalara, a sales tax compliance company, where he
both administers and develops database solutions for several
enterprise applications that handle global address validation, tax
rate calculation, and sales tax remittance for e - commerce and ERP
clients. He has been working with SQL Server as a DBA, consultant,
and trainer since 1999. Dan was a contributing author on
Beginning Transact - SQL with SQL Server 2000 and 2005 and
the lead author of Beginning SQL Server Administration ,
both from Wrox.
show more

Rating details

14 ratings
3.21 out of 5 stars
5 7% (1)
4 21% (3)
3 57% (8)
2 14% (2)
1 0% (0)
Book ratings by Goodreads
Goodreads is the world's largest site for readers with over 50 million reviews. We're featuring millions of their reader ratings on our book pages to help you find your new favourite book. Close X