Page 130 - Touhpad Ai
P. 130

Unary Operations (Selection, Projection, Rename)
              These operations work on a single table.

              u  Selection filters rows based on a condition.
              u  Projection chooses specific columns.
              u  Rename changes table or column names for clarity.
              Context and Joins

              Joins connect two or more tables using a common field, such as a student ID or roll number. They help combine related
              data to make it more useful. For example, we can join a student table and a marks table to display both name and
              marks together. Common joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.

              What is the Significance of Context?
              Context helps us:
              u Understand how data is related.
              u Choose the right operation or join.
              u Avoid confusion when working with multiple tables.
              u Make data analysis clear and meaningful.



              Set Theory
              In this module, we will try to explain the fusion of set theory (a branch of mathematics) and relational databases
              (RDBMS), which are a part of computer science. We will also learn how the principles of set theory can help to retrieve
              data from a database, and this data can then be used for training AI models.
              Before we get into the relationship between set and database of sets, we first need to understand few terms.
              A Set is an unordered collection of objects, known as elements or members of the set. An element ‘a’ belongs to a
              set A. This can be written as ‘a → ∈ A’. If a is not an element of set A, then we write ‘a → ∉ A’. For examples:
              Set of even numbers between 5 and 15: {6,8,10,12,14}.

              Set of 5 prime numbers: {2, 3, 5, 7, 11}.
              Set of names of grade XI students: {‘Anuj’, ‘Bobby’, ‘Hemant’, ..............}.
              We use databases (like Oracle, MS SQL Server, MySQL, etc.) to store digital data. A database is a collection of data.
              Database stores the data in the form of tables. For example, the student database has 2 tables as follows:
                                      Student                                        Teacher
                                Rollno       Name                             T No.         TName
                                  101        Vivek                             T01         Mr. Neeraj
                                 103         Punit                             T02        Mr. Govind
                                 106         John

              The value of data in database tables (also known as relationships) is very small, unless data from different tables are
              combined and manipulated to generate useful information. From here begins the role of relational algebra.


              Relational Algebra

              Relational algebra is a set of algebraic operators and rules used to manipulate relational tables to generate the
              required information. Relational algebra takes relations (tables) as its operands and returns relations (tables) as its
              result. Relational algebra consists of eight operators:

              Selection, Projection, Join, Intersection, Union, Difference, Cartesian Product, and Division.


                 128    Touchpad Artificial Intelligence - XI
   125   126   127   128   129   130   131   132   133   134   135