Skip to content

Ryndine/sql_employee_database

Repository files navigation

SQL Employee Database Analysis

Objective:

Using sql views and queries, analysis the database for business. Find potential mentorship candidates, which employees are retiring and from which departments.

Tools & databases used:

  • PostgreSQL
  • SQL

Preparing Analysis:

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.

diagram

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.

Analysis:

(SQL File) Example of the postgres database:
example

(SQL File) All retiring employees:
employees

(SQL File) Retiring employees without duplicates:
retiring

(SQL File) Number of employees retiring by title:
titles

(SQL File) Employees eligilible for mentorship:
mentorship

About

Using PostgreSQL to gain insight into employee database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published