Completed
Incomplete
Not Attended
Completed
Incomplete
Not Attended
Galactic University is a futuristic institution where students explore diverse
programs across multiple disciplines. Each student has a unique student ID, and each course
has a unique course code. The university administration wants to ensure data integrity by
enforcing constraints: students can only enroll in valid courses, the total credits per course are
monitored, and duplicate enrollments are prevented. Your role is to create and manage SQL
tables with primary keys, foreign keys, and check constraints to maintain accurate course
registration records and uphold academic policies.
Insert a new student while ensuring the email remains unique and display the inserted row
Insert a new course ensuring the number of credits is between 1 and 5 and display the inserted row
Enroll student 'Isha' into 'Operating Systems' ensuring foreign key validation and display the inserted row
| student_id | student_name | |
|---|---|---|
| 1 | Kabir | [email protected] |
| 2 | Nisha | [email protected] |
| 3 | Rohan | [email protected] |
| 4 | Isha | [email protected] |
| 5 | Arjun | [email protected] |
| course_id | course_name | credits |
|---|---|---|
| 101 | Database Systems | 3 |
| 102 | Algorithms | 4 |
| 103 | Operating Systems | 4 |
| 104 | Computer Networks | 3 |
| 105 | Web Development | 2 |
