A relational database system for managing multiple food banks, their inventories, donors, recipients, and food distributions. Built as part of CMPE 172 — Enterprise Software at San José State University.
This project models a complete food bank management system using a relational database with 8 interconnected tables, 23 SQL queries (Basic → Intermediate → Advanced), and mathematical notation for relational algebra operations.
- Multi-location Management — Track and manage multiple food banks simultaneously
- Donor & Recipient Tracking — Full CRUD for donors, recipients, and food items
- Inventory Monitoring — Real-time stock levels per food bank with low-stock alerts
- Distribution Logging — Record food distributions from banks to recipients
- Inter-bank Transfers — Log inventory transfers between food banks
- Reporting — Total inventory per bank, most transferred items, top donors
- Relational Algebra — Mathematical notation for projection, selection, and join operations
┌──────────────┐ ┌──────────────┐ ┌──────────────────┐
│ Food_Bank │ │ Donor │ │ Food_Item │
├──────────────┤ ├──────────────┤ ├──────────────────┤
│ store_id (PK)│ │ donor_id (PK)│ │ item_id (PK) │
│ name │ │ name │ │ name │
│ address │ │ type │ │ category │
└──────┬───────┘ └──────────────┘ └────────┬─────────┘
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────────┐
│ Inventory_Entry │ │ Distribution │
├──────────────────┤ ├──────────────────────┤
│ food_bank (FK) │ │ distribution_id (PK) │
│ item (FK) │ │ food_bank (FK) │
│ quantity │ │ recipient (FK) │
└──────────────────┘ └──────────────────────┘
| Component | Technology |
|---|---|
| Database | MySQL |
| Application | Java |
| Queries | 23 SQL scripts (Basic, Intermediate, Advanced) |
| Modeling | ER Diagrams, Relational Algebra |
| File | Description |
|---|---|
BasicQ1FoodbankByName.sql |
List all food banks sorted alphabetically |
BasicQ2InventoryEntry.sql |
Count inventory entries per item |
BasicQ3NameWithS.sql |
Recipients whose name starts with "S" |
BasicQ4StaffNameAndPlace.sql |
Staff names and their food bank |
BasicQ5InventoryIDandName.sql |
Items with quantity < 100 |
| File | Description |
|---|---|
IntermediateQ1Donations.sql |
Food items with donor info and quantities |
IntermediateQ2RecipientsAndLocation.sql |
Recipients and their distributing bank |
IntermediateQ3ShelfLife.sql |
Items expiring within 6 months |
IntermediateQ4Staff&Roles.sql |
Staff, food bank, and role details |
IntermediateQ5LastDist.sql |
Most recent distribution per recipient |
| File | Description |
|---|---|
AdvancedQ1Top3Donors.sql |
Top 3 donors by distributed quantity |
AdvancedQ2HighestCanned.sql |
Bank with most canned goods distributed |
AdvancedQ3HigherThanAvg.sql |
Banks distributing above average |
AdvancedQ4Top5Highest.sql |
Top 5 banks by total distributed items |
AdvancedQ5MoreThanAvgRecieved.sql |
Recipients above average received items |
Relational algebra representations using projection (π), selection (σ), and join (⋈) operations.
- MySQL Workbench or any MySQL client
- Java JDK 11+
git clone https://github.com/amanimran786/FoodBankInventorySystem.git
cd FoodBankInventorySystem- Open MySQL Workbench and connect to your server
- Run the
CREATE DATABASEscript - Run the insert scripts to populate tables
- Execute queries from Basic → Intermediate → Advanced
- Aman Imran — aman.imran@sjsu.edu | Portfolio
- Albert Van — albertvan755891@gmail.com
This project is open source and available for educational purposes.