Page 175 - Artificial Intellegence_v2.0_Class_11
P. 175

Union Operation
                 The union operation combines two or more relations (tables). The union operation is a binary operation. The resultant
                 relation of the union operation contains tuples that are in either of the relation or in both relations. The duplicate
                 tuples are eliminated. The symbol denotes the union operation.
                 Before applying the union operation, the two relations must satisfy these situations:
                    • Both the relations are of the same degree.
                    • The domain of the attributes of both the relations (pool of data containing values) are the same.
                            Student                                       Student 1

                   Rollno     Name       Marks                           Rollno     Name       Marks
                     100      Prakash      256                            101        Vivek      256
                     102      Sudha        210
                     103       Punit       269                            103        Punit      269
                     105      Jimmy        210                            104       Kumar       287
                     106       John        276
                                                                          106        John       276

                 If we perform union operation on the above two tables: σ (Student Student1) we get the following result:
                 Result of the Union Operation
                                                       Rollno     Name       Marks
                                                        100      Prakash      256

                                                        101        Vivek      256
                                                        102       Sudha       210
                                                        103        Punit      269

                                                        104       Kumar       287
                                                        105       Jimmy       210
                                                        106        John       276

                 Intersection Operation
                 The intersection operation is also a binary operation. The intersection operation yields the common tuples from the
                 two tables. Consider the following tables:
                    Student                                              Student 1
                   Rollno     Name       Marks                          Rollno      Name        Marks
                     100      Prakash      256
                     102      Sudha        210                            101        Vivek       256
                     103       Punit       269                            103        Punit       269
                     105      Jimmy        210                            104       Kumar        287
                     106       John        276
                                                                          106        John        276

                 The result produced by the intersection operation (Student ∩ Student1) is shown as:
                 Result of the Intersection Operation

                                                       Rollno     Name       Marks
                                                        103        Punit      269

                                                        106        John       276

                                                                                                 Maths for AI   173
   170   171   172   173   174   175   176   177   178   179   180