Beginning T-SQL with Microsoft SQL Server 2005 and 2008
You may already have a basic idea of what SQL is used for, but you may not have a good understanding of the concepts behind relational databases and the purpose of SQL. This book will help you build a solid foundation of understanding, beginning with core relational database concepts and continuing to reinforce those concepts with real-world T-SQL query applications.
If you are familiar with relational database concepts but are new to Microsoft SQL Server or the T-SQL language, this book will teach you the basics from the ground up. If you're familiar with earlier versions of SQL Server, it will get you up-to-speed on the newest features. And if you know SQL Server 2005, you'll learn about some exciting new capabilities in SQL Server 2008.
This book introduces the T-SQL language and its many uses, and serves as a comprehensive guide at a beginner through intermediate level. Our goal in writing this book was to cover all the basics thoroughly and to cover the most common applications of T-SQL at a deeper level. Depending on your role and skill level, this book will serve as a companion to the other Wrox books in the Microsoft SQL Server Beginning and Professional series.
Chapter 1: Introducing T-SQL and Data Management Systems.
Chapter 2: SQL Server Fundamentals.
Chapter 3: SQL Server Tools.
Chapter 4: Introducing the T-SQL Language.
Chapter 5: Data Retrieval.
Chapter 6: SQL Functions.
Chapter 7: Aggregation and Grouping.
Chapter 8: Multi-Table Queries.
Chapter 9: Advanced Queries and Scripting.
Chapter 10: Transactions.
Chapter 11: Advanced Capabilities.
Chapter 12: T-SQL Programming Objects.
Chapter 13: Creating and Managing Database Objects.
Chapter 14: Analyzing and Optimizing Query Performance.
Chapter 15: T-SQL in Applications and Reporting.
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.
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 Press.
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.
|Readme||1.74 KB||Click to Download|
|All Code Downloads for Beginning T-SQL
Chapter 6, Exercise 1 updated on 1/3/2011
|23.67 KB||Click to Download|
|Errata: New Code for Chapter 6, Exercise 1
The problem in Chapter 6, Exercise 1 should read: Write a query to return the average weight of all touring bikes
|23.67 KB||Click to Download|
Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.
|9||Error in Text
On page 9 under decimal type, the parenthetical scientific notation to the all 9s string should be +10^38 - 1
|217||Error in Code
Beginning T-SQL, page 217, exercise 1 asks for all average weight of all touring bikes with a list price over $2,500.
The code provided ignores list price and averages the weight of the 22 touring bikes sold by Adventure Works Cycles. In fact, there are no touring bikes priced over $2,500.
|10||315||Error in Code
CREATE PROCEDURE spUpd_MyContacts @ContactID int , @FirstName nvarchar(50) , @LastName nvarchar(50) , @Phone nvarchar(25) AS UPDATE MyContacts SET FirstName = @FirstName , LastName = @LastName , Phone = @Phone spUpd_MyContacts 5, 'Betrice', 'Rubble', '(222) 234-7654'
CREATE PROCEDURE spUpd_MyContacts @ContactID int , @FirstName nvarchar(50) , @LastName nvarchar(50) , @Phone nvarchar(25) AS UPDATE MyContacts SET FirstName = @FirstName , LastName = @LastName , Phone = @Phone WHERE ContactID = @ContactID
|503||Error in Text
At the bottom of the page, after keyword UNION the keyword SELECT is missing. The code should read:
SELECT -1 AS ProductCategoryID, '(All Categories)' AS Name
SELECT ProductCategoryID, NAME
ORDER BY Name