Theta join operations are commutative.
\(X_1 ⋈_ \theta X_2\)= \(X_2 ⋈_ \theta X_1\)
Theta joins are associative in the following manner:
\((X_1 ⋈_ {\theta _1} X_2) ⋈_ {\theta _2 \wedge \theta _3} X_3\) = \(X_1 ⋈_ {\theta _1 \wedge \theta _3} (X_2 ⋈_ {\theta _2} X_3)\)
Which is/are the correct statement given about a relation?
I. In relational algebra, selection may return duplicate tuples.
II. In relational algebra, projection will never return duplicate column.In relational algebra, selection and projection will never return duplicate entries.
Symbol |
Name |
Example |
σ |
selection |
σ_{A = 500}(R) → Return rows whose A attribute is equal to 500 and no duplicates are allowed |
∏ |
projection |
∏_{B}(R) → Output the column B and no duplicate are allowed |
Concept:
A natural join (join) is based on common attributes or common columns to join two tables or relations.Explanation:
Consider an example, suppose there is two tables Employee(Eid, Ename) consists of 5 tuples and department(Eid, Did) consists of 3 tuples only.
Eid |
Ename |
1 |
E1 |
1 |
E2 |
1 |
E3 |
1 |
E4 |
1 |
E5 |
Eid |
Did |
1 |
D1 |
1 |
D2 |
1 |
D3 |
Natural join of employee and department(Employee * Department) gives:
m×n = 5 × 3 = 15Therefore maximum size is m × n
Minimum size:
When Both the relations have a common attribute but no tuple in both relations match.
∴ minimum size = 0.
The following question involve the three relation below:
1) R(a,b) = {(0,1), (4,5), (8,9)}
2) S(b,c) = {(1,2), (5,2), (5,6), (5,10), (13,10)}
3) T(c,d) = {(2,3), (6,7), (10,11), (10,3)}
The number of tuples in R ⋈ S ⋈ T, where ⋈ is the natural join is:
Result of R ⋈ S ⋈ T is
0 |
1 |
2 |
3 |
4 |
5 |
2 |
3 |
4 |
5 |
6 |
7 |
4 |
5 |
10 |
11 |
4 |
5 |
10 |
3 |
Consider the following relation schema of students.
STUDENT (Rollno, Name, DOB, Marks, Gender) Which of the given query is equivalent to this query in English? “Find the tuples of student having marks above 80”.
Option 1:σMARKS>80 (STUDENT)
True, Find the number of students having marks above 80. A selection operator is used to select tuples from a relation based on some condition.
Option 2: ΠMarks<80 (STUDENT)
The projection operator is used to project particular columns from a relation but here condition is used so wrong statement.
Option 3: σMARKS<80 (STUDENT)
Find the number of students having marks less than 80. A selection operator is used to select tuples from a relation based on some condition.
Option 4: ΠMarks>80 (STUDENT)
The projection operator is used to project particular columns from a relation but here condition is used so wrong statement.
Hence the correct answer is σMARKS>80 (STUDENT).
Consider two relational schemas:
emp(ID, name, address, phone number, deptID)
department(ID, managerID, deptname, location)
What does the following relational expression perform?
\(π_{(name, managerID)} (σ_{emp.deptID=department.ID} (σ_{deptname="Marketing"}(emp × department)))\)
Total MCQS : 20
gradeTotal MCQS : 30
gradeTotal MCQS : 230
gradeTotal MCQS : 15
gradeTotal MCQS : 31
grade191 Points
54 Points
53 Points
52 Points
49 Points