0% found this document useful (0 votes)
8 views

Assignment-V RK

The document describes a school database with tables for students, courses, and enrollments. It lists tasks to apply constraints like primary keys, foreign keys, checks and unique to the attributes of the tables.

Uploaded by

coolscools123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Assignment-V RK

The document describes a school database with tables for students, courses, and enrollments. It lists tasks to apply constraints like primary keys, foreign keys, checks and unique to the attributes of the tables.

Uploaded by

coolscools123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

School of Computer Science and Artificial Intelligence

Course: B.Tech Type: Core


Course Name: Database Management Systems Year: II
Semester: EVEN Branch: CS &AI

Entities: Consider the following relations:

 Students (StudentID, Name, Age, Department)

 Courses (CourseID, Title, Credits, Department)

 Enrollments (StudentID, CourseID, Grade)

Tasks:

1. Apply PRIMARY KEY constraint to the StudentID attribute in the Students relation.

2. Apply PRIMARY KEY constraint to the CourseID attribute in the Courses relation.

3. Apply FOREIGN KEY constraint to the Department attribute in the Students relation,
referencing the Department attribute in the Courses relation.

4. Apply FOREIGN KEY constraint to the StudentID attribute in the Enrollments relation,
referencing the StudentID attribute in the Students relation.

5. Apply FOREIGN KEY constraint to the CourseID attribute in the Enrollments relation,
referencing the CourseID attribute in the Courses relation.

6. Apply NOT NULL constraint to the Name attribute in the Students relation.

7. Apply CHECK constraint to the Age attribute in the Students relation to ensure it is greater
than or equal to 18.

8. Apply CHECK constraint to the Credits attribute in the Courses relation to ensure it is greater
than 0 and less than or equal to 5.

9. Apply CHECK constraint to the Grade attribute in the Enrollments relation to ensure it is one
of the values (A, B, C, D, F).

10. Apply Unique Constraint and Ensure that each student has a unique name in the Students
table.

You might also like