Skip to content

alfeenaami/Library-Management-Query-Analysis-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intelligent Library Data Management & Query Analytics

Overview

A relational database project designed to streamline library operations — managing books, members, and loans while applying advanced SQL techniques to generate meaningful insights such as overdue tracking, borrow frequency, and member activity analysis.


Database Schema

The project operates on a schema containing three core tables:

  • Books — Stores book details including ID, title, author, genre, and publication date.
  • Members — Contains member information such as ID, name, contact details, and join date.
  • Loans — Records borrowing activity with loan dates, return dates, and loan status.

Key SQL Implementation Details

Joins & Aggregation

  • Relational Joins — Combined books, members, and loans to generate detailed borrowing histories.
  • Aggregate Functions — Applied COUNT, AVG, MIN, MAX to calculate borrow statistics, overdue counts, and average loan durations.

Window Functions

  • RANK(), DENSE_RANK(), ROW_NUMBER() — Used to build leaderboards for most borrowed books, active members, and popular genres.

Modular Queries

  • Common Table Expressions (CTEs) — Modular queries for overdue tracking, borrow counts, and identifying top members.
  • Subqueries — Compared borrow counts against averages to detect special cases (e.g., books borrowed more than average).

Data Preparation & Grouping

  • Data Cleaning — Converted inconsistent text dates into proper SQL DATE types and handled null values.
  • Grouping & Ordering — Used GROUP BY and ORDER BY for genre-level reporting and chronological loan analysis.

Analytical Insights

  • Book Popularity — Identified top-borrowed titles and genres.
  • Member Activity — Ranked members by borrow frequency and engagement.
  • Overdue Tracking — Generated reports on overdue loans for better management.

Technical Stack

  • Database Engine: MySQL
  • Scripting: Advanced SQL (joins, aggregates, window functions, CTEs, subqueries)

About

This project explores building a relational Library Management System using SQL to manage books, members, and loans. It leverages joins, aggregates, ranking functions, CTEs, and subqueries to generate analytical insights such as overdue tracking, borrow frequency, member activity, and genre trends, while ensuring accurate and clean data handling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors