E-R Diagram (Entity Relationship Diagram) - PowerPoint PPT Presentation

Loading...

PPT – E-R Diagram (Entity Relationship Diagram) PowerPoint presentation | free to download - id: 7057a1-M2U3Y



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

E-R Diagram (Entity Relationship Diagram)

Description:

Title: E-R Diagram (Entity Relationship Diagram) Author: lek Last modified by: COMPAQ-IT Created Date: 12/11/2006 1:50:34 PM Document presentation format – PowerPoint PPT presentation

Number of Views:134
Avg rating:3.0/5.0
Slides: 27
Provided by: Lek83
Learn more at: http://www.atc.ac.th
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: E-R Diagram (Entity Relationship Diagram)


1
E-R Diagram(Entity Relationship Diagram)
  • Wichan Hongbin

2
E-R Diagram
  • ??????????????????????????????????????????????????
    ???
  • ????????????????????????????? Conceptual
  • ??????????????????????????????????????????????????
    ??????????? Software ??????????????????????
    (?????????? Software)
  • ????????????????????????????????????????

3
????????????????? E-R Diagram ?????? Chen Model
  • Entity
  • ??????????????????????????????????????????????????
    ????????????????????
  • ????
  • ????? (???????, ???????, ???????,
    ????????,??????)
  • ??????? (???????, ?????, ???, ???????)
  • ????? (??????, ?????, ???????????,??????)
  • ????????? (???????, ????????????,
    ???????????,????,???)
  • ???????????????????????????????????????? Entity
    ?????????

???????
????????? Entity
4
  • Attributes
  • ?????????????????????????? Entity
  • ???? Attributes ??? ??????? ??????????
  • ?????????????
  • ????-???????
  • ???
  • ?????????
  • ????????? Attributes ?????????????????
    ???????????? Attributes ??????????????
    ????????????????????? Entity ?????? ????

5
  • ???????? Attributes

Emp_Id ???????? Key Attribute
Sex
Name
Key ??? Attribute ???????????????????????????????
??????????????????
Employee
Emp_ID
Salary
6
Key ??? Attribute ???????????????????????????????
??????????????????
PK Primary Key (????????)
SK Secondary Key (???????)
CK Candidate Key (???????????)
???????????? ???????????? ???? ??????????? ??????????????
25432 ???? 19 19/7/52 1111111111111
25344 ????? 21 19/7/52 2222222222222
25379 ????? 20 20/7/52 3333333333333
25546 ??????? 19 21/7/52 4444444444444
7
FK Forient Key (???????)
????????
????????????
????????????
????
???????????
?????????????????
????????
????????
????????
????????
PK
PK
SK
FK
8
  • Attributes ?????????????????? 6 ??????
  • 1 Simple Attributes
  • Attributes????????????????????????????????? ????
    ???,?????????
  • 2 Composite Attributes
  • ????????????????????? Simple ?????????????????????
    ??????? ???? ???????? ???????????????????????
    Attributes ???? ??? ????
  • 3 Key Attributes
  • ???? Attributes ??????????????????????????????
    Entity ??????? (??????????????)
  • ????????? ER Diagram ?????????????? Attributes
    ??????? Key ????

9
  • ??????????? Attributes ???????? ?

Composite
Name
Surname
Sex
Name_Surname
Birthday
Derived
Student
ID
Age
key
Tel
Multi - Valued
10
Composite
Name
Sex
Name_Surname
Birthday
Student
ID
Age
key
Tel
Multi - Valued
11
  • 3. Relationship
  • ??????? Entity ?????????????????????????? 2
    Entity ??????
  • ??????????????????????? Entity ????? Attributes
    ???????
  • ??????????????????????????????????????????????????
    ????????????? (Diamond) ??????????????????????????
    ??????? ?
  • ??????????????????????????????????????? Entity
    ???? ? ????

12
  • ???????? Relationship

13
????????? Relationship
  • 1. One-to-One Relationship
  • ?????????????????????????????? Entity
    ?????????????????? ?????????????? Entity
    ??????????? ???????????????????????

1
1
14
????????? Relationship
  • 2. One-to-Many Relationship
  • ?????????????????????????????? Entity
    ?????????????????? ?????????????? Entity
    ??????????? ??????? 1 ??????

1
M
15
????????? Relationship
  • 3. Many-to-Many Relationship
  • ???????????????????????????????? 1 ?????? ?????
    Entity ?????????????????? ?????????????? Entity
    ??????????? ??????? 1 ??????

M
N
16
  • Composite Entity
  • ???? Entity ?????????????????????????????????????
    ?? MN ??????? ??? 1M (???????? MN
    ???????????????????????????)
  • ???? Composite Entity ?????????? Entity
    ???????????????????? Key Property ??????? 2
    Entity ???? ??????????????? ?
  • ???? Key Property ??? Composite Entity ????? Key
    Property ??????? 2 Entity ??????????? (???? PK
    ??????????????? Super Key ????????)
  • ???????????? Composite Entity ???
    ????????????????????????????????????????????????

17
???????????????????????? MN ?????? 1M
18
?????????????????????? E-R Model
  • 1. ?????????????????????????????????????????
  • ?????????????????????
  • ?????????????????????
  • ???????????????
  • ?????????????????

19
  • 2. ????? Entity ???????????????????????
  • ??????????????????????????????????????????????????
    ? ?????????????????????????? Entity
  • ??????????????????? ? ???????????? Entity
    ???????????? ?????????????????????????????????????
    ???????????????????

20
  • 3. ??????????????????????????? Entity
  • ???????? Entity ????????????????????????
    ??????????????????????????? ??????????????????????
    ????????
  • One to One Relationship
  • One to Many Relationship
  • Many to Many Relationship

21
  • 4. ???????????????????? Entity
  • ????????????????????? (Attributes) ?????? Entity
    ???????????????????? Attributes ?????
  • ??????????????????????? Attributes
    ???????????????
  • Composite Attributes
  • Derived Attributes

22
  • 5. ???????? Primary Key ???????? Entity
  • ??????????????? Entity ????? Entity
    ??????????????????????????????????????????????????
  • ????????????????? Primary Key ???????

23
?????????????????????????????? E-R Model
  • Ex ??????????????????????????????????? 3 ??? ???
    ?????, ???????????, ???????????
  • ??????????????????????????????????????? ?
  • ??????????????????????????????????????? ? ??
  • ???????????????????????????? ?????????????????????
    ?????????????????

24
  • ????? Entity ???????????????????????
  • Entity Faculty ????????????????????
  • Entity Department ????????????????????????
  • Entity Teacher ????????????????????????
  • Entity Subject ?????????????????????

25
  • ??????????????????????????????????????? ?
  • ??????????????????????????????????????? ? ??
  • ???????????????????????????? ?????????????????????
    ?????????????????
  • ???????????????????????? Entity

1
M
1
M
1
M
26
  • ????????????????????????????

M
M
1
1
27
  • ????????????????? Entity
  • Faculty
  • Department

28
  • Teacher
  • Subject

29
  • ???????? Primary Key ??? Entity
  • Entity Faculty ??? Faculty_ID
  • Entity Department ??? Dep_ID
  • Entity Teacher ??? Teacher_ID
  • Entity Subject ??? Subject_ID

30
(No Transcript)
31
?????????????????????????????? E-R Model
  • Ex ???????? ER-Diagram ???????????????????????ABC
    ???????????
  • ??????
  • ????????????????????????????????????
  • ???????????????????????????????????????
  • ??????????????????????????????????????????????????
  • ????????????????????????????????????????????

32
  • ????????????????????????????????????
  • ???????????????????????????????????????
  • ???????????????????????????????????????????????
  • ????????????????????????????????????????????
  • ????? Entity ???????????????????????
  • Entity Customer ???????????????????????
  • Entity Employee ???????????????????????????
  • Entity Product ???????????????????????
  • Entity TypeProduct ???????????????????
  • Entity Bill ????????????????????????

33
  • ????????????????????????????????????
  • ???????????????????????????????????????????????
  • ????????????????????????????????????????????
  • ???????????????????????? Entity

??
1
M
Employee
Bill
??
1
M
TypeProduct
Product
34
  • ???????????????????????????????????????

??
M
N
Bill
Product
Bill_detail
M
1
1
M
Bill
Product
35
  • ????????????????? Entity

Emp_ID
Product_ID
Employee
Emp_name
Product
Product_name
salary
price
TypeProduct
TypeName
TypeID
36
Cus_ID
Bill_No
Customer
Cus_name
Bill
Bill_date
Address
Emp_ID
37
ER-Diagram ???????????????????
Product_ID
Product_name
Product_ID
Price_s
Detail_ID
Bill_No
price
Bill_detail
Bill_detail
1
1
M
M
Bill
Product
Bill_date
M
M
Amount
M
Emp_ID
??
Bill_No
??????
TypeName
1
??
TypeID
TypeProduct
1
1
Employee
Emp_name
salary
Emp_ID
38
?????????????????????????????? E-R Model
  • Ex ???????? ER-Diagram ???????????????????????????
  • ??????
  • ??????????????? ??????????????????????????????????
    ???
  • ??????????????????????????????????????????????????
    ?
  • ?????????????? ??????????????????????????
  • ??????????????????????????????????????????????????
    ???
  • ????????????????????????????????????

39
??????????????? ??????????????????????????????????
??? ??????????????????????????????????????????????
????? ?????????????? ?????????????????????????? ?
??????????????????????????????????????????????????
?? ????????????????????????????????????
  • ????? Entity ???????????????????????
  • Entity ?????????????????
  • Entity ?????????????????
  • Entity ?????????????????
  • Entity ?????????????
  • Entity ?????????????????

40
??????????????? ??????????????????????????????????
??? ??????????????????????????????????????????????
????? ?????????????? ?????????????????????????? ?
??????????????????????????????????????????????????
?? ????????????????????????????????????
  • ???????????????????????? Entity

41
??????????????? ??????????????????????????????????
??? ??????????????????????????????????????????????
????? ?????????????? ?????????????????????????? ?
??????????????????????????????????????????????????
?? ????????????????????????????????????
  • ???????????????????????? Entity

42
  • ?????????????? ??????????????????????????

M
M
M
1
1
M
43
?????????
  • ????????????????????????????????????
  • ??????????????????????????????????????????????
  • ????????????????????????????????????????????
  • ????????????????????????????????????????????????
  • ?????????????????????????????????????????????????

44
?????????
  • ????????????????????????????????????
  • ????????????????????????????????????
  • ??????????????????????????????????????????????????
    ????
  • ?????????????????????????????????????????
  • ????????????????????????????????????????
  • ??????????????????????????? ??????????????????????
    ????????????????????????
  • ??????????????????????????????????????????????????
    ???

45
?????????
  • ????????????????????????????????????????????????
  • ?????????????????????????????????????????????
  • ????????????????????????????????????
  • ?????????? ?? ????????? ???????????????????
  • ?? ????????????????????????????????????????

46
?????????
????????????????? ??????????????????????????
? ?????????????????????????????????????????
????????????????? ????????????????????????????????
????? ???????????????????????????????????????????
??????????????????????????????????????? ?
???????????????? ?????????????????????????????????
???????????????????????????????????
47
????????
????????????????????????????????????????????
?????????????? ???????????????????????????????????
???????????????????????? ?????????????????????????
????????????????? ? ??????????????????????????????
????????????????????????? ???????????????????????
???????????????????? ?????????????????????????????
???????
48
  • ????????? ??? Entity ?? 2 ??????
  • 1 Regular Entity ???????????????????? Strong
    Entity
  • ???? Entity ????????????????????????? Entity
    ??????????????? ??????????????? Identity
    ????????????? ??????????? Entity ????
  • 2 Week Entity
  • ???? Entity ?????????????????????? Entity
    ???????????????

Customer
Order Detail
49
????????? Strong Weak Entity
Student (Strong)
Subject (Strong)
???? ???? ???
45001 ???? ????????????
45002 ????? ?????
???????? ????????
01 ?????????
02 ?????????
Regis_Detail(Weak)
???? ?????????? ????????
45001 1/45 01
45002 1/45 01
45001 1/45 02
45002 1/45 02
50
  • 4 Single - Valued Attributes
  • Property ????????????????????????????????????
    ???? Attributes ??? ??????????????? ??? ???? ????
    ???????? ??????????????????????????
  • ????????????????? ????????????????????????
  • 5 Multi - Valued Attributes
  • ????????????????????? Single ?????????????????????
    ???????????? ???? ????????????????????????????????
    ?????????????????????????
  • ????????????????????????
  • 6 Derived Attributes
  • ???? Property ??????????????????? ?????????????
    Property ???? ? ???? ?????????? ???????????
    Property ???????
  • ????????????????????????
About PowerShow.com