Skip to main content

Database Schema

Overview​

Smart Academic Hub uses MySQL 8.0+ with a normalized relational database schema.

Core Tables​

Users​

Central authentication table for all user types.

Academies​

Multi-tenant isolation at the academy level.

Students​

Student information linked to academies.

Parents​

Parent/guardian information with student relationships.

Staff​

Staff members including teachers and administrators.

Courses​

Course offerings within academies.

Batches​

Class groups or cohorts for students.

Enrollments​

Student enrollment in courses and batches.

Relationships​

  • One Academy has many Students, Staff, Courses, and Batches
  • One Student belongs to one Academy
  • Students have many-to-many relationship with Parents
  • Courses belong to Academies
  • Enrollments link Students to Courses

Indexes​

Strategic indexes for performance:

  • Foreign keys
  • Frequently queried fields
  • Composite indexes for multi-column queries

Migrations​

Database migrations are version-controlled and located in database/migrations/.

Run migrations:

php artisan migrate

Seeders​

Seed development data:

php artisan db:seed