April 2006
Intermediate to advanced
640 pages
16h 46m
English
To describe the logical processing phases in detail, I’ll walk you through a sample query. First run the code in Example 1-2 to create the Customers and Orders tables and populate them with sample data. Table 1-1 and Table 1-2 show the contents of Customers and Orders.
Example 1-2. Data definition language (DDL) and sample data for Customers and Orders
SET NOCOUNT ON; USE tempdb; GO IF OBJECT_ID('dbo.Orders') IS NOT NULL DROP TABLE dbo.Orders; GO IF OBJECT_ID('dbo.Customers') IS NOT NULL DROP TABLE dbo.Customers; GO CREATE TABLE dbo.Customers ( customerid CHAR(5) NOT NULL PRIMARY KEY, city VARCHAR(10) NOT NULL ); INSERT INTO dbo.Customers(customerid, city) VALUES('FISSA', 'Madrid'); INSERT INTO dbo.Customers(customerid, ...Read now
Unlock full access