Skip to content

This SQL programming project involves the creation of a database host application that interfaces with a backend SQL database implementing a Library Management System. Users of the system are understood to be librarians (not book borrowers).

Notifications You must be signed in to change notification settings

jaszmine/cs4347_Library-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library System Programming Project

CS-4347 Database Systems (Milestone 1)

This project involves the creation of a database host application that interfaces with a backend SQL database implementing a Library Management System. The first milestone focuses on normalizing the given data into Third Normal Form (3NF) and preparing the schema for further development.

Table of Contents


Project Overview

The project aims to develop a Library Management System using SQL. The first milestone involves normalizing the provided books.csv and borrowers.csv files into separate tables that adhere to the schema defined below.


Schema

library-system_schema drawio

Directory Structure

cs4347_Library-System/
├── data/
│   ├── books.csv                        // raw data provided
│   ├── borrowers.csv                    // raw data provided
├── normalized_data/
│   ├── normalized_book.csv              // auto-generated by normalize_books.py
│   ├── normalized_book_authors.csv      // auto-generated by normalize_books.py
│   ├── normalized_authors.csv           // auto-generated by normalize_books.py
│   ├── normalized_borrower.csv          // auto-generated by normalize_borrowers.py
├── src/
│   ├── normalize_books.py               // owner: Jaszmine
│   ├── normalize_borrowers.py           // owner: Hung Minh
│   └── generate_visualizations.py       // owner: Sam
├── visualizations/
│   ├── page_count_distribution.png      // auto-generated by gerate_visulaizations.py
│   ├── top_authors.png                  // auto-generated by gerate_visulaizations.py
│   └── top_publishers.png               // auto-generated by gerate_visulaizations.py
├── tests/
│   ├── test_normalize_books.py          // owner: Jess
│   ├── test_normalize_borrowers.py      // owner: Sai
└── README.md

Dependencies

  • Python 3.x
  • csv module (standard library)
  • pandas (optional, for more advanced data manipulation)

Setup Instructions

  1. Clone the Repository:
git clone https://github.com/jaszmine/cs4347_Library-System.git
cd cs4347_Library-System
  1. Install Dependencies:
pip3 install pandas
  1. Run the Normalization Scripts: Navigate to the src directory and run the normalization scripts:
python3 normalize_books.py
python3 normalize_borrowers.py
  1. Verify the Normalized Data: Check the normalized_data directory for the normalized CSV files.

Normalization Process

Normalizing books.csv The normalize_books.py script reads the books.csv file, normalizes the data into Third Normal Form (3NF), and writes the results to book.csv, book_authors.csv, and authors.csv.

Normalizing borrowers.csv The normalize_borrowers.py script reads the borrowers.csv file and normalizes the data into the borrower.csv file.


Contributing

  1. Fork the Repository: Fork the repository to your GitHub account.

  2. Create a New Branch: Create a new branch for your feature or fix:

git checkout -b your-branch-name
  1. Commit Your Changes: Commit your changes with descriptive commit messages:
git add .
git commit -m "Your commit message"
  1. Push Your Changes: Push your branch to your forked repository:
git push origin your-branch-name
  1. Create a Pull Request: Go to the original repository and create a pull request from your branch.

Git Reference

Pushing to Your Branch

Command Meaning
git branch //check what branch you're on
git status
git status && git branch
//check branch status OR
use helpful one-liner
git checkout main //switch to main branch for updates
git pull origin main //pull all latest updates from main
git checkout your-branch-name //switch to your branch
git merge main //merge latest changes from main into your branch
Edit files, run scripts, etc.
git add . //stage changes
git commit -m "Add commit message" //commit with message
git push origin your-branch-name //push to your branch

If git merge main shows conflicts

# Resolve conflicts in your editor, then:
git add .
git commit -m "Merge main into my branch"
git push origin your-branch-name

Pushing to Main via Pull Request

Command Meaning
Complete your work on your branch Make sure all changes are committed and pushed
Go to GitHub Navigate to repo
Click "Pull Requests" → "New Pull Request" Start the PR process
Select: base: main ← compare: your-branch-name Set up the merge
Add PR title & description Explain what you changed
Request reviews from teammates Get code review
Address review comments Make requested changes
Merge the pull request Squash & merge recommended

Git Commands During PR Process:

Command Meaning
git checkout your-branch-name // switch to your branch
git fetch origin // Get latest remote changes
git merge origin/main // Update your branch with latest main
git push origin your-branch-name // push updates after addressing review comments

Complete PR Workflow Example:

# 1. Make sure your branch is up to date and ready
git checkout your-branch-name
git fetch origin
git merge origin/main
git push origin your-branch-name

# 2. Go to GitHub and create PR
# - Base: main
# - Compare: your-branch-name
# - Title: "feat: add book normalization script"
# - Description: "Implements 3NF normalization for books data..."

# 3. If teammates request changes:
git checkout your-branch-name
# ... make the requested changes ...
git add .
git commit -m "fix: address PR review comments"
git push your-branch-name
# The PR automatically updates

# 4. After approval, merge via GitHub UI
# Use "Squash and merge" to keep history clean

Pushing to Main

Only do this if you're CERTAIN it won't mess shit up <3

Command Meaning
git status && git branch //check branch status & which branch you're on
git checkout main //switch to main branch
git pull origin main //pull all latest changes from main
Edit files, run scripts, etc.
git add . //stage changes
git commit -m "Add commit message" //commit changes with message
git push origin main //push to remote main branch

About

This SQL programming project involves the creation of a database host application that interfaces with a backend SQL database implementing a Library Management System. Users of the system are understood to be librarians (not book borrowers).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5