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

Referential Integrity

         eferential integrity is applied in databse  to maintain accuracy and consistency of data in a relationship
        between tables. When  data is linked between two or more tables with the help of primary key and foreign
        key constraints  this rule helps:

          Adding more records to a related child  table if there is no associated record available in the table where
           primary key is defined in the parent table.
           hanging values in a primary key table will also reflect in dependent records  present in associated table s .
          Deleting records from a primary key table if there are any matching related records available in associated
           child  table s .




                                            Lab Assignment ‘n Activity                           S ub j e ct  E nr ich me nt




             Complete the following activities and tick on the circle.
                 reate a  atabase namely Student having a  able  Stumast  with the following fields:

                 Field Name           Field Type
                 Stu I                Number N M  I

                 Stu Name              ext
                  ender                ext
                  lass                 ext
                 Sec                   ext

                  oll No              Number N M  I
                  a    pply proper validation in all the fields.   ike  ntry  e uired   ength   efault  alue .
                  b    reate  another  table  namely    arents   to  store  parents  details  with  fields  Stu I
                      Number  N M  I     Fname   ext            Mname   ext          .

                  c   Set Stu I  as primary key in both the  ables.
                  d    dd atleast    records in both the  ables.
                  e   Set  elationship between both the  ables.
                  f    Modify Stu I  of the last record as    in  Stumast   able and see if the Stu I  of the last
                     record of   arents  table changed or not.

                  g     elete one record from the  Stumast   able and see if the same Stu I  is deleted from
                     the   arents  table or not.




           QUERY

        In database, query is a tool through which data is evaluated or manipulated and reports are generated. A
        user can apply a filter criteria in  uery so that only those records which meet the criteria are evaluated and
        displayed. In   ase   there are three ways to generate a  uery.
           reate  uery in  esign  iew...



         274       Touchpad Information Technology-X
   271   272   273   274   275   276   277   278   279   280   281