Qus : 1
UGC NET Computer Science PYQ
2
What will be the ordering of typical steps when processing a high-level query?
A. Query optimizer
B. Runtime database processor
C. Scanning, parsing and validating
D. Query code generator
1
D, A, C, B 2
C, A, D, B 3
C, D, B, A 4
D, C, B, A Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ
Solution Typical DBMS query processing steps:
Scanning, parsing and validating → C
Query optimizer → A
Query code generator → D
Runtime database processor → B
Correct order:
C → A → D → B
Qus : 3
UGC NET Computer Science PYQ
2
In the context of concurrency control, a given pair of operations in a schedule is called conflict schedule if (A) At least one of the operations is write operation. (B) Both the operations are performed on the same data item. (C) Both the operations are performed by different transactions. (D) Both the operations are performed on different data items. Choose the correct answer from the options given below:
1
(A) and (B) only 2
A), (B) and (C) only 3
(A), (C) and (D) only 4
(C) and (D) only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ
Solution Two operations conflict if: They belong to different transactions. They operate on the same data item. At least one operation is write. So, statements A, B and C are true. Statement D is false because conflict needs same data item, not different data items.
Qus : 4
UGC NET Computer Science PYQ
4
Consider the following statements:
A. A database design is in BCNF if each member of the set of relation schemas that constitutes the design is in BCNF
B. A BCNF schema can have transitive dependency
C. It is always possible to obtain a 3NF design without sacrificing a lossless join
D. There are multivalued dependencies in 4NF
1
A, B and C only 2
B, C and D only 3
A, B and D only 4
A, C and D only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ
Solution A is correct because a database design is in BCNF when every relation schema in the design is in BCNF.
B is incorrect because BCNF removes dependency problems caused by non-super-key determinants.
C is correct because 3NF decomposition can be made lossless.
D is correct because 4NF deals with multivalued dependencies.
Qus : 5
UGC NET Computer Science PYQ
2
Let $R(A, B, C, D, E)$ be a relational schema with following functional dependencies:
$C \to F,\ E \to A,\ EC \to D,\ A \to B$
Which of the following is a key for R?
1
CD 2
EC 3
AE 4
AC Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ
Solution Find closure of $EC$:
$EC^+ = {E, C}$
Using $E \to A$,
$EC^+ = {E, C, A}$
Using $A \to B$,
$EC^+ = {E, C, A, B}$
Using $EC \to D$,
$EC^+ = {E, C, A, B, D}$
So, $EC$ determines all attributes.
Qus : 8
UGC NET Computer Science PYQ
3
Match List I with List II.
Choose the correct answer from the options given below:
1
A-II, B-IV, C-III, D-I 2
A-IV, B-I, C-II, D-III 3
A-II, B-I, C-IV, D-III 4
A-III, B-IV, C-I, D-II Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ
Solution In E-R diagram, double rectangle represents weak entity type. So, (A) matches with (II). Oval with underlined attribute represents key attribute type. So, (B) matches with (I). Double oval represents multivalue attribute type. So, (C) matches with (IV). Double line between entity and relationship represents total participation of entity in a relation. So, (D) matches with (III). Final matching is: A-II, B-I, C-IV, D-III
Qus : 10
UGC NET Computer Science PYQ
2
Which of the following has same expressive power with regard to relational query language?
$(a)$ Relational algebra and domain relational calculus
$(b)$ Relational algebra and tuple relational calculus
$(c)$ Relational algebra and domain relational calculus restricted to safe expression
$(d)$ Relational algebra and tuple relational calculus restricted to safe expression
1
$(a)$ and $(b)$ only 2
$(c)$ and $(d)$ only 3
$(a)$ and $(c)$ only 4
$(b)$ and $(d)$ only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ
Solution Relational algebra has the same expressive power as relational calculus only when relational calculus expressions are restricted to safe expressions.
Safe expressions ensure that the query result is finite and depends only on the database.
So,
Relational algebra is equivalent to domain relational calculus restricted to safe expressions.
Also,
Relational algebra is equivalent to tuple relational calculus restricted to safe expressions.
Therefore, $(c)$ and $(d)$ are correct.
Qus : 11
UGC NET Computer Science PYQ
2
With respect to relational algebra, which of the following operations are included for mathematical set theory?
$(a)$ Join
$(b)$ Intersection
$(c)$ Cartesian product
$(d)$ Project
1
$(a)$ and $(d)$ 2
$(b)$ and $(c)$ 3
Associations with multiplicities 4
$(b)$ and $(d)$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ
Solution In relational algebra, some operations are based on mathematical set theory.
Intersection is a set operation.
Cartesian product is also a set operation.
Join and project are relational algebra operations, but they are not basic mathematical set theory operations.
So, the operations included for mathematical set theory are:
$(b)$ Intersection
$(c)$ Cartesian product
Qus : 15
UGC NET Computer Science PYQ
1
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
Sid Sname Rating Age 22 Dustin 7 45.0 29 Brutus 1 33.0 31 Lubber 8 55.5 32 Andy 8 25.5 58 Rusty 10 35.5 64 Horatio 7 35.5 71 Zorba 10 16.0 74 Horatio 9 35.0 85 Art 3 25.5 95 Bob 3 63.5
Table 2: Reserves $R$
Sid Bid day 22 101 10/10/98 22 102 10/10/98 22 103 10/8/98 22 104 10/7/98 31 102 11/10/98 31 103 11/6/98 31 104 11/12/98 64 101 9/5/98 64 102 9/8/98 74 103 9/8/98
Table 3: Boats $B$
Bid Bname Color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red
Which of the following relational algebra query computes the Sid's of sailors with age over $20$ who have not reserved a red boat?
1
$\pi_{sid}(\sigma_{age>20}(Sailors))-\pi_{sid}((\sigma_{color='red'}(Boats))\bowtie Reserves\bowtie Sailors)$ 2
$\pi_{sid}((\sigma_{color='red'\land age=20}(Boats\bowtie Sailors\bowtie Reserves)))$ 3
$\pi_{sid}((\sigma_{age<20}(Sailors))-\pi_{sid}((\sigma_{color='red'}(Boats))\bowtie Reserves\bowtie Sailors))$ 4
$\pi_{sid}((\sigma_{age>20}(Sailors))\cap \pi_{sid}((\sigma_{color='red'}(Boats))\bowtie Reserves\bowtie Sailors))$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution We need sailors whose age is over $20$ and who have not reserved a red boat. First find sailors with age over $20$. From Sailors table: $\pi_{sid}(\sigma_{age>20}(Sailors))=\{22,29,31,32,58,64,74,85,95\}$ Now find red boats. From Boats table, red boats are: $Bid=102$ and $Bid=104$ Now find sailors who reserved red boats. From Reserves table: $Sid=22$ reserved $Bid=102$ and $Bid=104$ $Sid=31$ reserved $Bid=102$ and $Bid=104$ $Sid=64$ reserved $Bid=102$ So, $\pi_{sid}((\sigma_{color='red'}(Boats))\bowtie Reserves\bowtie Sailors)=\{22,31,64\}$ Now subtract sailors who reserved red boats from sailors whose age is over $20$. $\{22,29,31,32,58,64,74,85,95\}-\{22,31,64\}$ $=\{29,32,58,74,85,95\}$ So, the correct relational algebra expression must be: $\pi_{sid}(\sigma_{age>20}(Sailors))-\pi_{sid}((\sigma_{color='red'}(Boats))\bowtie Reserves\bowtie Sailors)$
Qus : 17
UGC NET Computer Science PYQ
1
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
Sid Sname Rating Age 22 Dustin 7 45.0 29 Brutus 1 33.0 31 Lubber 8 55.5 32 Andy 8 25.5 58 Rusty 10 35.5 64 Horatio 7 35.5 71 Zorba 10 16.0 74 Horatio 9 35.0 85 Art 3 25.5 95 Bob 3 63.5
Table 2: Reserves $R$
Sid Bid day 22 101 10/10/98 22 102 10/10/98 22 103 10/8/98 22 104 10/7/98 31 102 11/10/98 31 103 11/6/98 31 104 11/12/98 64 101 9/5/98 64 102 9/8/98 74 103 9/8/98
Table 3: Boats $B$
Bid Bname Color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red
Which of the following relational algebra query/queries computes/compute the names of sailors who have reserved a red boat?Q1 $\pi_{sname}((\sigma_{color='red'}(Boats))\bowtie Reserves\bowtie Sailors)$Q2 $\pi_{sname}((\pi_{sid}((\pi_{bid}(\sigma_{color='red'}(Boats)))\bowtie Reserves))\bowtie Sailors)$Q3 $\pi_{sname}((\sigma_{color='red'}(Reserves))\bowtie Boats\bowtie Sailors)$
1
Both Q1 and Q2 2
Both Q2 and Q3 3
Only Q1 4
Only Q2 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution We need the names of sailors who have reserved a red boat. First, we must identify red boats from the Boats table. Red boats are obtained by: $\sigma_{color='red'}(Boats)$ After this, we need to join these red boats with Reserves table, because Reserves table tells which sailor reserved which boat. Then we join with Sailors table to get sailor names. So, Q1 is correct: $\pi_{sname}((\sigma_{color='red'}(Boats))\bowtie Reserves\bowtie Sailors)$ Now check Q2. Q2 first finds red boat IDs: $\pi_{bid}(\sigma_{color='red'}(Boats))$ Then it joins with Reserves to find sailors who reserved those red boats. Then it projects $sid$ and joins with Sailors to get sailor names. So, Q2 is also correct. Now check Q3. Q3 applies condition $color='red'$ on Reserves. But Reserves table does not contain the attribute $color$. The $color$ attribute belongs to Boats table. So, Q3 is incorrect. Therefore, both Q1 and Q2 compute the required result.
Qus : 19
UGC NET Computer Science PYQ
2
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
Sid Sname Rating Age 22 Dustin 7 45.0 29 Brutus 1 33.0 31 Lubber 8 55.5 32 Andy 8 25.5 58 Rusty 10 35.5 64 Horatio 7 35.5 71 Zorba 10 16.0 74 Horatio 9 35.0 85 Art 3 25.5 95 Bob 3 63.5
Table 2: Reserves $R$
Sid Bid day 22 101 10/10/98 22 102 10/10/98 22 103 10/8/98 22 104 10/7/98 31 102 11/10/98 31 103 11/6/98 31 104 11/12/98 64 101 9/5/98 64 102 9/8/98 74 103 9/8/98
Table 3: Boats $B$
Bid Bname Color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red
Which of the following relational algebra query/queries computes/compute the name of sailors who have reserved boat $103$?Q1 $\pi_{sname}((\sigma_{bid=103}(Boats))\bowtie Sailors)$Q2 $\pi_{sname}((\sigma_{bid=103}(Reserves\bowtie Sailors)))$Q3 $\pi_{sname}((\sigma_{bid=103}(Reserves))\bowtie Sailors)$
1
Both Q1 and Q3 2
Both Q2 and Q3 3
Only Q3 4
Only Q2 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution We need the names of sailors who have reserved boat $103$. The information about reservation is available in the Reserves table. So, to find sailors who reserved boat $103$, first select those tuples from Reserves where $bid=103$. $\sigma_{bid=103}(Reserves)$ Then join this result with Sailors table using $sid$. Finally, project the sailor names using $\pi_{sname}$. So, Q3 is correct: $\pi_{sname}((\sigma_{bid=103}(Reserves))\bowtie Sailors)$ Now check Q2. In Q2, Reserves is first joined with Sailors. Then condition $bid=103$ is applied. After that, sailor names are projected. This also gives the same correct result. So, Q2 is also correct. Now check Q1. Q1 selects $bid=103$ from Boats and joins it directly with Sailors. But Boats table and Sailors table do not directly tell which sailor reserved which boat. The Reserves table is required for this relationship. So, Q1 is incorrect. Therefore, both Q2 and Q3 compute the required result.
Qus : 21
UGC NET Computer Science PYQ
2
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
Sid Sname Rating Age 22 Dustin 7 45.0 29 Brutus 1 33.0 31 Lubber 8 55.5 32 Andy 8 25.5 58 Rusty 10 35.5 64 Horatio 7 35.5 71 Zorba 10 16.0 74 Horatio 9 35.0 85 Art 3 25.5 95 Bob 3 63.5
Table 2: Reserves $R$
Sid Bid day 22 101 10/10/98 22 102 10/10/98 22 103 10/8/98 22 104 10/7/98 31 102 11/10/98 31 103 11/6/98 31 104 11/12/98 64 101 9/5/98 64 102 9/8/98 74 103 9/8/98
Table 3: Boats $B$
Bid Bname Color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red
Which of the following relational algebra query computes the names of sailor who have reserved all boats?
1
$\rho(Tempsids,((\pi_{bid}Reserves)/(\pi_{bid}Boats)))\ \pi_{sname}((Tempsids)\bowtie Sailors)$ 2
$\rho(Tempsids,((\pi_{sid,bid}Reserves)/(\pi_{bid}Boats)))\ \pi_{sname}((Tempsids)\bowtie Sailors)$ 3
$\rho(Tempsids,((\pi_{sid}Sailors)/(\pi_{bid}Boats)))\ \pi_{sname}((Tempsids)\bowtie Sailors)$ 4
$\rho(Tempsids,((\pi_{sid}Reserves)/(\pi_{bid}Boats)))\ \pi_{sname}((Tempsids)\bowtie Boats)$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution We need the names of sailors who have reserved all boats. In relational algebra, when we need to find entities related to all values of another relation, we use division operation. Here, $Reserves(Sid,Bid,day)$ tells which sailor reserved which boat. $Boats(Bid,Bname,Color)$ tells all available boats. First, take only required columns from Reserves: $\pi_{sid,bid}(Reserves)$ This gives pairs of sailors and boats reserved by them. Now take all boat IDs from Boats: $\pi_{bid}(Boats)$ To find sailors who reserved every boat, apply division: $(\pi_{sid,bid}(Reserves))/(\pi_{bid}(Boats))$ This gives only those $sid$ values which are associated with all $bid$ values. Now rename this result as $Tempsids$: $\rho(Tempsids,((\pi_{sid,bid}Reserves)/(\pi_{bid}Boats)))$ Finally, join $Tempsids$ with Sailors table to get sailor names: $\pi_{sname}((Tempsids)\bowtie Sailors)$ So, the correct query must use: $\pi_{sid,bid}Reserves$ and $\pi_{bid}Boats$ with division operation. Option (b) correctly represents this logic.
Qus : 22
UGC NET Computer Science PYQ
3
Which of the following features is supported in the relational database model?
1
Complex data-types 2
Multivalued attributes 3
Associations with multiplicities 4
Generalization relationships Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ
Solution In the relational database model, data is stored in the form of relations or tables.
Complex data-types are not directly supported in the basic relational model because values are generally atomic.
Multivalued attributes are also not directly stored in a single attribute; they are usually represented by creating another relation.
Generalization relationships are mainly part of the ER model or enhanced ER model.
But associations between entities can be represented using relations, primary keys and foreign keys. Multiplicity like one-to-one or one-to-many can also be represented using constraints.
Therefore, the supported feature is associations with multiplicities.
Qus : 23
UGC NET Computer Science PYQ
1
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
Sid Sname Rating Age 22 Dustin 7 45.0 29 Brutus 1 33.0 31 Lubber 8 55.5 32 Andy 8 25.5 58 Rusty 10 35.5 64 Horatio 7 35.5 71 Zorba 10 16.0 74 Horatio 9 35.0 85 Art 3 25.5 95 Bob 3 63.5
Table 2: Reserves $R$
Sid Bid day 22 101 10/10/98 22 102 10/10/98 22 103 10/8/98 22 104 10/7/98 31 102 11/10/98 31 103 11/6/98 31 104 11/12/98 64 101 9/5/98 64 102 9/8/98 74 103 9/8/98
Table 3: Boats $B$
Bid Bname Color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red
Which of the following relational algebra query computes the names of sailors who have reserved a red and a green boat?
1
$\rho(Tempred,\pi_{sid}((\sigma_{color='red'}(Boats))\bowtie Reserves))\ .\ \rho(Tempgreen,\pi_{sid}((\sigma_{color='green'}(Boats))\bowtie Reserves))\ .\ \pi_{sname}((Tempred\cap Tempgreen)\bowtie Sailors)$ 2
$\rho(Tempboats2,(\sigma_{color='red'}(Boats)\cap\sigma_{color='green'}(Boats)))\ \pi_{sname}(Tempboats2\bowtie Reserves)$ 3
$\pi_{sname}((\sigma_{color='red'}(Boats)\cap\sigma_{color='green'}(Boats))(Tempboats2\bowtie Sailors\bowtie Reserves))$ 4
$\rho(Tempboats2,(\sigma_{color='red'\land color='green'}(Boats)))\ \pi_{sname}(Tempboats2\bowtie Sailors)$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution We need the names of sailors who have reserved both types of boats: Red boat Green boat First, find sailors who reserved a red boat. Red boats are selected by: $\sigma_{color='red'}(Boats)$ Now join this with Reserves table, because Reserves table contains the information about which sailor reserved which boat. $\pi_{sid}((\sigma_{color='red'}(Boats))\bowtie Reserves)$ This gives the $sid$ of sailors who reserved a red boat. Rename this result as: $Tempred$ So, $Tempred=\pi_{sid}((\sigma_{color='red'}(Boats))\bowtie Reserves)$ Now, find sailors who reserved a green boat. Green boats are selected by: $\sigma_{color='green'}(Boats)$ Join with Reserves table and project $sid$: $\pi_{sid}((\sigma_{color='green'}(Boats))\bowtie Reserves)$ Rename this result as: $Tempgreen$ So, $Tempgreen=\pi_{sid}((\sigma_{color='green'}(Boats))\bowtie Reserves)$ Now, sailors who reserved both red and green boats will be obtained by intersection: $Tempred\cap Tempgreen$ This gives common $sid$ values. Finally, join this result with Sailors table to get sailor names: $\pi_{sname}((Tempred\cap Tempgreen)\bowtie Sailors)$ Therefore, option (a) correctly finds sailors who reserved both a red and a green boat.
Qus : 24
UGC NET Computer Science PYQ
2
The following table has two attributes Employee_id and Manager_id, where Employee_id is a primary key and Manager_id is a foreign key referencing Employee_id with on-delete cascade:
Employee_id
Manager_id
20
40
25
40
30
35
35
20
40
45
45
25
On deleting the tuple $(20,40)$, the set of other tuples that must be deleted to maintain the referential integrity of the table is:
1
$(30,35)$ only 2
$(30,35)$ and $(35,20)$ only 3
$(35,20)$ only 4
$(40,45)$ and $(25,40)$ only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ
Solution Deleting tuple $(20,40)$ means employee id $20$ is deleted.
Since $Manager_id$ is a foreign key referencing $Employee_id$ with on-delete cascade, all tuples having $Manager_id=20$ must also be deleted.
So, tuple $(35,20)$ must be deleted.
Now, deleting employee id $35$ will again affect tuples having $Manager_id=35$.
So, tuple $(30,35)$ must also be deleted.
No tuple has $Manager_id=30$, so the cascade stops here.
Therefore, the other tuples that must be deleted are
$(35,20)$ and $(30,35)$
Qus : 25
UGC NET Computer Science PYQ
3
Consider the following table structures related to a university for the below questions.
EMPLOYEE
NAME
VARCHAR(30)
NOT NULL
EID
VARCHAR(10)
NOT NULL
DEPTNO
INT(5)
NOT NULL
HODEID
VARCHAR(10)
SALARY
INT(10)
PRIMARY KEY (EID),
FOREIGN KEY (HODEID) REFERENCES EMPLOYEE (EID),
FOREIGN KEY (DEPTNO) REFERENCES DEPARTMENT (DID);
DEPARTMENT
DID
INT(5)
NOT NULL
DNAME
VARCHAR(30)
NOT NULL
HODID
VARCHAR(10)
NOT NULL
HODNAME
VARCHAR(30)
PRIMARY KEY (DID),
UNIQUE (DNAME),
FOREIGN KEY (HODID) REFERENCES EMPLOYEE (EID);
PROJECT WORK
EMPID
VARCHAR(10)
NOT NULL
PROJNO
INT(5)
NOT NULL
PROJECTLOC
VARCHAR(30)
NOT NULL
PRIMARY KEY (EMPID, PROJNO),
FOREIGN KEY (EMPID) REFERENCES EMPLOYEE (EID);
On the basis of above given table structures, retrieve the distinct employee ID $(EMPID)$ of all employees of university who are working on project No. $20$, $30$ and $40$.
1
SELECT EMPIDFROM PROJECTWORKWHERE PROJNO=(20,30,40); 2
SELECT EMPIDFROM PROJECTWORKWHERE PROJNO IN (20,30,40); 3
SELECT DISTINCT EMPIDFROM PROJECTWORKWHERE PROJNO IN (20,30,40); 4
SELECT DISTINCT EMPIDFROM PROJECTWORKWHERE PROJNO=20,30,40; Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ
Solution We need to retrieve distinct employee IDs. So, we must use: SELECT DISTINCT EMPID Now, the project number can be $20$, $30$ or $40$. For checking multiple possible values in SQL, we use IN operator. So, correct condition is: WHERE PROJNO IN (20,30,40) Therefore, correct SQL query is: SELECT DISTINCT EMPID FROM PROJECTWORK WHERE PROJNO IN (20,30,40); Option (A) is incorrect because PROJNO=(20,30,40) is not valid SQL syntax. Option (B) is incorrect because it does not use DISTINCT. Option (D) is incorrect because PROJNO=20,30,40 is not valid SQL syntax. Correct Answer: (C) SELECT DISTINCT EMPID FROM PROJECTWORK WHERE PROJNO IN (20,30,40);
Qus : 26
UGC NET Computer Science PYQ
3
Consider the following table structures related to a university for the below questions.
EMPLOYEE
NAME
VARCHAR(30)
NOT NULL
EID
VARCHAR(10)
NOT NULL
DEPTNO
INT(5)
NOT NULL
HODEID
VARCHAR(10)
SALARY
INT(10)
PRIMARY KEY (EID),
FOREIGN KEY (HODEID) REFERENCES EMPLOYEE (EID),
FOREIGN KEY (DEPTNO) REFERENCES DEPARTMENT (DID);
DEPARTMENT
DID
INT(5)
NOT NULL
DNAME
VARCHAR(30)
NOT NULL
HODID
VARCHAR(10)
NOT NULL
HODNAME
VARCHAR(30)
PRIMARY KEY (DID),
UNIQUE (DNAME),
FOREIGN KEY (HODID) REFERENCES EMPLOYEE (EID);
PROJECT WORK
EMPID
VARCHAR(10)
NOT NULL
PROJNO
INT(5)
NOT NULL
PROJECTLOC
VARCHAR(30)
NOT NULL
PRIMARY KEY (EMPID, PROJNO),
FOREIGN KEY (EMPID) REFERENCES EMPLOYEE (EID);
Given below are two statements to find the sum of salaries of all employees of the English department as well as the maximum, minimum and average salary in English department.
Statement I:
SELECT SUM(SALARY), MAX(SALARY), MIN(SALARY), AVG(SALARY)
FROM EMPLOYEE, DEPARTMENT
WHERE DEPTNO=DID
AND DNAME='ENGLISH';
Statement II:
SELECT SUM(SALARY), MAX(SALARY), MIN(SALARY), AVG(SALARY)
FROM EMPLOYEE, DEPARTMENT
WHERE DNAME='ENGLISH';
In the light of the above statements, choose the correct answer from the options given below:
1
Both Statement I and Statement II are true 2
Both Statement I and Statement II are false 3
Statement I is correct but Statement II is false 4
Statement I is incorrect but Statement II is true Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ
Solution We need to find salary details of employees who belong to the English department. For this, EMPLOYEE table and DEPARTMENT table must be joined. In Statement I: DEPTNO=DID This condition joins EMPLOYEE table with DEPARTMENT table. Also, DNAME='ENGLISH' filters only English department employees. So, Statement I is correct. In Statement II: Only condition is: DNAME='ENGLISH' There is no join condition between EMPLOYEE and DEPARTMENT. So, it will not correctly connect employees with their department. It may produce incorrect result due to Cartesian product. Therefore, Statement II is false.
Qus : 27
UGC NET Computer Science PYQ
3
Consider the following table structures related to a university for the below questions.
EMPLOYEE
NAME
VARCHAR(30)
NOT NULL
EID
VARCHAR(10)
NOT NULL
DEPTNO
INT(5)
NOT NULL
HODEID
VARCHAR(10)
SALARY
INT(10)
PRIMARY KEY (EID),
FOREIGN KEY (HODEID) REFERENCES EMPLOYEE (EID),
FOREIGN KEY (DEPTNO) REFERENCES DEPARTMENT (DID);
DEPARTMENT
DID
INT(5)
NOT NULL
DNAME
VARCHAR(30)
NOT NULL
HODID
VARCHAR(10)
NOT NULL
HODNAME
VARCHAR(30)
PRIMARY KEY (DID),
UNIQUE (DNAME),
FOREIGN KEY (HODID) REFERENCES EMPLOYEE (EID);
PROJECT WORK
EMPID
VARCHAR(10)
NOT NULL
PROJNO
INT(5)
NOT NULL
PROJECTLOC
VARCHAR(30)
NOT NULL
PRIMARY KEY (EMPID, PROJNO),
FOREIGN KEY (EMPID) REFERENCES EMPLOYEE (EID);
Which of the following query or queries return the employee ID and name of employees whose salary is greater than the salary of all employees in department number $20$ of university?
Order results by employee ID.
(A)
SELECT EID, NAME
FROM EMPLOYEE
WHERE SALARY > (SELECT SALARY FROM EMPLOYEE WHERE DEPTNO = 20)
ORDER BY EID;
(B)
SELECT EID, NAME
FROM EMPLOYEE
WHERE SALARY > (SELECT SALARY FROM EMPLOYEE WHERE DEPTNO = 20);
(C)
SELECT EID, NAME
FROM EMPLOYEE
WHERE SALARY > ALL (SELECT SALARY FROM EMPLOYEE WHERE DEPTNO = 20)
ORDER BY EID;
Choose the correct answer from the options given below:
1
(A) and (B) only 2
(A) and (C) only 3
(B) only 4
(C) only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ
Solution We need employees whose salary is greater than the salary of all employees in department number $20$. For comparing one value with all values returned by a subquery, we use: SALARY > ALL (subquery) So, the correct condition is: SALARY > ALL (SELECT SALARY FROM EMPLOYEE WHERE DEPTNO = 20) Also, the question asks to order results by employee ID. So, ORDER BY EID is also required. Option (A) is incorrect because the subquery may return more than one salary value. So, direct comparison using $>$ is not correct. Option (B) is incorrect because it also uses direct comparison with a subquery that may return multiple values, and it does not use ORDER BY EID. Option (C) is correct because it uses ALL and also orders the result by EID. Therefore, only query (C) is correct.
Qus : 28
UGC NET Computer Science PYQ
1
Consider the following table structures related to a university for the below questions.
EMPLOYEE
NAME
VARCHAR(30)
NOT NULL
EID
VARCHAR(10)
NOT NULL
DEPTNO
INT(5)
NOT NULL
HODEID
VARCHAR(10)
SALARY
INT(10)
PRIMARY KEY (EID),
FOREIGN KEY (HODEID) REFERENCES EMPLOYEE (EID),
FOREIGN KEY (DEPTNO) REFERENCES DEPARTMENT (DID);
DEPARTMENT
DID
INT(5)
NOT NULL
DNAME
VARCHAR(30)
NOT NULL
HODID
VARCHAR(10)
NOT NULL
HODNAME
VARCHAR(30)
PRIMARY KEY (DID),
UNIQUE (DNAME),
FOREIGN KEY (HODID) REFERENCES EMPLOYEE (EID);
PROJECT WORK
EMPID
VARCHAR(10)
NOT NULL
PROJNO
INT(5)
NOT NULL
PROJECTLOC
VARCHAR(30)
NOT NULL
PRIMARY KEY (EMPID, PROJNO),
FOREIGN KEY (EMPID) REFERENCES EMPLOYEE (EID);
In reference to the above given table structures, which of the following query or queries will drop the 'SALARY' column from 'EMPLOYEE' table?
(A)
ALTER TABLE EMPLOYEE DROP SALARY CASCADE;
(B)
ALTER TABLE EMPLOYEE DROP SALARY RESTRICT;
(C)
ALTER EMPLOYEE DROP SALARY;
Choose the correct answer from the options given below::
1
(A) and (B) only 2
(A) and (C) only 3
(B) and (C) only 4
(A) only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ
Solution To drop a column from a table, correct SQL syntax is: ALTER TABLE table_name DROP column_name; In Statement (A): ALTER TABLE EMPLOYEE DROP SALARY CASCADE; This query is valid because it uses ALTER TABLE and drops the SALARY column. CASCADE means if there are dependent objects, they may also be removed. So, Statement (A) is correct. In Statement (B): ALTER TABLE EMPLOYEE DROP SALARY RESTRICT; This query is also valid because it uses ALTER TABLE and drops the SALARY column. RESTRICT means the column will be dropped only if there is no dependent object. Here, SALARY is not used as a primary key or foreign key. So, Statement (B) is also correct. In Statement (C): ALTER EMPLOYEE DROP SALARY; This query is incorrect because the keyword TABLE is missing. Correct syntax should have ALTER TABLE, not only ALTER. So, Statement (C) is incorrect. Therefore, correct queries are (A) and (B) only.
Qus : 29
UGC NET Computer Science PYQ
2
Consider the following table structures related to a university for the below questions.
EMPLOYEE
NAME
VARCHAR(30)
NOT NULL
EID
VARCHAR(10)
NOT NULL
DEPTNO
INT(5)
NOT NULL
HODEID
VARCHAR(10)
SALARY
INT(10)
PRIMARY KEY (EID),
FOREIGN KEY (HODEID) REFERENCES EMPLOYEE (EID),
FOREIGN KEY (DEPTNO) REFERENCES DEPARTMENT (DID);
DEPARTMENT
DID
INT(5)
NOT NULL
DNAME
VARCHAR(30)
NOT NULL
HODID
VARCHAR(10)
NOT NULL
HODNAME
VARCHAR(30)
PRIMARY KEY (DID),
UNIQUE (DNAME),
FOREIGN KEY (HODID) REFERENCES EMPLOYEE (EID);
PROJECT WORK
EMPID
VARCHAR(10)
NOT NULL
PROJNO
INT(5)
NOT NULL
PROJECTLOC
VARCHAR(30)
NOT NULL
PRIMARY KEY (EMPID, PROJNO),
FOREIGN KEY (EMPID) REFERENCES EMPLOYEE (EID);
Refer table structures given above. The university decided to give all employees in the 'SCIENCE' department a $20\%$ rise in salary. Which of the following query or queries will compute the above results?
(A)
UPDATE EMPLOYEE
SET SALARY = SALARY * 1.20
WHERE DEPTNO IN (SELECT DID FROM DEPARTMENT WHERE DNAME='SCIENCE');
(B)
UPDATE TABLE EMPLOYEE
SET SALARY = SALARY * 1.20
WHERE DNAME='SCIENCE';
(C)
ALTER TABLE EMPLOYEE
SET SALARY = SALARY * 1.20
WHERE DEPTNO IN (SELECT DNAME FROM DEPARTMENT WHERE DNAME='SCIENCE');
Choose the correct answer from the options given below:
1
(A) and (B) only 2
(A) only 3
(B) and (C) only 4
(C) only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ
Solution We need to increase the salary of all employees who belong to the 'SCIENCE' department. The salary is stored in EMPLOYEE table. The department name is stored in DEPARTMENT table. So, first we need to find the DID of the 'SCIENCE' department. This can be done by: SELECT DID FROM DEPARTMENT WHERE DNAME='SCIENCE' Then update salary of employees whose DEPTNO matches that DID. So, correct query is: UPDATE EMPLOYEE SET SALARY = SALARY * 1.20 WHERE DEPTNO IN (SELECT DID FROM DEPARTMENT WHERE DNAME='SCIENCE'); Therefore, query (A) is correct. Query (B) is incorrect because UPDATE TABLE is not valid syntax. Also, DNAME is not present in EMPLOYEE table. Query (C) is incorrect because ALTER TABLE is used to change table structure, not to update data. Also, it compares DEPTNO with DNAME, which is wrong. Therefore, only query (A) is correct.
Qus : 30
UGC NET Computer Science PYQ
1
A company is implementing a new database system to manage its customer information. The database contains tables for customers, orders, products and sales representatives. Each customer can place multiple orders and each order can contain multiple products. Each order is associated with a specific sales representative who manages the customer account. The system keeps records of customers, their orders, the products included in each order, and the sales representatives responsible for handling the accounts. The database is designed to improve efficiency in tracking sales and customer interactions. Which SQL query retrieves the total number of distinct customers who have placed orders?
1
Select COUNT(DISTINCT customer_id) As total_customers From orders; 2
Select COUNT(*) As total_customers from customers; 3
Select COUNT(DISTINCT order_id) As total_customers from orders; 4
Select COUNT(DISTINCT customer_id) As total_customers from customers; Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ
Solution We need the number of distinct customers who placed orders, so we count unique customer_id from orders table.
Correct query:
Select COUNT(DISTINCT customer_id) As total_customers From orders;
Qus : 32
UGC NET Computer Science PYQ
2
A company is implementing a new database system to manage its customer information. The database contains tables for customers, orders, products and sales representatives. Each customer can place multiple orders and each order can contain multiple products. Each order is associated with a specific sales representative who manages the customer account. The system keeps records of customers, their orders, the products included in each order, and the sales representatives responsible for handling the accounts. The database is designed to improve efficiency in tracking sales and customer interactions. Based on the passage, which of the following statements is true?
1
Each customer can place only one order. 2
Each sales representative can manage multiple customer accounts. 3
Each order can be associated with only one product. 4
The database does not include a table for products. Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ
Solution From passage:
• customers can place multiple orders
• orders can contain multiple products
• representatives manage customer accounts
Thus correct statement:
Each sales representative can manage multiple customer accounts.
Qus : 33
UGC NET Computer Science PYQ
1
A company is implementing a new database system to manage its customer information. The database contains tables for customers, orders, products and sales representatives. Each customer can place multiple orders and each order can contain multiple products. Each order is associated with a specific sales representative who manages the customer account. The system keeps records of customers, their orders, the products included in each order, and the sales representatives responsible for handling the accounts. The database is designed to improve efficiency in tracking sales and customer interactions. Which SQL query retrieves the total number of orders placed by a specific customer?
1
Select COUNT(*) As total_orders
from orders where customer_id = [Customer_ID]; 2
Select COUNT(order_id) As total_orders
from orders where customer_id = [Customer_ID]; 3
Select COUNT(DISTINCT order_id) As total_orders
from orders where customer_id = [Customer_ID]; 4
Select SUM(order_id) As total_orders
from orders where customer_id = [Customer_ID]; Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ
Solution From passage:
• customers can place multiple orders
• orders can contain multiple products
• representatives manage customer accounts
Thus correct statement:
Each sales representative can manage multiple customer accounts.
Qus : 34
UGC NET Computer Science PYQ
2
A company is implementing a new database system to manage its customer information. The database contains tables for customers, orders, products and sales representatives. Each customer can place multiple orders and each order can contain multiple products. Each order is associated with a specific sales representative who manages the customer account. The system keeps records of customers, their orders, the products included in each order, and the sales representatives responsible for handling the accounts. The database is designed to improve efficiency in tracking sales and customer interactions. Which of the following best describes the relationship between the orders table and the customers table?
1
One-to-One 2
One-to-Many 3
Many-to-One 4
Many-to-Many Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ
Solution One customer can place multiple orders.
Thus relationship:
Customer → Orders
$1 : N$
Qus : 36
UGC NET Computer Science PYQ
3
Which of the following relations cannot be decomposed into BCNF with a lossless join and dependency-preserving decomposition?
R(V, W, X, Y, Z)
1
R(V, W, X, Y, Z) | VW→X, WX→V, VX→W, W→Y, Y→Z 2
R(V, W, X, Y) | VW→X, X→Y
3
R(V, W, X, Y) | VW→X, X→YV
4
R(V, W, X, Y, Z) | VW→X, X→Y, Y→Z, Z→V Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ
Solution BCNF condition:
For every functional dependency $X \rightarrow Y$, X must be a superkey.
Check option (3)
FDs:
$VW \rightarrow X$
$X \rightarrow YV$
Here:
$X$ determines $V$ and $Y$
Qus : 37
UGC NET Computer Science PYQ
1
Consider the relation
$R(P,Q,R,S,T,U,V,W,X,Y)$ and FDs:
${P,Q,S}\to T$
$R\to Y$
${P,Q}\to V$
${R,X}\to X$
$Q\to U$
$V\to {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 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Solution Find closure of ${P,Q,R,S}$.
${P,Q,S}\to T$
So, we get $T$.
$R\to Y$
So, we get $Y$.
${P,Q}\to V$
So, we get $V$.
$Q\to U$
So, we get $U$.
$V\to {W,X}$
So, we get $W$ and $X$.
Therefore,
$(P,Q,R,S)^+={P,Q,R,S,T,U,V,W,X,Y}$
It contains all attributes of the relation.
Qus : 38
UGC NET Computer Science PYQ
1
Let $R(ABCDEFGH)$ be a relation schema and $F$ be the set of dependencies $F=\{A\to B,\ ABCD\to E,\ EF\to G,\ EF\to H,\ ACDF\to EG\}$ The minimal cover of a set of functional dependencies is
1
$A\to B,\ ACD\to E,\ EF\to G,\ EF\to H$ 2
$A\to B,\ ACD\to E,\ EF\to G,\ EF\to H,\ ACDF\to G$ 3
$A\to B,\ ACD\to E,\ EF\to G,\ EF\to H,\ ACDF\to E$ 4
$A\to B,\ ABCD\to E,\ EF\to H,\ EF\to G$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution Given functional dependencies are: $A\to B$ $ABCD\to E$ $EF\to G$ $EF\to H$ $ACDF\to EG$ First, split the right hand side having multiple attributes. $ACDF\to EG$ becomes: $ACDF\to E$ $ACDF\to G$ So, the set becomes: $A\to B$ $ABCD\to E$ $EF\to G$ $EF\to H$ $ACDF\to E$ $ACDF\to G$ Now check $ABCD\to E$. Since, $A\to B$ So, from $ACD$, we can get $B$ also. Therefore, $ACD^+=ACDB$ Now using $ABCD\to E$, we get: $ACD\to E$ So, $B$ is extraneous in $ABCD\to E$. Hence, $ABCD\to E$ reduces to $ACD\to E$ Now check $ACDF\to E$. Since we already have: $ACD\to E$ So, $ACDF\to E$ is unnecessary. Therefore, remove $ACDF\to E$. Now check $ACDF\to G$. From $ACDF$, using $ACD\to E$, we get $E$. Now we have $E$ and $F$. Using, $EF\to G$ we get $G$. So, $ACDF\to G$ is also unnecessary. Therefore, remove $ACDF\to G$. The remaining minimal cover is: $A\to B$ $ACD\to E$ $EF\to G$ $EF\to H$
Qus : 39
UGC NET Computer Science PYQ
4
A trigger is
1
A statement that enables to start DBMS. 2
A statement that is executed by the user when debugging an application program. 3
A condition the system tests for the validity of the database user. 4
A statement that is executed automatically by the system as a side effect of modification to the database. Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution A trigger is a special type of database statement or procedure. It is executed automatically when a specific event occurs in the database. For example, a trigger may execute automatically when: A record is inserted A record is updated A record is deleted So, a trigger is not manually executed by the user every time. It is automatically executed by the DBMS as a side effect of modification to the database. Now check the options: Option (a) is incorrect because trigger is not used to start DBMS. Option (b) is incorrect because trigger is not mainly used for debugging. Option (c) is incorrect because user validity checking is related to authentication or authorization. Option (d) is correct because trigger executes automatically after database modification.
Qus : 42
UGC NET Computer Science PYQ
2
Given two tables $EMPLOYEE(EID,ENAME,DEPTNO)$ and $DEPARTMENT(DEPTNO,DEPTNAME)$.
Find the most appropriate statement of the given query:
Select count(*) 'total'
from EMPLOYEE
where DEPTNO IN (D1, D2)
group by DEPTNO
having count(*) > 5;
1
Total number of employees in each department $D1$ and $D2$ 2
Total number of employees of departments $D1$ and $D2$ if their total is $>5$ 3
Display total number of employees in both departments $D1$ and $D2$ 4
The output of the query must have atleast two rows Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ
Solution The query first selects employees whose department number is either $D1$ or $D2$.
Then,
$group\ by\ DEPTNO$
means employees are grouped department-wise.
After that,
$having\ count(*)>5$
means only those department groups will be displayed whose employee count is greater than $5$.
So, the query displays the total number of employees of departments $D1$ and $D2$ only if their count is greater than $5$.
Qus : 43
UGC NET Computer Science PYQ
3
Find the minimum number of tables required for converting the following entity relationship diagram into a relational database.
1
2 2
4 3
3 4
5 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ
Solution In the given ER diagram:
Entity $R_1$ has attributes $A$, $B$, and $C$.
Here, $B$ is shown as a double oval, so $B$ is a multivalued attribute.
A multivalued attribute requires a separate table.
So, for $R_1$:
One table for entity $R_1$
One separate table for multivalued attribute $B$
Entity $R_2$ has attributes $X$ and $Y$.
So, one table is required for $R_2$.
The relationship between $R_1$ and $R_2$ is $1:M$.
For a $1:M$ relationship, no separate relationship table is required. We can add the primary key of the $1$ side as a foreign key in the $M$ side table.
Total number of tables:
$1$ table for $R_1$
$1$ table for multivalued attribute $B$
$1$ table for $R_2$
Total:
$1+1+1=3$
Qus : 44
UGC NET Computer Science PYQ
3
In a schema $R(A, B, C, D, E, F, G, H)$, each field of $R$ contains only atomic values.
$F = {CH \rightarrow C, A \rightarrow BC, B \rightarrow CEH, E \rightarrow A, A \rightarrow EFG}$ is a set of functional dependencies so that $F^+$ is exactly the set of FDs that holds $R$. The relation $R$ is :
1
In 1NF, but not in 2NF
2
In 2NF, but not in 3NF
3
In 3NF, but not in BCNF
4
In BCNF Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ
Solution Given FDs
$CH \rightarrow C$
$A \rightarrow BC$
$B \rightarrow CEH$
$E \rightarrow A$
$A \rightarrow EFG$
From
$A \rightarrow BC$
$A \rightarrow EFG$
we get
$A \rightarrow BCFG E$
Then
$B \rightarrow CEH$
Thus
$A^+ = {A,B,C,D,E,F,G,H}$
So $A$ is a candidate key.
Now check dependency
$E \rightarrow A$
Since $E$ is not a superkey, but RHS contains a prime attribute, it satisfies 3NF but violates BCNF.
Therefore the relation is
in 3NF but not in BCNF.
Qus : 45
UGC NET Computer Science PYQ
3
Match List I with List II:
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 transitive transparency. D. 4NF IV. It removes partial functional dependency.
Choose the correct answer from the options given below:
1
$(A)-(III), (B)-(II), (C)-(IV), (D)-(I)$ 2
$(A)-(II), (B)-(IV), (C)-(I), (D)-(III)$ 3
$(A)-(II), (B)-(III), (C)-(IV), (D)-(I)$ 4
$(A)-(II), (B)-(I), (C)-(IV), (D)-(III)$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution We need to match each normal form with its correct property.
BCNF:
BCNF is stronger than 3NF.
A decomposition into BCNF is not always dependency preserving.
So,
$(A)-(II)$
3NF:
3NF removes transitive dependency.
In the question, it is written as transitive transparency, but the correct database term is transitive dependency.
So,
$(B)-(III)$
2NF:
2NF removes partial functional dependency.
A relation is in 2NF when it is in 1NF and no non-prime attribute is partially dependent on any candidate key.
So,
$(C)-(IV)$
4NF:
4NF removes multivalued dependency.
It is used when a relation has non-trivial multivalued dependencies.
So,
$(D)-(I)$
Final matching is:
$(A)-(II), (B)-(III), (C)-(IV), (D)-(I)$
Qus : 46
UGC NET Computer Science PYQ
3
Match List I with List II:
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 transitive transparency. D. 4NF IV. It removes partial functional dependency.
Choose the correct answer from the options given below:
1
$(A)-(III), (B)-(II), (C)-(IV), (D)-(I)$ 2
$(A)-(II), (B)-(IV), (C)-(I), (D)-(III)$ 3
$(A)-(II), (B)-(III), (C)-(IV), (D)-(I)$ 4
$(A)-(II), (B)-(I), (C)-(IV), (D)-(III)$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution We have to match each normal form with the dependency that it removes or the property related to it. First, consider $BCNF$. $BCNF$ means Boyce-Codd Normal Form. It is stronger than $3NF$. A relation decomposed into $BCNF$ gives lossless decomposition, but it is not always dependency preserving. So, $A-(II)$ Now, consider $3NF$. $3NF$ means Third Normal Form. It removes transitive dependency. In the question, it is written as transitive transparency, but the correct database term is transitive dependency. So, $B-(III)$ Now, consider $2NF$. $2NF$ means Second Normal Form. It removes partial functional dependency. A relation is in $2NF$ when it is in $1NF$ and no non-prime attribute is partially dependent on a candidate key. So, $C-(IV)$ Now, consider $4NF$. $4NF$ means Fourth Normal Form. It removes multivalued dependency. So, $D-(I)$ Therefore, the correct matching is: $(A)-(II), (B)-(III), (C)-(IV), (D)-(I)$
Qus : 48
UGC NET Computer Science PYQ
3
Consider the following statements: Statement I: Conservative 2 PL is a deadlock-free protocol. Statement II: Thomas's write rule enforces conflict serializability. Statement III: Timestamp ordering protocol ensures serializability based on the order of transaction timestamps. Which of the following is correct?
1
Statement I, Statement II true, and Statement III false 2
Statement I, Statement III true, and Statement II false 3
Statement I, Statement II false, and Statement III true 4
Statement I, Statement II, and Statement III true Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution Statement I: Conservative $2PL$ means Conservative Two Phase Locking. In this protocol, a transaction obtains all required locks before it starts execution. If all locks are not available, the transaction does not start. Because a transaction does not hold some locks while waiting for other locks, circular wait cannot occur. So, Conservative $2PL$ is deadlock-free. Therefore, Statement I is true. Statement II: Thomas's write rule is a modification of timestamp ordering. It allows some obsolete write operations to be ignored. Because of this, it can generate schedules that are view serializable but not necessarily conflict serializable. So, Thomas's write rule does not enforce conflict serializability. Therefore, Statement II is false. Statement III: Timestamp ordering protocol assigns a timestamp to every transaction. The serial order of transactions is decided according to their timestamps. So, it ensures serializability based on the timestamp order. Therefore, Statement III is true. Hence, Statement I and Statement III are true, and Statement II is false.
Qus : 49
UGC NET Computer Science PYQ
2
Consider relation R(A, B, C, D, E) with the following functional dependencies:
C → F, E → A, EC → D, A → B.
Which of the following is a key for R?
1
CD 2
EC 3
AE 4
AC Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ
Solution Goal: Find a set of attributes whose closure covers all attributes of R = {A, B, C, D, E}.
Check (1) CD+ :
From C → F we get F. D gives nothing further. So CD+ = {C, D, F}.
Missing A, B, E ⇒ not a key.
Check (2) EC+ :
Start {E, C}. Using E → A ⇒ add A. Using A → B ⇒ add B. Using EC → D ⇒ add D.
Therefore EC+ = {E, C, A, B, D} = {A, B, C, D, E}. Covers all attributes of R ⇒ key .
Check (3) AE+ :
A → B gives B; E → A adds nothing new. No way to reach C or D ⇒ not a key.
Check (4) AC+ :
A → B gives B; C → F gives F. No E or D ⇒ not a key.
Answer: (2) EC
Note: F is outside R, so while C → F is valid, a key must cover only attributes of R. EC+ covers {A, B, C, D, E}.
Qus : 50
UGC NET Computer Science PYQ
4
Consider the following statements: Statement I: Composite attributes cannot be divided into smaller subparts. Statement II: Complex attribute is formed by nesting composite attributes and multivalued attributes in an arbitrary way. Statement III: A derived attribute is an attribute whose values are computed from other attribute. Which of the following is correct?
1
Statement I, Statement II and Statement III are true 2
Statement I true and Statement II, Statement III false 3
Statement I, Statement II true and Statement III false 4
Statement I false and Statement II, Statement III true Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ
Solution Statement I: Composite attributes are attributes that can be divided into smaller subparts. For example, Name can be divided into First Name, Middle Name and Last Name. So, the statement "Composite attributes cannot be divided into smaller subparts" is false. Therefore, Statement I is false. Statement II: Complex attributes are formed by combining composite attributes and multivalued attributes. They may contain nested structures. So, complex attributes can be formed by nesting composite attributes and multivalued attributes. Therefore, Statement II is true. Statement III: A derived attribute is an attribute whose value is calculated from another attribute. For example, Age can be derived from Date of Birth. So, Statement III is true. Therefore: Statement I is false. Statement II is true. Statement III is true.
Qus : 51
UGC NET Computer Science PYQ
2
Consider the transactions $T_1, T_2, T_3$ and the schedules $S_1$ and $S_2$ given below.
$T_1 : r_1(x); r_1(z); w_1(z)$
$T_2 : r_2(y); r_2(z); w_2(z)$
$T_3 : r_3(y); r_3(x); w_3(y)$
$S_1$ :
$r_1(x); r_3(y); r_3(x); r_2(y); r_2(z); w_3(y); w_3(z); r_1(z); w_1(x); w_1(z)$
$S_2$ :
$r_1(x); r_3(y); r_2(y); r_3(x); r_1(z); r_2(z); w_3(y); w_1(x); w_2(z); w_1(z)$
Which one of the following statements about the schedules is TRUE ?
1
Only $S_1$ is conflict-serializable 2
Only $S_2$ is conflict-serializable 3
Both $S_1$ and $S_2$ are conflict-serializable 4
Neither $S_1$ nor $S_2$ is conflict-serializable Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ
Solution To check conflict serializability we build precedence graph .
For $S_1$
Conflicts:
$T_1 \rightarrow T_3$
$T_3 \rightarrow T_2$
$T_2 \rightarrow T_1$
Cycle exists:
$T_1 \rightarrow T_3 \rightarrow T_2 \rightarrow T_1$
Therefore
$S_1$ not conflict-serializable
For $S_2$ Conflicts:
$T_3 \rightarrow T_1$
$T_2 \rightarrow T_1$
$T_3 \rightarrow T_2$
Graph has no cycle
Serializable order:
$T_3 \rightarrow T_2 \rightarrow T_1$
Thus
$S_2$ is conflict-serializable
Qus : 52
UGC NET Computer Science PYQ
3
Arrange the following phases of database design in the correct order :
(A) Physical Design
(B) Conceptual Design
(C) Logical Design
(D) Requirement Analysis
Choose the correct answer from the options given below :
1
(B), (D), (A), (C) 2
(C), (A), (B), (D) 3
(D), (B), (C), (A) 4
(A), (D), (C), (B) Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ
Solution Standard database design process:
Requirement Analysis
Conceptual Design
Logical Design
Physical Design
Thus order:
(D) → (B) → (C) → (A)
Qus : 53
UGC NET Computer Science PYQ
2
Let $T_1$ be a transaction that transfer Rs. $50$ from account A to account B. This transaction can be defined as follows:
Step Operation 1 Read (A) 2 A: A-50 3 Write(A) 4 Read(B) 5 B:=B+50 6 Write (B)
What will be the status of a database just after $3^{rd}$ step but before $5^{th}$ step of transaction execution?
1
Always consistent 2
May be temporarily inconsistent
3
Must be abort 4
Always rollback Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Solution After step $3$, amount Rs. $50$ has been deducted from account A.
But before step $5$, Rs. $50$ has not yet been added to account B.
So, for some time, the total balance may not match the original total balance.
Therefore, the database may be temporarily inconsistent.
So, correct option is:
$\boxed{(b)\ \text{May be temporarily inconsistent}}$
Qus : 54
UGC NET Computer Science PYQ
2
onsider the relation
$Student(stuid,dept,clsroll)$
The following functional dependencies are given:
$FD1: stuid \to dept$
$FD2: dept \to stuid$
$FD3: stuid \to clsroll$
$FD4: clsroll \to stuid$
$FD5: dept \to clsroll$
Which functional dependencies should be removed to obtain the canonical cover of the set?
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 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Solution Given FDs:
$FD1: stuid \to dept$
$FD2: dept \to stuid$
$FD3: stuid \to clsroll$
$FD4: clsroll \to stuid$
$FD5: dept \to clsroll$
Check redundancy:
$FD5: dept \to clsroll$ can be derived as:
$dept \to stuid$ using $FD2$
$stuid \to clsroll$ using $FD3$
So,
$dept \to clsroll$
Therefore, $FD5$ is redundant.
Also, $FD2$ and $FD3$ can be removed together because:
$dept \to clsroll$ using $FD5$
$clsroll \to stuid$ using $FD4$
So,
$dept \to stuid$
Also,
$stuid \to dept$ using $FD1$
$dept \to clsroll$ using $FD5$
So,
$stuid \to clsroll$
Therefore, $FD2$ and $FD3$ are also removable together.
Hence, correct statements are A and C only.
So, correct option is:
$\boxed{(b)\ \text{A, C only}}$
Qus : 55
UGC NET Computer Science PYQ
4
Consider a relation schema $R = (U, V, W, X, Y, Z)$, on which the following functional dependencies hold:
${U \rightarrow V,; VW \rightarrow X,; Y \rightarrow W,; X \rightarrow U}$
The candidate keys of $R$ are:
1
$UY,; VY$ 2
$UY,; VY,; XY$ 3
$UYZ,; VYZ,; VWZ$ 4
$UYZ,; VYZ,; XYZ$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ
Solution Functional dependencies:
$U \rightarrow V$
$VW \rightarrow X$
$Y \rightarrow W$
$X \rightarrow U$
Start with $UY$:
$U \rightarrow V$
$Y \rightarrow W$
Thus we get $V,W$
Then
$VW \rightarrow X$
Then
$X \rightarrow U$
So closure:
$UY^+ = {U,V,W,X,Y}$
Add $Z$ to cover all attributes.
Thus minimal key:
$UYZ$
Similarly:
$VYZ$ and $XYZ$
Thus candidate keys:
$UYZ,; VYZ,; XYZ$
Qus : 57
UGC NET Computer Science PYQ
1
Consider the following three relations:
Employee(eid, eName), Comp(cid, cName), Own(eid, cid).
Which of the following relational algebra expressions return the set of eids who own all brands?
(1) π_eid( π_eid,cid(Own) ÷ π_cid(Comp) )
(2) π_eid( π_eid(Own) × π_cid(Comp) )
(3) π_eid( π_eid,cid(Own) × π_cid(Comp) )
(4) π_eid( π_eid(Own) × (π_cid,cName(Own) ÷ π_cid(Comp)) )
1
1 2
2 3
3 4
4 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ
Solution Reason: To find employees who own all brands, divide the (eid,cid) pairs in Own by the set of all cids in Comp, then project eid:
π_eid( (Own[eid,cid]) ÷ (Comp[cid]) ).
Qus : 58
UGC NET Computer Science PYQ
2
Match List I with List II
List I
List II
A. Timestamp protocol I. As long as the transaction is already running, it will try to obtain the required lock in the first part. B. Strict two-phase locking protocol II. Indicates final lock of the schedule. C. Two-phase locking III. Ensures freedom from deadlock.
D. Lock point in two-phase locking protocol
IV. Ensures cascade-less rollback
Choose the correct answer from the options given below:
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 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Qus : 59
UGC NET Computer Science PYQ
4
Consider the following relations on ${1,2,3,4}$. Which of the following relations are reflexive ?
(A)
$R_1={(1,1),(1,2),(2,1),(2,2),(3,4),(4,1),(4,4)}$
(B)
$R_2={(1,1),(1,2),(2,1)}$
(C)
$R_3={(1,1),(1,2),(1,4),(2,1),(2,2),(3,3),(4,1),(4,4)}$
(D)
$R_4={(2,1),(3,1),(3,2),(4,1),(4,2),(4,3)}$
(E)
$R_5={(1,1),(1,2),(1,3),(1,4),(2,2),(2,3),(2,4),(3,3),(3,4),(4,4)}$
Choose the correct answer from the options given below :
1
(A), (B) and (C) Only 2
(A), (D) and (E) Only 3
(D) and (E) Only 4
(C) and (E) Only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ
Solution For a relation on ${1,2,3,4}$ to be reflexive, it must contain
$(1,1),(2,2),(3,3),(4,4)$
Check each:
$R_1$ → missing $(3,3)$ ✘
$R_2$ → missing $(3,3),(4,4)$ ✘
$R_3$ → contains $(1,1),(2,2),(3,3),(4,4)$ ✔
$R_4$ → missing all diagonal pairs ✘
$R_5$ → contains all $(1,1),(2,2),(3,3),(4,4)$ ✔
Thus reflexive relations:
$R_3$ and $R_5$
Qus : 60
UGC NET Computer Science PYQ
4
Two concurrent executing transactions $T_1$ and $T_2$ are allowed to update same stock item say $A$ in an uncontrolled manner. In such scenario, following problems may occur:
(a) Dirty read problem
(b) Lost update problem
(c) Transaction failure
(d) Inconsistent database state
Which of the following option is correct if database system has no concurrency module and allows concurrent execution of above two transactions?
1
(a), (b) and (c) only 2
(c) and (d) only 3
(a) and (b) only 4
(a), (b) and (d) only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ
Solution If two transactions update the same data item without concurrency control, then many problems may occur.
Dirty read problem can occur when one transaction reads uncommitted data of another transaction.
Lost update problem can occur when one transaction update is overwritten by another transaction.
Inconsistent database state can occur because uncontrolled concurrent execution may violate consistency.
But transaction failure is not necessarily due to concurrency control absence.
So, correct problems are:
(a), (b) and (d)
Qus : 61
UGC NET Computer Science PYQ
3
Consider the following schedule S.
T1 T2 T3 T4 Timestamp R(X) R(Y) t1 W(X) W(Y) t2 R(Y) R(X) t3 W(Y) W(X) t4 R(X) t5 W(X) t6
(R(X)) denotes the read operation on data item X
by transaction Ti.
W(X) denotes write operation on data item X by
transaction Ti.
Choose the correct execution order for the
above schedule S.
1
D, B, A, C 2
B, D, A, C
3
B, D, C, A 4
B, A, D, C Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Qus : 62
UGC NET Computer Science PYQ
3
Consider a schema $R(P,Q,R,S)$ and the following functional dependencies
$P \rightarrow Q$
$Q \rightarrow R$
$R \rightarrow S$
$S \rightarrow Q$
The decomposition of $R(P,Q,R,S)$ into $R_1(P,Q)$, $R_2(Q,R)$ and $R_3(Q,S)$ is :
1
Dependency preserving and lossless join 2
Lossless Join but not dependency preserving 3
Dependency preserving but not lossless join 4
Not dependency preserving and not lossless join Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ
Solution Check dependency preservation
Given FDs:
$P \rightarrow Q$
$Q \rightarrow R$
$R \rightarrow S$
$S \rightarrow Q$
Decomposed relations:
$R_1(P,Q)$
$R_2(Q,R)$
$R_3(Q,S)$
Each dependency is preserved:
$P \rightarrow Q$ → in $R_1$
$Q \rightarrow R$ → in $R_2$
$R \rightarrow S$ → derived via $Q$ in $R_3$
$S \rightarrow Q$ → in $R_3$
Thus dependency preserving
Check lossless join:
Common attribute between relations is Q, which functionally determines other attributes through dependencies.
Hence not lossless join.
Qus : 63
UGC NET Computer Science PYQ
1
A disk has $300$ cylinders $(0$ to $299)$. If the initial position of the read-write head is at cylinder $101$, moving towards the higher end of the disk, calculate the total head movement following C_LOOK policy for the read request sequence:
$123,45,197,87,250,198,280$
1
456 2
450
3
458 4
445 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Solution Initial head position:
$101$
Direction is towards higher cylinder numbers.
Request sequence in sorted order:
$45,87,123,197,198,250,280$
Using C_LOOK, first serve higher side requests:
$101 \to 123 \to 197 \to 198 \to 250 \to 280$
Then jump to lowest request:
$280 \to 45$
Then continue:
$45 \to 87$
Total head movement:
$=|123-101|+|197-123|+|198-197|+|250-198|+|280-250|+|45-280|+|87-45|$
$=22+74+1+52+30+235+42$
$=456$
Qus : 64
UGC NET Computer Science PYQ
3
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 * 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 * prerequisite p where p.courseid = "324") and EXISTS (select * from enrollment e where e.courseid = p.precourseid and e.rollno = s.rollno)) Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Solution We need students who have enrolled in all prerequisite courses of course 324.
This is a “for all” type query.
In SQL, “for all” is usually written using double NOT EXISTS.
Meaning of option (c):
For a student s, there should not exist any prerequisite course p of course 324 such that the student has not enrolled in that prerequisite course.
So, option (c) checks:
No prerequisite course of 324 is missing from the student's enrollment.
Option (a) uses ANY, so it checks only at least one prerequisite course.
Option (b) uses ALL incorrectly, because one enrollment course cannot be equal to all different prerequisite course IDs at the same time.
Option (d) uses EXISTS, so it checks only at least one matching prerequisite enrollment, not all.
Qus : 65
UGC NET Computer Science PYQ
1
Minimal cover $F'$ of functional dependency set $F$ is:
Given:
$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$
1
$F'={A\rightarrow B,\ A\rightarrow C,\ BC\rightarrow D,\ D\rightarrow E}$ 2
$F'={A\rightarrow BC,\ B\rightarrow D,\ D\rightarrow E}$ 3
$F'={A\rightarrow B,\ A\rightarrow C,\ A\rightarrow D,\ D\rightarrow E}$ 4
$F'={A\rightarrow B,\ A\rightarrow C,\ B\rightarrow D,\ C\rightarrow D,\ D\rightarrow E}$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ
Solution Given functional dependency set:
$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$
First split right side of $A\rightarrow BC$:
$A\rightarrow B$
$A\rightarrow C$
So,
$F={A\rightarrow B,\ A\rightarrow C,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$
Now check whether $A\rightarrow D$ is redundant or not.
From:
$A\rightarrow B$
$A\rightarrow C$
we get:
$A\rightarrow BC$
And given:
$BC\rightarrow D$
So,
$A\rightarrow BC\rightarrow D$
Therefore,
$A\rightarrow D$
can be derived from other dependencies, so it is redundant.
Remove $A\rightarrow D$.
Hence minimal cover is:
$F'={A\rightarrow B,\ A\rightarrow C,\ BC\rightarrow D,\ D\rightarrow E}$
Qus : 67
UGC NET Computer Science PYQ
3
1
$BC$ 2
$AD$ 3
$A$ 4
$AB$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ
Solution To find the primary key, find closure of $A$.
Given:
$A\rightarrow BC$
So,
$A^+={A,B,C}$
Also,
$A\rightarrow D$
So,
$A^+={A,B,C,D}$
And,
$D\rightarrow E$
So,
$A^+={A,B,C,D,E}$
Since $A^+$ contains all attributes of relation $R$, $A$ is a candidate key.
Therefore, the primary key is:
$A$
Qus : 68
UGC NET Computer Science PYQ
1
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 3
group by deptid, name; 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; Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Solution We need total credits of courses for each department.
So, we must use:
sum(credits)
Also, department and course must be joined using:
deptid = deptno
Then grouping must be done department-wise using:
group by deptid, name
Option (a) correctly uses join, sum and group by.
Option (b) uses count(credits), so it counts courses, not total credits.
Option (c) is syntactically incorrect.
Option (d) uses the join condition in having instead of where, so it is not the correct standard query.
Qus : 70
UGC NET Computer Science PYQ
4
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
Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Solution We need departments whose total course credits are greater than 40.
First, department and course must be joined:
deptid = deptno
Then courses must be grouped department-wise:
group by deptid, name
After grouping, total credits must be checked using HAVING:
having totalcredits >40
Option (d) correctly uses:
where deptid = deptno
group by deptid, name
having totalcredits >40
Qus : 72
UGC NET Computer Science PYQ
2
In a relational database, which one of the following is CORRECT:
1
A relation with only two attributes is always in BCNF.
2
If all attributes of a relation are prime attributes, then the relation is in BCNF. 3
Every relation has at least one non-prime attribute. 4
BCNF decomposition preserves functional dependencies. Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ
Solution A prime attribute is one that is part of a candidate key.
In BCNF (Boyce-Codd Normal Form), for every functional dependency $X \to Y$, $X$ must be a super key.
If all attributes are prime, there cannot exist a dependency where a non-superkey determines another attribute.
Hence, the relation is automatically in BCNF.
Qus : 73
UGC NET Computer Science PYQ
3
1
It retrieves the roll number and names of students who have not enrolled for all course offered by department number 5. 2
It retrieves the roll number and names of students who have enrolled for all course offered by department number 5. 3
It retrieves the roll number and names of students who have enrolled for at least one course offered by department number 5. 4
It retrieves the roll number and names of students who are such that there exists at least one course offered by department number 5 which is not enrolled by the student. Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ
Solution The outer query selects students.
Inside the query:
EXISTS checks whether there is at least one course from department number 5.
The inner EXISTS checks whether the same student has enrolled in that course.
So the query means:
Find students who have enrolled in at least one course offered by department number 5.
It does not check all courses. For all courses, double NOT EXISTS would be required.
Qus : 74
UGC NET Computer Science PYQ
4
1
Dependency preservation property is followed 2
$R_1$ and $R_2$ are both in $2NF$ 3
$R_2$ is in $2NF$ and $R_1$ is in $3NF$ 4
$R_1$ is in $3NF$ and $R_2$ is in $2NF$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ
Solution For $R_1(A,B,C)$:
Given:
$A\rightarrow B$
$A\rightarrow C$
So,
$A^+={A,B,C}$
Therefore, $A$ is a key of $R_1$.
Since all dependencies have left side as key $A$, $R_1$ is in $3NF$.
Now for $R_2(A,D,E)$:
Given:
$A\rightarrow D$
$D\rightarrow E$
Here,
$A^+={A,D,E}$
So, $A$ is a key of $R_2$.
But dependency $D\rightarrow E$ violates $3NF$, because $D$ is not a super key and $E$ is a non-prime attribute.
Since the key $A$ is a single attribute, there is no partial dependency.
So, $R_2$ is in $2NF$ but not in $3NF$.
Qus : 76
UGC NET Computer Science PYQ
1
The order of a leaf node in a $B+$ tree is the maximum number of value, data record pointer pairs it can hold. Given that the block size is $1K$ bytes, data record pointer is $7$ bytes long, the value field is $9$ bytes long and a block pointer is $6$ bytes long, what is the order of the leaf node?
1
63 2
64 3
67 4
68 Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution Block size $=1K=1024$ bytes. Each value and data record pointer pair needs: $9+7=16$ bytes One block pointer is also required, so available space for pairs is: $1024-6=1018$ bytes Number of pairs: $\left\lfloor\frac{1018}{16}\right\rfloor=63$ So, the order of the leaf node is $63$.
Qus : 78
UGC NET Computer Science PYQ
3
Which of the following statements is correct,
according to the following instance of the
relational schema R(X, Y, Z)?
1
X → Y, Z → X 2
Y → Z, Z → X 3
X → Y, X → Z 4
Y → X, X → Z
Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ
Solution Functional dependency $A \to B$ means:
If two rows have the same value of $A$, then they must have the same value of $B$.
Now check each dependency.
For $X \to Y$:
When $X=1$, $Y=1$ in both rows.
When $X=2$, $Y=1$.
When $X=3$, $Y=2$.
So, same $X$ always gives same $Y$.
Therefore, $X \to Y$ is true.
For $X \to Z$:
When $X=1$, $Z=a$ in both rows.
When $X=2$, $Z=b$.
When $X=3$, $Z=b$.
So, same $X$ always gives same $Z$.
Therefore, $X \to Z$ is true.
For $Z \to X$:
When $Z=b$, we have two different values of $X$:
$X=2$ and $X=3$
So, $Z \to X$ is false.
For $Y \to Z$:
When $Y=1$, we get:
$Z=a$ and $Z=b$
So, $Y \to Z$ is false.
For $Y \to X$:
When $Y=1$, we get:
$X=1$ and $X=2$
So, $Y \to X$ is false.
Hence, only $X \to Y$ and $X \to Z$ are true.
Qus : 79
UGC NET Computer Science PYQ
4
Consider a domain consisting of three Boolean variables Toothache, Cavity, and Catch. The full joint distribution is a $2\times2\times2$ table as shown below.
toothache $\neg$toothache catch $\neg$catch catch $\neg$catch cavity $0.108$ $0.012$ $0.072$ $0.008$ $\neg$cavity $0.016$ $0.064$ $0.144$ $0.576$
Which of the DBMS component ensures that concurrent execution of multiple operations on the database results into a consistent database state?
1
Logs 2
Buffer manager 3
File manager 4
Transaction processing system Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution Concurrent execution means many transactions may execute at the same time. The transaction processing system controls concurrency and recovery. It ensures that even with multiple transactions, the database remains in a consistent state. Logs help in recovery, buffer manager manages memory pages, and file manager manages storage files.
Qus : 80
UGC NET Computer Science PYQ
1
Consider following two statements: Statement I: Relational database schema represents the logical design of the database. Statement II: Current snapshot of a relation only provides the degree of the relation. In the context to the above statements, choose the correct option from the options given below:
1
Statement I is TRUE but Statement II is FALSE 2
Statement I is FALSE but Statement II is TRUE 3
Both Statement I and Statement II are FALSE 4
Both Statement I and Statement II are TRUE Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution Statement I is true because relational database schema represents the logical structure or logical design of the database. Statement II is false because current snapshot of a relation means relation instance. It gives the current set of tuples in the relation. Degree means number of attributes, which is part of schema, not only the current snapshot. Therefore, Statement I is true and Statement II is false.
Qus : 82
UGC NET Computer Science PYQ
3
Consider T1(A,B,C,D,E) with FDs { EB→C, D→E, EA→B } and T2(A,B,C,D) with FDs { C→A, A→B, A→D }. Which is TRUE?
1
T1 is in 3NF 2
T2 is in 3NF 3
T1 is not in 3NF 4
T1 is in 2NF Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ
Solution Candidate key for T1 is AD (A,D are prime; B,C,E non-prime). FDs EB→C, D→E, EA→B have LHS not a superkey and RHS non-prime → violates 3NF (and even 2NF due to D→E partial on key).
Qus : 83
UGC NET Computer Science PYQ
1
Given the following STUDENT-COURSE scheme: STUDENT(Rollno, Name, courseno) COURSE(courseno, coursename, capacity) where Rollno is the primary key of relation STUDENT and courseno is the primary key of relation COURSE. Attribute coursename of COURSE takes unique values only. Which of the following query/queries will find total number of students enrolled in each course, along with its coursename? A. SELECT coursename, count(*) 'total' from STUDENT natural join COURSE group by coursename; B. SELECT C.coursename, count(*) 'total' from STUDENT S, COURSE C where S.courseno=C.courseno group by coursename; C. SELECT coursename, count(*) 'total' from COURSE C where courseno in (SELECT courseno from STUDENT);
1
A and B only 2
C only 3
A only 4
B only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution Query A uses natural join between STUDENT and COURSE on common attribute courseno. Then it groups by coursename and counts students in each course. So, A is correct. Query B explicitly joins STUDENT and COURSE using: $S.courseno=C.courseno$ Then it groups by coursename and counts students in each course. So, B is also correct. Query C does not use GROUP BY and does not count students course-wise. It only filters courses whose courseno appears in STUDENT, so it cannot correctly give total students enrolled in each course. So, C is incorrect.
Qus : 84
UGC NET Computer Science PYQ
1
STUDENT(Rollno, Name, Courseno)COURSE(Courseno, Coursename, Capacity)where Rollno is the primary key of relation STUDENT and Courseno is the primary key of relation COURSE. Attribute Coursename of COURSE takes unique values only. The number of records in COURSE and STUDENT tables are $3$ and $5$ respectively.Following relational algebra query is executed:$R=STUDENT\times COURSE$Match List I with List II in context to the above problem statement.
List I List II A. Degree of table R I. $15$ B. Cardinality of table R II. NIL C. Foreign key of relation STUDENT III. $6$ D. Foreign key of relation COURSE IV. Courseno
Choose the correct answer from the options given below:
1
A-III, B-I, C-IV, D-II 2
A-I, B-III, C-IV, D-II 3
A-I, B-III, C-IV, D-II 4
A-I, B-III, C-II, D-IV Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution $R=STUDENT\times COURSE$ means Cartesian product. Degree means number of attributes. STUDENT has $3$ attributes and COURSE has $3$ attributes. So, degree of $R=3+3=6$. Hence, $A-III$. Cardinality means number of tuples. STUDENT has $5$ records and COURSE has $3$ records. So, cardinality of $R=5\times3=15$. Hence, $B-I$. In STUDENT, $Courseno$ refers to the primary key of COURSE. So, foreign key of STUDENT is $Courseno$. Hence, $C-IV$. COURSE does not have any foreign key given in the schema. So, foreign key of COURSE is NIL. Hence, $D-II$. Final matching is $A-III,\ B-I,\ C-IV,\ D-II$.
Qus : 85
UGC NET Computer Science PYQ
1
Suppose a B tree is used for indexing a database file. Consider the following information:size of the search key field $=10$ bytes, block size $=1024$ bytes, size of the record pointer $=9$ bytes, size of the block pointer $=8$ bytes.Let $K$ be the order of internal node and $L$ be the order of leaf node of B tree, then $(K,L)=$ ______.
1
$(57,53)$ 2
$(50,52)$ 3
$(60,64)$ 4
$(34,31)$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution For internal node, if order is $K$, then it has $K$ block pointers and $K-1$ keys. So, $8K+10(K-1)\le 1024$ $8K+10K-10\le 1024$ $18K\le 1034$ $K\le 57.44$ So, $K=57$. For leaf node, each entry has search key and record pointer. One extra block pointer is also needed. So, $L(10+9)+8\le 1024$ $19L+8\le 1024$ $19L\le 1016$ $L\le 53.47$ So, $L=53$. Therefore, $(K,L)=(57,53)$.
Qus : 86
UGC NET Computer Science PYQ
3
Given a relation scheme $R(x,y,z,w)$ with functional dependencies set $F=\{x\to y,\ z\to w\}$. All attributes take single and atomic values only. A. Relation $R$ is in First Normal Form B. Relation $R$ is in Second Normal Form C. Primary key of $R$ is $xz$ Choose the correct answer from the options given below:
1
C only 2
B and C only 3
A and C only 4
B only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution All attributes are single and atomic.
So, relation $R$ is in $1NF$.
Hence, statement A is true.
Now find key:
$x\to y$ and $z\to w$
So,
$(xz)^+=\{x,z,y,w\}$
Thus, $xz$ is a candidate key.
Hence, statement C is true.
For $2NF$, no non-prime attribute should depend on a proper part of candidate key.
But here,
$x\to y$
and
$z\to w$
Here $y$ and $w$ are non-prime attributes, and they depend on parts of key $xz$.
So, partial dependency exists.
Therefore, $R$ is not in $2NF$.
Hence, statement B is false.
Therefore, A and C only are correct.
Qus : 87
UGC NET Computer Science PYQ
1
A company is consuming parts in the manufacturing of other products. Each of the part is either manufactured within the company or purchased from the external suppliers or both. For each part, partnumber, partname is maintained. Attribute batchnumber is maintained if the consumed part is manufactured in the company. If part is purchased from external supplier, then supplier name is maintained. Which of the following constraints need to be considered when modelling class/subclass concepts in ERD for the given problem?
1
Total specialization and overlapping constraints 2
Disjoint constraint only 3
Partial participation 4
Partial participation and disjoint constraints Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution Here, every part is either manufactured, purchased, or both. So, every part must belong to at least one subclass. This means total specialization. Also, a part can be both manufactured and purchased. So, subclasses are not disjoint. This means overlapping constraint is needed. Therefore, required constraints are total specialization and overlapping constraints.
Qus : 88
UGC NET Computer Science PYQ
1
A transaction may be in one of the following states during its execution life cycle in concurrent execution environment. A. FAILED B. TERMINATED C. PARTIALLY COMMITTED D. COMMITTED E. ACTIVE Given a transaction in active state during its execution, find its next transitioned state from the options given below:
1
A only 2
Either A or C only 3
C only 4
D only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ
Solution A transaction starts in the Active state. From Active state, two transitions are possible: If the transaction executes successfully, then it goes to Partially Committed state. If some error or failure occurs, then it goes to Failed state. So, from Active state, the next possible state can be either Failed or Partially Committed. That means either A or C only.
Qus : 90
UGC NET Computer Science PYQ
3
Considering the following statements:
A. A non-serial schedule is said to be conflict-serializable, if it is conflict-equivalent to some serial schedule.
B. A non-serial schedule is said to be view serializable if it is view-equivalent to some serial schedule.
C. A schedule is said to be serial, if instructions of participating transactions are chronologically interleaved with each other.
D. A conflict-serializable schedule will be view-serializable also but vice-versa may not be true.
1
A, B, C, D 2
A, B, C Only 3
A, B, D Only
4
B, C, D Only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ
Solution A True (definition of conflict serializability).
B True (definition of view serializability).
C False — a serial schedule has no interleaving; one transaction completes before the next starts.
D True — conflict-serializable ⇒ view-serializable, but not every view-serializable schedule is conflict-serializable.
Qus : 91
UGC NET Computer Science PYQ
4
What are the drawbacks of using file systems to store data?
Data inconsistency
Difficulty in accessing data
Data isolation
Atomicity of updates
Choose the correct answer from the options given below:
1
$1,2$ only 2
$2,3,4$ only 3
$1,2,3$ only 4
$1,2,3,4$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ
Solution Traditional file systems have many drawbacks.
Statement $1$:
Data inconsistency can occur because the same data may be stored in multiple files.
So, statement $1$ is correct.
Statement $2$:
Accessing required data is difficult because special programs may be needed for each task.
So, statement $2$ is correct.
Statement $3$:
Data isolation occurs because data may be stored in different files and formats.
So, statement $3$ is correct.
Statement $4$:
Atomicity problems can occur because updates may be incomplete if a system failure happens.
So, statement $4$ is also correct.
Therefore, all given statements are drawbacks of file systems.
Qus : 92
UGC NET Computer Science PYQ
1
Which of the following database model, we have a parent-child relationship?
hierarchical databases
network databases
relational databases
Choose the correct answer from the options below:
1
$1,2$ only 2
$1,3$ 3
$2,3$ 4
$1,2,3$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ
Solution In a hierarchical database model, data is arranged like a tree.
It clearly follows a parent-child relationship.
So, statement $1$ is correct.
In a network database model, records are connected using links, and it can also represent parent-child type relationships.
So, statement $2$ is also correct.
In a relational database model, data is stored in tables.
It uses relations, primary keys, and foreign keys, but it is not mainly based on a parent-child structure.
So, statement $3$ is not correct.
Therefore, correct statements are:
$1$ and $2$
Qus : 93
UGC NET Computer Science PYQ
1
Identify the correct operation that produces the
below-given output based on two relations R1
and R2.
R1
Name Class a1 9 b1 5 c1 6 d1 11
R2
Output
Choose the correct answer from the options below :
1
$R1 \cap R2$ 2
$R1 - R2$ 3
$R1 - (R1 - R2)$ 4
$R1 \cup R2$ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ
Solution The output contains only the common tuple present in both $R1$ and $R2$.
In $R1$, tuples are:
$(a1,9), (b1,5), (c1,6), (d1,11)$
In $R2$, tuples are:
$(b1,5), (f1,8)$
Common tuple is:
$(b1,5)$
So,
$R1 \cap R2 = {(b1,5)}$
Therefore, the direct correct operation is:
$R1 \cap R2$
Qus : 94
UGC NET Computer Science PYQ
4
Given below are two statements:
Which of the following concurrency control protocol ensures both conflict serializability and freedom from deadlock?
Statement I: Two phase locking
Statement II: Timestamp ordering
In the light of the above statements, choose the most appropriate answer from the options given below:
1
Both Statement I and Statement II are correct 2
Both Statement I and Statement II are incorrect 3
Statement I is correct but Statement II is incorrect 4
Statement I is incorrect but Statement II is correct
Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ
Solution Two phase locking ensures conflict serializability, but it may cause deadlock. So, it does not ensure freedom from deadlock.
Timestamp ordering ensures conflict serializability and it is deadlock-free because transactions do not wait for locks.
So, Statement I is incorrect and Statement II is correct.
Qus : 95
UGC NET Computer Science PYQ
2
The techniques used to handle the phantom problem are
A. Time stamping
B. Index locking
C. Predicate locking
D. Execution indexing
1
A and B Only 2
B and C Only 3
A and D Only 4
C and D Only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ
Solution The phantom problem occurs in database concurrency control when a transaction re-executes a query and finds new rows inserted by another transaction.
Techniques used to prevent phantom problem:
• Index locking – locks index ranges to prevent insertion of new tuples in the range.
• Predicate locking – locks records satisfying a condition.
Time stamping and execution indexing are not specifically used to solve phantom problem.
Therefore, correct options are B and C .
Qus : 97
UGC NET Computer Science PYQ
4
Consider a relational schema $S=(U,V,W,X,Y,Z)$ on which the following functional dependencies hold: $\{U\to V,\ VW\to X,\ Y\to W,\ X\to U\}$ Which are the candidate keys among following options?
1
UY, VY 2
UY, VY, XY 3
UYZ, VYZ, VWZ 4
UYZ, VYZ, XYZ Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ
Solution Attributes $Y$ and $Z$ are not present on RHS of any FD. So, every candidate key must contain $Y$ and $Z$. Now check: $(UYZ)^+=\{U,Y,Z,V,W,X\}$, so $UYZ$ is a key. $(VYZ)^+=\{V,Y,Z,W,X,U\}$, so $VYZ$ is a key. $(XYZ)^+=\{X,Y,Z,U,V,W\}$, so $XYZ$ is a key. Thus, candidate keys are: $UYZ,\ VYZ,\ XYZ$
Qus : 98
UGC NET Computer Science PYQ
1
Let R (A, B, C, D) be a relational schema with following functional dependencies:
$A \to B,\ B \to C$
$C \to D$ and $D \to B$
The decomposition of R into
$(A, B)\ (B, C)\ (B, D)$
1
gives a lossless join, and is dependency preserving 2
gives lossless join, but is not dependency preserving 3
does not give a lossless join, but is dependency preserving 4
does not give a lossless join and is not dependency preserving Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ
Solution From the given FDs:
$B \to C$ and $C \to D \Rightarrow B \to D$
So, in relation $(B, D)$, $B$ is a key.
Also, projected dependencies preserve:
$A \to B,\ B \to C,\ D \to B,\ B \to D$
And from
$C \to B$ (via $C \to D$ and $D \to B$), and $B \to D$
we get
$C \to D$
So, decomposition is dependency preserving.
It is also lossless.
Qus : 99
UGC NET Computer Science PYQ
4
Which of the following scenario may lead to an irrecoverable error in a database system?
1
A transaction writes a data item after it is read by an uncommitted transaction 2
A transaction reads a data item after it is read by an uncommitted transaction 3
A transaction reads a data item after it is written by a committed transactions 4
A transaction reads a data item after it is written by an uncommitted transaction. Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ
Solution An irrecoverable state occurs when a transaction reads a value written by an uncommitted transaction.
This is called a dirty read.
If the writer transaction aborts later, recovery becomes difficult.
Qus : 100
UGC NET Computer Science PYQ
3
Which of the following is/are true in case of tree locking?
A. It ensures shorter waiting times.
B. It ensures freedom from deadlock.
C. Transaction can lock data items earlier.
D. It does not ensure greater amount of concurrency.
1
A and B Only 2
C and D Only 3
B and C Only 4
A and D Only Go to Discussion
UGC NET Computer Science UGC NET PYQ
UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ
Solution Tree locking protocol (graph-based protocol) rules:
• The first lock may be on any node.
• A transaction may lock a node only if it already holds a lock on the parent.
• Nodes may be unlocked anytime but cannot be relocked.
Properties:
• Deadlock cannot occur because locking follows a hierarchical order.
• Transactions can lock data items earlier since unlocking can happen anytime.
Thus:
B → True
C → True
[{"qus_id":"14703","year":"2025"},{"qus_id":"14981","year":"2025"},{"qus_id":"15014","year":"2025"},{"qus_id":"15034","year":"2025"},{"qus_id":"15042","year":"2025"},{"qus_id":"17383","year":"2024"},{"qus_id":"17404","year":"2024"},{"qus_id":"17419","year":"2024"},{"qus_id":"17433","year":"2024"},{"qus_id":"17476","year":"2024"},{"qus_id":"17477","year":"2024"},{"qus_id":"17478","year":"2024"},{"qus_id":"17479","year":"2024"},{"qus_id":"17480","year":"2024"},{"qus_id":"17488","year":"2024"},{"qus_id":"17499","year":"2024"},{"qus_id":"17517","year":"2024"},{"qus_id":"17520","year":"2024"},{"qus_id":"17523","year":"2024"},{"qus_id":"17525","year":"2024"},{"qus_id":"17538","year":"2024"},{"qus_id":"17544","year":"2024"},{"qus_id":"17555","year":"2024"},{"qus_id":"17577","year":"2024"},{"qus_id":"18404","year":"2023"},{"qus_id":"18419","year":"2023"},{"qus_id":"18421","year":"2023"},{"qus_id":"18443","year":"2023"},{"qus_id":"18452","year":"2023"},{"qus_id":"18455","year":"2023"},{"qus_id":"18457","year":"2023"},{"qus_id":"18477","year":"2023"},{"qus_id":"18484","year":"2023"},{"qus_id":"18511","year":"2022"},{"qus_id":"18512","year":"2022"},{"qus_id":"18547","year":"2022"},{"qus_id":"18548","year":"2022"},{"qus_id":"18567","year":"2022"},{"qus_id":"18576","year":"2022"},{"qus_id":"18584","year":"2022"},{"qus_id":"18594","year":"2022"},{"qus_id":"18595","year":"2022"},{"qus_id":"18596","year":"2022"},{"qus_id":"18597","year":"2022"},{"qus_id":"18598","year":"2022"},{"qus_id":"18613","year":"2020"},{"qus_id":"18614","year":"2020"},{"qus_id":"18646","year":"2022"},{"qus_id":"18647","year":"2022"},{"qus_id":"18648","year":"2022"},{"qus_id":"18741","year":"2022"},{"qus_id":"18742","year":"2022"},{"qus_id":"18743","year":"2022"},{"qus_id":"18744","year":"2022"},{"qus_id":"18745","year":"2022"},{"qus_id":"18771","year":"2022"},{"qus_id":"18772","year":"2022"},{"qus_id":"18785","year":"2022"},{"qus_id":"18786","year":"2022"},{"qus_id":"18798","year":"2022"},{"qus_id":"18799","year":"2022"},{"qus_id":"18858","year":"2021"},{"qus_id":"18871","year":"2021"},{"qus_id":"18872","year":"2021"},{"qus_id":"18873","year":"2021"},{"qus_id":"18874","year":"2021"},{"qus_id":"18875","year":"2021"},{"qus_id":"18876","year":"2021"},{"qus_id":"18877","year":"2021"},{"qus_id":"18878","year":"2021"},{"qus_id":"18879","year":"2021"},{"qus_id":"18880","year":"2021"},{"qus_id":"18923","year":"2020"},{"qus_id":"18924","year":"2020"},{"qus_id":"18958","year":"2020"},{"qus_id":"18977","year":"2020"},{"qus_id":"19006","year":"2020"},{"qus_id":"19007","year":"2020"},{"qus_id":"19008","year":"2020"},{"qus_id":"19009","year":"2020"},{"qus_id":"19010","year":"2020"},{"qus_id":"19030","year":"2019"},{"qus_id":"19031","year":"2019"},{"qus_id":"19032","year":"2019"},{"qus_id":"19033","year":"2019"},{"qus_id":"19083","year":"2019"},{"qus_id":"19106","year":"2019"},{"qus_id":"19107","year":"2019"},{"qus_id":"19108","year":"2019"},{"qus_id":"19109","year":"2019"},{"qus_id":"19110","year":"2019"},{"qus_id":"19249","year":"2019"},{"qus_id":"19250","year":"2019"},{"qus_id":"19251","year":"2019"},{"qus_id":"19252","year":"2019"},{"qus_id":"19253","year":"2019"},{"qus_id":"19254","year":"2019"},{"qus_id":"19255","year":"2019"},{"qus_id":"19256","year":"2019"},{"qus_id":"19257","year":"2019"}]