Aspire Faculty ID #18595 · Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II) · Just now
UGC NET Computer Science Dec 2022 Shift I (Paper II)

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:

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.

Previous 10 Questions — UGC NET Computer Science Dec 2022 Shift I (Paper II)

Nearest first
1
Use the following schema of the academic institution relational database: student (rollno, name, degree, year, sex, dep…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
2
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:$P={9,5,2,7,6,16,9}$$…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
3
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:$P={9,5,2,7,6,16,9}$$…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
4
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:$P={9,5,2,7,6,16,9}$$…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
5
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:$P={9,5,2,7,6,16,9}$$…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
6
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:$P={9,5,2,7,6,16,9}$$…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
7
 Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason R. A: Artifici…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
8
Consider the following statements:A. For every regular language, we can design Turing Machine.B. For every context free…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
9
The primary objectives of the SWE-IPT are to: A. Solicit stakeholder needs and expectations. B. Specify the software re…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
10
Given below are the two statements:Statement I: Any retrieval request that is specified in the basic relational algebra…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)

Next 10 Questions — UGC NET Computer Science Dec 2022 Shift I (Paper II)

Ascending by ID
Ask Your Question or Put Your Review.

loading...