???????? ?? ER Diagram

Document Sample
???????? ?? ER Diagram Powered By Docstoc
					                                                 5



ค               ว                   า                                      า

           ER-Model                           (Chen,1976)

           ER-Model                                           (Conceptual Data Model)

                                                                       Entity Type, Entity
Instance
                                             E       R    -   D    i   a       g   r   a    m

Entity-Relationship Data Model (ER-MODEL)

           ER-MODEL                                  (Chen,1976)                           ER-
MODEL
                                             ER-MODEL
                                        ER

                      (Entity)



                :
                         :
                     :
                             :
                      :
                    ว (Attribute)
                                                                                 5

                Student : Student_no , Name , Birthdate , Age
                Employee : Emp_no , Name , Address , Skill
                Car : Car_id , Color , Weight




             Composite         ะ Atomic Attribute

                   Composite Attribute
Atomic Attribute                               Address               Employee
                                                                  (Street)         (City)
(Postcode)                                 Address             Composite Attribute        5–1

                                 Employee


                                                    Address



                              Street                   City           Postcode


                                       5
                                  รู ปที่ -1 แสดง   Composite Attribute

             Multivalued Attribute
                                             (Entity Instance)
                                                       (skill)
                                                                          (Multivalued      Attribute)



             Derived Attribute
                                                                                            Age
      Student           Age                                          Birthdate


                                                Page 2 of 17
                                                                     5


Entity Type    ะ Entity Instance

         Entity Type                                                           ER   Model
               Entity Type

              Employee                   Student                     Course


         Entity Instance                                                              5–2
                                   Entity Type     Entity Instance

              Entity Type : Course
              Attribute : Course_no
                            Course_name
                            Credit
                            Hour

              Entity Instance      Course
                                Com1101
                                Pascal Programming
                                3
                                2

                                Com3202
                                System Analysis And Design
                                3
                                3

                    5–2                      Entity Type     Entity Instance




                                         Page 3 of 17
                                                                               5

                                    Employee


         Emp_no                                                        Skill
                            Name                Address



                                Street            City              Postcode


             5–3                           Composite Attribute         Multivalue Attribute

                     (Candidate Key)
                             Instance       Entity Type                        Entity Instance
Course            5–2 Course_no        Pascal Programming                                            2
                                   Instance

                    (Primary Key)                          Entity

                        Entity Attribute                   (Primary Key)                    ER Diagram
                     5–3

           ควา             (Relationship)
Entity                 Type



                                                                    (Employee)
(Course)                                                                                    (Completed)




            Employee                         Completed                             Course


                                            Page 4 of 17
                                                                      5




                    5–4                                Entity Employee         Course

คา        ควา                 (Cardinality of Relationship)

                                                           Instance
                     2
     1. One-to-one                                  Relationship




                          1                                    1
        Driver                            Drive                             Bus


                          1                                    1
      Head Master                        Manage                           School


                               5–5                            One-to-one

     2. One-to-many                                 Relationship



                          1                                    N
       Member                             Rent                            Video



                          1                                    N
       Advisor                           Advise                           Student



     3. Many-to-many 5–6                                One-to-many
                                                     Relationship



                                     Page 5 of 17
                                                                              5




                                       M                                 N
                          Student                         Enroll                  Course


                                      M                                 N
                              Staff                    Work_on                    Project



                                           5–7                        Many-to-many



                                                      (
                     Connoly, Begg, Strachan,1995 : p.177)



                                                                            O n e - t o - o n e



                                                                   M a n y - t o - m a n y

แอททริ บิวท์ของความสัมพันธ์




                                           (Treats)                                 (Doctor)
(Patient)

                         5–8          Date_treat        Comment




                                                   Page 6 of 17
                                                                      5



          Doc_id         Date_treat                Comment            Patient_id


          Doctor                          treats                          Patient



       5–8                                                   Doctor                 Patient

       ควา          (Degree of a Relationship)

                                    E n t i t y T y p e
                       E R      M o d e l             3
                       (Unary Relationship)                  (Binary
Relationship)                          (Ternary Relationship)
                      (Unary Relationship)                Entity Type
                                Recursive Relationship
                 Entity
Staff         (Supervisor)                            (Supervisee)




                                      Supervise

                   Supervisee                          Supervisor


                                         Staff

                                5–9 Unary Relationship




                                      Page 7 of 17
                                                                      5

                          (Binary Relationship)                                         Entity
Type 2 Entity Type


                Driver                        Drive                        Bus



                Student                       Enroll                      Course


                                      5–10 Binary Relationship

                                                 (Ternary          Relationship)
                                     Entity Type 3 Entity Type


                 Staff                       Lease                        Vehicle




                                             Renter


                                     5-11 Ternary Relationship

 า       ER-Diagram
             E R - D i a g r a m
          1.          entity type                                          entity type

           2.                        (Relationship Type)            Relationship type



           3.
                                                           One-to-one (1:1) One-to-many (1:n)


                                          Page 8 of 17
                                                                    5

     Many-to-many (m:n)                                     mandatory participation
optional participation

สรุ ป



                                                                                    ER
                                                            (Logical Data Modeling) ER
                                        (Chen)

                                    ER -




                                    (
                                                                (Identifier)

                          (Relationship)



(                                       3)



          ER-Diagram
3                  ER - Diagram                        One-to-One                     One-
to-many                    Many-to-many




                                        Page 9 of 17
                                                                       5




1.
                                                  ก.

                                             ข.

                                        ค.

                                             ง.

     จ.   M u l t i v a l u e d                                    a t t r i b u t e

2.        E   R   -   D   i        a     g             r   a   m
                                        ก.

                                   ข.

                                        ค.

                                   ง.

                              จ.

                                   ฉ.

                              ช.

3.        E R - D i a g r a m
     ก.

     ข.



     ค.

     ง.




                                    Page 10 of 17
                                           5

4.             E R - D i a g r a m
     ก.                                    Employee)




          ข.

               (section)



     ค.




5.                              ER-Diagram
     1.
     2.




     3.



     4.




                           Page 11 of 17
                                       5

5.

                               า




                                                          1 0




ควา   า า า        (Database Requirement)
1)
1.                                 (       s   t a f f )

                        ( S u p e r v i s o r )

2.

3.

              4.
                                                   5- 0
      5.

                                       0




               Page 12 of 17
                                                    5

6.                                                             2
     (Private Owner)                                    (Business Owner)




7.
     7.1




                       (                     )



     7.2

                           (client)



     7.3                                        (view)
                                           (view – date)

     7.4




2) ควา        า    า า า า (Transaction Requirement)

     2.1
        2.2
                  3)


                           Page 13 of 17
                                                           5

    4)

         5)
                  6)
                       7)
                       8)
                       9)
                       10)
                       11)
                 12)
                 13)
                         14)
                   15)

า   า                    E     R      -      D     i   a   g   r   a   m

         1




             2



                                   Page 14 of 17
                                                               5




              าา     1




                              3
                                                          One-to-one
One-to-many                  Many-to-many
 ฎ                 (business rules)




                    ว า   1        า า า          า า า            า




                                  Page 15 of 17
                                                              5

                                                  one-to-many




                          :

                                                          :




m   a     n   d   a   t       e

mandate                                                           5-12


                          1                        M



                          5-12




                                  Page 16 of 17
                                                              5

           ว า     2          า าควา                     คา       าคา

                                                                         one-to-many
                                                                                one-to-
    many                                                                many-to-many



                           1.
                            2.

o          p                     t                   i             o                      n




                       M                             M



                       5-13




               4




                                     Page 17 of 17

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:295
posted:4/21/2012
language:
pages:17