Designed tables to hold data in the CSVs, imported the CSVs into a SQL database, and answered questions about the data. Performed:
-
Data Engineering
-
Data Analysis
Inspected the CSVs and sketched out an ERD of the tables. Using the following tool http://www.quickdatabasediagrams.com.
-
Used the information gathered to create a table schema for each of the six CSV files. Remembering to specify data types, primary keys, foreign keys, and other constraints.
-
Created tables in the correct order to handle foreign keys.
-
Imported each CSV file into the corresponding SQL table. imported the data in the same order that the tables were created and accounted for the headers when importing to avoid errors.
Once the database was completed, I then:
-
Listed the following details of each employee: employee number, last name, first name, sex, and salary.
-
Listed first name, last name, and hire date for employees who were hired in 1986.
-
Listed the manager of each department with the following information: department number, department name, the manager's employee number, last name, first name.
-
Listed the department of each employee with the following information: employee number, last name, first name, and department name.
-
Listed first name, last name, and sex for employees whose first name is "Hercules" and last names begin with "B."
-
Listed all employees in the Sales department, including their employee number, last name, first name, and department name.
-
Listed all employees in the Sales and Development departments, including their employee number, last name, first name, and department name.
-
In descending order, listed the frequency count of employee last names, i.e., how many employees shared each last name.
-
Imported the SQL database into Pandas. Used the code below to get started and made necessary modifications for username, password, host, port, and database name:
from sqlalchemy import create_engine engine = create_engine('postgresql://localhost:5432/<your_db_name>') connection = engine.connect()
-
Created a histogram to visualize the most common salary ranges for employees.
-
Created a bar chart of average salary by title.