You are on page 1of 13

PROFESSOR(Prof_id, Prof_name, Email, Mobile, Specialty, Dept_id)

SCHOOL(SCode, Scl_name, Prof_id, Location)

DEPARTMENT(Dept_id, Dname, SCode, Prof_id)


COURSE(Crs_code, Crs_name, Description, Credits, Hours)

CLASS(Cls_code, Slot, Stime, Etime, Crs_code, Prof_id, Room_no, Sem_code, Day_of_week)

SEMESTER(Sem_code, Term, Year, Sdate, Edate)

STUDENT(Reg_no, Sname, Address, DoB, Email, Mobile, Dept_id, Prof_id)


ENROLL(Cls_code, Reg_no, Enroll_time, Grade)

STUDENT_VISA(Reg_no, Visa_status)

PROGRAMME(Prog_code, Prog_name, Prog_preamble, Scode, Dept_id)


FOREIGN KEY:
1. Create the above tables with the following integrity constraints assigning name to integrity constraint.
i) Prof_id must have exactly five characters and their email and mobile number are unique. The email
address must have @ as one of the characters and mobile number must have exactly ten characters.

ii) Use timestamp data type without fractional parts of seconds for start time and end time column of
class table.
iii) The Sem_code should start with either ‘Win’ or ‘Fall’ and Term column can assume only one of two
values {Winter, Fall}.

iv) Email and mobile column in student table should have same characteristics as those in professor
able.

v) The enroll_time in the enroll table should be of timestamp data type without fractional parts of
seconds.

vi) Use ‘on delete cascade’ or ‘on delete set null’ clause as requirements. Use deferrable constraint, if
required.
vii) Additional (innovative) integrity constraints, if any, may be specified by you.

(i) Display name, email address and address for those students who live in Katpadi area and whose name
has an l as the third character.

(ii) Display name, email address and address for those students who are not from Tamil Nadu.

(iii) Display name, email address and address of foreign students only.
(iv) List the name of professors along with their specialty who belong to School of Medicine.

(v) Display name of the school and name of professor who chairs the school.
(vi) List course code, course name and course description in alphabetic order of course code
(vii) Change the mobile number of a student interactively.

(viii) Remove enrollment information of a student from a particular course interactively. How would you
recover the data?
(ix) Create a duplicate of course table.

(x) Create a view for list of students (Reg_no, Sname) and the courses they have registered along with
name of professors teaching the course.

(xi) List the room number, slot, start time, end time and duration of every class held on Wednesdays in
descending order of room number.

(xii) Display the name and grade of a student in different courses underwent in fall semester 2017 – 18.

(xiii) Find out name of students who have taken Database Systems course as well as Operating Systems
course in fall semester 2016 – 17.
(xiv) Find out name of students who have taken Database Systems course but have not taken Operating
Systems course in winter semester 2017 – 18.

(xv) List the registration number and name of the students who have registered for maximum number of
credits in Winter 17-18 semester.

(xvi) List the name of the course and the number of students registered in each slot for course under
different faculty members.

(xvii) Find out the name of the students who have registered in all the courses being taught by Prof.
O’Brien in Winter 17-18.
(xviii) List the registration number of the students who registered in Database Systems course on
November 17, 2017
(xix) Write a query to display the grade of a student given his/her registration number and the course
name for Fall semester 17–18.
(xx) List the name of departments and the name professors who is in charge of the department.
(xxi) List the name of schools with students strength higher than 7000.
(xxii) List the name of the department(s) under school of medicine with student strength higher than the
average students of all the departments in the school.
(xxiii) Given the registration number of a student, display the total credits registered by him/her in
Winter 17–18.
(xxiv) Given the registration number of a student, display her/his grade in the course she/he registered
in Fall 17–18.
(xxv) Display the name of the courses that are not being offered in Winter 17–18.
(xxvi) Write necessary SQL statement to advance the start time and end time of every class by ten
minutes in Fall 18–19.
(xxvii) Write necessary SQL statement to advance the start date and end date of Fall 18–19 semester by
one week with respect to Fall semester of 17 – 18.
(xxviii) Find out the name list of students who had secured ‘S’ grade in at least 50% of the courses
cleared by her/him.
(xxix) Given the registration number of a student, find out his/her free slots.
(xxx) Find out the name list of students who have classes in the afternoon session only a specific day of
the week.
(xxxi) Add a column named ‘Duration’ (to indicate duration of a class) with appropriate data type to the
CLASS table and populate the column from values of start time and end time columns.
(xxxii) Add a column named ‘SemesterDuration’ (indicating duration of a semester) with appropriate
data type to the SEMESTER table and populate the column from values of start date and end date
columns.
(xxxiii) Find out the list of students who are undergoing MCA program.
(xxxiv) Display the name of programs and the name of school offering the program.
(xxxv) Display the name of the departments and the name of the program controlled by the department.

You might also like