Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aaisha-nexus/sql_company_insights

A beginner-friendly SQL project for managing employee records, departments, and sales transactions. Includes table creation, optimized queries, stored procedures, and window functions to extract business insights.
https://github.com/aaisha-nexus/sql_company_insights

business-analytics data data-analysis dataanalysis-projects dataanalytics database-schema mssql-database query relational-databases sql sql-query ssms

Last synced: about 21 hours ago
JSON representation

A beginner-friendly SQL project for managing employee records, departments, and sales transactions. Includes table creation, optimized queries, stored procedures, and window functions to extract business insights.

Awesome Lists containing this project

README

        

# SQL Project Overview

## Scenario
A company wants to efficiently manage its employee records, department structures, and sales transactions by maintaining a structured database. As a database administrator, your task is to design and implement a relational database system to track employees, their respective departments, and their sales performance. The company needs well-defined relationships between tables, optimized queries for reporting, and stored procedures to retrieve key insights.

## Project Description
This project involves the creation and management of a structured database system, including defining tables, inserting data, executing various SQL queries, implementing stored procedures, and utilizing window functions. The project provides insights into employee and sales data analysis through different SQL operations.

## Features
- **Database Creation:** Define tables for `Department`, `Employee`, and `Sales`.
- **Data Entry:** Populate tables with sample data for meaningful queries.
- **Query Execution:** Perform various SQL queries including filtering, aggregation, and ranking.
- **Stored Procedures:** Automate common tasks such as retrieving employees by department, filtering salaries, and calculating total sales.
- **Window Functions:** Use ranking and cumulative calculations for advanced analysis.
- **Data Insights:** Extract useful business insights from employee and sales data.

## Table Structure
- **Department:** Stores department details (`DepartmentID`, `DepartmentName`).
- **Employee:** Stores employee records (`EmployeeID`, `Name`, `DeptID`, `Salary`, `HireDate`).
- **Sales:** Stores sales records (`SalesID`, `EmpID`, `SaleAmount`, `SaleDate`).

## Key SQL Queries
- Retrieve employees based on salary, hire date, and department.
- Calculate total salary and employee count for each department.
- Identify high-performing employees based on sales.
- Use window functions to rank employees and track salary trends.

## Stored Procedures
- Fetch employees by department.
- Retrieve employees with salaries above a specified threshold.
- Compute total sales for a given employee.

## Window Functions
- Rank employees by salary and sales performance.
- Calculate cumulative salary totals based on hire date.

## Insights
- Department-wise salary and sales analysis.
- Employee categorization based on salary and experience level.
- Identification of sales trends and employee performance fluctuations.

## Documentation
The project includes SQL queries, comments, and insights derived from the analysis. A PDF file and included including all the queries and the picture of their output.

---
**Author:** Aaisha Iqbal
**Project Type:** SQL Database Management