Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 67 - Modular_V2.0_SQL_Flipbook
P. 67

    c.  CREATE INDEX index_name ON database_name;
                           d.  CREATE INDEX index_name ON table_name;

                        3.  What is a view?
                           a.  A view is a special stored procedure executed when certain event occurs.

                           b.  A view is a virtual table created based on one or more tables.
                           c.  A view is a database diagram.

                           d.  None of these
                        4.  Which of the following index types can be applied to multiple columns to uniquely identify rows?

                           a.  Primary Index                                b.  Unique Index
                           c.  Composite Index                              d.  Spatial Index

                        5.  You can delete a view with …………………… command.
                           a.  DROP VIEW                                    b.  DELETE VIEW

                           c.  REMOVE VIEW                                  d.  TRUNCATE VIEW

                     B.  Fill in the blanks using the words given below:

                                             CREATE VIEW, Cartesian product, database, WHERE, INNER JOIN

                        1.   A subquery can be embedded within various clauses of the main query, such as the ……………………,
                           HAVING, or FROM clause.
                        2.  The …………………… is also known as cross product.

                        3.   An …………………… is a way to combine data from two or more tables based on a common column that
                           they share.
                        4.  A view is created using …………………… commands.

                        5.  A …………………… table can have one or more indexes associated with it.

                     C.  Write 'T' for true and 'F' for false.
                        1.  A join query produces a Cartesian product with a join condition.                    ……………………

                        2.  The operator used in an equi join is = to match values.                             ……………………
                        3.  Join can be created in one table.                                                   ……………………

                        4.  Views are virtual and can be dropped; they are not permanent like tables.           ……………………

                        5.  Index makes searching very slow and takes more time to fetch results.               ……………………

                     D.  Short answer type questions.
                        1.  What is the syntax for creating a view in SQL?

                        2.  What is the purpose of an index in a database?
                        3.  What is the difference between a Unique Index and a Primary Index?

                        4.  What is the difference between INNER JOIN and OUTER JOIN?

                                                                                                                         65
                                                                                            Advanced Features of MySQL

| 62 63 64 65 66 67 68 69 70 71 72 |