UNC_data_bootcamp_module_9
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
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:
- Create an Entity Relationship Diagram based on the tables the CSV files. This will provide a layout for the employee database.
- Create an employee database schema sql using the original six CSV files as foundations for each table.
- 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.
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:
- 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:
- titles
- employees
- departments
- dept_emp
- dept_manager
- salaries
- We then import each CSV file into its corresponding SQL table using the Import function in pgAdmin.
Here we were ask a series of questions based on the data from the schema tables:
- List the employee number, last name, first name, sex, and salary of each employee.
- List the first name, last name, and hire date for the employees who were hired in 1986.
- List the manager of each department along with their department number, department name, employee number, last name, and first name.
- List the department number for each employee along with that employee’s employee number, last name, first name, and department name.
- List first name, last name, and sex of each employee whose first name is Hercules and whose last name begins with the letter B.
- List each employee in the Sales department, including their employee number, last name, and first name.
- List each employee in the Sales and Development departments, including their employee number, last name, first name, and department name.
- List the frequency counts, in descending order, of all the employee last names.
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
(where possible will provide link to website)
*YouTube (various sources)