O'Reilly logo

Beginning C# 5.0 Databases, Second Edition by Vidya Vrat Agarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required