Page 248 - DCAP405_SOFTWARE_ENGINEERING
P. 248

Unit 14: Data Modeling




          is a multi-valued attribute – i.e., one instance of a branch manager will have a single value for  Notes
          BranchManagerId but can have more than one phone number.
          An attribute can be Derivable or Non-Derivable. Derivable attribute can be obtained by subjecting
          other attributes to computation. For instance, Age is a derived attribute for an AccountHolder
          entity because its value can be obtained by computing the difference between the current date
          and the DateOfBirth attribute.




             Notes  Since the value of the derived attribute can be computed from other attributes its
            value need not be stored in the database.
          Self Assessment


          Fill in the blanks:
          10.  On the basis of whether an attribute must take a value for an instance of a given entity or
               not, attributes can be either…………………….

          11.  On the basis of the ………………………. of values taken attributes can be classified either
               as Single-valued or Multi-valued.
          12.  ………………………. attribute can be obtained by subjecting other attributes to computation.

          14.4 Relationships and Relationship Set


          Entities do not exist in isolation form each other. They are more often than not related somehow
          with each other. A relationship is an association between entities. Let there be n number of
          entities given by: E , E , E ,…., E n
                                 3
                          1
                             2
          A relationship is defined as a collection of attributes(  r ,  r ,.... r  ) r ,  such that  r ∈  E  and
                                                             3
                                                           2
                                                        1
                                                                  n
          r ∈  E and so on. A relationship set is a set of relationships of the same type.  1  1
           2    2
                 Example: Consider the two entity sets – AccountHolders and Account. These two entities
          are related to each other because an Account is owned by an Account holder. We can give a name
          to this relationship – say, Owns. The relationship would read as:
               AccountHolder(Name=”Eknath”, Address=”A-45, Tagore Garden”, DateOfBirth=”13/11/
               1966", DateOfOpeningAccount=”12/10/2005") Owns Account (AccountNumber = “1345”,
               OpeningBalance=50000)

               In fact another relationship may also exist in the opposite manner. In our case the
               relationship – Belongs To - can be thought of a relationship from Account entity to
               AccountHolder entity as:
               Account (AccountNumber = “1345”, OpeningBalance=50000) Belongs To
               AccountHolder(Name=”Eknath”, Address=”A-45, Tagore Garden”, DateOfBirth=”13/11/
               1966", DateOfOpeningAccount=”12/10/2005")
          Thus, the two relationships “Owns” and “Belongs To” are inversely related to each other.
          A relationship that exists between two entities is called binary relationship. But a relationship
          may exist between more than two entities as well. A relationship between three entity sets is
          called ternary relationship, and so on. The number of sets forming a relationship is known as
          degree of relationship. Therefore, a binary relationship is of degree 2 while ternary is that of
          3 and a quinary of degree 5.



                                           LOVELY PROFESSIONAL UNIVERSITY                                   241
   243   244   245   246   247   248   249   250   251   252   253