Giter Site home page Giter Site logo

lavih / sql-employee-database Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jbizzlefoshizzle/sql-employee-database

0.0 0.0 0.0 14.56 MB

A project combining the data modeling, engineering, and analysis of SQL databases with the data visualization of Python

Jupyter Notebook 100.00%

sql-employee-database's Introduction

Employee Database

sql.jpg

Background

My task here was a research project on employees of this corporation from the 1980s and 1990s. All that remained of the database of employees from this period are six CSV files.

I designed tables to hold data in the CSVs, imported the CSVs into a SQL database, and queried the data using Python/Pandas/Jupyter Notebook.

Data Modeling

After inspecting the CSVs, I sketched out an entity relationship diagram (ERD) of the tables ERD.png

Data Engineering

Using the ERD, I created a table schema for each of the CSV files. I specified data types, primary keys, foreign keys, and other constraints. sql screenshot I then imported each CSV file into its corresponding SQL table.

Data Analysis

The following are a sample of the queries run:

  • Listing the employee number, last name, first name, gender, and salary of each employee
  • Listing the manager of each department with specific information
  • Listing all employees in Sales, including their employee number, last name, first name, and department name
  • In descending order, listing the frequency count of employee last names

Generating a visualization of the data

I imported the SQL database into Pandas. Using the Python SQL toolkit and Object Relational Mapper "SQLAlchemy", I used the create_engine function to interact directly with the database using Jupyter Notebook. pandas.png

I used SELECT statements to call in the "salaries" and "titles" tables from the SQL database, select then combined the dataframes in order to better aggregate the data. combine I then found the mean salary of each job title, mean before using the Python plotting library Matplotlib to create a bar graph visualization. bar graph

sql-employee-database's People

Contributors

jbizzlefoshizzle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.