Skip to content

Repository files navigation

SQL Challenge


Postgres MySQL C++ GitHub

License: GPL v3

Databases

  • departments: Stores department details.
  • titles: Contains job titles.
  • employees: Stores personal employee information.
  • salaries: Tracks salary details.
  • dept_emp: Maps employees to departments.
  • dept_manager: Tracks department managers.

SQL Queries

Several SQL queries were used to extract insights from the database, including:

  1. Employee Salary Report: basic select
  2. Employees Hired in 1986: where clause
  3. Department Managers: joining, formatting
  4. Employee Department Details: joining, formatting
  5. Employees Named 'Hercules B...': regexing
  6. Employees in Sales and Development: boolean operations
  7. Most Common Last Names: aggregation

Installation & Setup

Prerequisites

  • PostgreSQL

Database Setup

  1. Clone this repository:

    git clone https://github.com/constcorrectness/sql-challenge.git
    cd sql-challenge
  2. Open PostgreSQL and create a database:

    CREATE DATABASE employee_db;
  3. Load the schema and data:

    psql -d employee_db -f schemas/all_schemas.sql
    psql -d employee_db -f data/load_tables.sql

Usage

To run queries, connect to the database using:

psql -d employee_db

Then, execute any SQL query by running:

SELECT * FROM employees LIMIT 10;

Contributors

License

This project is licensed under the GNU GPL v3

About

Module 9 Challenge

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages