DOCUMENTS

Topics: Database, Microsoft SQL Server, Relational model Pages: 4 (435 words) Published: May 8, 2014
SQL Server Exercises on Aggregate Functions

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 Employees in...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Togaf Architecture Definition Document Essay
  • Essay about Managing Business Document Design and Development
  • Essay about A Guide on Writing Quality Management System Documents
  • Essay on Bap23 Principles of Managing Information and Producing Documents
  • The Purpose of Producing Documents in a Business Environment Essay
  • Unit 312 Design and produce documents in a business environment Essay
  • BSBADM506B
  • Business Document Design and Development Research Paper

Become a StudyMode Member

Sign Up - It's Free