All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 04

Database Management Systems – Previous Year Questions

218 questions from past UGC NET Paper 2 – Computer Science papers, each with the correct answer. Open any question for its explanation.

  1. 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?
    Answer: A. {P, Q, R, S} Paper 2 CS · December 2022 Shift 1
  2. 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 befor…
    Answer: B. May be temporarily inconsistent Paper 2 CS · December 2022 Shift 1
  3. 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…
    Answer: B. A, C only Paper 2 CS · December 2022 Shift 1
  4. Match List I with List IIList I List II A. Timestamp protocol I. As long as the transaction is running, it obtains the required locks in the first phase. B. Strict two-phase locking protocol II. Indicates the final lock…
    Answer: B. A-III, B-IV, C-I, D-II Paper 2 CS · December 2022 Shift 1
  5. 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) s…
    Answer: C. T2 − T4 − T3 − T1 Paper 2 CS · December 2022 Shift 1
  6. 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 als…
    Answer: A. Both Statement I and Statement II are true. Paper 2 CS · December 2022 Shift 1
  7. 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?
    Answer: C. SELECT s.rollno, s.name FROM student s WHERE NOT EXISTS (SELECT * FROM prerequi… Paper 2 CS · December 2022 Shift 1
  8. 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 co…
    Answer: A. S1 and S3 are true Paper 2 CS · December 2022 Shift 1
  9. Which of the following queries computes, for each department, the total credits of all the courses offered by the department?
    Answer: A. SELECT deptid, name, SUM(credits) AS totalcredits FROM department, course WHERE… Paper 2 CS · December 2022 Shift 1
  10. Which of the following queries retrieves the deptid and name of all departments whose total credits of offered courses is strictly greater than 40?
    Answer: D. SELECT deptid, name, SUM(credits) AS totalcredits FROM department, course WHERE… Paper 2 CS · December 2022 Shift 1
  11. 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)); w…
    Answer: C. It retrieves students who have enrolled in at least one course offered by depar… Paper 2 CS · December 2022 Shift 1
  12. Identify the incorrect statement.
    Answer: B. A candidate key for which no proper subset is also a candidate key is called a… Paper 2 CS · December 2022 Shift 2
  13. Consider the two relations below (primary keys: EMP.eid and DEPT.did). Identify all possible foreign key(s) based only on the two relations. EMP (eid, ename, did) DEPT (did, dname)
    Answer: B. did Paper 2 CS · December 2022 Shift 2
  14. Which of the following statements is correct according to the following instance of the relational schema R(X, Y, Z)?X Y Z 1 1 a 1 1 a 2 1 b 3 2 b
    Answer: C. X → Y, X → Z Paper 2 CS · December 2022 Shift 2
  15. What are the drawbacks of using file systems to store data? 1. Data inconsistency 2. Difficulty in accessing data 3. Data isolation 4. Atomicity of updates Choose the correct answer from the options given below:
    Answer: D. 1, 2, 3, 4 Paper 2 CS · December 2022 Shift 2
  16. In which of the following database models do we have a parent-child relationship? 1. Hierarchical databases 2. Network databases 3. Relational databases Choose the correct answer from the options given below:
    Answer: A. 1, 2 Paper 2 CS · December 2022 Shift 2
  17. Identify the correct operation that produces the given output from the two relations R1 and R2.R1 Name Class a1 9 b1 5 c1 6 d1 11 R2 Name Class b1 5 f1 8 Output Name Class b1 5
    Answer: A. R1 ∩ R2 Paper 2 CS · December 2022 Shift 2
  18. Match List I with List II. Choose the correct answer from the options given below:List I List II a. Apache Kafka I. Platform for constructing data flows for extract, transform and load (ETL) processing and analysis of l…
    Answer: C. a-III, b-I, c-IV, d-II Paper 2 CS · December 2022 Shift 2
  19. Select the correct order of the DBSCAN algorithm. I. Recursively find all density-connected points and assign them to the same cluster as the core point. II. Find all neighbour points within eps and identify the core po…
    Answer: C. II, IV, I, III Paper 2 CS · December 2022 Shift 2
  20. Which relational algebra query computes the sids of sailors with age over 20 who have not reserved a red boat?
    Answer: A. πsid(σage>20 Sailors) − πsid((σcolor='red' Boats) ⋈ Reserves ⋈ Sailors) Paper 2 CS · September 2022
  21. Which query/queries compute the names of sailors who have reserved a red boat? Q1: πsname((σcolor='red' Boats) ⋈ Reserves ⋈ Sailors) Q2: πsname(πsid((πbid σcolor='red' Boats) ⋈ Reserves) ⋈ Sailors) Q3: πsname((σcolor='r…
    Answer: A. Both Q1 and Q2 Paper 2 CS · September 2022
  22. Which query/queries compute the names of sailors who have reserved boat 103? Q1: πsname((σbid=103 Boats) ⋈ Sailors) Q2: πsname(σbid=103(Reserves ⋈ Sailors)) Q3: πsname((σbid=103 Reserves) ⋈ Sailors)
    Answer: B. Both Q2 and Q3 Paper 2 CS · September 2022
  23. Which query computes the names of sailors who have reserved all boats?
    Answer: B. ρ(Tempsids, (πsid, bid Reserves) ÷ (πbid Boats)); πsname(Tempsids ⋈ Sailors) Paper 2 CS · September 2022
  24. Which query computes the names of sailors who have reserved a red and a green boat?
    Answer: A. ρ(Tempred, πsid((σcolor='red' Boats) ⋈ Reserves)); ρ(Tempgreen, πsid((σcolor='g… Paper 2 CS · September 2022
  25. Let R(ABCDEFGH) be a relation schema and F = {A → B, ABCD → E, EF → G, EF → H, ACDF → EG} the set of dependencies. The minimal cover of F is
    Answer: A. A → B, ACD → E, EF → G, EF → H Paper 2 CS · September 2022
  26. A trigger is
    Answer: D. a statement that is executed automatically by the system as a side effect of a… Paper 2 CS · September 2022
  27. In reference to Big Data, consider the following databases: (A) Memcached (B) CouchDB (C) InfiniteGraph Choose the most appropriate answer from the options given below:
    Answer: D. (A), (B) and (C) Paper 2 CS · September 2022
  28. Match List I with List II. Choose the correct answer from the options given below:List I List II A. BCNF I. It removes multivalued dependency. B. 3NF II. It is not always dependency preserving. C. 2NF III. It removes tr…
    Answer: C. A-II, B-III, C-IV, D-I Paper 2 CS · September 2022
  29. Consider the following statements: Statement I: Conservative 2PL is a deadlock-free protocol. Statement II: Thomas's write rule enforces conflict serializability. Statement III: The timestamp ordering protocol ensures s…
    Answer: B. Statements I and III true, Statement II false Paper 2 CS · September 2022
  30. Consider the following statements: Statement I: Composite attributes cannot be divided into smaller subparts. Statement II: A complex attribute is formed by nesting composite attributes and multivalued attributes in an…
    Answer: D. Statement I false and Statements II, III true Paper 2 CS · September 2022