Page 147 - Touhpad Ai
P. 147

4.  Describe the different types of joins with diagrams.
                        Ans.  There are four types of joins:
                             ●      Inner Join: Those records are selected that have matching values in both tables. In an inner join, only
                                  those tuples that satisfy the matching condition are included, while the remaining tuples are excluded.
                                  Syntax: SELECT table1.column1, table1.column2, table2.column1, ....
                                  FROM table1
                                  INNER JOIN table2
                                  ON table1.matching_column = table2.matching_column;
                                  where table1: First table, table2: Second table and matching_column: Column common to both the tables.

                             ●    Left Outer Join: This join returns all records from the left table, and the matching records from the
                                  right table.
                                  Syntax: SELECT table1.column1,table1.column2,table2.column1,....
                                  FROM table1

                                  LEFT JOIN table2
                                  ON table1.matching_column = table2.matching_column;
                             ●      Right Outer Join: It returns all records from the right table, and the matching records from the left table.
                                  Syntax: SELECT table1.column1,table1.column2,table2.column1,....
                                  FROM table1
                                  RIGHT JOIN table2
                                  ON table1.matching_column = table2.matching_column;

                             ●    Full Outer Join: Combines the result of both LEFT JOIN and RIGHT JOIN. It returns all records which
                                  match in either left or right table.
                                  Syntax: SELECT table1.column1,table1.column2,table2.column1,....
                                  FROM table1
                                  FULL OUTER JOIN table2

                                  ON table1.matching_column = table2.matching_column;
                    5.  List any two applications of vectors.
                        Ans.  a.  Representing data points: Each data point in a dataset is typically represented as a vector. For
                                  example, a house with features like number of rooms, size, and price can be represented as a vector
                                  [rooms, size, price]. This format allows algorithms to process and analyse data mathematically.
                             b.   Feature vectors in image, text and audio processing:  In fields like computer vision or natural
                                  language processing (NLP), raw data (like images or text) is converted into numerical feature
                                  vectors. These vectors help in comparing, clustering, or classifying images, texts, or audio based
                                  on similarity.

                                                                                                   21 st
                 C.  Competency-based questions:     HOTS                                         Century   #Interdisciplinary
                                                                                                   Skills
                    Assertion and Reasoning questions:
                    Direction: Questions 1-2, consist of two statements – Assertion (A) and Reasoning (R). Answer these questions by
                    selecting the appropriate option given below:
                    a.  Both A and R are true and R is the correct explanation of A.
                    b.  Both A and R are true but R is not the correct explanation of A.

                    c.  A is true but R is false.
                    d.  A is false but R is true.


                                                                                                Mathematics for AI  145
   142   143   144   145   146   147   148   149   150   151   152