Please help from attached file. Find the distinct number of workers who work in the HR department and who earn more than ₹250,000. Find the last name and title of all workers and the department they work in who earn less than the average salary. What is the average salary

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please help from attached file.

  1. Find the distinct number of workers who work in the HR department and who earn more than ₹250,000.
  2. Find the last name and title of all workers and the department they work in who earn less than the average salary.
  3. What is the average salary paid for all workers in each department? List the department, the average salary for the department, and the number of workers in each department. Name the average column 'AvgSal' and the number of workers column to 'Num'.
  4. What is the total compensation for each worker (salary and bonus) on a per monthly basis? List the name of the worker, their title, and the their monthly compensation (annual compensation divided by 12). Change the header for compensation to 'MonthlyComp' and round it to the nearest whole number.
  5. List the full names of all workers in all capital letters who did not get a bonus.
  6. What are the full names of all workers who have 'Manager' in their title. Do not "hard code" the titles; use string searching. 
### SQL Schema and Sample Data for an Educational Database

**1. Worker Table:**

The `Worker` table is designed to store information about each worker. Below are the details of its schema:

- **Columns:**
  - `WORKER_ID`: An integer serving as the primary key with auto-increment.
  - `FIRST_NAME`: A text field for the worker's first name.
  - `LAST_NAME`: A text field for the worker's last name.
  - `SALARY`: An integer field (maximum of 15 digits) for the worker's salary.
  - `JOINING_DATE`: A datetime field for the date the worker joined.
  - `DEPARTMENT`: A character field (maximum 25 characters) for the department name.

- **Sample Data Inserted:**
  - Six workers with varying details such as ID, name, salary, joining date, and department.

**2. Bonus Table:**

The `Bonus` table captures information about bonuses awarded to workers.

- **Columns:**
  - `WORKER_REF_ID`: An integer referencing the `WORKER_ID` in the Worker table.
  - `BONUS_AMOUNT`: An integer field for the bonus amount.
  - `BONUS_DATE`: A datetime field for the date the bonus was awarded.

- **Foreign Key:**
  - `WORKER_REF_ID` references `WORKER_ID` in the `Worker` table with a cascading delete option.

- **Sample Data Inserted:**
  - Bonuses for different workers on specified dates.

**3. Title Table:**

The `Title` table records the designation or title of the workers.

- **Columns:**
  - `WORKER_REF_ID`: An integer referencing the `WORKER_ID` in the Worker table.
  - `WORKER_TITLE`: A variable character field (maximum 64 characters) for the worker's title.
  - `AFFECTED_FROM`: A datetime field indicating when the title became effective.

- **Foreign Key:**
  - `WORKER_REF_ID` references `WORKER_ID` in the `Worker` table with a cascading delete option.

- **Sample Data Inserted:**
  - Various titles assigned to workers from particular dates.

This setup illustrates how to organize a basic employee database, incorporating crucial aspects like employee details, bonuses, and titles, while maintaining referential integrity across the tables.
Transcribed Image Text:### SQL Schema and Sample Data for an Educational Database **1. Worker Table:** The `Worker` table is designed to store information about each worker. Below are the details of its schema: - **Columns:** - `WORKER_ID`: An integer serving as the primary key with auto-increment. - `FIRST_NAME`: A text field for the worker's first name. - `LAST_NAME`: A text field for the worker's last name. - `SALARY`: An integer field (maximum of 15 digits) for the worker's salary. - `JOINING_DATE`: A datetime field for the date the worker joined. - `DEPARTMENT`: A character field (maximum 25 characters) for the department name. - **Sample Data Inserted:** - Six workers with varying details such as ID, name, salary, joining date, and department. **2. Bonus Table:** The `Bonus` table captures information about bonuses awarded to workers. - **Columns:** - `WORKER_REF_ID`: An integer referencing the `WORKER_ID` in the Worker table. - `BONUS_AMOUNT`: An integer field for the bonus amount. - `BONUS_DATE`: A datetime field for the date the bonus was awarded. - **Foreign Key:** - `WORKER_REF_ID` references `WORKER_ID` in the `Worker` table with a cascading delete option. - **Sample Data Inserted:** - Bonuses for different workers on specified dates. **3. Title Table:** The `Title` table records the designation or title of the workers. - **Columns:** - `WORKER_REF_ID`: An integer referencing the `WORKER_ID` in the Worker table. - `WORKER_TITLE`: A variable character field (maximum 64 characters) for the worker's title. - `AFFECTED_FROM`: A datetime field indicating when the title became effective. - **Foreign Key:** - `WORKER_REF_ID` references `WORKER_ID` in the `Worker` table with a cascading delete option. - **Sample Data Inserted:** - Various titles assigned to workers from particular dates. This setup illustrates how to organize a basic employee database, incorporating crucial aspects like employee details, bonuses, and titles, while maintaining referential integrity across the tables.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education