Sql problem | Computer Science homework help
Sql problem | Computer Science homework help.
First of all you need to downlod SQL 2012 the abloud the data to solve Module 9 assighnment , ther is in class qury can help you as well.
For this assignment you will use the PR database. Download the PR.zip folder from the Module, extract the database from the folder and attach it to the server.
The PR database is a “raw data” payroll database comprised of 6 tables with the following fields and schema:
The function of each table is as follows:
Benefits: this table contains insurance plan information and costs EmpData: this table contains employee information including whether they have a spouse (bit datatype- 1 equals yes), how many children (dependents) and the employees withholding allowance for payroll tax purposes. Work: this table contains current payrate information including start and end dates for the payrate, and whether the raise was for cost of living (COLA- bit data type). Department: this table contains information for the different departments an employee is assigned. Hours: this table contains payperiod hours worked including ancillary pay (vacation, holiday, sick, etc.) PayPeriod: this table contains individual payperiod information.
This is a typical layout for a payroll database- information regarding gross pay, net pay, tax withholding, insurance costs, etc. will be generated by creating and using views.
I highly suggest first setting up each view as a SELECT statement (sans the CREATE VIEW AS statement) and check the result sets against your SELECT for accuracy.
After successfully creating the views in this assignment, please do not delete them as they will be used again in upcoming assignments.
Create the base view for calculating payroll: 1. Create a view named vwPayroll that returns the following