Skip to Main Content
Programming ASP.NET 3.5, 4th Edition
book

Programming ASP.NET 3.5, 4th Edition

by Dan Maharry, Dan Hurwitz, Jesse Liberty
October 2008
Intermediate to advanced content levelIntermediate to advanced
1166 pages
28h 31m
English
O'Reilly Media, Inc.
Content preview from Programming ASP.NET 3.5, 4th Edition

SQL

The language of choice for querying and manipulating databases is Structured Query Language, often referred to as SQL. SQL is often pronounced “sequel.” SQL is a declarative language, as opposed to a procedural language, and it can take awhile to get used to working with a declarative language if you are used to languages such as Visual Basic and C#.

Most programmers tend to think in terms of a sequence of steps: “Find me all the orders, then get the customer’s ID, then use that ID to look up that customer’s records in Customer, then get me the email address.” In a declarative language, such as SQL, you declare the entire query and the query engine returns a set of results. You are not thinking about a set of steps; rather, you are thinking about designing and “shaping” a set of data. Your goal is to make a single declaration that will return the right records. You do that by creating temporary “wide” tables that include all the fields you need and then filtering for only those records you want: “Widen the SalesOrderHeader table with the Customer table, joining the two on the CustomerID, then filter for only those that meet my criteria.”

The heart of SQL is the query. A query is a statement that returns a set of records from the database. Typically, queries are in this form:

Select column,column,column from table where column = value

For example, you might like to see information about the customers served by Janet. To do so you would write:

Select FirstName, LastName, CompanyName ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Microsoft® ASP.NET 3.5

Programming Microsoft® ASP.NET 3.5

Dino Esposito
Learning ASP.NET 3.5, 2nd Edition

Learning ASP.NET 3.5, 2nd Edition

Brian MacDonald, Dan Hurwitz, Jesse Liberty
Pro ASP.Net 4 in C# 2010

Pro ASP.Net 4 in C# 2010

Matthew MacDonald, Adam Freeman, Mario Szpuszta
Programming .NET 3.5

Programming .NET 3.5

Jesse Liberty, Alex Horovitz

Publisher Resources

ISBN: 9780596156657Supplemental ContentErrata Page