Question 21
If D1, D2, ..., Dn are domains in a relational model, then the relation table is a subset of
Step-by-Step Solution
Detailed Explanation:
Relation is defined as a subset of the Cartesian product D1 x D2 x ... x Dn.
If D1, D2, ..., Dn are domains in a relational model, then the relation table is a subset of
Detailed Explanation:
Relation is defined as a subset of the Cartesian product D1 x D2 x ... x Dn.
Consider relational query SELECT S.sname FROM Suppliers S WHERE S.sid NOT IN (SELECT C.sid FROM Catalog C WHERE C.pid NOT IN (SELECT P.pid FROM Parts P WHERE P.color <> 'blue')). Interpretation:
Detailed Explanation:
The double negation query selects suppliers whose supplied parts are exclusively non-blue.
Consider schema Emp(Empcode, Name, Sex, Salary, Deptt). Query: SELECT Deptt FROM Emp WHERE Sex='M' GROUP BY Deptt HAVING avg(Salary) > {SELECT avg(Salary) FROM Emp}. Output:
Detailed Explanation:
HAVING clause outputs departments where male employees' average salary exceeds overall company average.
Given expression grammar: E -> E * F | F + E | F; F -> F - F | id. Which is true?
Detailed Explanation:
Production rule F is derived deeper in the parse tree than E, giving - higher precedence than * and +.
The number of tokens in the C statement: printf ("i = %d, &i =%x", i&i);
Detailed Explanation:
Tokens are: printf, (, string, ,, i, &, i, ), ; = 10 tokens.