Explore BrainMass

Explore BrainMass

    SQL Server Database

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    SQL Server database for Kudler Fine Foods/Service Request SR-kf-009

    Create the following two tables using the following fields:

    Note: Supply the appropriate SQL Server data types when creating the tables. In the Employee table, create an Employee ID field that will generate a unique number for each employee and designate the field as the Primary Key. In the Job Title table, you will need to either utilize one of the listed fields as the table's primary key or you will need to create an additional field to use as the primary key. The primary key from the Job Title table will appear as the foreign key in the Employee table.

    · Employee

    § Emp_ID

    § Last_name

    § First_name

    § Address

    § City

    § State

    § Telephone_area_code

    § Telephone_number

    § EEO-1 Classification

    § Hire_date

    § Salary

    § Gender

    § Age

    § Foreign Key from Job Title table

    · Job_title

    § EEO-1 Classification

    § Job_title

    § Job description

    § Exempt / Non-Exempt Status

    Using the SQL INSERT statement:

    · Go to the Human Resources department in the Kudler Fine Foods intranet. Using information found in the Employee Files for the La Jolla and Encinitas stores, enter records into the employee table for the following employees:

    § Glenn Edelman

    § Eric McMullen

    § Raj Slentz

    § Erin Broun

    § Donald Carpenter

    § David Esquivez

    § Nancy Sharp

    · Using the Kudler Fine Foods Job Classifications and Job Descriptions information, enter records into the job_title table for the following job titles:

    § Accounting Clerk

    § Asst. Manager

    § Bagger

    § Cashier

    § Computer Support Specialist

    § Director of Finance & Accounting

    § Retail Asst. Bakery & Pastry

    § Retail Asst. Butchers and Seafood Specialists

    § Stocker

    Non-Exempt employees at Kudler Fine Foods are paid an hourly wage and are required to track their working hours.

    Check the results by selecting all of the columns from both of your tables.

    Using the database and tables from Week Two, write SQL statements and enter the records into the employee table for the workers identified in the Employee Files for the administrative offices and the Del Mar location. Check the results by selecting all of the columns from both of your tables

    You will use the database you created in week 1 and will add these scripts to the database.

    Project Description
    Query 1 (SELECT LIKE):
    Write a SQL query that joins two tables Employee and JobTitle. Use LIKE to restrict record selection. (Use age column to restrict data. I will leave it up to you to select the restricting age.)

    Query 2 (SELECT BETWEEN):
    Write a SQL statement that does an INNER JOIN the two tables Employee and JobTitle with the result displaying the Employee full name, EEO Classification, job description and salary. You will use the BETWEEN qualifier to join only records where the Employee salary is between $20,000 and $35,000. You will order the list by employee's last name.

    First write a SELECT INTO query to create a table employee_ca. What you will be doing is selecting all fields for every record where the employee is from a specific state. I used California as my state in the sample query. Make a table appropriate to the state in your current employee data

    Then write a statement that uses the UNION ALL statement to select records from the employee table and all records from the employee_ca table you created above. Notice that the query displays all duplicate records.

    Write a SQL statement that displays the average salary of employees by EEO Classification. You only need to display the EEO Classification and the average salary. No invalid EEO Classifications should be displayed

    Query 5 (SELECT DISTINCT):
    Create a SELECT query that will display the number of different (distinct) states employees are in and the actual number of employees in each of the states. This means you need to use the DISTINCT and COUNT commands

    Query 6 (UPDATE DATA):

    Choose an EEO-1 Classification - then write a query that increases all employees' salaries that have that classification by 10%. This means you need to use the UPDATE command.

    Query 7 (DELETE EMPLOYEE):

    Choose an employee from the employee table - then write a query that deletes this employee. This means you need to use the DELETE command.

    Query 8 (SELECT SUBQUERY):

    Write a SELECT query that utilizes a SUBQUERY to determine if the EEO-Classification for an employee is invalid. This means that you need to use the NOT EXIST for the SUBQUERY.

    Query 9 (SELECT-SUM-COUNT):

    Create a SELECT statement that displays the Title, Number of Employees and Total salary paid to all employees for the specific Title. You need to COUNT the employees and SUM the salary. The resultant output should look like:

    Query 10 (SELECT MIN-MAX):

    Write a SELECT statement that displays the employee's average salary, employee's minimum salary, employee's maximum salary by title by state.

    © BrainMass Inc. brainmass.com October 9, 2019, 10:00 pm ad1c9bdddf

    Solution Summary

    SQL statements are created for the Kudler Fine Foods/Service request SR-kf-009. The response received a '5/5' rating from the student who originally posted the question.