wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit 3 MCQ DBMS

Total questions: 99

Worksheet time: 50mins

Name
Class
Date
1.
Assertion (A): Relational Algebra (RA) queries are inherently procedural. Reason (R): RA requires the user to specify the sequence of operations (selection, projection, join, etc.) needed to derive the result.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
2.
Assertion (A): The Division operator in RA can be expressed using the fundamental operators (\sigma, \Pi, \times, \cup, -). Reason (R): Division is defined as the set of values of A such that the pair (A, B) exists for all possible values of B.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
3.
Assertion (A): The operation \Pi_{A(R \cup S) is always equivalent to \Pi_{A(R) \cup \Pi_{A(S). Reason (R): The Projection (\Pi) operation is distributive over the Union (\cup) operation.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
4.
Assertion (A): The Theta Join (\bowtie_{\theta) is necessary when the join condition involves arbitrary comparison operators (<, >, \ne) rather than just equality. Reason (R): The Equijoin is simply a special case of the Theta Join where \theta is always equality (=).
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
5.
Assertion (A): The Tuple Relational Calculus (TRC) is computationally equivalent to the Domain Relational Calculus (DRC). Reason (R): Both relational calculus formalisms are non-procedural and express the same set of queries as the Relational Algebra.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
6.
Assertion (A): The Set Difference operator (-) is a fundamental operator in RA. Reason (R): The JOIN and INTERSECT operators can be defined entirely using the fundamental RA operators.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
7.
Assertion (A): The natural join (R \bowtie S) automatically removes duplicate attributes from the resulting relation. Reason (R): The natural join requires equality on all shared attributes and projects the result set only once for the common attributes.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
8.
Assertion (A): Renaming (\rho) is essential in RA for operations involving self-joins. Reason (R): Without renaming, the operands of a self-join would have identical attribute names, making attribute qualification impossible.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
9.
Assertion (A): The TRC query \{t \mid P(t)\ defines the set of tuples t that satisfy the formula P(t). Reason (R): P(t) must be a well-formed formula where the only free variable is t, and it may use existential (\exists) and universal (\forall) quantifiers.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
10.
Assertion (A): RA lacks the computational power equivalent to general-purpose programming languages like Java or Python. Reason (R): RA cannot perform iteration, recursion, or complex output formatting, limiting its capabilities to closed-form queries.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
11.
Assertion (A): The sequence \Pi_{B(R) \times \Pi_{A(S) (Cartesian Product of Projections) is generally much smaller than \Pi_{B, A(R \times S). Reason (R): The Cartesian Product operation is computationally expensive, and executing it after projection (on potentially smaller relations) is often an optimization technique.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
12.
Assertion (A): The Set Intersection (\cap) operation requires the relations to be union-compatible. Reason (R): Union compatibility means both relations must have the same number of attributes and corresponding attributes must have the same domains.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
13.
Assertion (A): DRC variables range over the values of attributes, whereas TRC variables range over entire tuples. Reason (R): DRC is considered more powerful than TRC because it can express non-safe queries more easily.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
14.
Assertion (A): The Outer Join operation (\bowtie_{O) is considered non-fundamental in RA. Reason (R): Outer Join can be expressed by combining a regular JOIN with UNION and Set Difference to add tuples that failed the join condition, padding them with null values.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
15.
Assertion (A): The Selection (\sigma) operator increases the number of tuples in a relation. Reason (R): Selection filters tuples based on a condition, resulting in a subset of the original tuples, thus the result size is \le the original size.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
16.
Numerical (Cartesian Product): Relation R has 5 tuples and 3 attributes. Relation S has 10 tuples and 4 attributes. How many tuples and attributes does the resulting relation R \times S have?
a)
5 tuples, 12 attributes
b)
15 tuples, 7 attributes
c)
50 tuples, 7 attributes
d)
50 tuples, 12 attributes
17.
Analytical (Projection): If a relation R has 100 tuples and 5 attributes, and R contains duplicate tuples, what is the maximum possible number of tuples in \Pi_{A, B(R)?
a)
5
b)
10
c)
100
d)
500
18.
Numerical (Theta Join): Relation R(A, B) has 3 tuples, and S(C, D) has 4 tuples. The join condition is R.B < S.C. If R.B=\{1, 2, 3\ and S.C=\{2, 4, 6, 8\, how many tuples will the join R \bowtie_{R.B < S.C S yield?
a)
12
b)
6
c)
7
d)
10
19.
Analytical (Division Expression): The Division operation R \div S (where R has attributes (A, B) and S has (B)) is equivalent to:
a)
\Pi_A(R) - \Pi_A((\Pi_A(R) \times S) \bowtie R)
b)
\Pi_A(R) - \Pi_A((\Pi_A(R) \times S) - R)
c)
R - S
d)
\Pi_A(R) \times \Pi_B(S)
20.
Analytical (Relational Comparison): What must be true for two relations R and S to be compared using the set operators (\cup, \cap, -)?
a)
They must be identical.
b)
They must have no attributes in common.
c)
They must be union-compatible.
d)
They must be the result of a JOIN.
21.
Analytical (Computational Capability): Which of the following RA queries is computationally impossible to express using TRC or DRC without extending the calculus?
a)
Find employees earning more than 50,000.
b)
Find pairs of employees working in the same department.
c)
Find the closure (ancestor/descendant) of a relationship (requires recursion).
d)
Find employees managed by all managers.
22.
Numerical (Relational Calculus Variable): In the DRC formula \{A, B \mid \exists C (P(A, C) \land Q(B, C)) \, how many distinct domain variables are used?
a)
2
b)
3
c)
4
23.
Analytical (Query Optimization): Given the expression \Pi_{A, C(\sigma_{B > 10(R \bowtie S)), an optimizer should ideally push the selection before the join. Why?
a)
Selection only works on single tables.
b)
To reduce the number of tuples passed to the computationally expensive JOIN operation.
c)
To avoid the need for projection.
d)
Joins must always be performed last.
24.
Analytical (Safe Query): A query in TRC or DRC is considered safe if:
a)
It is expressed using only fundamental operators.
b)
It avoids existential quantifiers.
c)
It guarantees that the result set is finite and contained within the domain of the active database.
d)
It can be translated directly to a RA expression.
25.
Case Study (Computational Capability): A bank needs to find the employees who have the highest salary in their respective departments. This query requires:
a)
Only Selection and Projection.
b)
Aggregation (\mathcal{G) and comparative Self-Join.
c)
Division and Set Union.
d)
Only Cartesian Product.
26.
Case Study (Query Intent): A user wants to retrieve the names of all employees who work on every project available in the PROJECTS relation. Which RA operation is essential for formulating this query?
a)
Selection
b)
Natural Join
c)
Cartesian Product
d)
Division
27.
Case Study (Self-Join): A company database has an EMPLOYEE table (E) with attributes (EID, Name, ManagerID). To find pairs of employees who report to the same manager, the administrator must use:
a)
Set Union
b)
Set Difference
c)
A self-join with \rho (Renaming)
d)
Division
28.
Case Study (Left Outer Join): A retail store wants a list of all customers along with any orders they have placed. Customers who have placed no orders must still appear. Which JOIN operation is required?
a)
Inner Join (\bowtie)
b)
Full Outer Join (\bowtie_{FO)
c)
Left Outer Join (\bowtie_{LO)
d)
Cartesian Product (\times)
29.
Case Study (TRC Formulation): To retrieve the Name of students who have scored > 90 in the GRADES(SID, CID, Score) relation, the TRC expression would involve:
a)
A selection predicate on the Score attribute with Score > 90.
b)
An existential quantifier over all Score values.
c)
A universal quantifier over all SID values.
d)
A Cartesian Product with the STUDENT relation.
30.
Case Study (Query Equivalence): An optimizer must choose between \sigma_{A=10(R \bowtie S) and R \bowtie \sigma_{A=10(S). Analytically, if attribute A belongs only to S, the second form is preferred because:
a)
Joins must always be executed first.
b)
The selection is performed on the smaller relation S before the costly JOIN, reducing the join input size.
c)
The first form violates closure.
d)
Selection cannot be pushed past the join.
31.
Case Study (DRC Formulation): To formulate the query "Find the EID and Name of employees who do NOT work on project 'P1'" using DRC, the query must include which quantifier?
a)
\exists (Existential)
b)
\forall (Universal) and negation (\neg)
c)
Only \land (AND)
d)
\leftarrow (Assignment)
32.
Case Study (Set Operations): An administrator runs a query to find employees listed in both the CURRENT\_EMP and FORMER\_EMP relations (assuming compatibility). Which RA operator is used?
a)
Union (\cup)
b)
Set Difference (-)
c)
Intersection (\cap)
d)
Cartesian Product (\times)
33.
Case Study (Division Application): A company uses R(Supplier, Part) and S(Part). If the query R \div S is executed, the result will be a relation containing:
a)
All parts supplied by every supplier.
b)
All suppliers who supply all the parts listed in S.
c)
All pairs of Supplier and Part.
d)
All parts supplied by at least one supplier.
34.
Case Study (Projection): A relation R(A, B, C) has tuples \{(1, 10, X), (2, 10, Y), (1, 10, X)\. What is the cardinality of \Pi_{A, B(R)?
a)
3
b)
2
c)
1
d)
4
35.
Case Study (Inner Join): A Natural Join between EMPLOYEE(EID, DeptID) and DEPARTMENT(DeptID, DName) returns 100 tuples. If 5 employees have a null DeptID, how many tuples would a Left Outer Join return?
a)
100
b)
105
c)
95
d)
5
36.
Analytical (Minimal Set): Which set of RA operators is considered the fundamental minimal set from which all other RA operators can be derived?
a)
\{\Pi, \sigma, \cup, \bowtie, \rho\
b)
\{\Pi, \sigma, \times, \cup, -\
c)
\{\Pi, \sigma, \cap, \div, \rho\
d)
\{\bowtie, \cup, -\
37.
Numerical (Equijoin): Relation R has 100 tuples, S has 200 tuples. If their shared key attribute ID has 50 matching values, and each match is unique, how many tuples result from the Equijoin R \bowtie_{R.ID=S.ID S?
a)
20000
b)
300
c)
150
d)
50
38.
Analytical (Calculus vs. Algebra): Why is the Relational Calculus primarily used as a theoretical definition language, whereas Algebra is used for implementation?
a)
Calculus is procedural and slow.
b)
Calculus is non-procedural (descriptive), making it suitable for optimization and declarative query definition.
c)
Algebra lacks universal and existential quantifiers.
d)
Calculus cannot be translated to SQL.
39.
Analytical (Renaming): If R(A, B) is renamed as \rho_{S(R), what is the resulting schema?
a)
R(S.A, S.B)
b)
R(A, B)
c)
S(A, B)
d)
S(S.A, S.B)
40.
Analytical (Closure Property): Relational Algebra operations satisfy the Closure Property. What does this mean?
a)
Every query must be safe.
b)
The result of any RA operation is always another relation, allowing operations to be chained.
c)
All attributes must have the same domain.
d)
The result must be finite.
41.
Numerical (Selection): A relation STUDENT has 1000 tuples. If \sigma_{Age>20 \land City='NY'(STUDENT) is executed, and 400 students are > 20 and 300 students are in 'NY', what is the maximum possible cardinality of the result?
a)
700
b)
1000
c)
300
d)
400
42.
Analytical (Computational Limitation): Which RA operation can be derived using only the fundamental operators (\sigma, \Pi, \times, \cup, -) and is not considered fundamental itself?
a)
Selection (\sigma)
b)
Cartesian Product (\times)
c)
Intersection (\cap)
d)
Projection (\Pi)
43.
Analytical (Grouping/Ungrouping): If a relation is grouped using an RA extension (like \mathcal{G operator), what happens to the attributes that are not part of the grouping key?
a)
They are projected out.
b)
They are deleted.
c)
They form complex, nested relations (nested relations or bags).
d)
They are duplicated across all groups.
44.
Numerical (Left Outer Join): R(A, B) has 5 tuples. S(B, C) has 3 tuples. All 3 tuples in S match B values in R. Additionally, 2 tuples in R have unique B values. How many tuples result from the Left Outer Join R \bowtie_{LO S?
a)
5
b)
3
c)
7
d)
5
45.
Analytical (Well-Formed Formula): In the Relational Calculus, a condition that only uses variables bound by quantifiers (\exists or \forall) or ranging over attributes in the result is required to be:
a)
Recursive
b)
Procedural
c)
Well-Formed
d)
Atomic
46.
Case Study (Set Difference): A department wants to identify employees who are currently working on a project but have not been assigned a specific skill. This requires finding the difference between the ASSIGNED and SKILLED relations. Which operator is used?
a)
\cup
b)
\cap
c)
\bowtie
d)
-
47.
Analytical (Equivalence): The expression \sigma_{P(R) is equivalent to which TRC expression?
a)
\{t \mid \neg P(t) \
b)
\{t \mid t \in R \land P(t) \
c)
\{t \mid t \in R \lor P(t) \
d)
\{t \mid \exists s (s \in R \land P(s)) \
48.
Numerical (Self-Join): Relation R(A) has tuples \{1, 2, 3\. The self-join R_1 \bowtie_{R_1.A < R_2.A R_2 (where R_1=\rho_{R_1(R) and R_2=\rho_{R_2(R)) will result in how many tuples?
a)
9
b)
6
c)
3
49.
Analytical (Closure vs. Safety): What is the main analytical difference between the Closure Property (RA) and the Safety Requirement (RC)?
a)
Closure ensures the result is valid; Safety ensures the query is declarative.
b)
Closure ensures the result is another relation for chaining; Safety ensures the result is finite.
c)
Closure applies only to JOIN; Safety applies only to SELECT.
d)
They are synonyms for computational completeness.
50.
Analytical (Renaming Attributes): Given R(EID, Name), the operation \rho_{S(EmpID, FullName)(R) results in a relation S with the schema:
a)
S(EID, Name)
b)
S(EmpID, Name)
c)
S(EmpID, FullName)
d)
R(EmpID, FullName)
51.
Assertion (A): The TRC expression for finding all suppliers who supply either part P1 or part P2 uses the logical connective \lor (OR). Reason (R): TRC and DRC support all standard logical connectives and quantifiers, allowing complex conditions to be expressed non-procedurally.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
52.
Assertion (A): The Full Outer Join (\bowtie_{FO) can conceptually be expressed by combining Left Outer Join, Right Outer Join, and Set Intersection. Reason (R): The Full Outer Join includes all tuples from both relations, matching where possible, and padding non-matching tuples with nulls on both sides.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
53.
Assertion (A): The RA operation \Pi_{A(R \cap S) is always equivalent to \Pi_{A(R) \cap \Pi_{A(S). Reason (R): Intersection (\cap) is not generally distributive over Projection (\Pi), as projection might mask the non-matching attributes required for the intersection.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
54.
Assertion (A): Relational Calculus queries that include the Universal Quantifier (\forall) are typically translated into RA queries that use the Division operator. Reason (R): Division is the RA equivalent of the "for all" requirement, often involving negation of negation (\Pi_A(R) - \Pi_A((\Pi_A(R) \times S) - R)).
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
55.
Assertion (A): The JOIN operation is computationally more expensive than the SELECTION operation. Reason (R): JOIN involves combining potentially all pairs of tuples from two relations (in the worst case of a Cartesian product), whereas SELECTION is a linear scan of a single relation.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
56.
Assertion (A): The power of RA is limited to the expression of non-recursive queries. Reason (R): The result of any RA expression must be finite and computable in a fixed number of steps, which excludes recursive definitions.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
57.
Assertion (A): In DRC, the result schema must explicitly list the domain variables that correspond to the desired attributes. Reason (R): DRC variables represent domain values (like an EID value or a Name value), and the result set is formed by the listed free domain variables.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
58.
Assertion (A): The Inner Join (\bowtie) preserves all information from the original relations. Reason (R): The Inner Join only includes tuples that satisfy the join condition, discarding tuples from either relation that do not have a matching tuple in the other.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
59.
Assertion (A): The GROUPING and UNGROUPING operators are standard extensions to the basic RA set. Reason (R): These operators violate the first normal form by creating nested relations, making them necessary extensions for RA to support summary functions (like AVG or SUM).
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
60.
Assertion (A): The Natural Join requires the two joined relations to share at least one attribute name. Reason (R): Without a common attribute name, the Natural Join defaults to a Cartesian Product, as there is no basis for the implicit equality comparison.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
61.
Case Study (DRC Negation): Which DRC formula expresses the query "Find all $EID$s that are NOT in the WORKS\_ON(EID, PID, Hours) relation?"
a)
\{EID \mid \exists PID, Hours (WORKS\_ON(EID, PID, Hours)) \
b)
\{EID \mid \neg \exists PID, Hours (WORKS\_ON(EID, PID, Hours)) \
c)
\{EID \mid \forall PID, Hours (WORKS\_ON(EID, PID, Hours)) \
d)
\{EID \mid WORKS\_ON(EID, \dots) \
62.
Numerical (Set Operations): Relation R=\{1, 2, 3, 4\, S=\{3, 4, 5, 6\. What is the cardinality of the expression (R - S) \cup (S - R)?
a)
4
b)
6
c)
4
d)
8
63.
Case Study (Computational Capability): Which task can be performed by a RA query?
a)
Determine if the EMPLOYEE relation contains more tuples than the DEPT relation.
b)
Compute the Fibonacci sequence.
c)
Find the average salary of employees in Department 'D1'.
d)
Print the entire database schema to an external file.
64.
Analytical (Equivalence): The RA expression R \cap S is equivalent to which RA expression?
a)
R \cup S
b)
R - (R - S)
c)
S - (S - R)
d)
Both R - (R - S) and S - (S - R)
65.
Numerical (Projection/Selection): Relation R(A, B, C) has 10 unique tuples. R \bowtie_{B < C R is executed. What is the maximum number of attributes in the final result?
a)
3
b)
6
c)
10
d)
1
66.
Case Study (Right Outer Join): A Human Resources manager needs a report listing all departments and any employees currently assigned to them. Departments without employees must still be listed. This requires a JOIN between EMPLOYEE and DEPARTMENT:
a)
Left Outer Join (\bowtie_{LO)
b)
Inner Join (\bowtie)
c)
Right Outer Join (\bowtie_{RO)
d)
Division (\div)
67.
Analytical (Computational Power): RA is often described as being Turing-incomplete. Why?
a)
It cannot handle nested relations.
b)
It lacks constructs for iteration, recursion, and general flow control, unlike Turing-complete languages.
c)
It is only declarative.
d)
It requires the use of set theory.
68.
Case Study (Finding Managers): Given EMPLOYEE(EID, Name, MGR\EID), the query to find the names of all employees who are also managers requires:
a)
\Pi{Name(EMPLOYEE)
b)
\sigma_{MGR\EID \ne NULL(EMPLOYEE)
c)
\Pi{Name(EMPLOYEE \bowtie_{EID=MGR\EID \rho{M(EMPLOYEE))
d)
Division
69.
Numerical (Projection): Relation R has 100 tuples. The attribute City has 5 distinct values. What is the cardinality of \Pi_{City(R)?
a)
100
b)
5
c)
95
d)
1
70.
Analytical (Renaming): When using the \rho operator to rename attributes, what constraint is analytically imposed on the number of new attribute names provided?
a)
Must be the same as the number of tuples.
b)
Must be exactly the same as the number of attributes in the relation.
c)
Must be one more than the number of attributes.
d)
No constraint is imposed.
71.
Analytical (Calculus Free Variables): In the TRC formula \{t \mid \exists s (t \in R \land s \in S \land t.A = s.B)\, which variable is the free variable (defining the result)?
a)
s
b)
t.A
c)
s.B
d)
t
72.
Case Study (Relational Comparison): To find relations that are not identical, an administrator executes (R - S) \cup (S - R). If the result is empty, what conclusion can be drawn?
a)
R and S have no common tuples.
b)
R is a subset of S.
c)
R and S are identical relations (equal).
d)
R and S are not union-compatible.
73.
Numerical (Theta Join): Relation R(A) has 100 tuples, and S(B) has 100 tuples. What is the maximum possible cardinality of R \bowtie_{R.A \ne S.B S?
a)
100
b)
200
c)
9900
d)
10000
74.
Analytical (Outer Join): Why do Outer Join results potentially introduce null values?
a)
To enforce the closure property.
b)
To represent attribute values for tuples that failed the Inner Join condition.
c)
To satisfy the Division operator requirements.
d)
To simplify the projection step.
75.
Analytical (Query Simplification): The sequence \sigma_{C_1(\sigma_{C_2(R)) is always equivalent to \sigma_{C_1 \land C_2(R). This demonstrates the optimization principle of:
a)
Pushing projection
b)
Cascading selections
c)
Commutativity of join
d)
Distributivity of union
76.
Case Study (Complex Selection): To find employees whose salary is not between 30,000 and 50,000 (inclusive), the RA selection condition (\sigma_P(R)) must use which logical construct?
a)
\sigma_{Salary \ge 30000 \land Salary \le 50000(R)
b)
\sigma_{Salary < 30000 \lor Salary > 50000(R)
c)
\sigma_{Salary < 30000 \land Salary > 50000(R)
d)
\sigma_{Salary = 30000 \lor Salary = 50000(R)
77.
Analytical (Computational Completeness): The set of queries expressible in Relational Algebra is precisely the set of queries expressible in Tuple Relational Calculus. This set is called the:
a)
Turing Set
b)
Full Calculus
c)
Relational Complete Set
d)
Safe Set
78.
Numerical (Cartesian Product Attributes): Relation R has schema (A, B, C, D) and S has (C, D, E). How many attributes does R \times S have?
a)
5
b)
6
c)
7
d)
4
79.
Case Study (Equivalence): The RA expression R - S is equivalent to the TRC expression:
a)
\{t \mid t \in R \land t \in S\
b)
\{t \mid t \in R \land t \notin S\
c)
\{t \mid t \notin R \land t \in S\
d)
\{t \mid t \notin R \land t \notin S\
80.
Analytical (Optimization): When evaluating R \bowtie (S \bowtie T), if S \bowtie T results in a very large intermediate relation, an optimizer may use associativity to rewrite the query. This is an example of an optimization based on:
a)
Distributivity
b)
Commutativity
c)
Associativity
d)
Closure
81.
Assertion (A): The JOIN operation is both commutative and associative. Reason (R): R \bowtie S = S \bowtie R (commutative) and R \bowtie (S \bowtie T) = (R \bowtie S) \bowtie T (associative), which is useful for query optimization.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
82.
Numerical (Set Difference): R(A, B)=\{(1, x), (2, y)\. S(A, B)=\{(1, x), (3, z)\. What is the cardinality of R - S?
a)
2
b)
1
c)
3
83.
Analytical (Set Compatibility): Relations R(A) and S(A, B) are not union-compatible. Why?
a)
They have different attribute names.
b)
They have different numbers of attributes.
c)
They have different domains.
d)
They share the attribute A.
84.
Case Study (Computational Capability): To compute the total value of sales over the past year, which extension must be added to the basic RA operators?
a)
Division
b)
Aggregate functions (e.g., SUM)
c)
Set Difference
d)
Renaming
85.
Analytical (Equivalence): The TRC formula \{t \mid \exists s (t \in R \land s \in S)\ is equivalent to which RA expression?
a)
R \cup S
b)
R \cap S
c)
\Pi_{R.Schema(R \bowtie S)
d)
\Pi_{R.Schema(R \times S)
86.
Analytical (Outer Join): A key difference between Right Outer Join and Inner Join is that ROJ ensures that all tuples from the:
a)
Left relation are present.
b)
Right relation are present.
c)
Both relations are present.
d)
Neither relation is present.
87.
Numerical (Natural Join): R(A, B, C), S(C, D, E). R has 10 unique C values, S has 15 unique C values. If 8 C values match, and each match is unique, how many attributes are in R \bowtie S?
a)
8
b)
3
c)
5
d)
6
88.
Analytical (Calculus Safety): A DRC query that defines a result based on domain values not present in the database (e.g., all numbers greater than 1000) is classified as:
a)
Relational Complete
b)
Unsafe
c)
Procedural
d)
Non-recursive
89.
Case Study (Renaming): An application needs the result of R \bowtie S but requires the final attribute names to be A, B, C, D. If R=(A, B) and S=(C, D), which step is logically unnecessary for attribute naming in the final query?
a)
Natural Join (\bowtie)
b)
Cartesian Product (\times)
c)
\rho (Renaming)
d)
\Pi (Projection)
90.
Analytical (Projection Property): \Pi_{A(\Pi_{B(R)) is only valid if:
a)
A and B are the same attribute.
b)
A is a subset of B.
c)
B is a subset of A.
d)
R is union-compatible with S.
91.
Assertion (A): The Division operator requires the divisor relation (S) to be a subset of the attributes of the dividend relation (R). Reason (R): If S is not a subset of R, the Cartesian Product required for the Division expression cannot form the set difference correctly.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
92.
Numerical (Selection Order): A relation has 1000 tuples. \sigma_{Age>20(R) yields 500 tuples. \sigma_{City='NY'(R) yields 300 tuples. What is the maximum reduction in tuples achieved by applying \sigma_{Age>20 first in the sequence \sigma_{City='NY'(\sigma_{Age>20(R))?
a)
1000
b)
300
c)
500
d)
700
93.
Analytical (Calculus Variables): In TRC, if a tuple variable t is used in the output (e.g., \{t \mid \dots\), how must the attributes of t be defined?
a)
They must be recursively defined.
b)
They must be defined by \forall.
c)
They must be defined by membership in a relation (t \in R).
d)
They must be defined by \exists.
94.
Case Study (Natural Join Failure): R(A, B) and S(C, D) are joined using a Natural Join. The result is a relation with 4 attributes and 50 tuples. What can be inferred?
a)
The relations are identical.
b)
The relations shared no common attribute names, resulting in a Cartesian Product.
c)
The relations were union-compatible.
d)
The join condition was A=C.
95.
Analytical (Equivalence): Given two union-compatible relations R and S, R \cup S is equivalent to:
a)
(R - S) \cup S
b)
R \times S
c)
\Pi_{Schema(R \cap S)
d)
R \cap S
96.
Assertion (A): The use of Grouping and Aggregation extends the computational capabilities of the basic RA. Reason (R): Basic RA is limited to set-theoretic operations and cannot perform arithmetic summary calculations on groups of data.
a)
Both Assertion (A) and Reason (R) are true, and R is the correct explanation of A.
b)
Both Assertion (A) and Reason (R) are true, but R is NOT the correct explanation of A.
c)
A is true, but R is false.
d)
A is false, but R is true.
97.
Numerical (Set Union): R has 10 tuples, S has 15 tuples. If R \cap S has 3 tuples, what is the cardinality of R \cup S?
a)
28
b)
25
c)
22
d)
3
98.
Analytical (RA vs. SQL): RA expressions are converted into execution plans primarily because:
a)
RA is non-procedural.
b)
RA is closer to the physical implementation steps than the declarative SQL statement.
c)
RA is procedural, providing a sequence of steps that can be directly optimized and executed by the storage engine.
d)
RA lacks the ability to use projection.
99.
Case Study (Computational Capability): A bank needs to find the employees who have the highest salary in their respective departments. This query requires:
a)
Only Selection and Projection.
b)
Aggregation (\mathcal{G) and comparative Self-Join.
c)
Division and Set Union.
d)
Only Cartesian Product.