












































































Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Prepara tus exámenes
Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Prepara tus exámenes con los documentos que comparten otros estudiantes como tú en Docsity
Encuentra los documentos específicos para los exámenes de tu universidad
Estudia con lecciones y exámenes resueltos basados en los programas académicos de las mejores universidades
Responde a preguntas de exámenes reales y pon a prueba tu preparación
Consigue puntos base para descargar
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Comunidad
Pide ayuda a la comunidad y resuelve tus dudas de estudio
Ebooks gratuitos
Descarga nuestras guías gratuitas sobre técnicas de estudio, métodos para controlar la ansiedad y consejos para la tesis preparadas por los tutores de Docsity
El diseño de una base de datos que almacena información sobre departamentos, empleados y sueldos. Se detallan las tablas, columnas, índices y restricciones, así como las relaciones entre ellas. La base de datos utiliza procedimientos almacenados para el manejo de datos, como dbo.usplogerror y dbo.uspgetemployeemanagers.
Tipo: Guías, Proyectos, Investigaciones
1 / 84
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!













































































(Last updated on mié., may. 22nd, 2019 at 8:42 a. m.)
Current version number of the AdventureWorks 2012 sample database.
Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog.
Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.
Lookup table containing the departments within the Adventure Works Cycles company.
Employee information such as salary, department, and title.
Employee department transfers.
Employee pay history.
Résumés submitted to Human Resources by job applicants.
Work shift lookup table.
Street address information for customers, employees, and vendors.
Types of addresses stored in the Address table.
Source of the ID that connects vendors, customers, and employees with address and contact information.
Cross-reference table mapping customers, vendors, and employees to their addresses.
Cross-reference table mapping stores, vendors, and employees to people
Lookup table containing the types of business entity contacts.
Lookup table containing the ISO standard codes for countries and regions.
Where to send a person email.
Cross-reference table mapping product models and illustrations.
Cross-reference table mapping product descriptions and the language the description is written in.
Product images.
Cross-reference table mapping products and product photos.
Customer reviews of products they have purchased.
Product subcategories. See ProductCategory table.
Manufacturing failure reasons lookup table.
Record of each purchase order, sales order, or work order transaction year to date.
Transactions for previous years.
Unit of measure lookup table.
Manufacturing work orders.
Work order details.
Cross-reference table mapping vendors with the products they supply.
Individual products associated with a specific purchase order. See PurchaseOrderHeader.
General purchase order information. See PurchaseOrderDetail.
Shipping company lookup table.
Companies from whom Adventure Works Cycles purchases parts or other goods.
Cross-reference table mapping ISO currency codes to a country or region.
Customer credit card information.
Lookup table containing standard ISO currencies.
Currency exchange rates.
Current customer information. Also see the Person and Store tables.
Cross-reference table mapping people to their credit card information in the CreditCard table.
Individual products associated with a specific sales order. See SalesOrderHeader.
General sales order information.
Cross-reference table mapping sales orders to sales reason codes.
Sales representative current information.
Sales performance tracking.
Lookup table of customer purchase reasons.
Tax rate lookup table.
Sales territory lookup table.
Sales representative transfers to other sales territories.
Contains online customer orders until the order is submitted or cancelled.
Sale discounts lookup table.
Cross-reference table mapping products to special offer discounts.
Customers (resellers) of Adventure Works products.
Uses PIVOT to return aggregated sales information for each sales representative.
Stores (including store addresses) that sell Adventure Works Cycles products to consumers.
Stores (including store contacts) that sell Adventure Works Cycles products to consumers.
Stores (including demographics) that sell Adventure Works Cycles products to consumers.
Stored procedure using a recursive query to return a multi-level bill of material for the specified ProductID.
Stored procedure using a recursive query to return the direct and indirect managers of the specified employee.
Stored procedure using a recursive query to return the direct and indirect employees of the specified manager.
Stored procedure using a recursive query to return all components or assemblies that directly or indirectly use the specified ProductID.
Logs error information in the ErrorLog table about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without inserting error information.
Prints error information about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without printing any error information.
Updates the Employee table and inserts a new row in the EmployeePayHistory table with the values specified in the input parameters.
Updates the Employee table with the values specified in the input parameters for the given BusinessEntityID.
Updates the Employee table with the values specified in the input parameters for the given EmployeeID.
Scalar function used in the uSalesOrderHeader trigger to set the starting account date.
Scalar function used in the uSalesOrderHeader trigger to set the ending account date.
Table value function returning the first name, last name, job title and contact type for a given contact.
Scalar function returning the text representation of the Status column in the Document table.
Scalar function returning the dealer price for a given product on a particular order date.
Scalar function returning the list price for a given product on a particular order date.
Scalar function returning the standard cost for a given product on a particular order date.
Scalar function returning the text representation of the Status column in the PurchaseOrderHeader table.
Scalar function returning the text representation of the Status column in the SalesOrderHeader table.
Scalar function returning the quantity of inventory in LocationID 6 (Miscellaneous Storage)for a specified ProductID.
Scalar function used by the Sales.Customer table to help set the account number.
Page 2 of 76
construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.
Column Data Type Identity Nullable Default PK ErrorLogID int X Primary key for ErrorLog records. ErrorTime datetime getdate() The date and time at which the error occurred. UserName sysname(nvarchar(128)) The user who executed the batch in which the error occurred. ErrorNumber int The error number of the error that occurred. ErrorSeverity int X The severity of the error that occurred. ErrorState int X The state number of the error that occurred. ErrorProcedure nvarchar(126) X The name of the stored procedure or trigger where the error occurred. ErrorLine int X The line number at which the error occurred. ErrorMessage nvarchar(4000) The message text of the error that occurred.
PK_ErrorLog_ErrorLogID (Primary Key) (Clustered)
Primary key (clustered) constraint
ErrorLogID
Procedure dbo.uspLogError
H u m a n R e s o u r c e s . D e p a r t m e n t
Lookup table containing the departments within the Adventure Works Cycles company.
Column Data Type Identity Nullable Default PK DepartmentID smallint X Primary key for Department records. UK Name Name(nvarchar(50)) Name of the department. GroupName Name(nvarchar(50)) Name of the group to which the department belongs. ModifiedDate datetime getdate() Date and time the record was last updated.
PK_Department_DepartmentID (Primary Key) (Clustered)
Primary key (clustered) constraint
DepartmentID
AK_Department_Name (Unique)
Unique nonclustered index.
Page 3 of 76
Name
HumanResources.EmployeeDepartmentHistory (DepartmentID)
View HumanResources.vEmployeeDepartment
View HumanResources.vEmployeeDepartmentHistory
H u m a n R e s o u r c e s . E m p l o y e e
Employee information such as salary, department, and title.
Column Data Type Identity Nullable Default PK, FK BusinessEntityID int Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID. UK NationalIDNumber nvarchar(15) Unique national identification number such as a social security number. UK LoginID nvarchar(256) Network login. OrganizationNode hierarchyid X Where the employee is located in corporate hierarchy. OrganizationLevel smallint X The depth of the employee in the corporate hierarchy. JobTitle nvarchar(50) Work title such as Buyer or Sales Representative. BirthDate date Date of birth. MaritalStatus nchar(1) M = Married, S = Single Gender nchar(1) M = Male, F = Female HireDate date Employee hired on this date. SalariedFlag Flag(bit) 1 Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. VacationHours smallint 0 Number of available vacation hours. SickLeaveHours smallint 0 Number of available sick leave hours. CurrentFlag Flag(bit) 1 0 = Inactive, 1 = Active UK rowguid uniqueidentifier newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated.
PK_Employee_BusinessEntityID (Primary Key) (Clustered)
Primary key (clustered) constraint
BusinessEntityID
Page 5 of 76
View HumanResources.vEmployeeDepartment
View HumanResources.vEmployeeDepartmentHistory
View Sales.vSalesPerson
View Sales.vSalesPersonSalesByFiscalYears
H u m a n R e s o u r c e s . E m p l o y e e D e p a r t m e n t H i s t o r y
Employee department transfers.
Column Data Type Identity Nullable Default PK, FK BusinessEntityID int Employee identification number. Foreign key to Employee.BusinessEntityID. PK, FK DepartmentID smallint Department in which the employee worked including currently. Foreign key to Department.DepartmentID. PK, FK ShiftID tinyint Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. PK StartDate date Date the employee started work in the department. EndDate date X Date the employee left the department. NULL = Current department. ModifiedDate datetime getdate() Date and time the record was last updated.
PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID (Primary Key) (Clustered)
Primary key (clustered) constraint
BusinessEntityID StartDate DepartmentID ShiftID
IX_EmployeeDepartmentHistory_DepartmentID
Nonclustered index.
DepartmentID
IX_EmployeeDepartmentHistory_ShiftID
Nonclustered index.
ShiftID
HumanResources.Department (DepartmentID)
HumanResources.Employee (BusinessEntityID)
HumanResources.Shift (ShiftID)
View HumanResources.vEmployeeDepartment
View HumanResources.vEmployeeDepartmentHistory
H u m a n R e s o u r c e s . E m p l o y e e P a y H i s t o r y
Page 6 of 76
Employee pay history.
Column Data Type Identity Nullable Default PK, FK BusinessEntityID int Employee identification number. Foreign key to Employee.BusinessEntityID. PK RateChangeDate datetime Date the change in pay is effective Rate money Salary hourly rate. PayFrequency tinyint 1 = Salary received monthly, 2 = Salary received biweekly ModifiedDate datetime getdate() Date and time the record was last updated.
PK_EmployeePayHistory_BusinessEntityID_RateChangeDate (Primary Key) (Clustered)
Primary key (clustered) constraint
BusinessEntityID RateChangeDate
HumanResources.Employee (BusinessEntityID)
Procedure HumanResources.uspUpdateEmployeeHireInfo
H u m a n R e s o u r c e s . J o b C a n d i d a t e
Résumés submitted to Human Resources by job applicants.
Column Data Type Identity Nullable Default PK JobCandidateID int X Primary key for JobCandidate records. FK BusinessEntityID int X Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID. Resume xml X Résumé in XML format. ModifiedDate datetime getdate() Date and time the record was last updated.
PK_JobCandidate_JobCandidateID (Primary Key) (Clustered)
Primary key (clustered) constraint
JobCandidateID
IX_JobCandidate_BusinessEntityID
Nonclustered index.
BusinessEntityID
Page 8 of 76
UK AddressLine1 nvarchar(60) First street address line. UK AddressLine2 nvarchar(60) X Second street address line. UK City nvarchar(30) Name of the city. UK, FK StateProvinceID int Unique identification number for the state or province. Foreign key to StateProvince table. UK PostalCode nvarchar(15) Postal code for the street address. SpatialLocation geography X Latitude and longitude of this address. UK rowguid uniqueidentifier newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated.
PK_Address_AddressID (Primary Key) (Clustered)
Primary key (clustered) constraint
AddressID
AK_Address_rowguid (Unique)
Unique nonclustered index. Used to support replication samples.
rowguid
IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode (Unique)
Nonclustered index.
AddressLine AddressLine City StateProvinceID PostalCode
IX_Address_StateProvinceID
Nonclustered index.
StateProvinceID
Person.StateProvince (StateProvinceID)
Person.BusinessEntityAddress (AddressID)
Sales.SalesOrderHeader (BillToAddressID - > AddressID)
Sales.SalesOrderHeader (ShipToAddressID - > AddressID)
View HumanResources.vEmployee
View Purchasing.vVendorWithAddresses
Page 9 of 76
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithAddresses
P e r s o n . A d d r e s s T y p e
Types of addresses stored in the Address table.
Column Data Type Identity Nullable Default PK AddressTypeID int X Primary key for AddressType records. UK Name Name(nvarchar(50)) Address type description. For example, Billing, Home, or Shipping. UK rowguid uniqueidentifier newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated.
PK_AddressType_AddressTypeID (Primary Key) (Clustered)
Primary key (clustered) constraint
AddressTypeID
AK_AddressType_Name (Unique)
Unique nonclustered index.
Name
AK_AddressType_rowguid (Unique)
Unique nonclustered index. Used to support replication samples.
rowguid
Person.BusinessEntityAddress (AddressTypeID)
View Purchasing.vVendorWithAddresses
View Sales.vIndividualCustomer
View Sales.vStoreWithAddresses
P e r s o n . B u s i n e s s E n t i t y
Source of the ID that connects vendors, customers, and employees with address and contact information.
Column Data Type Identity Nullable Default PK BusinessEntityID int X Primary key for all customers, vendors, and employees. UK rowguid uniqueidentifier newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate()
Page 11 of 76
AddressID
IX_BusinessEntityAddress_AddressTypeID
Nonclustered index.
AddressTypeID
Person.Address (AddressID)
Person.AddressType (AddressTypeID)
Person.BusinessEntity (BusinessEntityID)
View HumanResources.vEmployee
View Purchasing.vVendorWithAddresses
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithAddresses
P e r s o n . B u s i n e s s E n t i t y C o n t a c t
Cross-reference table mapping stores, vendors, and employees to people
Column Data Type Identity Nullable Default PK, FK BusinessEntityID int Primary key. Foreign key to BusinessEntity.BusinessEntityID. PK, FK PersonID int Primary key. Foreign key to Person.BusinessEntityID. PK, FK ContactTypeID int Primary key. Foreign key to ContactType.ContactTypeID. UK rowguid uniqueidentifier newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated.
PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID (Primary Key) (Clustered)
Primary key (clustered) constraint
BusinessEntityID PersonID ContactTypeID
AK_BusinessEntityContact_rowguid (Unique)
Unique nonclustered index. Used to support replication samples.
rowguid
IX_BusinessEntityContact_ContactTypeID
Nonclustered index.
Page 12 of 76
ContactTypeID
IX_BusinessEntityContact_PersonID
Nonclustered index.
PersonID
Person.BusinessEntity (BusinessEntityID)
Person.ContactType (ContactTypeID)
Person.Person (PersonID - > BusinessEntityID)
Function dbo.ufnGetContactInformation
View Purchasing.vVendorWithContacts
View Sales.vStoreWithContacts
P e r s o n . C o n t a c t T y p e
Lookup table containing the types of business entity contacts.
Column Data Type Identity Nullable Default PK ContactTypeID int X Primary key for ContactType records. UK Name Name(nvarchar(50)) Contact type description. ModifiedDate datetime getdate() Date and time the record was last updated.
PK_ContactType_ContactTypeID (Primary Key) (Clustered)
Primary key (clustered) constraint
ContactTypeID
AK_ContactType_Name (Unique)
Unique nonclustered index.
Name
Person.BusinessEntityContact (ContactTypeID)
Function dbo.ufnGetContactInformation
View Purchasing.vVendorWithContacts
View Sales.vStoreWithContacts
P e r s o n . C o u n t r y R e g i o n
Lookup table containing the ISO standard codes for countries and regions.