A comprehensive database design and implementation project for a Large Language Model (LLM) management platform. This project demonstrates enterprise-level database architecture, SQL programming, and data modeling skills.
This project implements a complete database system for managing:
- Users & Departments: Multi-user organization management
- AI Projects: Project tracking and team collaboration
- ML Models: Model lifecycle and version management
- Datasets: Training and validation data management
- Deployments: Production environment tracking
- Sessions & Logs: User activity and system auditing
- Prompt Templates: Reusable AI prompt library
- β 10 interconnected tables with proper referential integrity
- β 6,118 test records across all tables
- β 43 validation queries testing all relationships
- β Complete documentation with execution guides
- β Automated testing with comprehensive error handling
DEPARTMENT (10 records)
β manages
USER (150 records) β supervises each other
β creates
PROJECT (100 records)
β uses
MODEL (22 records)
β configured via
MODEL_CONFIG (132 records)
β trained on
DATASET (30 records)
β deployed to
DEPLOYMENTS (44 records)
β generates
SESSIONS (650 records)
β logs
SESSION_LOGS (4,860 records)
β references
PROMPT_TEMPLATE (120 records)
| Table | Records | Purpose |
|---|---|---|
| DEPARTMENT | 10 | Organization structure |
| USER | 150 | System users |
| PROJECT | 100 | AI/ML projects |
| MODEL | 22 | ML model registry |
| MODEL_CONFIG | 132 | Model configurations |
| DATASET | 30 | Training datasets |
| DEPLOYMENTS | 44 | Production deployments |
| PROMPT_TEMPLATE | 120 | AI prompt templates |
| SESSIONS | 650 | User sessions |
| SESSION_LOGS | 4,860 | Activity logs |
| TOTAL | 6,118 |
- Oracle Database 19c or later
- SQL*Plus or SQL Developer
- User account with CREATE TABLE, INSERT, SELECT privileges
-
Clone the repository
git clone https://github.com/softkleenex/llm-database-project.git cd llm-database-project -
Connect to Oracle
sqlplus your_username/your_password@your_database
-
Run the automated setup
@run_all.sql
That's it! The script will:
- Create all 10 tables
- Insert 6,118 test records
- Run 43 validation queries
- Generate a log file with results
If you prefer step-by-step execution:
-- 1. Create tables
@0_create_table.sql
-- 2. Insert data (in order)
@1_insert_department.sql
@2_insert_user.sql
@3_insert_project.sql
@4_insert_model.sql
@5_insert_model_config.sql
@6_insert_dataset.sql
@7_insert_deployments.sql
@8_insert_prompt_template.sql
@9_insert_sessions.sql
@10_insert_session_logs.sql
-- 3. Run tests
@test_all_queries.sqldatabase-project/
βββ run_all.sql # β Automated setup script
βββ test_all_queries.sql # β Comprehensive test suite
β
βββ SQL Scripts/
β βββ 0_create_table.sql # Table definitions
β βββ 1_insert_department.sql # Department data
β βββ 2_insert_user.sql # User data
β βββ 3_insert_project.sql # Project data
β βββ 4_insert_model.sql # Model data
β βββ 5_insert_model_config.sql # Config data
β βββ 6_insert_dataset.sql # Dataset data
β βββ 7_insert_deployments.sql # Deployment data
β βββ 8_insert_prompt_template.sql # Template data
β βββ 9_insert_sessions.sql # Session data
β βββ 10_insert_session_logs.sql # Log data
β
βββ Documentation/
βββ README.md # β This file
βββ README_EXECUTION.md # Detailed execution guide
βββ TEST_SUMMARY.md # Test results summary
βββ FINAL_REPORT.md # Project final report
βββ EXECUTION_PLAN.md # Implementation plan
βββ ERROR_LOG.md # Known issues & solutions
βββ FINAL_CHECKLIST.md # Quality assurance
βββ ERD_SQL_MISMATCH_REPORT.md # Schema validation
βββ database_team_proj_erd.pdf # ER diagram
The project includes comprehensive testing:
@test_all_queries.sql- β Table creation and constraints
- β Foreign key relationships
- β Data insertion validation
- β Query performance (JOINs, aggregations)
- β Complex queries (nested, correlated)
- β Edge cases and error handling
-- Verify record counts
SELECT 'DEPARTMENT' as table_name, COUNT(*) as records FROM DEPARTMENT
UNION ALL
SELECT 'USER', COUNT(*) FROM USER_ACCOUNT
-- ... (should match the table above)SELECT d.department_name, COUNT(u.user_id) as user_count
FROM DEPARTMENT d
LEFT JOIN USER_ACCOUNT u ON d.department_id = u.department_id
WHERE u.status = 'active'
GROUP BY d.department_name
ORDER BY user_count DESC;SELECT p.project_name, m.model_name, m.model_type,
COUNT(dep.deployment_id) as deployment_count
FROM PROJECT p
JOIN MODEL m ON p.project_id = m.project_id
LEFT JOIN DEPLOYMENTS dep ON m.model_id = dep.model_id
GROUP BY p.project_name, m.model_name, m.model_type
ORDER BY deployment_count DESC;SELECT u.username, u.full_name, COUNT(sl.log_id) as activity_count
FROM USER_ACCOUNT u
JOIN SESSIONS s ON u.user_id = s.user_id
JOIN SESSION_LOGS sl ON s.session_id = sl.session_id
WHERE s.session_date >= ADD_MONTHS(SYSDATE, -1)
GROUP BY u.username, u.full_name
ORDER BY activity_count DESC
FETCH FIRST 10 ROWS ONLY;- 3NF (Third Normal Form) compliance
- No transitive dependencies
- Minimal data redundancy
- Primary Keys: All tables
- Foreign Keys: 15+ relationships
- Check Constraints: Data validation
- NOT NULL: Critical fields
- UNIQUE: Usernames, emails
- Primary key indexes (automatic)
- Foreign key indexes (recommended)
- Suggested indexes for frequent queries
- Database: Oracle Database 19c
- Language: SQL (PL/SQL)
- Tools: SQL*Plus, SQL Developer
- Testing: Custom SQL test suite
- Documentation: Markdown, PDF
Detailed documentation is available in the following files:
- README_EXECUTION.md - Step-by-step execution guide with troubleshooting
- FINAL_REPORT.md - Complete project report with analysis
- TEST_SUMMARY.md - Test results and validation
- database_team_proj_erd.pdf - Visual ER diagram
This is an academic project for educational purposes. Feel free to:
- Fork the repository
- Experiment with the schema
- Add new queries
- Improve documentation
This project is available for educational and non-commercial use.
SoftKleenex
- GitHub: @softkleenex
- Project: LLM Database Platform
- Course: Database Systems (COMP322)
- Database Systems course instructors
- Oracle Database documentation
- Team members who contributed to the original design
β Star this repository if you find it helpful for learning database design!
π§ For questions or feedback, please open an issue on GitHub.