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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.