50% found this document useful (2 votes)
2K views3 pages

Dbms Lab 1 Questions-1

The document describes a relational schema for a student enrollment database with tables for students, branches, departments, courses, course enrollments. It includes check constraints for gender and admission date fields in the student table and grade values in the enrollment table. Relationships between the tables are described, with branches offered by single departments, courses offered by single departments, and students enrolling in courses by semester. The document poses 5 questions about writing SQL queries on the schema, such as listing departments offering more than 3 branches or courses, courses common to more than 3 branches, and students getting an 'S' grade in more than 2 courses.

Uploaded by

Sahil Husain
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
50% found this document useful (2 votes)
2K views3 pages

Dbms Lab 1 Questions-1

The document describes a relational schema for a student enrollment database with tables for students, branches, departments, courses, course enrollments. It includes check constraints for gender and admission date fields in the student table and grade values in the enrollment table. Relationships between the tables are described, with branches offered by single departments, courses offered by single departments, and students enrolling in courses by semester. The document poses 5 questions about writing SQL queries on the schema, such as listing departments offering more than 3 branches or courses, courses common to more than 3 branches, and students getting an 'S' grade in more than 2 courses.

Uploaded by

Sahil Husain
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/ 3

Q1: Consider the following relational schema for the Office of the

Controller of Examinations Application.

Student (Rollno, Name, Dob, Gender, Doa, Bcode);


Implement a check constraint for

 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,

SESS can take values ‘APRIL 2013’, ‘NOV 2013’

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.

You might also like