CS27 Final Project | Scenario 4
A technical transition from manual data chaos to a normalized relational architecture.
| Role | Name |
|---|---|
| Project Lead | ZABRE Tania |
| Database Architect | ZONGO Aïda |
| Database Architect | SAWADOGO Asseta |
| Database Architect | KINI Jacob |
| Database Architect | ILBOUDO Balkissa |
| Database Architect | YAMEOGO Cedric |
| Database Architect | NASSA Didier |
Supervised by: Instructor Kweyakie Afi Blebo
Institution: Burkina Institute of Technology (BIT)
Manual library management often suffers from three critical failures: redundancy, data inconsistency, and inefficient retrieval.
LibTrack solves this by imposing a "Single Source of Truth." Our solution ensures that every transaction is validated through strict referential integrity.
Our approach to building LibTrack was guided by a rigorous adherence to database normalization principles and thoughtful design choices to ensure data integrity, efficiency, and scalability.
We rigorously decomposed the data structures to achieve Third Normal Form (3NF), systematically addressing common database anomalies:
- 1NF: Eliminated repeating groups, ensuring each column contains atomic values.
- 2NF: Removed partial functional dependencies, where non-key attributes were dependent on only part of a composite primary key.
- 3NF: Eliminated transitive dependencies, preventing non-key attributes from depending on other non-key attributes, thereby mitigating update anomalies.
To enforce data consistency and prevent invalid data entries, we implemented robust relational integrity rules:
- Referential Integrity: Ensured through the implementation of
FOREIGN KEYconstraints, withON DELETE RESTRICTto prevent accidental deletion of parent records that have dependent child records. - Validation: Utilized
UNIQUEconstraints on critical fields such as ISBN (for books) and Email (for members) to prevent duplicate entries and maintain data uniqueness.
Several deliberate design choices underpin the robustness and semantic correctness of the LibTrack database:
- Surrogate Keys:
INT AUTO_INCREMENTprimary keys were used for all tables (e.g.,LoanID,MemberID,BookID). This approach provides more stable and efficient primary keys compared to natural keys like ISBN or Email, which can be subject to change or complex composite structures. - NULL for ReturnDate: The
ReturnDatecolumn in theLoanstable is explicitly designed to allowNULLvalues. This semantically correct decision indicates that a book has been borrowed but has not yet been returned, providing a clear status for active loans. - UNIQUE on Members.Email: A
UNIQUEconstraint on theEmailcolumn in theMemberstable prevents duplicate member registrations, ensuring each member has a distinct identifier within the system. - Loans as a Bridge Table: The
Loanstable serves as a crucial bridge (or junction) table, resolving the many-to-many (M:N) relationship betweenMembersandBooks. This design transforms a complex relationship into clean, transactional records, facilitating efficient tracking of borrowing activities. - Categories Extracted to 3NF: The
Categoriestable was extracted as a separate entity to achieve 3NF. This eliminates transitive dependencies betweenBookIDandCategoryDescription, ensuring that category information is managed independently and consistently across all books.
LibTrack is built upon a well-structured relational schema designed to manage library operations efficiently. Below are the details of the tables, sample data, and various data manipulation and query examples.
The database consists of five interconnected tables, each with specific constraints to maintain data integrity:
| Table | Description | Primary Key |
|---|---|---|
Authors |
Stores information about book authors | AuthorID |
Categories |
Classifies books into different genres | CategoryID |
Books |
Contains details about each book in the library | BookID |
Members |
Manages library member information | MemberID |
Loans |
Records borrowing transactions for books | LoanID |
Detailed Table Structure:
Authors— Designed withNOT NULLandAUTO_INCREMENTforAuthorID.Categories— Features aUNIQUEconstraint onCategoryNameto prevent duplicate categories.Books— IncludesFOREIGN KEYconstraints linking toAuthors.AuthorIDandCategories.CategoryID.Members— Enforces aUNIQUEconstraint onEmailfor distinct member identification.Loans— ContainsFOREIGN KEYconstraints referencingBooks.BookIDandMembers.MemberID.ReturnDateis explicitly designed to allowNULLvalues for active loans.
To provide a realistic and comprehensive demonstration of the database functionality, LibTrack is populated with diverse sample data:
- 11 Authors from various African and international literary traditions.
- 5 Categories (Fiction, Dystopian, Magical Realism, Historical, Autobiography) to classify books.
- 11 Books with realistic ISBN numbers, covering a range of genres and authors.
- 11 Members each with unique email addresses, simulating a typical library user base.
- 12 Loan records, including both returned books and active loans, to test loan management.
The project demonstrates fundamental SQL Data Manipulation Language (DML) operations:
- 3 UPDATE statements: Showcasing modifications to member registration dates, loan return dates, and author nationalities.
- 2 DELETE statements: Illustrating the removal of a member with no outstanding loans and an old loan record.
- 1 Referential Integrity Violation Demonstration: A commented-out example to illustrate how
ON DELETE RESTRICTprevents invalid data operations.
A comprehensive set of SELECT queries is provided to demonstrate data retrieval capabilities:
- Basic SELECT: With
WHEREclauses for filtering,ORDER BYfor sorting, andLIMITfor pagination. - Filtering: Examples using
BETWEEN,LIKE, andINoperators for flexible data selection. - INNER JOIN: Across 2 tables to combine related data.
- LEFT JOIN: With detailed explanation of its behavior in retrieving all records from the left table.
- JOIN across 3 tables: To retrieve complex, interconnected information.
- IS NULL / IS NOT NULL: For handling and identifying records with missing or present data.
Advanced analytical capabilities are demonstrated through aggregate functions and grouping:
- COUNT, MAX, MIN, AVG: Examples of common aggregate functions to summarize data.
- GROUP BY: Used with aggregate functions to categorize and summarize data based on specific attributes.
- HAVING: To filter grouped results based on aggregate conditions.
- Full Summary Report: A complex query combining
JOIN,GROUP BY, andHAVINGto generate insightful management reports.
Setting up the LibTrack database is a straightforward process, designed for quick deployment and testing.
- Initialize: Execute
schema.sqlto build the table infrastructure. This script creates all necessary tables with their defined columns, primary keys, foreign keys, and constraints. - Seed: Run
data_population.sqlto inject 10 realistic records per entity. This populates the database with sample data, allowing immediate testing and demonstration of functionalities. - Analyze: Use
queries.sqlto generate management reports. This file contains variousSELECTqueries, including complex ones, to analyze the populated data.
For users preferring a graphical interface, the database can be easily imported using phpMyAdmin:
- Open phpMyAdmin in your browser.
- Click on the Import tab at the top.
- Click Choose File and select
library_db.sql(or the combinedschema.sqlanddata_population.sqlif provided as a single dump). - Leave the format as SQL.
- Click Go.
- The
library_dbdatabase will be created automatically with all 5 tables and data.
LibTrack enables powerful management reporting through complex SQL queries. An example demonstrating the retrieval of members who have borrowed more than 3 books is shown below:
SELECT
m.FullName,
COUNT(l.LoanID) AS BooksBorrowed
FROM Members m
INNER JOIN Loans l ON m.MemberID = l.MemberID
GROUP BY m.MemberID, m.FullName
HAVING BooksBorrowed > 3
ORDER BY BooksBorrowed DESC;A comprehensive 5–10 minute video demonstration is available on YouTube, providing a visual guide through the LibTrack project:
- Scenario overview and schema explanation.
- Live MySQL demo in phpMyAdmin.
- Walkthrough of at least 3 key queries, highlighting their functionality and results.
This project is submitted via Microsoft Forms by the Group Leader.
Form link: https://forms.cloud.microsoft/r/JjA4ZiaS2g
© 2026 Burkina Institute of Technology - Engineering Excellence