This repository contains SQL scripts for a School Management System built in PostgreSQL.
It demonstrates table creation, relationships, views, procedures, and reporting queries.
A schema diagram is included for visual clarity.
- students — student records with admission details, phone, email, fee status
- teachers — teacher records with performance, age, rank, salary
- class_incharge — classes with assigned teachers
- student_class — enrollment mapping between students and classes
- teacher_subject — subjects assigned to teachers
- matric_marks — student marks with topper view
- student_fee — fee records linked to marks
- Automatic salary updates based on teacher rank and performance
- Procedures for easy student data entry (
NEW_STUDENT) - Rollup queries for teacher salary and performance reports
- Bonus calculations for excellent teachers (
INCHARGE_BONUSview) - Topper reports combining marks and fees (
TOPPERSview) - Comprehensive teacher reports (average, total, and count by rank/performance)
- Clone this repository.
- Run the SQL file (
school_management.sql) in pgAdmin orpsql. - Explore tables, views, and reports using the provided queries.
- Class Incharge Data: Teacher details with student counts per class
- Bonus Report: Salary + bonus calculations for teachers
- Topper Report: Student ranking by marks with fee details
- Teacher Reports: Salary averages, totals, and counts grouped by rank and performance
For questions or collaboration, reach out via GitHub.
