Tech Ops Assignment
Tech Ops Assignment
You are managing a comprehensive employee database that comprises the "EmployeeDetails"
table, which includes employee records with various details like EmployeeID, FirstName,
LastName, Salary, JoiningDate, DepartmentID. Additionally, the database incorporates a
"Departments" table, containing information about the various departments within the company,
identified by DepartmentID and labeled with DepartmentName.
1 Sales
2 Marketing
3 Finance
4 Engineering
5 Human Resources
Your task is to write SQL queries to solve the following scenarios and challenges related to the
employee data:
Scenario 1: A new employee, "Sarah," is joining the company. Write an SQL query to insert a
new record for Sarah into the "EmployeeDetails" table with her details. Make sure to generate a
unique EmployeeID for her.
Scenario 2: The company wants a report of its top earners, showing the EmployeeID,
FirstName, LastName, Salary, and DepartmentName. Write an SQL query to select the details
of the top 5 earners along with their department names.
Scenario 3: HR wants to know how many employees are in each department. Write an SQL
query to select the "DepartmentName" and the count of employees in each department. Use an
inner join between the "EmployeeDetails" and "Departments" tables.
Scenario 4: The company is expanding and is creating a new department named "Research
and Development." Write an SQL query to insert a new department with the appropriate
DepartmentID and DepartmentName into the "Departments" table.
Scenario 5: The company has recently created a new department called "Quality Assurance"
(DepartmentID 6). They want to assign a few employees to this new department. Write an SQL
query to update the "DepartmentID" in the "EmployeeDetails" table for a few employees
(EmployeeID 11, 18, 20, 3) and assign them to the "Quality Assurance" department
(DepartmentID 6).
SECTION - 2
1. A man has Rs.480 in the denominations of one-rupee notes, five-rupee notes and
ten-rupee notes. The number of notes of each denomination is equal. What is the total
number of notes that he has ?
A.45 B.60 C.75 D.90
2. A grocer has a sale of Rs. 6435, Rs. 6927, Rs. 6855, Rs. 7230 and Rs. 6562 for 5
consecutive months. How much sale must he have in the sixth month so that he gets an
average sale of Rs. 6500?
A.Rs. 4991 B.Rs. 5991 C.Rs. 6001 D.Rs. 6991
3. A company's revenue is $500,000, and its expenses are $350,000. Calculate the
company's profit.
A) $500,000 B) $350,000 C) $150,000 D) $200,000
SECTION - 3