Dbms Lab 1 Questions-1
Dbms Lab 1 Questions-1
Gender
Date of Admission
Branch (Bcode, Bname, Dno);
Department (Dno, Dname);
Course (Ccode, Cname, Credits, Dno);
Branch_Course (Bcode, Ccode, Semester);
Enrolls (Rollno, Ccode, Sess, Grade);
For Example,
Implement a check constraint for grade Value Set (‘S’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘U’ );
Students are admitted to Branches and they are offered by Departments. A
branch is offered by only one department.
Each branch has a set of Courses (Subjects). Each student must enroll during a
semester. Courses are offered by Departments. A course is offered only by one
department. If a student is unsuccessful in a course he/she must enroll for the
course during next session. A student has successfully completed a course if the
grade obtained by is from the list (A, B, C, D, and E).
A student is unsuccessful if he/she have grade ‘U’ in a course.
Primary Keys are underlined.
Questions
These are questions for assignemnt 1. The solution is available after the last
question.
Question (A)
Develop a SQL query to list details of Departments that offer more than 3
branches.
Question (B)
Develop a SQL query to list the details of Departments that offer more than 6
courses.
Question (C)
Develop a SQL query to list the details of courses that are common for more
than 3 branches.
Question (D)
Develop a SQL query to list students who got ‘S’ in more than 2 courses during
single enrollment.
Question (E)
Create a view that will keep track of the roll number, name and number of
courses, a student has completed successfully.