All mock tests are FREE till 31 December — register to save your progress
UGC NET · PAPER 2

UGC NET Paper 2 Computer Science – Unit 4: Database Management Systems PYQ (December 2022 Shift 1)

12 questions · answer key at the end · updated 11 Oct 2026
Q13. A ______ operation combines the rows of two relations and outputs a new relation that has both input relations' rows in it.
  1. difference
  2. union
  3. cartesian product
  4. project
Answer & explanation →
Q14. Consider the relation R(P, Q, R, S, T, U, V, W, X, Y) and FDs: {P, Q, S} → T, R → Y, {P, Q} → V, {R, X} → X, Q → U, V → {W, X}. Which of the following is a candidate key?
  1. {P, Q, R, S}
  2. {R, Q, X}
  3. {V, X}
  4. None of the above
Answer & explanation →
Q49. Let T1 be a transaction that transfers Rs. 50 from account A to account B: 1 Read(A); 2 A := A − 50; 3 Write(A); 4 Read(B); 5 B := B + 50; 6 Write(B). What is the status of the database just after the 3rd step but before the 5th step?
  1. Always consistent
  2. May be temporarily inconsistent
  3. Must abort
  4. Always roll back
Answer & explanation →
Q50. Consider Student(stuid, dept, clsroll) with FD1: stuid → dept, FD2: dept → stuid, FD3: stuid → clsroll, FD4: clsroll → stuid, FD5: dept → clsroll. Which functional dependencies can be removed to obtain a canonical cover?
A. FD2 and FD3
B. FD1 and FD5
C. FD5
D. FD1
Choose the correct answer from the options given below:
  1. A, B only
  2. A, C only
  3. B, C only
  4. A, B, C only
Answer & explanation →
Q69. Match List I with List II
List IList II
A. Timestamp protocolI. As long as the transaction is running, it obtains the required locks in the first phase.
B. Strict two-phase locking protocolII. Indicates the final lock of the schedule.
C. Two-phase lockingIII. Ensures freedom from deadlock.
D. Lock point in two-phase locking protocolIV. Ensures cascadeless rollback.
  1. A-III, B-IV, C-II, D-I
  2. A-III, B-IV, C-I, D-II
  3. A-IV, B-III, C-II, D-I
  4. A-IV, B-II, C-I, D-III
Answer & explanation →
Q79. Consider the schedule S (operations at successive timestamps t1–t6):
t1: T2 R(X), T3 R(Y)
t2: T2 W(X), T3 W(Y)
t3: T1 R(Y), T4 R(X)
t4: T1 W(Y), T4 W(X)
t5: T3 R(X)
t6: T3 W(X)
Choose the correct (conflict-equivalent) serial execution order for the schedule S.
  1. T3 − T2 − T1 − T4
  2. T2 − T3 − T1 − T4
  3. T2 − T4 − T3 − T1
  4. T4 − T2 − T3 − T1
Answer & explanation →
Q87. Statement I: Any retrieval request that can be specified in basic relational algebra can also be specified in relational calculus.
Statement II: Any retrieval request that can be specified in relational calculus can also be specified in basic relational algebra.
  1. Both Statement I and Statement II are true.
  2. Both Statement I and Statement II are false.
  3. Statement I is true but Statement II is false.
  4. Statement I is false but Statement II is true.
Answer & explanation →

Directions (Q96–100): Use the following schema of an academic institution's relational database:

student (rollno, name, degree, year, sex, deptno, advisor)
department (deptid, name, hod, phone)
professor (empid, name, sex, startyear, deptno, phone)
course (courseid, cname, credits, deptno)
enrollment (rollno, courseid, sem, year, grade)
teaching (empid, courseid, sem, year, classroom)
prerequisite (precourseid, courseid)

deptno in student, professor and course refers to department.deptid; advisor (student) and hod (department) refer to professor.empid; rollno in enrollment refers to student; courseid in enrollment and teaching refers to course; empid in teaching refers to professor; precourseid and courseid in prerequisite refer to course.

Q96. Which of the following queries would retrieve the roll numbers and names of students who have enrolled in ALL the prerequisite courses of course number 324?
  1. SELECT s.rollno, s.name FROM student s, enrollment e
    WHERE e.rollno = s.rollno AND e.courseid = ANY
      (SELECT precourseid FROM prerequisite p WHERE p.courseid = '324')
  2. SELECT s.rollno, s.name FROM student s, enrollment e
    WHERE e.rollno = s.rollno AND e.courseid = ALL
      (SELECT precourseid FROM prerequisite p WHERE p.courseid = '324')
  3. SELECT s.rollno, s.name FROM student s
    WHERE NOT EXISTS (SELECT * FROM prerequisite p
      WHERE p.courseid = '324' AND NOT EXISTS
        (SELECT * FROM enrollment e
         WHERE e.courseid = p.precourseid AND e.rollno = s.rollno))
  4. SELECT s.rollno, s.name FROM student s
    WHERE EXISTS (SELECT * FROM prerequisite p
      WHERE p.courseid = '324' AND EXISTS
        (SELECT * FROM enrollment e
         WHERE e.courseid = p.precourseid AND e.rollno = s.rollno))
Answer & explanation →
Q97. Given the query
SELECT s.rollno FROM student s WHERE s.sex = ALL (SELECT f.sex FROM professor f WHERE f.empid = s.advisor);
which retrieves students whose gender is the same as their advisor's. Consider:
S1. It has a correlated subquery.
S2. It has an uncorrelated subquery.
S3. If we replace ALL by ANY, the result will be different.
S4. If we replace ALL by ANY, the result will be the same.
Identify the TRUE statements:
  1. S1 and S3 are true
  2. S1 and S4 are true
  3. S2 and S3 are true
  4. S2 and S4 are true
Answer & explanation →
Q98. Which of the following queries computes, for each department, the total credits of all the courses offered by the department?
  1. SELECT deptid, name, SUM(credits) AS totalcredits
    FROM department, course WHERE deptid = deptno
    GROUP BY deptid, name;
  2. SELECT deptid, name, COUNT(credits) AS totalcredits
    FROM department, course WHERE deptid = deptno
    GROUP BY deptid, name;
  3. SELECT deptid, name, SUM(credits) AS totalcredits
    FROM department, course;
  4. SELECT deptid, name, SUM(credits) AS totalcredits
    FROM department, course
    GROUP BY deptid, name HAVING deptid = deptno;
Answer & explanation →
Q99. Which of the following queries retrieves the deptid and name of all departments whose total credits of offered courses is strictly greater than 40?
  1. SELECT deptid, name, SUM(credits) AS totalcredits
    FROM department, course WHERE totalcredits > 40
    GROUP BY deptid, name HAVING deptid = deptno;
  2. SELECT deptid, name, SUM(credits) AS totalcredits
    FROM department, course
    WHERE deptid = deptno AND totalcredits > 40
    GROUP BY deptid, name;
  3. SELECT deptid, name, SUM(credits) AS totalcredits
    FROM department, course
    GROUP BY deptid, name
    HAVING deptid = deptno AND totalcredits > 40;
  4. SELECT deptid, name, SUM(credits) AS totalcredits
    FROM department, course WHERE deptid = deptno
    GROUP BY deptid, name
    HAVING totalcredits > 40;
Answer & explanation →
Q100. Given the query
SELECT s.rollno, s.name FROM student s WHERE EXISTS (SELECT c.courseid FROM course c WHERE c.deptno = 5 AND EXISTS (SELECT e.* FROM enrollment e WHERE e.courseid = c.courseid AND e.rollno = s.rollno));
which statement is correct?
  1. It retrieves students who have not enrolled in all courses offered by department 5.
  2. It retrieves students who have enrolled in all courses offered by department 5.
  3. It retrieves students who have enrolled in at least one course offered by department 5.
  4. It retrieves students for whom there exists at least one course of department 5 that they have not enrolled in.
Answer & explanation →

Answer key

  1. 13 – B
  2. 14 – A
  3. 49 – B
  4. 50 – B
  5. 69 – B
  6. 79 – C
  7. 87 – A
  8. 96 – C
  9. 97 – A
  10. 98 – A
  11. 99 – D
  12. 100 – C