Relational course registration database built in SQL Server demonstrating primary keys, foreign keys, many-to-many relationships, and data integrity constraints.
This database models a university-style course registration system.
It includes:
- Students
- Teachers
- Courses
- Enrollments (junction table)
- Grade tracking
The design enforces data integrity using:
- Primary Keys
- Foreign Keys
- CHECK constraints
- Composite Primary Keys
- NOT NULL constraints
- One Teacher β Many Courses
- One Student β Many Enrollments
- One Course β Many Enrollments
- Students and Courses form a Many-to-Many relationship through the
Enrollmentstable
Grades are stored in the Enrollments table because they belong to a student's participation in a specific course.
- Open VS Code with MSSQL extension
- Connect to local server
- Run
StudentDBStructure.sql- creates the database and all the tables
- Run
SampleData.sql- inserts in sample data for testing
- Run
TestQueries.sql- runs a test of queries to indicate how to retrieve certain data, read comments for details
- Microsoft SQL Server 2025 Development Edition
- Microsoft SQL Server Management Studio
- VS Code (MSSQL Extension)