C H A P T E R  5

Querying Databases

In this chapter, you will learn about coding queries in SQL Server 2012. SQL Server uses T-SQL as its language, and it has a wide variety of functions and constructs for querying. You will see how to use SQL Server Management Studio and the AdventureWorks database to submit queries for various scenarios of querying data. This chapter covers the following:

  • Retrieving data
  • Using the GROUP BY clause
  • Pattern matching
  • Using aggregate functions
  • Using DATETIME functions
  • Using the list operator
  • Using the range operator
  • Finding null values
  • Using joins

Retrieving Data

A SQL query retrieves data from a database. Data is stored as rows in tables. Rows are composed of columns. In its simplest form, a query consists ...

Get Beginning C# 5.0 Databases, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.