Page 134 - Touhpad Ai
P. 134
Roll_No Student_Name Subject Teacher_ID Teacher_ID
108 Rohan Sankrit 201 Mr Naveen
108 Rohan Sankrit 202 Ms Mehta
109 Meera Sankrit 201 Mr Naveen
109 Meera Sankrit 202 Ms Mehta
Division Operation
The Division operation is used when we have to evaluate queries that contain the keyword ‘all’. For example:
u “Which persons have a bank account at ALL the banks in the city?”
u “Which students are registered on ALL the courses given by Shiva University?”
u “Which students are registered on ALL the courses that are taught in period 2?”
The syntax of Division operation: Relation1 ÷ Relation2
For example, consider the following tables with different optional subjects.
In the example below, the divide operation will return every tuple from the first relation that matches all tuples of the
second relation. You can write:
Student ÷ Task
Student Task
Student Task Task Name
Vivek Studying plant growth Studying plant growth
Vivek Creating games Creating games
Jimmy Floor duty
Jimmy Creating games
Sudha Studying plant growth
Sudha Creating games
The Division of the above two relations, Student ÷ Task, will produce a relation which has a degree (number of columns)
of 1 and a cardinality (number of rows) equal to the number of students who have completed all tasks listed in the
Task table.
Result of the division operation:
Vivek
Sudha
Set Operations
When two or more sets are combined to form another set according to the mathematical principles of sets, the process
is called set operation. In set theory, typically represents the universal set. A Venn diagram uses circles or other
shapes to represent sets and their relationships for different set operations. The following four set operations are shown
by Venn diagrams. Let us study the four important set operations:
Set Union
The union of two sets A and B is the set of elements that are in A, in B, or in both A and B.
It is denoted by A B. For example: If A = {20, 21, 22, 23} and B = {23, 24, 25}, then: A B
A B = {20, 21, 22, 23, 24, 25}. (The common elements occur only once).
132 Touchpad Artificial Intelligence - XI

