Introduction

Many excellent books about T-SQL are available, so how is this one different? In talking to the many people I meet in my travels around the country, I have heard one common complaint. Instead of the host of wonderful books available to expert database administrators (DBAs), most SQL Server readers yearn for a book targeted toward the beginning-to-intermediate DBA or developer. They want a book that starts at the beginning, ensures that they have no gaps in their knowledge, and takes them through some of the more advanced aspects of SQL Server. Along the way, they want to acquire volumes of practical knowledge that they can easily port into their own applications. I wrote Sams Teach Yourself T-SQL in One Hour a Day with those requests in mind.

This book begins by providing you with some database basics. In Lesson 1, “Database Basics,” you get a summary of all the components that are covered through the remainder of the book.

Lesson 2, “SQL Server Basics,” teaches you the basics of working with SQL Server Management Studio. You learn about the versions of SQL Server available. You then find out how to connect with a database server and install the sample files.

In Lesson 3, “Creating a SQL Server Database,” you see how to create a new SQL Server database. The SQL Server database is a container within which you will place all the other objects you learn about throughout the book.

Lessons 4 through 18 cover tables, relationships, the T-SQL language, views, stored procedures, functions, and triggers. These objects are at the heart of every SQL Server database. Lesson 4, “Working with SQL Server Tables,” explains how to work with tables. Then you move on to Lesson 5, “Working with Table Relationships,” which covers how to work with table relationships.

Knowledge of the T-SQL language is an important aspect of SQL Server. Probably the most used keyword used in T-SQL is SELECT. Lesson 6, Getting to Know the SELECT Statement,” delves into the SELECT statement in quite a bit of detail. Lesson 7, “Taking the SELECT Statement to the Next Level,” expands on Lesson 6 by covering some more sophisticated T-SQL techniques. You then move on to Lesson 8, “Building SQL Statements Based on Multiple Tables,” where you find out how you can build T-SQL statements based on data from multiple tables. Lesson 9, “Powerful Join Techniques,” builds on Lesson 8 to provide you with different techniques you can use to join tables. Not only can you use T-SQL to retrieve data, but you can also use it to modify data. Lesson 10, “Modifying Data with Action Queries,” shows you how to modify data with action queries. Lesson 11, “Getting to Know the T-SQL Functions,” introduces you to many of the built-in T-SQL functions, such as DataAdd, DateDiff, and Upper. These built-in functions prove invaluable for building database applications.

Another important SQL Server object is the view. Lesson 12, “Working with SQL Server Views,” shows you how to build and work with views. Lesson 13, “Using T-SQL to Design SQL Server Stored Procedures,” begins the in-depth coverage of stored procedures. Lessons 14, 15, and 16 continue to build on each other, each providing more sophisticated coverage of stored procedures and their uses.

Lesson 17, “Building and Working with User-Defined Functions,” provides you with an alternative to stored procedures: user-defined functions. Lesson 18, “Creating and Working with Triggers,” shows you how you can use triggers to respond to inserts, updates, and deletes.

The last six lessons cover security and administration. You learn about SQL Server authentication and permissions validation and how you can take advantage of both to properly secure your databases. The lessons in Part III also show you how to configure, maintain, and tune the SQL Servers that you manage. Without proper care, even the fastest hardware could run a database that is abysmally slow!

Finally, this book uses the sample database called AdventureWorks2014. Lesson 2 covers the process of installing the sample database. Also, all the sample code created in this book are available in a script file that you can open and execute from a SQL Server Management Studio query.

SQL Server, and the T-SQL language, are powerful and exciting. With the keys to deliver all that it offers, you can produce applications that provide much satisfaction as well as many financial rewards. After poring over this hands-on guide and keeping it nearby for handy reference, you too can become masterful at working with SQL Server and T-SQL. This book is dedicated to demonstrating how you can fulfill the promise of making SQL Server perform up to its lofty capabilities. As you will see, you have the ability to really make SQL Server shine in the everyday world!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.74.190