Listing 1: Script to Create and Populate the Customers and Orders Tables USE tempdb GO IF OBJECT_ID('Orders') IS NOT NULL DROP TABLE Orders GO IF OBJECT_ID('Customers') IS NOT NULL DROP TABLE Customers GO CREATE TABLE Customers (custid varchar(5) NOT NULL PRIMARY KEY, city varchar(10) NOT NULL, /* other columns */) SET NOCOUNT ON INSERT INTO Customers(custid, city) VALUES('A', 'Seattle') INSERT INTO Customers(custid, city) VALUES('B', 'Seattle') INSERT INTO Customers(custid, city) VALUES('C', 'Seattle') INSERT INTO Customers(custid, city) VALUES('D', 'Denver') CREATE TABLE Orders (orderid int NOT NULL PRIMARY KEY, custid varchar(5) NULL REFERENCES Customers, /* other columns */) INSERT INTO Orders(orderid, custid) VALUES(1, 'A') INSERT INTO Orders(orderid, custid) VALUES(2, 'B') INSERT INTO Orders(orderid, custid) VALUES(3, 'B') INSERT INTO Orders(orderid, custid) VALUES(4, 'B') INSERT INTO Orders(orderid, custid) VALUES(5, NULL) GO