{"id":27104180,"url":"https://github.com/anurag-ghosh-12/library_management_system_sql","last_synced_at":"2026-01-29T03:07:58.254Z","repository":{"id":281338659,"uuid":"944973427","full_name":"Anurag-ghosh-12/Library_Management_System_SQL","owner":"Anurag-ghosh-12","description":"This project showcases the development of a comprehensive Library Management System utilizing Structured Query Language (SQL). It demonstrates a practical application of relational database principles to efficiently manage library resources, member information, and borrowing/returning transactions.","archived":false,"fork":false,"pushed_at":"2025-03-08T11:38:50.000Z","size":289,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-31T14:21:50.986Z","etag":null,"topics":["data-analysis","data-visualisation","dbms-project","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anurag-ghosh-12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T11:06:08.000Z","updated_at":"2025-03-08T11:38:53.000Z","dependencies_parsed_at":"2025-03-08T12:21:54.310Z","dependency_job_id":"03059164-15d4-480c-b20f-e3313e1d8fca","html_url":"https://github.com/Anurag-ghosh-12/Library_Management_System_SQL","commit_stats":null,"previous_names":["anurag-ghosh-12/library_management_system_sql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Anurag-ghosh-12/Library_Management_System_SQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag-ghosh-12%2FLibrary_Management_System_SQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag-ghosh-12%2FLibrary_Management_System_SQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag-ghosh-12%2FLibrary_Management_System_SQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag-ghosh-12%2FLibrary_Management_System_SQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anurag-ghosh-12","download_url":"https://codeload.github.com/Anurag-ghosh-12/Library_Management_System_SQL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag-ghosh-12%2FLibrary_Management_System_SQL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28861691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","data-visualisation","dbms-project","sql"],"created_at":"2025-04-06T17:31:09.498Z","updated_at":"2026-01-29T03:07:58.209Z","avatar_url":"https://github.com/Anurag-ghosh-12.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚 Library Management System (SQL) 🚀\n\nAuthor: Anurag Ghosh \n\nThis project demonstrates the power of SQL in building a robust Library Management System (LMS). We'll explore database design, CRUD operations, advanced queries, and how SQL transforms traditional bookkeeping. Let's dive in! 📖✨\n\n## 🏗️ Database Schema\n\u003cimg src=\"erd_library_management_system_using sql.png\" alt=\"Database design\"\u003e\n\nThe system consists of the following tables, designed to efficiently manage library resources:\n\n-   **🏢 LibraryBranch:** Stores branch details (branch ID, manager ID, address, contact).\n-   **🧑‍💼 Staff:** Stores staff information (staff ID, name, position, salary, branch ID).\n-   **👥 LibraryMembers:** Stores member details (member ID, name, address, registration date).\n-   **📖 Books:** Stores book information (ISBN, title, category, rental price, status, author, publisher).\n-   **📝 IssueStatus:** Tracks book borrowing (issue ID, member ID, book ISBN, issue date, staff ID).\n-   **↩️ ReturnStatus:** Tracks book returns (return ID, issue ID, return date).\n\n## 🚀 Setup Instructions\n\n1.  **💾 Database Creation:**\n    -   Create a database named `library_system`.\n    -   Execute the SQL script (`Library_main_script.sql`) to create tables and insert sample data.\n\n2.  **▶️ SQL Script Execution:**\n    -   Use a SQL client (e.g., MySQL Workbench, pgAdmin, SQL Server Management Studio).\n    -   Run the script to build your library database.\n\n## 💡 SQL Queries and Functionalities\n\n### 📚 What is a Relational Database?\n\nA relational database organizes data into tables with rows and columns. Relationships between tables are established using keys, ensuring data integrity and reducing redundancy. SQL (Structured Query Language) is the standard language for managing relational databases.\n\n### 🛠️ CRUD Operations\n\nCRUD (Create, Read, Update, Delete) operations are fundamental to database management.\n\n-   **📝 Create (INSERT):**\n    ```sql\n    INSERT INTO LibraryMembers (member_id, member_name, member_address, reg_date)\n    VALUES ('2022CSB14STU', 'New Member', 'New Address', '2024-04-01');\n    ```\n\n-   **🔍 Read (SELECT):**\n    ```sql\n    SELECT book_title, author FROM Books WHERE category = 'Computer Science';\n    ```\n\n-   **🔄 Update (UPDATE):**\n    ```sql\n    UPDATE Books SET rental_price = 9.99 WHERE isbn = '978-1-593-27082-7';\n    ```\n\n-   **🗑️ Delete (DELETE):**\n    ```sql\n    DELETE FROM LibraryMembers WHERE member_id = '2022CSB14STU';\n    ```\n\n### 📊 Data Analysis and Reporting\n\n-   **📈 Counting Books by Category:**\n    ```sql\n    SELECT category, COUNT(*) AS book_count FROM Books GROUP BY category ORDER BY book_count DESC;\n    ```\n  \u003cimg src=\"LIBRARY_books_dist.png\" alt=\"Books count\"\u003e\n\n-  Book issued and Books of different publisher report:\n   \u003cbr\u003e\n   \u003cbr\u003e\n    Books by publishers via a piechart:\n    \u003cimg src=\"LIBRARY_bookpublisher_dist.png\" alt=\"Books count\"\u003e\n    Books issued report: \n    \u003cimg src=\"LIBRARY_book_issued_graph.png\" alt=\"Books count\"\u003e\n    Publisher report\n\n-   **💰 Finding Total Rental Income:**\n    ```sql\n    SELECT category, SUM(rental_price) AS total_rental_income FROM Books GROUP BY category;\n    ```\n\n-   **⏳ Finding Overdue Books:**\n    ```sql\n    SELECT ist.issued_member_id,\n      m.member_name,\n      bk.book_title,\n      ist.issued_date,\n      CURRENT_DATE - ist.issued_date AS overdue_days\n    FROM issued_status ist JOIN members m ON m.member_id = ist.issued_member_id\n    JOIN books bk ON bk.isbn = ist.issued_book_isbn\n    LEFT JOIN return_status rs ON rs.issued_id = ist.issued_id\n    WHERE rs.return_date IS NULL AND (CURRENT_DATE - ist.issued_date) \u003e 30\n    ORDER BY overdue_days DESC;\n    ```\n\n### 🏢 Branch-wise Reports\n\n-   **📊 Generating Branch Reports:**\n    ```sql\n    SELECT lb.branch_id, COUNT(DISTINCT iss.issued_id)\n        AS total_books_issued,\n        COUNT(DISTINCT ret.return_id) AS total_books_returned,\n        COALESCE(SUM(b.rental_price), 0) AS total_revenue\n    FROM LibraryBranch lb LEFT JOIN Staff s ON lb.branch_id = s.branch_id\n    LEFT JOIN IssueStatus iss ON s.staff_id = iss.issued_staff_id\n    LEFT JOIN ReturnStatus ret ON iss.issued_id = ret.issued_id\n    LEFT JOIN Books b ON iss.issued_book_isbn = b.isbn\n    GROUP BY lb.branch_id\n    ORDER BY total_books_issued DESC;\n    ```\n    The visual representation:\n    \u003cimg src=\"LIBRARY_branchreport_graph.png\" alt=\"Branch report\"\u003e\n\n## 💖 Motivation: From Traditional Bookkeeping to SQL\n\n**Traditional Bookkeeping:** Imagine a library where records are maintained manually in ledgers. Finding a book's status, calculating overdue fines, or generating reports would be time-consuming and prone to errors.\n\n**SQL Transformation:** SQL automates these tasks, making them fast and accurate. With SQL, I can:\n\n-   **🔍 Instantly find any book or member.**\n-   **⚡ Generate real-time reports.**\n-   **✅ Maintain data integrity and consistency.**\n-   **📈 Analyze library data to improve operations.**\n\nI love how SQL transforms complex data management into simple, efficient queries. It's like having a super-powered assistant that handles all the tedious tasks, allowing me to focus on what matters most. 🌟\n\n## 🛠️ Technologies Used\n\n-   SQL (PostgreSQL)\n\n## 🚀 Potential Enhancements\n\n-   🌐 Implement a web-based user interface.\n-   📱 Integrate barcode scanning for efficient check-in/check-out.\n-   🔒 Add user authentication and authorization.\n-   🔔 Implement automated overdue notifications.\n-   📈 Create advanced analytics dashboards.\n\n## 🤝 How to Contribute\n\nContributions are welcome! Feel free to submit pull requests or open issues. Let's make this LMS even better! 🚀✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanurag-ghosh-12%2Flibrary_management_system_sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanurag-ghosh-12%2Flibrary_management_system_sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanurag-ghosh-12%2Flibrary_management_system_sql/lists"}