Using sql views and queries, analysis the database for business. Find potential mentorship candidates, which employees are retiring and from which departments.
- PostgreSQL
- SQL
Creating database:
In order to understand the schema needed for this database, I decided to mock up a quick diagram to better understand which keys are needed.
From here I decided to go with this schema (SQL File) and import the data from the csv files:
Creating views:
To gain further insight into the database I wanted to look at the following data:
- Retirement eligibility
- Retirement for current employees in the company
- Employees gender and salary
- Department managers
- Employees in each department
- Find overlap in departments, such as sales and development.
- Further break down retirement to make sure there are no duplicates
- See if any employees qualify for mentorship
Since I wanted this data to be temporary for the goal of quickly getting query results back, I decided they were best used as views.
(SQL File) Example of the postgres database:
(SQL File) All retiring employees:
(SQL File) Retiring employees without duplicates: