Skip to content

Perform data modeling, data engineering, and data analysis. Design tables to hold data from CSV files, import the CSV files into an SQL database, and then answer questions about the data.

Notifications You must be signed in to change notification settings

SteveTuttle/employee-database-in-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

employee-database-in-sql

UNC_data_bootcamp_module_9

Challenge Description

Background

It’s been two weeks since you were hired as a new data engineer at Pewlett Hackard (a fictional company). Your first major task is to do a research project about people whom the company employed during the 1980s and 1990s. All that remains of the employee database from that period are six CSV files.

from the UNC Bootcamp instructions for this challenge

Deliverables

The goal for this challenge is to perform data modeling, data engineering, and data analysis using data imported from the CSV files, then answering questions about the data. With that, this challenge is divided into three parts:

  1. Create an Entity Relationship Diagram based on the tables the CSV files. This will provide a layout for the employee database.
  2. Create an employee database schema sql using the original six CSV files as foundations for each table.
  3. Create a queries sql file based on a series of questions asked in this challenge using data from the schema tables.

We are using pgAdmin working with postgreSQL to complete this challenge.

Part-1: Data Modeling - Entity Relationship Diagram (ERD)

Inspect the CSV files, and then sketch an Entity Relationship Diagram of the tables. After reviewing and mapping out each CSV file, using the ERD Tool in pgADmin provided me the most efficient way to display the ERD for this challenge.

employee database ERD:

employee_db_erd

Part-2: Data Engineering - Schema SQL

  1. Use the information provided from the six CSV files to create a table Schema. Based on the data from the CSV files used to create the initial Entity Relationship Diagram, the following is the most efficient sequence to load the data into the SQL Schema database:
    1. titles
    2. employees
    3. departments
    4. dept_emp
    5. dept_manager
    6. salaries
  2. We then import each CSV file into its corresponding SQL table using the Import function in pgAdmin.

Part-3: Data Analysis - Queries SQL

Here we were ask a series of questions based on the data from the schema tables:

  1. List the employee number, last name, first name, sex, and salary of each employee.
  2. List the first name, last name, and hire date for the employees who were hired in 1986.
  3. List the manager of each department along with their department number, department name, employee number, last name, and first name.
  4. List the department number for each employee along with that employee’s employee number, last name, first name, and department name.
  5. List first name, last name, and sex of each employee whose first name is Hercules and whose last name begins with the letter B.
  6. List each employee in the Sales department, including their employee number, last name, and first name.
  7. List each employee in the Sales and Development departments, including their employee number, last name, first name, and department name.
  8. List the frequency counts, in descending order, of all the employee last names.

Resources

Bootcamp References

Module 9 Instructions

Starter CSV files

  • titles.csv
  • employees.csv
  • departments.csv
  • dept_emp.csv
  • dept_manager.csv
  • salaries.csv

Special Thanks:

  • Jamie Miller
  • Mounika Mamindla
  • Lisa Shemanciik

External References

(where possible will provide link to website)

*PostgreSQL Cheatsheet

*SQL Reference Guide

*YouTube (various sources)

About

Perform data modeling, data engineering, and data analysis. Design tables to hold data from CSV files, import the CSV files into an SQL database, and then answer questions about the data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published