Skip to content

Instantly share code, notes, and snippets.

University System Database

1) Creating Database

CREATE DATABASE university_system 

2)Designing tables which table we should:

  • Departments
  • Faculties
  • Professors
  • Courses
@Tealod
Tealod / gist:9c8b1f77e98f0e0bf26a20f17c059582
Last active October 30, 2025 06:51
What this query do?
-- SQL : Retrieve all students with their enrolled courses
-- and enrollment dates.
-- Tables used:
-- 1. student (id, name, …)
-- 2. course (id, name, …)
-- 3. enrolment (student_id, course_id, enrollmentDate)
--
-- Joins explained:
-- - student s JOIN enrolment e: matches each student with their enrollments