Course Project — Advanced Databases
This repository contains an Oracle PL/SQL implementation of a simple University Exam Management System.
It demonstrates core DB programming concepts: users/privileges, triggers, procedures, functions, cursors, and transaction control.
The system supports:
- Managing students, professors, courses, registrations, exams, and exam results
- Enforcing prerequisite-based registration eligibility
- Computing letter grades and pass/fail status automatically
- Generating course performance reports
- Writing audit logs for registration operations
- Issuing warnings and suspending students based on academic performance
- Demonstrating a blocking/waiting (lock) scenario for concurrency concepts
All logic is implemented in a single SQL script:
project.sql
Professors(id, name, department)Courses(id, name, professor_id, credit_hours, prerequisite_course_id)Students(id, name, academic_status, total_credits)Register(id, student_id, course_id)Exams(id, course_id, exam_date, exam_type)ExamResults(id, registration_id, score, grade, status)AuditTrail(id, table_name, operation, old_data, new_data, log_date)Warnings(id, student_id, warning_reason, warning_date)DBUserCreationLog(id, username, created_by, created_at)
✅ Tip: Add an ERD image here if you have it:
docs/erd.png
- Creates
MANAGER,USER1,USER2 - Grants minimum required privileges per task requirements
- Logs
CREATE USERoperations intoDBUserCreationLogusing a database trigger
- Trigger blocks registration if prerequisite course was not completed (passed).
BEFORE INSERTandBEFORE DELETEtriggers onRegisterwrite toAuditTrail.
- Function computes letter grade from numeric
score - Updates
ExamResults.gradeandExamResults.status
- Trigger prevents unauthorized grade updates.
- Procedure inserts a warning if a student fails 2+ courses.
- Procedure prints a report (students, results, pass/fail counts) via
DBMS_OUTPUT.
- PL/SQL block displays all exams for a given course (midterm/final).
- PL/SQL block updates multiple rows in one transaction with rollback on error.
- Procedure suspends students who received 3+ warnings and logs to
AuditTrail.
- Function calculates GPA using course credit hours + letter grades.
- Demonstrates lock contention and shows how to identify blocker/waiting sessions.
- Oracle Database (Local / XE / Cloud)
- SQL*Plus (recommended) or SQL Developer
-
Open SQL*Plus as SYSDBA:
sqlplus / as sysdba
-
Run the script:
@project.sql
⚠️ Note: The script usesconn ...commands (SQL*Plus style). If you are using SQL Developer, you may need to run sections manually or ensure connection switching is supported.
Enable output when running report procedures:
SET SERVEROUTPUT ON;-- Calculate & update grade for a specific ExamResults row:
SELECT FN_CALC_GRADE(1) AS grade FROM dual;
-- Issue warnings (students failing >= 2 courses):
EXEC PR_ISSUE_WARNINGS;
-- Generate course report:
EXEC PR_COURSE_PERFORMANCE_REPORT(101);
-- Suspend students with >= 3 warnings:
EXEC PR_SUSPEND_STUDENTS;
-- Calculate GPA:
SELECT FN_CALC_GPA(932230126) AS gpa FROM dual;Pick one and adjust:
- Option A: University Exam Management System (Oracle PL/SQL) — Advanced Databases course project.
- Option B: Oracle PL/SQL project: scheduling exams, eligibility checks, results, audit logs, and reports.
- Option C: Advanced Databases assignment: PL/SQL triggers, procedures, functions, cursors, transactions.
oracle • plsql • sql • triggers • stored-procedures • cursors • transactions • database • university • exam-management
- Replace the placeholder metadata (university / instructor / team).
- Add screenshots (optional): output of reports, log tables, etc.
For educational use. (Choose a license if your course allows it.)