Understanding adventureworks2012 db structure

ruedi picture ruedi · May 12, 2016 · Viewed 9.4k times · Source

I go through a tutorial on hierachyid and for their explanation they use the following query on the advantureworks2012

Select * From HumanRessources.Employee

I generated the diagram and can find a table called employee but no HumanRessources one. enter image description here.

I tried to find a documentation of the AW2012 db but could only find one of the AW2008 which does not have HumanRessources.

My question: What is HumanRessources, since it is not a table I do not understand what it is and how this is implemented?

Answer

Chris Pickford picture Chris Pickford · May 12, 2016

HumanResources is indeed the schema, with Employee being the table name.

You would therefore query the table using SELECT * FROM HumanResources.Employee;

You might find the official data dictionary useful here: https://technet.microsoft.com/en-us/library/ms124438(v=sql.100).aspx

Alternatively, see the following diagram for an overview of the AdventureWorks2008 database ( it's almost identical to 2012). Notice the shaded areas represent the different schemas.

Adventureworks2008 ER Diagram