Skip to content

Tam-ala/Employee-Database-with-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee Database with SQL

sql and database image

Background

In this assignment, I designed the tables to hold data in the CSVs, import the CSVs into a SQL database, and answer questions about the data through Data Engineering and Data Analysis. The data contains employees hired at "Pewlett Hackard" from the 1980s and 1990s which were stored in six CSV files.

Data Engineering

  • Used the information to create a table schema for each of the six CSV files.

  • Imported each CSV file into the corresponding SQL table.

  • CSVs used: Data Folder

  • Tool used to sketch ERD: Quick Database Diagrams

  • Tool used to make queries: Postgres

Data Analysis

After creating the EmployeeSQL database, I did the following:

  1. List the following details of each employee: employee number, last name, first name, sex, and salary.

The output displayed 300,024 employess based on this query.

sql image

  1. List first name, last name, and hire date for employees who were hired in 1986.

There were 36,150 hired that year.

sql image

  1. List the manager of each department with the following information: department number, department name, the manager's employee number, last name, first name.

There were a total of 24 managers.

sql image

  1. List the department of each employee with the following information: employee number, last name, first name, and department name.

There were a total of 331,603 employees. This is a 31,579 increase compared to the first query. Meaning, that these employees were not included in the employee csv.

sql image

  1. List first name, last name, and sex for employees whose first name is "Hercules" and last names begin with "B."

There were 20 employees with the last name Hercules.

sql image

  1. List all employees in the Sales department, including their employee number, last name, first name, and department name.

During this time period, 52,245 employees were in the Sales departments.

sql image

  1. List all employees in the Sales and Development departments, including their employee number, last name, first name, and department name.

During this time period, 137,952 employees were in the Sales and Development departments.

sql image

  1. In descending order, list the frequency count of employee last names, i.e., how many employees share each last name.

From the 1638 last names in this database, the range of employess sharing that last name during this time period was from 145 to 226 employees except of one person. That one person's name is April Foolsday(Emp.# 499942) from the Development department.

sql image

About

Utilizing postgreSQL to conduct queries about employee data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published