3. ��������ѹ��ͧ�ҹ������ Show ��������ѹ�� (Relationship) 1. ��������ѹ��Ẻ˹�觵��˹�� (One - to - One Relationships) 2. ��������ѹ��Ẻ˹�觵�͡���� (One - to - many Relationships) ����� //www.thaigoodview.com/library/teachershow/lumpang/datamon/photo222.htm 3. ��������ѹ��Ẻ�������͡���� (Many - to - Many Relationships) ����� //www.thaigoodview.com/library/teachershow/lumpang/datamon/photo223.htm����(KEY) �س���ѵ�˹�觷���Ӥѭ�ͧ��������ѹ����� �������͡�ѡɳ� (Uniqueness property) ��觷�����˹��������͡�ѡɳ�ͧ��㹤�������ѹ�� ���¡��� ���� (key) �ҹ������˹��� ���բ����������ҡ��� ��觰ҹ�������բ�Ҵ�˭��鹡���բ����Ũӹǹ�ҡ������ҵ����Ǣ���������ҹ���Ҩ�դ��ᵡ��ҧ�ѹ ����¡ѹ ��������з�������ѹ ��������¡������������§��Ǣ��������ҧ���Ƿ������ҧ�ҡ�Ӻҡ �ѧ��鹨֧�ա�á�˹���� Keys ��ШӢ��������ͷ�������¡��Т�����㹰ҹ������������ҧ�١��ͧ ���������»����� ���� ������ѡ, Secondary key, Foreign key, Candidate key 1. ������ѡ (Primary key) ������ѡ�繢������Ӥѭ���з��������Ҷ֧�����ź��ҹ��������������ҧ�Ǵ���� �ѧ��鹼����֧��á�˹�������ѡ���Ѵਹ������鹵�͡Ẻ�ҹ������ �ҡ����բ���������㹰ҹ�����ŷ������з����繤�����ѡ���÷��С�˹� Record ��������Ѻ����繤�����ѡ���� 2. �����ͧ (Secondary Key) 3. ����͡ (Foreign key) ��á�˹�������Ѻ����͡�ͧ��������ѹ������ҧ�ԧ�֧�е�ͧ��˹���Ңͧ�������������������ǡѹ�Ѻ��������ѹ�������͡����繤�����ѡ �����͡��������繨е�ͧ����ǹ˹��㹤�����ѡ�ͧ��������ѹ����� 4. �ػ�������
(Superkey) 5. �����觢ѹ (Candidate key) �դ����Ӥѭ��͡�èѴ����к��ҹ������ (DBMS) ��駹�����ͧ�ҡ�����ŷ���������㹰ҹ�����Ũе�ͧ�֡�Ҷ֧��������ѹ��ͧ������ �ç���ҧ�ͧ�����š����Ҷ֧��������С�кǹ��÷�����������ء������¡��ҹ������ �ѧ��� ��Ҩ֧����ö���Ըա�����ҧ�ҹ�������� 3 ������ 1. �ٻẺ������Ẻ�ӴѺ��� �����ç���ҧẺ�ӴѺ��� (Hierarchical data model) �Ըա�����ҧ�ҹ ������Ẻ�ӴѺ��鹶١�Ѳ���º���ѷ �ͺ����� �ӡѴ 㹻� 1980 ���Ѻ���������ҡ 㹡�þѲ�Ұҹ�����ź�����ͧ���������좹Ҵ�˭���Т�Ҵ��ҧ �·���ç���ҧ�����Ũ����ҧ�ٻẺ��������� �¤�������ѹ����Ẻ˹�觵������ (One- to -Many) 2. �ٻẺ������Ẻ���͢��� (Network data Model) �ҹ������Ẻ���͢����դ�������¤�֧�Ѻ�ҹ ������Ẻ�ӴѺ��� ��ҧ�ѹ����ç���ҧẺ���͢��� �Ҩ���ա�õԴ������µ��˹�� (Many-to-one) ���� ���µ������ (Many-to-many) ����Ǥ���١ (Child) �Ҩ�վ����� (Parent) �ҡ����˹�� ����Ѻ������ҧ�ҹ������Ẻ���͢�������ͧ�Ԩ�óҡ�èѴ��â����Ţͧ��ͧ��ش �����¡�èл�Сͺ���� ��������ͧ ����� �ӹѡ����� ������� ������ 3. �ٻẺ��������ѹ������� (Relation data model) ���ѡɳС���͡Ẻ�ҹ�������¨Ѵ���������������ٻ�ͧ���ҧ������к��������� �·������������� (Row) �ͧ���ҧ��᷹�ä��� (Record) ��ǹ �����Ź�Ǵ�觨�᷹������� (Column) ����繢ͺࢵ�ͧ������ (Field) �·����ҧ���е��ҧ������ҧ��鹨�������� �ѧ��鹼���͡Ẻ�ҹ�����Ũе�ͧ�ա���ҧἹ�֧���ҧ�����ŷ����繵�ͧ�� ���к��ҹ�����ź���ѷ���˹�� ��Сͺ���� ���ҧ����ѵԾ�ѡ�ҹ ���ҧἹ���е��ҧ�������ç��� �ʴ�����ѵԾ�ѡ�ҹ ���ҧἹ� ��е��ҧ�������ç��� Ẻ�֡�Ѵ ��-��������Entity-Relationship Model ������-�������� ��Ẻ���ͧ�����ŷ�����Ѻ��û���ء���Ҩҡ �ǤԴ�ͧ Semantic ���� ������Ѻ�����������ҧ�ҡ����Ѻ���������͡���͡Ẻ�ҹ��������дѺ�ǤԴ ����-���������繼ŧҹ��þѲ�Ңͧ Peter Pin Shan Chen �ҡ Massachusetts Institute of Technology 㹻� �.�.1976 ��-�������� ��Ẻ���ͧ�����ū���ʴ��֧�ç���ҧ�ͧ�ҹ�����ŷ��������Шҡ�Ϳ�����������㹡�þѲ�Ұҹ������ ��������������´��Ф�������ѹ�������ҧ��������к���ѡɳз�����Ҿ��� ������繻���ª�����ҧ�ҡ��͡���Ǻ����������������������´ ��ʹ����������ѹ��ͧ�����ŵ�ҧ � ����-���������ա�����ѭ�ѡɳ��ҧ� ������¡��� Entity Relationship Diagram ���� ��-���������� ᷹�ٻẺ�ͧ�������ԧ��áТͧͧ��� �֧�����ؤ�ҡ÷������Ǣ�ͧ�Ѻ�к��ҹ����������ö�����ѡɳТͧ��������Ф�������ѹ�������ҧ�������������ж١��ͧ�ç�ѹ �к�������Ѻ ����͡Ẻ�֧�դ����١��ͧ����ʹ���ͧ�Ѻ�ѵ�ػ��ʧ��ͧͧ��� ��駹�� ��-�������Ż�Сͺ���� 4 ��ǹ ��� ��Ե� Property ��������ѹ�� Subtype ��� Supertype 1. ��Ե���Ե� ���¶֧ ��觷��ʹ�����ö�к���㹤����繨�ԧ ��е�ͧ������Ǻ��������ŷ�� ����Ǣ�ͧ�������㹰ҹ������ �µ�����ҧ�ͧ��Եջ�������ҧ � �� �ؤ�� ʶҹ��� ��觢ͧ ���� �˵ء�ó� �մѧ��� - �ؤ�� ���� ��ѡ�ҹ ������ ��� �ѡ�֡�� �繵� - ʶҹ��� ���� ࢵ �ѧ��Ѵ ��� �Ҥ �繵� - �ѵ�� ���� ö¹�� �Ҥ�� ��� ����ͧ�ѡ� �繵� - �˵ء�ó� ���� ���ŧ����¹���¹ �����ӹҭ �繵� ���-���������� ���ѭ�ѡɳ��ٻ�������������� (rectangle) ᷹˹����Ե� ���ժ��ͧ͢ ��Եչ�� � �ӡѺ�������� �Ҿ��� 3.5��Եչѡ�֡����Ե�����ö��ṡ���� 2 ������ ��� ��Եջ��� (regular entity) �����Ե����� (weak entity) 1.1 ��Եջ�����Եջ��� ���� Strong Entity ���¶֧ ��Եշ��ʹ���е�ͧ��èѴ�红����ŷ������Ǣ�ͧ�����к��ҹ������ ��觡�ä�����ͧ��Եչ���������Ǣ�ͧ�Ѻ��Ե���� ����Եչ������ö�դس���ѵ� Identity �����ͧ ���-���������� �ѭ�ѡɳ�����᷹��Եջ����������ǡѺ��Ե� �ѧ��� ������ա���Ƕ֧��Ե�� � ������ա���к���������´��� �֧�����¤����֧��Եջ��Թ���ͧ 1.2 ��Ե�������Ե����� ���¶֧ ��Եշ���ա�ä���������Ǣ�ͧ�Ѻ��Ե������к��ҹ������ ����Ե���蹷���դ�������ѹ��Ѻ��Եչ�����¡��� Parent Entity �����Ҩ���������� ��Ե����ͨ�����դ������������������ö��ҡ�㹰ҹ�������� �ҡ���Ȩҡ Parent Entity ����դ�������ѹ������Ǣ�ͧ�ѹ �����Ҫԡ�ͧ��Ե����ͨ�����ö�դس���ѵ� Identity ��������������� Property � Property ˹�觢ͧ��Եջ����һ�Сͺ�Ѻ Property �ͧ��Եչ�� � ���-���������� ���ѭ�ѡɳ��ٻ���������������ͧ�ٻ���ѹ (double rectangle) ᷹˹����Ե����� ���ժ��ͧ͢��Ե������ � �ӡѺ�������� �Ҿ��� 3.6������ҧ�ͧ��Ե�������駹�� ������ҧ�ͧ��Եջ��������Ե������ҨԺ����ѧ�Ҿ��� 3.7 ��� �ʶҹ�֡�� ���˹�� �Ҩ�������Ф����������Ҩ����������ӡѹ �ѧ��� ��Ե��Ҩ���������Եջ��Է���� Property �����Ҩ������ Identity ���Եյ��ҧ� �Ҩ�������Ф��Ҩ����ش�Ԫ����ǡѹ����������¹���ǡѹ ���ͺҧ���Ҩ����ش�Ԫ����ǡѹ�褹���������¹���� �й���ҡ�������Ե��Ҩ�������������ö��Һ����� �Ҩ���줹� ��ش�Ԫ�� �������¹� ��ѹ/����� �͡�ҡ��� ��Եյ��ҧ�������ö�դس���ѵ� Identity ��������������� Property �����Ҩ����ͧ��Ե��Ҩ����������Եջ����һ�Сͺ�Ѻ Property �ѹ/������ͧ ��Եյ��ҧ� �й�� ��Եյ��ҧ����������ö�������� �ҡ���Ȩҡ��Ե��Ҩ���� �ѧ��� �֧���������� ��Եյ��ҧ�����Ե����� �Ҿ��� 3.7 ������ҧ�ͧ��Եջ��������Ե����� 2. PropertyProperty ���¶֧ �����ŷ���ʴ��س���ѵ����ͤس�ѡɳТͧ��Ե����ͤ�������ѹ�� (�� �������������ǡѺ�ͷ��Ժ�ǵ��Ẻ���ͧ�������ԧ����ѹ��) �� Property �ͧ��Եչѡ�֡�һ�Сͺ���� ���ʻ�Шӵ�� ����-ʡ�� �� ���ʤ�� �繵� ���-�������������ѭ�ѡɳ��ٻǧ�� (ellipse) ����ժ��ͧ͢ Property ��鹡ӡѺ��������᷹˹�� Property ����������͡Ѻ��Եշ���� Property ��鹴�����鹵ç �Ҿ��� 3.8Property �ͧ��Եչѡ�֡��Property����ö��ṡ���� 6 ������ ��� Simple Property, Composite Property, Key Property, Single Property, Multi-Valued Property ��� Derived Property 2.1 Simple PropertySimple Property ���¶֧ Property ����������ö���¡����ŧ����ա �� Property ���� ���ʡ�� ����� �繵� ��駹�� ���-���������� �ѭ�ѡɳ�����᷹ Simple Property �������ǡѺ Property 2.2 Composite PropertyComposite Property ���¶֧ Property ������ѡɳеç�����Ѻ Simple Property ��� ����ö���¡����ŧ����ա �� Property ����-ʡ�� ����ö���� 2 Simple Property ��� Property ���� ��й��ʡ�� ���� Property ������� ����ö���� 5 Simple Property ��� Property ��ҹ�Ţ��� ��� �ǧ ࢵ ��Шѧ��Ѵ �繵�
�Ҿ��� 3.9������ҧ�ͧ Composite Property2.3 Key PropertyKey Property ���¶֧ Property ���͡�����ͧ Property ����դ�Ңͧ�������������Ҫԡ�ͧ ��Ե�����ӡѹ ���������ö�кؤ���ᵡ��ҧ�ͧ������Ҫԡ���Ե��� �� ��Եչѡ�֡�һ�Сͺ���� Property ���ʻ�Шӵ�� ����-ʡ�� ��з������ �� Property �������ö�͡����ᵡ��ҧ�ͧ �ѡ�֡�����Ф��� ��� ���ʻ�Шӵ�� �ѧ��� Property ���ʻ�Шӵ�Ǩ֧�� Key Property �ͧ��Ե� �ѡ�֡�� �繵� ���ѭ�ѡɳ��ٻǧ�ի�����㹡ӡѺ���ª��ͧ͢ Property ����ա�âմ�����᷹ Key Property ����������͡Ѻ��Եշ���� Property ��鹴�����鹵ç |