Page 201 -
P. 201

Chapter 5  Database Processing
                200
                                                                     6CDNGU QT (KNGU
                                                                     4GNCVKQPUJKRU
                                                                       #OQPI            &CVCDCUG
                                                                     4QYU KP 6CDNGU
                Figure 5-5
                Components of a Database                              /GVCFCVC


                                            Relationships Among Rows

                                            Consider the terms on the left-hand side of Figure 5-5. You know what tables are. To understand what
                                            is meant by relationships among rows in tables, examine Figure 5-6. It shows sample data from the three
                                            tables Email, Student, and Office_Visit. Notice the column named Student Number in the Email table.
                                            That column indicates the row in Student to which a row of Email is connected. In the first row of
                                            Email, the Student Number value is 1325. This indicates that this particular email was received from
                                            the student whose Student Number is 1325. If you examine the Student table, you will see that the row
                                            for Andrea Baker has this value. Thus, the first row of the Email table is related to Andrea Baker.
                                               Now consider the last row of the Office_Visit table at the bottom of the figure. The value of
                                            Student Number in that row is 4867. This value indicates that the last row in Office_Visit belongs to
                                            Adam Verberra.
                                               From these examples, you can see that values in one table relate rows of that table to rows in
                                            a second table. Several special terms are used to express these ideas. A key (also called a primary
                                            key) is a column or group of columns that identifies a unique row in a table. Student Number is the
                Figure 5-6                  key of the Student table. Given a value of Student Number, you can determine one and only one row
                Example of Relationships    in Student. Only one student has the number 1325, for example.
                Among Rows

                              'OCKN 6CDNG
                               'OCKN0WO   &CVG                         /GUUCIG                        5VWFGPV 0WODGT
                                                   (QT JQOGYQTM    FQ [QW YCPV WU VQ RTQXKFG PQVGU QP QWT TGHGTGPEGU!
                                                   /[ ITQWR EQPUKUVU QH 5YGG .CW CPF 5VWCTV 0GNUQP
                                                   %QWNF [QW RNGCUG CUUKIP OG VQ C ITQWR!

                                                       5VWFGPV 6CDNG

                                                      5VWFGPV 0WODGT  5VWFGPV 0COG  *9  *9  /KF6GTO
                                                                    $#-'4  #0&4'#
                                                                    .#7  59''
                                                                    0'.510  567#46
                                                                    (+5%*'4  /#;#0
                                                                    6#/  ,'((4';
                                                                    8'4$'44#  #&#/
                                                                    8#.&'<  /#4+'
                                                                    41)'45  5*'..;
                                1HHKEGA8KUKV 6CDNG

                                 8KUKV+&  &CVG                            0QVGU                            5VWFGPV 0WODGT
                                                  #PFTGC JCF SWGUVKQPU CDQWV WUKPI +5 HQT TCKUKPI DCTTKGTU VQ GPVT[
                                                  ,GHHTG[ KU EQPUKFGTKPI CP +5 OCLQT   9CPVGF VQ VCNM CDQWV ECTGGT QRRQTVWPKVKGU
                                                  9KNN OKUU ENCUU (TKFC[ FWG VQ LQD EQPƃKEV
   196   197   198   199   200   201   202   203   204   205   206