tailieunhanh - Hướng dẫn học Microsoft SQL Server 2008 part 45
Part III Beyond Relational FIGURE 17-1 Jean Trenary and her crew are the able Information Service Department at AdventureWorks. 1 Ken Sánchez Chief Executive Officer Adventure Works 2008 Information Service Department 263 Jean Trenary Information Services Manager 264 Stephanie Conroy Network Manager 267 Karen Berg Application Specialist 270 François Ajenstat Database Administrator 265 Ashvini Sharma Network Administrator 268 Ramesh Meyyappan Application Specialist 271 Dan Wilson Database Administrator 266 Peter Connelly Network Administrator 269 Dan Bacon Application Specialist 272 Janaina Bueno Application Specialist The next query result shows the data from the Information Service Department: BusinessEntityID Name ----- -----------------263 Jean Trenary 264 Stephanie Conroy 267 Karen Berg 268 Ramesh Meyyappan 269 Dan Bacon 270 Franois Ajenstat c 271 Dan Wilson 272 Janaina Bueno 265 Ashvini Sharma 266 Peter. | Part III Beyond Relational FIGURE 17-1 Jean Trenary and her crew are the able Information Service Department at AdventureWorks. Adventure Works 2008 Information Service Department 264 Stephanie Conroy Network Manager 265 Ashvini Sharma Network Administrator 267 Karen Berg Application Specialist y 268 Ramesh Meyyappan v Application Specialist y 270 François Ajenstat Database Administrator y 271 Dan Wilson Database Administrator 266 Peter Connelly Network Administrator 269 Dan Bacon Application Specialist 272 Janaina Bueno Application Specialist The next query result shows the data from the Information Service Department BusinessEntityID ManagerID Name JobTitle Manager 263 Jean Trenary Information Services Manager 1 Ken Sanchez 264 Stephanie Conroy Network Manager 263 Jean Trenary 267 Karen Berg Application Specialist 263 Jean Trenary 268 Ramesh Meyyappan Application Specialist 263 Jean Trenary 269 Dan Bacon Application Specialist 263 Jean Trenary 270 François Ajenstat Database Administrator 263 Jean Trenary 271 Dan Wilson Database Administrator 263 Jean Trenary 272 Janaina Bueno Application Specialist 263 Jean Trenary 265 Ashvini Sharma Network Administrator 264 Stephanie Con 266 Peter Connelly Network Administrator 264 Stephanie Con roy roy 402 Traversing Hierarchies 17 To examine one row from the employee perspective Karen Berg s BusinessEntitylD PK is 264. Her ManagerlD is 263. That s the BusinessEntitylD forJean Trenary so Karen reports to Jean. From the supervisor s point of view his BusinessEntitylD is stored in each of his direct report s rows in the ManagerlD column. For example Jean Trenary s BusinessEntitylD is 263 so 263 is stored in the ManagerlD column of everyone who reports directly to her. To maintain referential integrity the ManagerlD column has a foreign key constraint that refers to the BusinessEntitylD column the primary key in the same table as shown in Figure 17-2. The ManagerlD column allows nulls so that the top person .
đang nạp các trang xem trước