Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations

UGC NET Computer Science Previous Year Questions (PYQs)

UGC NET Computer Science Database Management Systems PYQ


UGC NET Computer Science PYQ
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





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


UGC NET Computer Science PYQ
The total cost of retrieving records in sorted order using an unclustered B+ tree is

(P – Average number of records per data page

N – Data pages

F – Ratio of the size of a data entry to the size of a data record)






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

In an unclustered B+ tree, retrieving records in sorted order requires scanning index entries and then fetching records from data pages.


Cost of scanning leaf level entries:


$F \times N$


Number of records:


$P \times N$


So, total cost:


$FN + PN = (F + P)N$


Final Answer: (b) (F + P) * N


UGC NET Computer Science PYQ
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:





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.

UGC NET Computer Science PYQ
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





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.


UGC NET Computer Science PYQ
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?





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.


UGC NET Computer Science PYQ
Which of the following statements is/are false?

A. A user can assign privileges to any user on any relation.
B. A user can assign privileges to any user on its own relations only.
C. System error that leads to accessibility to the portion of database is an example of malicious attack.
D. Passwords itself need to be secured from unauthorized access.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

A → False (only owner or DBA can grant privileges)

B → True

C → False (system error is not a malicious attack)

D → True


False statements:


A and C


UGC NET Computer Science PYQ
A B-tree used as an index for a large database table has four levels including the root node. If a new key is inserted in this index, then maximum number of nodes that could be newly created in the process is





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

In worst case, insertion causes splitting at every level.


There are 4 levels, so 4 new nodes may be created due to splitting.


If the root also splits, one extra new root node is created.


Maximum newly created nodes:


$4 + 1 = 5$


UGC NET Computer Science PYQ
Match List I with List II.

Choose the correct answer from the options given below:





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

UGC NET Computer Science PYQ
Given the basic E R diagram and relational model, which of the following is incorrect?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

In the E R model, an attribute can be multivalued or composite.

But in the relational model, each cell of a table should contain a single atomic value or NULL.

UGC NET Computer Science PYQ

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






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.


UGC NET Computer Science PYQ

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






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


UGC NET Computer Science PYQ

In relational databases, if relation $R$ is in $BCNF$, then which of the following is true about relation $R$?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

If a relation is in $BCNF$, then it is also in $3NF$.

Also, if a relation is in $3NF$, then it is already in $2NF$.

So, if $R$ is in $BCNF$, then $R$ must be in $2NF$ and $3NF$.


UGC NET Computer Science PYQ
Which one of the following is NOT a part of ACID properties of a database 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

ACID properties are:

Atomicity

Consistency

Isolation

Durability

Deadlock-freedom is not a part of ACID properties.

UGC NET Computer Science PYQ

Which of the following key constraints is required for functioning of foreign key in the context of relational databases?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

A foreign key is used to create a relationship between two tables.

A foreign key in one table generally refers to the primary key of another table.

This ensures referential integrity between the two tables.


UGC NET Computer Science PYQ
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5
Table 2: Reserves $R$
SidBidday
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98
Table 3: Boats $B$
BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
Which of the following relational algebra query computes the Sid's of sailors with age over $20$ who have not reserved a red boat?





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)$

UGC NET Computer Science PYQ

In relational database management, which of the following is/are property/properties of candidate key?

$P$: Uniqueness

$Q$: Irreducibility






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

A candidate key must uniquely identify each tuple in a relation.

So, uniqueness is a property of candidate key.

Also, a candidate key must be minimal. It means no proper subset of it can uniquely identify tuples.

This property is called irreducibility.

Therefore, both $P$ and $Q$ are true.


UGC NET Computer Science PYQ
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5
Table 2: Reserves $R$
SidBidday
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98
Table 3: Boats $B$
BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
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)$





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.

UGC NET Computer Science PYQ

Which of the following statements are DML statements?

$(a)$ Update $[tablename]$ Set $[columnname]=VALUE$

$(b)$ Delete $[tablename]$

$(c)$ Select $*$ from $[tablename]$






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

A candidate key must uniquely identify each tuple in a relation.

So, uniqueness is a property of candidate key.

Also, a candidate key must be minimal. It means no proper subset of it can uniquely identify tuples.

This property is called irreducibility.

Therefore, both $P$ and $Q$ are true.


UGC NET Computer Science PYQ
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5
Table 2: Reserves $R$
SidBidday
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98
Table 3: Boats $B$
BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
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)$





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.

UGC NET Computer Science PYQ

Hadoop, a big data tool, works with a number of related tools. Choose from the following, the common tools included into Hadoop:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Hadoop ecosystem includes several tools used for big data storage and processing.

Map Reduce is used for distributed data processing.

HBase is a NoSQL database used in the Hadoop ecosystem.

Hive is used for querying large datasets stored in Hadoop.

Therefore, the common Hadoop tools are Map Reduce, HBase and Hive.


UGC NET Computer Science PYQ
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5
Table 2: Reserves $R$
SidBidday
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98
Table 3: Boats $B$
BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
Which of the following relational algebra query computes the names of sailor who have reserved all 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.

UGC NET Computer Science PYQ

Which of the following features is supported in the relational database model?






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.


UGC NET Computer Science PYQ
Consider the relational schema of sailors $S$, Reserves $R$ and Boats $B$.Table 1: Sailors $S$
SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5
Table 2: Reserves $R$
SidBidday
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98
Table 3: Boats $B$
BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered
Which of the following relational algebra query computes the names of sailors who have reserved a red and a green boat?





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.

UGC NET Computer Science PYQ
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:





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)$


UGC NET Computer Science PYQ
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$.





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);

UGC NET Computer Science PYQ
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:





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.

UGC NET Computer Science PYQ
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:





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.

UGC NET Computer Science PYQ
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::





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.

UGC NET Computer Science PYQ
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:





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.

UGC NET Computer Science PYQ
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?






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;


UGC NET Computer Science PYQ
Which of the following tables is likely to have a foreign key referencing another table in the database system implemented by the company?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Orders table usually contains:


customer_id → referencing Customers table


Thus it contains a foreign key.


UGC NET Computer Science PYQ
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?





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.


UGC NET Computer Science PYQ
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?





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.


UGC NET Computer Science PYQ
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?





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$


UGC NET Computer Science PYQ
A _____ operation combines the rows of the two relations and outputs a new relation that has both input relations' rows in it.





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 union operation combines the rows of two relations.

It gives a new relation containing rows from both input relations.

UGC NET Computer Science PYQ
Which of the following relations cannot be decomposed into BCNF with a lossless join and dependency-preserving decomposition?

R(V, W, X, Y, Z)





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$

UGC NET Computer Science PYQ

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?






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.

UGC NET Computer Science PYQ
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





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$

UGC NET Computer Science PYQ
A trigger is





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.

UGC NET Computer Science PYQ
 Which of the component module of DBMS does rearrangement and possible ordering of operations, eliminate redundancy in query and use efficient algorithms and indexes during the execution of a query?





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 DBMS, the query optimizer is responsible for choosing the most efficient way to execute a query.

It performs tasks like:

Rearranging operations

Choosing proper order of operations

Removing redundant operations

Using efficient algorithms and indexes

So, the required component is:

$query\ optimizer$


UGC NET Computer Science PYQ

Given two tables $R1(x,y)$ and $R2(y,z)$ with $50$ and $30$ numbers of tuples respectively. Find the maximum number of tuples in the output of natural join between tables $R1$ and $R2$ i.e. $R1 * R2$.

$(*-$ Natural Join$)$






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

Tables are:

$R1(x,y)$ has $50$ tuples

$R2(y,z)$ has $30$ tuples

Natural join will be performed on the common attribute:

$y$

Maximum number of tuples will occur when every tuple of $R1$ matches with every tuple of $R2$ on attribute $y$.

So, maximum number of tuples:

$50 \times 30=1500$


UGC NET Computer Science PYQ

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;






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$.


UGC NET Computer Science PYQ

Find the minimum number of tables required for converting the following entity relationship diagram into a relational database.







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$


UGC NET Computer Science PYQ
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 :





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.


UGC NET Computer Science PYQ
Match List I with List II:
List-IList-II
A. BCNFI. It removes multivalued dependency.
B. 3NFII. It is not always dependency preserving.
C. 2NFIII. It removes transitive transparency.
D. 4NFIV. It removes partial functional dependency.
Choose the correct answer from the options given below:





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)$


UGC NET Computer Science PYQ
Match List I with List II:
List-IList-II
A. BCNFI. It removes multivalued dependency.
B. 3NFII. It is not always dependency preserving.
C. 2NFIII. It removes transitive transparency.
D. 4NFIV. It removes partial functional dependency.
Choose the correct answer from the options given below:





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)$

UGC NET Computer Science PYQ

What is SQL primarily used for in the context of relational databases?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

SQL (Structured Query Language) is used to:

  • create tables

  • insert data

  • update data

  • delete data

  • query data

Thus its primary purpose is managing and manipulating relational databases.


UGC NET Computer Science PYQ
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?





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.

UGC NET Computer Science PYQ
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?





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}.


UGC NET Computer Science PYQ
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?





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.

UGC NET Computer Science PYQ

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 ?






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



UGC NET Computer Science PYQ

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 :






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)


UGC NET Computer Science PYQ

Let $T_1$ be a transaction that transfer Rs. $50$ from account A to account B. This transaction can be defined as follows:

 StepOperation 
1  Read (A)
 2A: A-50 
 3 Write(A)
 4 Read(B)
 5B:=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?





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}}$

UGC NET Computer Science PYQ

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:






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}}$

UGC NET Computer Science PYQ

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:






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$


UGC NET Computer Science PYQ
Which of the following best describes the structure of a relational database ?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Relational databases (MySQL, PostgreSQL, Oracle etc.) store data in relations (tables).


Each table consists of:


Rows → tuples / records


Columns → attributes / fields


Thus relational model structure:


tables with rows and columns


UGC NET Computer Science PYQ
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)) )





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]) ).

UGC NET Computer Science PYQ
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:






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

Timestamp protocol ensures freedom from deadlock.

Strict two-phase locking protocol ensures cascade-less rollback.

Two-phase locking means transaction obtains locks in the first phase.

Lock point indicates the final lock of the schedule.

So,

A → III
B → IV
C → I
D → II

Correct option is:

$\boxed{(b)\ A-III,\ B-IV,\ C-I,\ D-II}$


UGC NET Computer Science PYQ
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 :







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$


UGC NET Computer Science PYQ

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?






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)


UGC NET Computer Science PYQ
Consider the following schedule S.
 T1T2T3 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.





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

For data item $X$:

$T2$ writes $X$ before $T4$ reads and writes $X$.

So,

$T2 \to T4$

$T4$ writes $X$ before $T3$ reads and writes $X$.

So,

$T4 \to T3$

For data item $Y$:

$T3$ writes $Y$ before $T1$ reads and writes $Y$.

So,

$T3 \to T1$

Therefore, the serial order is:

$T2 \to T4 \to T3 \to T1$

Correct option is:

$\boxed{(c)\ T2-T4-T3-T1}$


UGC NET Computer Science PYQ
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 :





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.


UGC NET Computer Science PYQ

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$






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$


UGC NET Computer Science PYQ

Use the following schema of the academic institution relational database:

student (rollno, name, degree, year, sex, deptno, advisor)

department (deptid, name, hod, phone)

professor (empid, name, sex, startyear, deptno, phone)

course (courseid cname, credits, deptno)

enrollment (rollno, courseid, sem, year, grade)

teaching (empid, courseid, sem, year, classroom)

prerequisite (precourseid, courseid)

deptno is foreign key in the student, professor and course relations referring to deptid of department relation; advisor is a foreign key in the student relation referring to empid of professor relation; hod is a foreign key in the department relation referring to empid of professor relation; rollno is a foreign key in the enrollment relation referring to rollno of student relation; courseid is a foreign key in the enrollment, teaching relations referring to courseid of course relation; empid is a foreign key of the teaching relation referring to empid of professor relation; precourseid and courseid are foreign keys in the prerequisite relation referring to courseid of the course relation;

Which of the following queries would retrieve the roll number and names of students who have enrolled for all the prerequisite courses of the course number 324 ?







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.

UGC NET Computer Science PYQ

 Minimal cover $F'$ of functional dependency set $F$ is:

Given:

$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$






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}$


UGC NET Computer Science PYQ

Use the following schema of the academic institution relational database:

student (rollno, name, degree, year, sex, deptno, advisor)

department (deptid, name, hod, phone)

professor (empid, name, sex, startyear, deptno, phone)

course (courseid cname, credits, deptno)

enrollment (rollno, courseid, sem, year, grade)

teaching (empid, courseid, sem, year, classroom)

prerequisite (precourseid, courseid)

deptno is foreign key in the student, professor and course relations referring to deptid of department relation; advisor is a foreign key in the student relation referring to empid of professor relation; hod is a foreign key in the department relation referring to empid of professor relation; rollno is a foreign key in the enrollment relation referring to rollno of student relation; courseid is a foreign key in the enrollment, teaching relations referring to courseid of course relation; empid is a foreign key of the teaching relation referring to empid of professor relation; precourseid and courseid are foreign keys in the prerequisite relation referring to courseid of the course relation;

Given query: select s.rollno from students where s.sex = ALL (select f.sex from professor f where f.empid = s.advisor).

Consider the following statements about the given query that retrieves the set of all students whose gender is same as the gender of their advisor:

S1. It has a correlated subquery

S2. It has an uncorrelated subquery

S3. If we replace ALL by ANY in the above query, its result will be different

S4. If we replace ALL by ANY in the above query, its result will be same.

Identify all the statement that are TRUE:






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 subquery is:

select f.sex from professor f where f.empid = s.advisor

Here, the subquery uses s.advisor from the outer query.

So, it is a correlated subquery.

Therefore, S1 is true and S2 is false.

Also, advisor refers to empid of professor relation. Since empid is unique, the subquery returns only one professor’s sex.

So,

s.sex = ALL (single value)

and

s.sex = ANY (single value)

will give the same result.

Therefore, S4 is true and S3 is false.


UGC NET Computer Science PYQ

An organization needs to maintain database having five attributes $A,B,C,D,E$. These attributes are functionally dependent on each other for which functional dependency set $F$ is given as:

$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$

Consider a universal relation $R(A,B,C,D,E)$ with functional dependency set $F$. Also all attributes are simple and take atomic values only.

Identify primary key of table $R$ with functional dependency set $F$.

Given:

$R(A,B,C,D,E)$

$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$






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$


UGC NET Computer Science PYQ

Use the following schema of the academic institution relational database:

student (rollno, name, degree, year, sex, deptno, advisor)

department (deptid, name, hod, phone)

professor (empid, name, sex, startyear, deptno, phone)

course (courseid cname, credits, deptno)

enrollment (rollno, courseid, sem, year, grade)

teaching (empid, courseid, sem, year, classroom)

prerequisite (precourseid, courseid)

deptno is foreign key in the student, professor and course relations referring to deptid of department relation; advisor is a foreign key in the student relation referring to empid of professor relation; hod is a foreign key in the department relation referring to empid of professor relation; rollno is a foreign key in the enrollment relation referring to rollno of student relation; courseid is a foreign key in the enrollment, teaching relations referring to courseid of course relation; empid is a foreign key of the teaching relation referring to empid of professor relation; precourseid and courseid are foreign keys in the prerequisite relation referring to courseid of the course relation;

Which of the following queries would compute, for each department, the total credits of all the courses offered by the department?






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.


UGC NET Computer Science PYQ

An organization needs to maintain database having five attributes $A,B,C,D,E$. These attributes are functionally dependent on each other for which functional dependency set $F$ is given as:

$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$

Consider a universal relation $R(A,B,C,D,E)$ with functional dependency set $F$. Also all attributes are simple and take atomic values only.

Identify the normal form in which relation $R$ belong to.






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

$A$

Since the primary key contains only one attribute, there is no partial dependency.

So, relation $R$ is in $2NF$.

Now check for $3NF$.

Given dependency:

$D\rightarrow E$

Here, $D$ is not a super key and $E$ is a non-prime attribute.

So, relation is not in $3NF$.

Therefore, the highest normal form of relation $R$ is:

$2NF$


UGC NET Computer Science PYQ

Use the following schema of the academic institution relational database:

student (rollno, name, degree, year, sex, deptno, advisor)

department (deptid, name, hod, phone)

professor (empid, name, sex, startyear, deptno, phone)

course (courseid cname, credits, deptno)

enrollment (rollno, courseid, sem, year, grade)

teaching (empid, courseid, sem, year, classroom)

prerequisite (precourseid, courseid)

deptno is foreign key in the student, professor and course relations referring to deptid of department relation; advisor is a foreign key in the student relation referring to empid of professor relation; hod is a foreign key in the department relation referring to empid of professor relation; rollno is a foreign key in the enrollment relation referring to rollno of student relation; courseid is a foreign key in the enrollment, teaching relations referring to courseid of course relation; empid is a foreign key of the teaching relation referring to empid of professor relation; precourseid and courseid are foreign keys in the prerequisite relation referring to courseid of the course relation;

Which of the following queries would retrieve the dept id and name of all the departments that are such that the total of the credits of all the offered courses by the department is strictly greater than 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


UGC NET Computer Science PYQ

An organization needs to maintain database having five attributes $A,B,C,D,E$. These attributes are functionally dependent on each other for which functional dependency set $F$ is given as:

$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$

Consider a universal relation $R(A,B,C,D,E)$ with functional dependency set $F$. Also all attributes are simple and take atomic values only.

Identify the redundant functional dependency in $F$.

Given:

$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

We need to check which functional dependency can be derived from the other dependencies.

Given:

$A\rightarrow BC$

and

$BC\rightarrow D$

So, by transitivity:

$A\rightarrow BC\rightarrow D$

Therefore,

$A\rightarrow D$

can be derived from $A\rightarrow BC$ and $BC\rightarrow D$.

So, $A\rightarrow D$ is redundant.


UGC NET Computer Science PYQ
In a relational database, which one of the following is CORRECT:





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.

UGC NET Computer Science PYQ

Use the following schema of the academic institution relational database:

student (rollno, name, degree, year, sex, deptno, advisor)

department (deptid, name, hod, phone)

professor (empid, name, sex, startyear, deptno, phone)

course (courseid cname, credits, deptno)

enrollment (rollno, courseid, sem, year, grade)

teaching (empid, courseid, sem, year, classroom)

prerequisite (precourseid, courseid)

deptno is foreign key in the student, professor and course relations referring to deptid of department relation; advisor is a foreign key in the student relation referring to empid of professor relation; hod is a foreign key in the department relation referring to empid of professor relation; rollno is a foreign key in the enrollment relation referring to rollno of student relation; courseid is a foreign key in the enrollment, teaching relations referring to courseid of course relation; empid is a foreign key of the teaching relation referring to empid of professor relation; precourseid and courseid are foreign keys in the prerequisite relation referring to courseid of the course relation;

Given query:

select s.rollno, s.name
from student s
where EXISTS (select c.courseid from course c Where c.deptno =5 and
EXISTS (select e.* from enrollment e
where e.courseid = c.courseid and
e.rollno = s.rollno));

Which one of the following statements is correct with respect to the given query?






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.


UGC NET Computer Science PYQ

An organization needs to maintain database having five attributes $A,B,C,D,E$. These attributes are functionally dependent on each other for which functional dependency set $F$ is given as:

$F={A\rightarrow BC,\ D\rightarrow E,\ BC\rightarrow D,\ A\rightarrow D}$

Consider a universal relation $R(A,B,C,D,E)$ with functional dependency set $F$. Also all attributes are simple and take atomic values only.

Assume that given table $R$ is decomposed in two tables:

$R_1(A,B,C)$ with functional dependency set

$f_1={A\rightarrow B,\ A\rightarrow C}$

and

$R_2(A,D,E)$ with FD set

$F_2={A\rightarrow D,\ D\rightarrow E}$

Which of the following option is true w.r.t. given decomposition?






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$.


UGC NET Computer Science PYQ

How does a relational database ensure data integrity?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Relational databases ensure data integrity using:

• Primary keys
• Foreign keys
• Constraints
• Schema rules

Thus integrity is maintained by enforcing rules defined in the schema.

UGC NET Computer Science PYQ
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?





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$.

UGC NET Computer Science PYQ

Consider the two relations below. The primary keys are underlined. Identify all possible foreign key(s) from the options based only on the two relations.

$EMP(eid, ename, did)$

$DEPT(did, dname)$






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 $DEPT$, $did$ is the primary key.

In $EMP$, $did$ can refer to $DEPT(did)$.

So, $EMP.did$ is a foreign key.


UGC NET Computer Science PYQ
Which of the following statements is correct, according to the following instance of the relational schema R(X, Y, Z)?
 XY Z 
1   1a 
 11  a
 21 b 
 32 b 





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.


UGC NET Computer Science PYQ
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$catchcatch$\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?





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.

UGC NET Computer Science PYQ
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:





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.

UGC NET Computer Science PYQ
Given a fixed-length record file that is ordered on the key field. The file needs $B$ disk blocks to store $R$ number of records. Find the average access time needed to access any record of the given file using binary search.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

The file is ordered on the key field, so binary search can be applied.

Binary search works on disk blocks, not directly on records.

If there are $B$ disk blocks, then number of block accesses required is approximately:

$\log_2 B$

So, average access time using binary search is:

$\log_2 B$

UGC NET Computer Science PYQ
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?





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).

UGC NET Computer Science PYQ
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);





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.

UGC NET Computer Science PYQ
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 IList II
A. Degree of table RI. $15$
B. Cardinality of table RII. NIL
C. Foreign key of relation STUDENTIII. $6$
D. Foreign key of relation COURSEIV. Courseno
Choose the correct answer from the options given below:





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$.

UGC NET Computer Science PYQ
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)=$ ______.





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)$.

UGC NET Computer Science PYQ
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:





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.

UGC NET Computer Science PYQ
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?





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.

UGC NET Computer Science PYQ
 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:





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.

UGC NET Computer Science PYQ
 Which of the following is used to create a database schema?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

Database schema means structure of database.

It includes tables, attributes, constraints and relationships.

DDL means Data Definition Language.

DDL commands like CREATE, ALTER and DROP are used to define or modify database schema.

DML is used to manipulate data, not create schema.

UGC NET Computer Science PYQ
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.





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.

UGC NET Computer Science PYQ

What are the drawbacks of using file systems to store data?

  1. Data inconsistency
  2. Difficulty in accessing data
  3. Data isolation
  4. Atomicity of updates

Choose the correct answer from the options given below:






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.


UGC NET Computer Science PYQ

Which of the following database model, we have a parent-child relationship?

  1. hierarchical databases
  2. network databases
  3. relational databases

Choose the correct answer from the options below:






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$


UGC NET Computer Science PYQ
Identify the correct operation that produces the below-given output based on two relations R1 and R2.
R1
 NameClass 
a1 9 
 b1 5
c1 6 
d1 11 
R2
 Name Class
b1 5 
f1 8 
Output
 Name Class 
b1 5 
Choose the correct answer from the options below :





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$


UGC NET Computer Science PYQ
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:





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.

UGC NET Computer Science PYQ

The techniques used to handle the phantom problem are

A. Time stamping
B. Index locking
C. Predicate locking
D. Execution indexing






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.


UGC NET Computer Science PYQ
The data node and name node in HADOOP are





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 Hadoop, DataNode stores actual data blocks, so it works as worker node.

NameNode manages metadata of files and blocks, so it works as master node.

Hence, DataNode and NameNode are Worker Node and Master Node respectively.

UGC NET Computer Science PYQ
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?





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$


UGC NET Computer Science PYQ
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)$





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.

UGC NET Computer Science PYQ
Which of the following scenario may lead to an irrecoverable error in a database system?





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.

UGC NET Computer Science PYQ

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.






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



UGC NET Computer Science


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

UGC NET Computer Science


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Limited Seats
× Aspire MCA Promotion

Game Changer NIMCET Test Series 2026

Boost your preparation with mock tests, analysis and rank-focused practice.

JOIN NOW
Ask Your Question or Put Your Review.

loading...