Relational Database Management System RDBMS

Document Sample
Relational Database Management System RDBMS Powered By Docstoc
					                                            5

                      (Relational Database Systems)

                   (Relational Database)
( R e l a t i o n a l     D a t a b a s e                             M o d e l )


                                              entity
                              a t t r i b u t e
                                       e   n    t    i                         t   y




         (Relation)                 (Table)
        (Tuple)                   (Row)                (Record)
               (Attribute)           (Column)            (Field)
              (Cardinality)              (Number of rows)
       (Degree)                                 (Number of attribute)
          (Primary key)                    (Unique identifier)
         (Domain)                                     (Pool of legal values)

                 (Attribute)




     3102401250111                                           16/04/2514
     3102401250112                                           6/11/2514
     3102401250113                                           12/06/2514
                          204204                                                          5-2



             (Record)                                                        (Relation)
                                                        R(               , ,         ,




      5.2




       1111                                            10               044-216191
       1112                                            110              02-2763444




       001                    1112                 02/01/86
       002                    4551                 05/06/87



                        RDBMS
       1)                             (Define)
                                                              2)          (Query) Column
                                                  3)

Mathematic              Set          function


5.1                     Relational
                     Relation
      1)         Tuples                         (No duplicate tuples)
      2)                Tuples
      3)                Attributes
      5                                                                                        5-3

          4)           Attribute                 (Atomic)

               Relation                                     Relation             Normal form
          5)                         Attribute
5.2                    E.F Codd

                                                                        (Mathematical Concept of
relational sets)                70                                              (Relational Model)




                        Codd

(RDBMS)
       1                       (The Information Rule)


                                                                  (domain)
              2                                  (Guaranteed Access Rule)
                                                                                      primary key




                  3                                                                           null




                       null
              4


              5              ษ (Comprehensive data sublanguage rule)
                        204204                                              5-4



         1.
         2.
         3.

         4.        integrity
                                                                  0
                                                                        )
         5.
         6.
              6                 (View update rule)




              7




              8                            (Physical data independence)




              9                          (Logical data independence)




             10

( integrity )
             11
      5                                                                                    5-5




            12                  ษ

                                                                                           4th
GL        3nd GL)
5.3           (Null Values)
                   Attribute                   (Null)




5.4 Redundant vs Duplicated Data


          Duplicate data                 Attribute
                                                                  (Redundant)

               (Redundancy)      Duplication

            Part                                               Part
            Part      Part-description                       Part       Part-description
            P2             Nut                               P2              -
            P1             Bolt                              P1              Bolt
            P3             Washer                            P3              Washer
            P4             Nut                               P4              Nut
                            (a)                                              (b)
                                    5.3 Non-redundant duplication
                      (a)             Duplicate
                      (b)                         Duplicate
                                                                          P ‘P ’

            Supplier-part                               Supplier-part
            Supplier Part Part-description              Supplier Part Part-description
                          204204                                                                                 5-6

         S2               P1              Bolt                     S2           P1                 Bolt
         S7               P6              Bolt                     S7           P6                 Bolt
         S2               P4              Nut                      S2           P4                 Nut
         S5               P1              Bolt                     S5           P1                 -
                                   (a)                                                 (b)
                                           5.4 Redundant duplication
               5.4 (a)              Supplier-part                  Duplicate
                Suppliers                       (Part)
                                        P1        Bolt      (Duplicate)                             Redundant)
                      “        ”                                                                   P1 “ ”
               5.4 (b)
                                                   5.4 (a)                              5.4 (b)
                                         5.4 (b)                                          Conceptual model
                                                                                (a)
5.5

         Supplier-Part-1                                                Part
         Supplier# Part-description                                     Part#         Part-description
         S2             P1                                              P1                 Bolt
         S7             P6                                              P6                 Bolt
         S2             P4                                              P4                 Nut
         S5             P1
                     (a)                                                                     (b)


5.5            Relations
                                               Relation
        5.5.1 Relation             (Base Relation)
                  Relation
Relation        Data Definition Language                     SQL        CREATE TABLE
Relation                                                                           Relation

       5.5.2    (View)                                         Relation               (Virtual Relation)
      5                                                                                      5-7

                    Relation

                                         Relation
                                                             Relation


5.6         ภ        key (Types of Keys)
          key                     attribute                                                  attribute
                    attribute          attribute                                             tuple
relation            tuple        )
         5.6.1 Simple key
                         key            attribute
         5.6.2 Combine key (Composite key        Concatenated key)
                Combine key                            key                       attribute          1
attribute
         5.6.3 Candidate key
                Candidate          key                                                             key

          5.6.4 Primary key
                  Primary key                        candidate key
          primary key                                     attribute
          5.6.5 Foreign key
                            nonkey attribute relation           primary key relation
          5.6.6 Secondary key (Alternate key)
                                  candidate key                            (primary key)
          5.6.7) Superkey
                  attribute
                                                                    attributes

5.7
                                            relational system
          5.7.1 Data Structure            relation
                1) Domain                single value (atomic value)            data item
                                                repeating group
                   204204                                                                      5-8

       2) N-ary relation                                attribute       tuples
 5.7.2 Data Integrity rule
                                                                                DBMS
                                                    primary key          foreign key

           1) Entity Integrity Rule            “      primary key           null       ”
           2) Referential Integrity Rule           “foreign key       relation
                                           primary key          relation
                                       ”
                                 primary key       relation                        foreign key
relation      DBMS
           1) Restriction                      update         delete

       2) Cascade                 update      delete
          relation
       3) Nullify               update     delete                      set       foreign key
                  null
 5.7.3 Data Manipulation language
                     Relational Complete Language                            Codd 2

           1) Relational Calculus (R.C)
                      nonprocedural language
              
              
               User Interface          2
                  Tuple R.C
                      IBM             SEQUEL        ORACLE, SQL
                      UCB              QUEL       INGRESS
                  Domain R.C
                                 QBE (Query by Example)      Zloof’
           2) Relational Algebra (R.A)
                  procedural language
      5                                                                                     5-9

5.8


               Relational Model
          1)                                     (Productivity
          2)
          3)                                    “relational complete language”     concept
                    set theory       SQL, QBE


1.                      ,                              ,                             :
                   , 2542.
2.                           ,                    ,                     :        ฯ, 2543.
3.                               ,                          ,
                                            :          ฯ, 2543.

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:13
posted:6/7/2012
language:
pages:9