Installing AdventureWorks2012 Database
This is a relational database that runs on a Database Engine instance.
To install this database, do the following:
Download the AdventureWork2012 database from http://msftdbprodsamples.codeplex.com/releases/view/55330
The database file name is AdvntureWorks2012_Data.mdf. The file should be in the Downloads folder on your computer. Copy the AdventureWorks2012_Data.mdf file to the data directory of the local SQL Server Database Engine instance. By default, it is located at C:\Program Files\Microsoft SQL
Server\MSSQL11.MSSQLSERVER\MSSQL\Data.
Start SQL Server Management Studio and connect to the Database Engine instance.
Right-click Databases, click Attach.
Click Add.
Select the AdventureWorks2012_Data.mdf database file and click OK. If the file is not listed, check the C:\Program
Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data folder to be sure the file is there.
In database details, remove the Log file entry. The sample download does not include a log file. A new log file will be created automatically when you attach the database. Select the log file and click Remove, and then click OK to attach just the primary database file.
By Venkat Devarapalli venkateswarlu.devarapalli@ptgindia.com venkat.it.d@gmail.com
1
select e.BusinessEntityID,
e.JobTitle,
e.BirthDate,
e.MaritalStatus,
e.Gender,
e.HireDate,
e.VacationHours,
e.SickLeaveHours
from AdventureWorks2012.HumanResources.Employee as e
By Venkat Devarapalli venkateswarlu.devarapalli@ptgindia.com venkat.it.d@gmail.com
2
By Venkat Devarapalli venkateswarlu.devarapalli@ptgindia.com venkat.it.d@gmail.com
3
1. WAQ to Display total no of Males and Female employees in the Organizations.
2. WAQ to Display total no of Married Males and Un Married Females in the Organizations.
3. WAQ to Display total no of Employee in designation wise.
4. WAQ to Display Senior most