Git Product home page Git Product logo

sql-challenge's Introduction

Employee SQL

Description

This project involves managing employee data within a PostgreSQL (Version 16) database using SQL queries. It includes setting up table schemas, importing data from CSV files, and performing various data analysis queries to extract meaningful insights from the employee data.

Table of Contents

Installation

Step 1: Download and install the latest version of PostgreSQL from PostgreSQL Official Website.

Step 2: To set up the Employee SQL database, follow these steps:

  1. Create Tables from CSV Files:

    • Use the provided SQL schema to create tables for each CSV file.
    • Specify the data types, primary keys, foreign keys, and any other constraints as needed.
  2. Import Data:

    • Import each CSV file into its corresponding SQL table using PostgresSQL.

Usage

Data Engineering:

Table Schema Creation Example

  1. Employees Table Schema:

    CREATE TABLE employees (
        emp_no INT PRIMARY KEY,
        emp_title_id VARCHAR(10) NOT NULL,
        birth_date DATE NOT NULL,
        first_name VARCHAR(50) NOT NULL,
        last_name VARCHAR(50) NOT NULL,
        sex CHAR(1) NOT NULL,
        hire_date DATE NOT NULL,
        FOREIGN KEY (emp_title_id) REFERENCES titles(title_id)
    );
    
  2. Data Import

    • Import each CSV file into its corresponding SQL table using SQL LOAD DATA or equivalent commands based on your database system.

Data Analysis:

SQL Queries

  1. List Employee Details:

    SELECT emp_no, last_name, first_name, sex, salary
    FROM employees
    JOIN salaries ON employees.emp_no = salaries.emp_no;
    

Data Modeling

Entity Relationship Diagram (ERD)

  • Below is the Entity Relationship Diagram for the Employee SQL database:

    ERD

Acknowledgements

sql-challenge's People

Contributors

omidk414 avatar

Watchers

 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.