Capstone Project 2-SQL-DataETL
Capstone Project 2-SQL-DataETL
Scenario:
You are tasked with designing and implementing a database for a fictional company called
"TechCorp" that manages employees, departments, projects, and their respective budgets.
The database must enforce constraints to ensure data integrity and support queries for data
analysis and reporting.
1. Database Design
Entities and Relationships:
- Employees: Stores information about employees.
Total Departments: 20
- Projects: Stores information about projects, including the department responsible and the
budget allocated.
Total Projects: 50
- ProjectAssignments: Tracks which employees are assigned to which projects, along with
their roles and the hours they have worked.
For query no. 3, I was getting no output, so I added the row in Project Assignment to have a
output.
For query no. 4, No Outputs were shown because CURRDATE is way more than any of the
EndDate.So, I added few columns to get some output.
OUTPUT:
2. Project Budget Analysis
- Calculate the total budget allocated to each department and identify the department
with the highest total budget.
NOTE: Earlier, no output was shown, so added a row to get some Output.
4. Project Timeliness
- Identify projects that are behind schedule by comparing the current date with the
`EndDate`.
Q. Use CTE to find out the highest paid employee in each department
Use case of this question could be to find out the seniority based on salaries in department.