Objective is to conduct a research project on employees from a corporation from 1980 to 1990. Using six CSV files, the task is to design the tables to hold data in the CSVs, import the CSVs into a SQL database, and answer questions about the data. In other words, to perform the following:
-
Data Modeling
-
Data Engineering
-
Data Analysis
Data Modeling
Modeling begins with sketching an ERD (Entity Relation Database) diagram of the six CSV files in order to inspect them.
Data Engineering
Table schemas are created with accompanying data types and keys to fit the incoming CSV files. The six CSV files are then imported into the corresponding SQL table.
Data Analysis
Now with a complete database, the following tasks are performed with SQL queries:
-
List the following details of each employee: employee number, last name, first name, sex, and salary.
-
List first name, last name, and hire date for employees who were hired in 1986.
-
List the manager of each department with the following information: department number, department name, the manager's employee number, last name, first name.
-
List the department of each employee with the following information: employee number, last name, first name, and department name.
-
List first name, last name, and sex for employees whose first name is "Hercules" and last names begin with "B."
-
List all employees in the Sales department, including their employee number, last name, first name, and department name.
-
List all employees in the Sales and Development departments, including their employee number, last name, first name, and department name.
-
In descending order, list the frequency count of employee last names, i.e., how many employees share each last name.
Data Visualization
The SQL database is imported into Pandas to further inspect the data.
Most common salaries for employees:
Average salary by title: