View Single Post
  #2 (permalink)  
Old July 28th, 2012, 05:13 PM
Avtor Avtor is offline
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 2 Times in 1 Post
Default

you need to download source codes and execute them for each chapter
this one will create new table HumanResources.Employee2
make sure you work with in Advenute work

paste this code in your SQL Query and execute
Start From HERE:

USE AdventureWorks
GO

CREATE TABLE HumanResources.Employee2
(
EmployeeID int NOT NULL,
ManagerID int NULL REFERENCES HumanResources.Employee2(EmployeeID),
JobTitle nvarchar(50) NOT NULL,
LastName nvarchar(50) NOT NULL,
FirstName nvarchar(50) NOT NULL,
CONSTRAINT PK_Employee2_EmployeeID PRIMARY KEY CLUSTERED (EmployeeID ASC)
);

INSERT INTO HumanResources.Employee2(EmployeeID,ManagerID,JobT itle,LastName,FirstName)
VALUES
(1, NULL, 'CEO','Smith', 'Hunter'),
(2, 1, 'CFO', 'Jones', 'Drew'),
(3, 1, 'COO','Lenzy','Sheila'),
(4, 1, 'CTO', 'Huntington', 'Karla'),
(5, 4, 'VP of Engineering', 'Gutierrez', 'Ron'),
(8, 5, 'VP of Engineering', 'Gutierrez', 'Ron'),
(9, 5, 'Software Engineer', 'Bray', 'Marky'),
(10 ,5, 'Data Architect', 'Cheechov', 'Robert'),
(11 ,5, 'Software Engineer', 'Gale', 'Sue'),
(6, 4, 'VP of Professional Services', 'Cross', 'Gary'),
(7, 4, 'VP of Security','Lebowski','Jeff');
Reply With Quote
The Following 2 Users Say Thank You to Avtor For This Useful Post:
milad0101 (November 6th, 2012)