Page 324 - IT 402 v2.0 class 10
P. 324

Section
                                                Su  ecti e T  e  uestions
             ns er t e follo ing  uestions:

            1.  Categorise the following commands as DDL, DML, DCL and TCL:
              CREATE, SELECT, REVOKE, ALTER, COMMENT, TRUNCATE, DELETE, UPDATE, SAVEPOINT, GRANT, INSERT INTO,
              SETTRANSACTION, RENAME, DROP, COMMIT, ROLLBACK
         Ans.
                     DDL              DML                DCL               TCL
               CREATE            SELECT           GRANT             COMMIT
               ALTER             UPDATE           COMMENT           ROLLBACK

               TRUNCATE          INSERT           REVOKE            SAVEPOINT
               RENAME            INTO                               SETTRANSACTION
               DROP              DELETE


            2.  Write short notes on:
              i.  DDL                                           ii.  DCL
              iii. DML                                          iv. TCL

          ns.  i.   ata  efinition  anguage or  ata  escription  anguage is a standard for commands that define the different
                structures in a database. These statements Create, Modify and Remove database objects such as tables and
                indexes. Some common DDL statements are CREATE, ALTER, RENAME, and DROP.
              ii.  Data Control Language command is related to security issues. It is used to control a user’s access to a database.
                Some common DCL commands are GRANT, COMMENT, REVOKE.
              iii.  Data manipulation language enables users to retrieve, update, insert, and delete data in a database. Common
                DML statements are SELECT, UPDATE, INSERT INTO, AND DELETE.
              iv.   ransaction  ontrol  anguage is used to manage transactions by tracking other commands and their effects on
                the database. It can also rollback the changes made by other commands. Some common TCL commands are
                COMMIT, ROLLBACK, and SAVEPOINT.
            3.  Name a popular data manipulation language.

          ns.  S    Structured  uery  anguage .
            4.  What are operators?
          ns.   he symbols or specific characters that are used to perform arithmetical operations  comparisons  etc. are called
              ‘Operators’. There are three types of operators in SQL:
                 rit metical   erators:  he operators like     -          etc.  which are used to add  subtract  multiply  divide  etc.
                  om arison   erators:  he operators like   .       etc  which are used to compare values in an expression.
                 ogical   erators:  hese are operators  e.g.   ll   nd   ny   etween  Not  Or etc.  which are used for performing
                various actions in the database such as searching for mid value, a particular data, and combining multiple
                conditions in a database.
            5.  List the name of 4 Logical operators.

         Ans.  Four Logical operators are:
                ALL – It is used to compare a value to all values in another value set.
                AND – It allows the existence of multiple conditions in SQL statement.
                ANY – It compares the values in a list according to the given conditions.
                NOT – It reverses the meaning of any logical operator with which it is used.



         322       Touchpad Information Technology-X
   319   320   321   322   323   324   325   326   327   328   329