Only student–enrolment pairs satisfying the ID equality survive. This avoids the unrelated pairs produced by the full Cartesian product.
05 • EXPRESS “FOR ALL”
Division Finds Values Related to Every Required Value
ENROLMENT(student, course)
Anu
DBMS
Anu
C
Bharat
DBMS
Charan
DBMS
Charan
C
Charan
Python
÷
REQUIRED(course)
DBMS
C
=
RESULT(student)
Anu
Charan
Anu and Charan appear because each is related to every course in REQUIRED. Bharat is excluded because C is missing. Division is the classic operator for “all required skills,” “all compulsory courses” or “all supplied parts.”
06 • EXECUTE OPERATIONS
Interactive Relational Operation Visualizer
Choose an operation and inspect the input, expression, output schema and result tuples.
07 • TRACE COMPLETE EXPRESSIONS
Query-Tree Visualizer
Select a natural-language question. Read the tree from its leaves upward.
RELATIONAL ALGEBRA EXPRESSION
QUERY TREE
08 • REASON ABOUT EQUIVALENT EXPRESSIONS
Push Selective Work Down the Tree
ORIGINALσbranch='AIML'(STUDENT ⋈ ENROLMENT)
Join all matching rows, then discard non-AIML results.
≡
OFTEN CHEAPER(σbranch='AIML'(STUDENT)) ⋈ ENROLMENT
Reduce STUDENT first, so the join processes fewer tuples.
Cascade selections
σc1∧c2(R) ≡ σc1(σc2(R))
Selection commutes
σc1(σc2(R)) ≡ σc2(σc1(R))
Join commutes
R ⋈ S ≡ S ⋈ R
Join associates
(R ⋈ S) ⋈ T ≡ R ⋈ (S ⋈ T)
09 • CHECK YOUR UNDERSTANDING
Seven Formative Concept Checks
1. Which operator selects rows?
2. Projection primarily chooses:
3. Union compatibility requires:
4. If |R|=5 and |S|=4, then |R × S| is:
5. Which operator naturally expresses “completed every required course”?
6. A natural join normally removes:
7. A query tree is normally evaluated:
Answered correctly: 0 of 7
10 • EXPLAIN & PREPARE
University and Interview Questions
2-MARK QUESTIONS
State the closure property.
Define selection and projection.
What is union compatibility?
Define natural join.
What type of query uses division?
5-MARK QUESTIONS
Explain fundamental relational algebra operators.
Compare product, theta join and natural join.
Explain division with an example.
Draw a query tree for a selection–join–projection expression.
INTERVIEW / PROBLEM SOLVING
Why push selection below a join?
Difference between SQL SELECT and algebraic selection?
Can R − S equal S − R?
How do you find students with no enrolment?
How is intersection derived using difference?
Show the expression-solving method
Write the output attributes requested by the question.
Identify the relations containing those attributes.
Add join conditions that connect the relations.
Add selections for row conditions.
Project the final required attributes.
For “none,” consider difference; for “all,” consider division.
Trace intermediate schemas and tuples from inside outward.
LEVEL 5 SUMMARY • PART 1 COMPLETE
You Can Now Express and Trace Formal Queries
Closure allows relational operations to be composed.
Selection filters tuples, projection chooses attributes and rename resolves naming.
Set operations require compatible relation schemas.
Product creates every pair; joins retain meaningful combinations.
Division expresses “related to all required values.”
Query trees reveal execution order and optimization opportunities.
COURSE CHECKPOINT
Mark this level when you can write, trace and explain multi-operator expressions without guessing.