Page 328 - Trackpad 402_Class-X_Final
P. 328

2.  Table: COACH
                  NO        CNAME           GAME           FEE
                  01    RAVI SHASTRI     CRICKET       50000
                  02    MARY KOM         BOXING        90000
                  03    SANIA MIRZA      TENNIS        15000
                  04    PT USHA          ATHLETICS     51000
                  05    VIRAT KOHLI      CRICKET       10000
               Write SQL commands:
               a.  To show all the information about the CRICKET coach.
               b.  To list the details of all the coaches whose fees range between 20000 to 35000.
               c.  To display the coach name and the game of all those whose fees is more than 50000
               d.  To display the list of names with their game of all the coaches in alphabetical order

          Ans.  a.   SELECT * FROM COACH WHERE GAME=’CRICKET’
               b.  SELECT * FROM COACH WHERE FEE BETWEEN 20000 AND 35000
               c.  SELECT NAME, GAME FROM COACH WHERE FEE>50000
               d.  SELECT NAME, GAME FROM COACH ORDER BY NAME
            3.  Define the following:
               a.  Data Integrity
               b.  Data Inconsistency
               c.  Composite Primary Key
               d.  Relationship (with respect to DBMS)
          Ans.  a.   Data Integrity: Data Integrity is very important as there are multiple databases in a DBMS. It means that the data is
                 accurate and consistent in the database.
               b.   Data Inconsistency: Data inconsistency is when the same data exists in different forms in multiple tables. Which can
                 provide a unreliable or meaningless information.
               c.   Composite Primary Key: It is also called a composite key. It is a combination of two or more columns to form a primary
                 key for a table.
               d.   Relationship:  A  relationship  refers to an association or connection  between  two or more  tables.  When we  relate
                 two tables, we don't need to enter the same data in separate tables. Three types of relationships are:  One to One
                 relationship, One to many or many to one relationship and Many to many relationships.
            4.  The structure of a table “ITEM” is given below.

               Suggest suitable data type and size of each column.
                    NAME          DATA TYPE       SIZE
               ITEMNO
               NAME
               PRICE
               QUANTITY
               AMOUNT

          Ans.
                    NAME          DATA TYPE       SIZE
               ITEMNO           NUMBER              3
               NAME             VARCHAR2           25
               PRICE            NUMBER             8,2
               QUANTITY         NUMBER             8,2
               AMOUNT           NUMBER             5





          328   Trackpad Information Technology-X
   323   324   325   326   327   328   329   330   331   332   333