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:
Itzik Ben-Gan is a principal mentor and a founder of SolidQ. A Microsoft MVP for SQL Server since 1999, Itzik teaches and consults internationally on T-SQL querying, programming, and query tuning. He has written numerous articles for SQL Server Magazine and MSDN, and speaks at industry events such as Microsoft TechEd, DevWeek, PASS, and SQL Server Connections.
Optimize your queries—and obtain simple and elegant solutions to a variety of problems—using window functions in Transact-SQL. Led by T-SQL expert Itzik Ben-Gan, you’ll learn how to apply calculations against sets of rows in a flexible, clear, and efficient manner. Ideal whether you’re a database administrator or developer, this practical guide demonstrates ways to use more than a dozen T-SQL querying solutions to address common business tasks.
Discover how to: Go beyond traditional query approaches to express set calculations more efficiently Delve into ordered set functions such as rank, distribution, and offset Implement hypothetical set and inverse distribution functions in standard SQL Use strategies for improving sequencing, paging, filtering, and pivoting Increase query speed using partitioning, ordering, and coverage indexing Apply new optimization iterators such as Window Spool Handle common issues such as running totals, intervals, medians, and gaps
Sams Teach Yourself SQL in 10 Minutes, Fourth Edition
New full-color code examples help you see how SQL statements are structured
Whether you're an application developer, database administrator, web application designer, mobile app developer, or Microsoft Office users, a good working knowledge of SQL is an important part of interacting with databases. And Sams Teach Yourself SQL in 10 Minutes offers the straightforward, practical answers you need to help you do your job.
Expert trainer and popular author Ben Forta teaches you just the parts of SQL you need to know–starting with simple data retrieval and quickly going on to more complex topics including the use of joins, subqueries, stored procedures, cursors, triggers, and table constraints.
You'll learn methodically, systematically, and simply–in 22 short, quick lessons that will each take only 10 minutes or less to complete.
With the Fourth Edition of this worldwide bestseller, the book has been thoroughly updated, expanded, and improved. Lessons now cover the latest versions of IBM DB2, Microsoft Access, Microsoft SQL Server, MySQL, Oracle, PostgreSQL, SQLite, MariaDB, and Apache Open Office Base. And new full-color SQL code listings help the beginner clearly see the elements and structure of the language.
Use the major SQL statements Construct complex SQL statements using multiple clauses and operators Retrieve, sort, and format database contents Pinpoint the data you need using a variety of filtering techniques Use aggregate functions to summarize data Join two or more related tables Insert, update, and delete data Create and alter database tables Work with views, stored procedures, and more Table of Contents
2 Retrieving Data
4 Filtering Data
5 Advanced Data Filtering
6 Using Wildcard Filtering
7 Creating Calculated Fields
8 Using Data Manipulation Functions
9 Summarizing Data
10 Grouping Data
11 Working with Subqueries
12 Joining Tables
13 Creating Advanced Joins
14 Combining Queries
15 Inserting Data
16 Updating and Deleting Data
17 Creating and Manipulating Tables
18 Using Views
19 Working with Stored Procedures
20 Managing Transaction Processing
21 Using Cursors
22 Understanding Advanced SQL Features
Appendix A: Sample Table Scripts
Appendix B: Working in Popular Applications
Appendix C : SQL Statement Syntax
Appendix E: SQL Reserved Words
Discover how to:Query complex data with powerful Transact-SQL enhancements Use new, non-relational features: hierarchical tables, native file streaming, and geospatial capabilities Exploit XML inside the database to design XML-aware applications Consume and deliver your data using Microsoft LINQ, Entity Framework, and data binding Implement database-level encryption and server auditing Build and maintain data warehouses Use Microsoft Excel to build front ends for OLAP cubes, and MDX to query them Integrate data mining into applications quickly and effectively.
Get code samples on the Web.
Microsoft Data Platform MVP Itzik Ben-Gan shows you how to:Review core SQL concepts and its mathematical roots Create tables and enforce data integrity Perform effective single-table queries by using the SELECT statement Query multiple tables by using joins, subqueries, table expressions, and set operators Use advanced query techniques such as window functions, pivoting, and grouping sets Insert, update, delete, and merge data Use transactions in a concurrent environment Get started with programmable objects–from variables and batches to user-defined functions, stored procedures, triggers, and dynamic SQL
SQL Queries for Mere Mortals ® has earned worldwide praise as the clearest, simplest tutorial on writing effective SQL queries. The authors have updated this hands-on classic to reflect new SQL standards and database applications and teach valuable new techniques.
Step by step, John L. Viescas and Michael J. Hernandez guide you through creating reliable queries for virtually any modern SQL-based database. They demystify all aspects of SQL query writing, from simple data selection and filtering to joining multiple tables and modifying sets of data.
Three brand-new chapters teach you how to solve a wide range of challenging SQL problems. You’ll learn how to write queries that apply multiple complex conditions on one table, perform sophisticated logical evaluations, and think “outside the box” using unlinked tables.
-- Getting started: understanding what relational databases are, and ensuring that your database structures are sound
-- SQL basics: using SELECT statements, creating expressions, sorting information with ORDER BY, and filtering data using WHERE
-- Summarizing and grouping data with GROUP BY and HAVING clauses
-- Drawing data from multiple tables: using INNER JOIN, OUTER JOIN, and UNION operators, and working with subqueries
-- Modifying data sets with UPDATE, INSERT, and DELETE statements Advanced queries: complex NOT and AND, conditions, if-then-else using CASE, unlinked tables, driver tables, and more
Practice all you want with downloadable sample databases for today’s versions of Microsoft Office Access, Microsoft SQL Server, and the open source MySQL database. Whether you’re a DBA, developer, user, or student, there’s no better way to master SQL.
Expert tips and real code examples teach advanced database programmers to write more efficient and better-performing code that takes full advantage of T-SQL. The authors offer practical solutions to the everyday problems programmers face and include in-depth information on advanced T-SQL topics such as joins, subqueries, stored procedures, triggers, user-defined functions (UDFs), indexed views, cascading actions, federated views, hierarchical structures, cursors, and more.
Discover how to:
Focus on the expertise measured by these objectives:
• Filter, sort, join, aggregate, and modify data
• Use subqueries, table expressions, grouping sets, and pivoting
• Query temporal and non-relational data, and output XML or JSON
• Create views, user-defined functions, and stored procedures
• Implement error handling, transactions, data types, and nulls
This Microsoft Exam Ref:
• Organizes its coverage by exam objectives
• Features strategic, what-if scenarios to challenge you
• Assumes you have experience working with SQL Server as a database administrator, system engineer, or developer
• Includes downloadable sample database and code for SQL Server 2016 SP1 (or later) and Azure SQL Database
Querying Data with Transact-SQL
About the Exam
Exam 70-761 focuses on the skills and knowledge necessary to manage and query data and to program databases
with Transact-SQL in SQL Server 2016.
About Microsoft Certification
Passing this exam earns you credit toward a Microsoft Certified Solutions Associate (MCSA) certification that demonstrates your mastery of essential skills for building and implementing on-premises and cloud-based databases across organizations. Exam 70-762 (Developing SQL Databases) is also required for MCSA: SQL 2016 Database Development certification.
See full details at: microsoft.com/learning
Discover how to:Work with T-SQL and CLR user-defined functions, stored procedures, and triggers. Handle transactions, concurrency, and error handling. Efficiently use temporary objects, including temporary tables, table variables, and table expressions. Evaluate when to use set-based programming techniques and when to use cursors. Work with dynamic SQL in an efficient and secure manner. Treat date- and time-related data in a robust manner. Develop CLR user-defined types and learn about temporal support in the relational model. Use XML and XQuery and implement a dynamic schema solution. Work with spatial data using the new geometry and geography types and spatial indexes. Track access and changes to data using extended events, SQL Server Audit, change tracking, and change data capture. Use Service Broker for controlled asynchronous processing in database applications.
All the book’s code samples will be available for download from the companion Web site.