management information system 5

80
Mr.Warawut Khangkhan Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter 5 5 5 5 5 5 5 5 Database System Database System Database System Database System Database System Database System Database System Database System Mr.Warawut Khangkhan e-Mail: [email protected] Social Network: www.facebook.com/AjWarawut

Upload: warawut

Post on 18-Nov-2014

743 views

Category:

Education


2 download

DESCRIPTION

Database System

TRANSCRIPT

Page 1: Management Information System 5

Mr.Warawut Khangkhan

Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter 5 5 5 5 5 5 5 5 Database SystemDatabase SystemDatabase SystemDatabase SystemDatabase SystemDatabase SystemDatabase SystemDatabase System

Mr.Warawut Khangkhan

e-Mail: [email protected]

Social Network: www.facebook.com/AjWarawut

Page 2: Management Information System 5

������������������������

Mr.Warawut KhangkhanChapter 5 Database System2

Page 3: Management Information System 5

������������������������ (File System)(File System)(File System)(File System)(File System)(File System)(File System)(File System)

��������

���� ��� ���

Mr.Warawut Khangkhan3 Chapter 5 Database System

������� ���������

Page 4: Management Information System 5

������������������������� ����������������������������� (Bit)

� ��������� (Character)

������ (Field)

� ��������/�������

Mr.Warawut KhangkhanChapter 5 Database System4

� ��������/�������(Record)

� ��� (File)

Page 5: Management Information System 5

��������������������������������������� ���������!�"����#�"��$� (Data Redundancy)

� ��� �%&����"�#�����#�"��$� (Data Inconsistency)

� ��� �%&��'��(������#�"��$� (Data Anomaly)� ��� �%&��'��(������#�"��$� (Data Anomaly)

� ��� �%�)*���&����#�"��$� (Data Dependency)

Mr.Warawut Khangkhan5 Chapter 5 Database System

Page 6: Management Information System 5

����������������������

Mr.Warawut KhangkhanChapter 5 Database System6

Page 7: Management Information System 5

������������������������ (File System)(File System)(File System)(File System)(File System)(File System)(File System)(File System)

��������

���� ��� ���

Mr.Warawut Khangkhan7 Chapter 5 Database System

������� ���������

Page 8: Management Information System 5

���������������������� (Database System)(Database System)(Database System)(Database System)(Database System)(Database System)(Database System)(Database System)

��������

���� ��� ���

Mr.Warawut Khangkhan8 Chapter 5 Database System

������� ���������

Page 9: Management Information System 5

���������������������� (Database System)(Database System)(Database System)(Database System)(Database System)(Database System)(Database System)(Database System)

�+��,-# �� %���#�"��$�/�0�����&��'��(����1��,$��!������� 2����2��#&�"#�������� ,$����� � �$1� 1�������2�������1��������3��"��$� (DBMS: Database Management System) �'�0����&��#Database Management System) �'�0����&��#����"�#��&�&��/4��#�#����1���'�0���5�"#��%�������#6$"5�" ������#��)�����/��#+��/�0/!#��%������% ����������� (Database System)�

Mr.Warawut Khangkhan9 Chapter 5 Database System

Page 10: Management Information System 5

������������������������������������������� �"��$� (Data)

� 7���1��� (Hardware)

� �����1��� (Software) �"1�% Database Management System : DBMSManagement System : DBMS

� 6$"5�" (User) �"1�% Programmer, Database Administrator (DBA)

�Procedure ���0���"�#���� ��!&�0#/�02)�1��������+���DBA �!+�� �"�'�0���������3��"��$� ���,-#������������������"5�"3��"��$� Mr.Warawut Khangkhan10 Chapter 5 Database System

Page 11: Management Information System 5

Application Interface

Procedure

Query/ReportTools

ApplicationSoftware

End UserProgrammer / DBA

Mr.Warawut Khangkhan11 Chapter 5 Database System

DBMSDataRepository

DataDictionary

HardwareSystemSoftware

ServerDatabase

Page 12: Management Information System 5

������������������������������������������������

View 1 View 2 View 3...

Conceptual

External

Level

Conceptual

Mr.Warawut Khangkhan12 Chapter 5 Database System

Conceptual

Schema

Internal

Schema

Database Physical Data

Level

Internal

Level

1��� ���#/�0���%��"��$���#6$"5�"

Page 13: Management Information System 5

View 1 View 2 View 3...

Conceptual

Schema

External

Level

Conceptual

Level

• �)*������� ���#��#6$"5�" • �(���,-#�"��$�5����89�:���� /�0 �% �"�)*�

�$)�%#+���2��#&�"#��#�"��$�• 2��#&�"#�"��$�5��������� ��1)��)��0�� )��

Mr.Warawut KhangkhanChapter 5 Database System13

Internal

Schema

Database Physical Data

Internal

Level

• 2��#&�"#�"��$�5��������� ��1)��)��0�� )��� ���#��#6$"5�"

• ���!�&���"��$��-#�-����$%���� ���#/�06$"5�"�"�#�� 2�� �%�!�)*��"�#�)*��"��$��$)1�������������/�0�����;� �"5�3��"��$����#

Page 14: Management Information System 5

View 1 View 2 View 3...

Conceptual

Schema

External

Level

Conceptual

Level

• �)*������� ���#��#3��"��$� • �(���5+"/���%���"��$�5��"#/�0,$������;�5�

Mr.Warawut KhangkhanChapter 5 Database System14

Internal

Schema

Database Physical Data

Internal

Level

• �(���5+"/���%���"��$�5��"#/�0,$������;�5�3��"��$� 1���"��$��+�%����&��'��(������%# �

• �)*�:'��#2��#&�"#�"��$�/�05�"1/�2��#&�"#/#��:'��#�"��$����#/�0��;���$%5�3��"��$�

• �'�0�5+"#%��%����(���,-#2��#&�"#��#�"��$��%#< /�0��;���$%5�3��"��$�����

Page 15: Management Information System 5

View 1 View 2 View 3...

Conceptual

Schema

External

Level

Conceptual

Level

� �)*������� ���#/�0�!�&��2��#&�"#/#��:'��#3��"��$�

� �(���5+"/���%�"��$�,$������;���%# �5�3��"��$� ��� �(���,-#2��#&�"#�"��$� �����"��$� )���:/����",-#�"��$� ������� ����"��$� ������ � )��,-#�����&�������/�05�1+�%#�����;�

Mr.Warawut KhangkhanChapter 5 Database System15

Internal

Schema

Database Physical Data

Internal

Level

������ � )��,-#�����&�������/�05�1+�%#�����;��"��$� ���!+�� Index 1����������� Record �"��$�

Page 16: Management Information System 5

MappingMappingMappingMapping� �)*���,%�/��� ���#��&,)=������5������/�0&$#��%

)��#�����/�0�0!��% &��,1�%#����)*� 2 ���89� ��#����Conceptual / Internal Mapping – �'�0��!2��#&�"#��#�"��$�5������ Conceptual ��!+��2��#&�"#��#

Mr.Warawut KhangkhanChapter 5 Database System16

��#�"��$�5������ Conceptual ��!+��2��#&�"#��#Record 1�� Field /�0�! )5�"�����;��"��$�

�External / Conceptual Mapping – �'�0��!+��2��#&�"#��# Record 1�� Field 5+"&��,������ �����"�#�� +���� ���#�%#< ��#6$"5�"

Page 17: Management Information System 5

MappingMappingMappingMappingExternal View 1

EmpId FName LName Age Salary

External View 2

EmpId LName ProNo

Conceptual View EmpId FName LName Age Salary ProNo

Mr.Warawut KhangkhanChapter 5 Database System17

Internal View struct EMPLOYEE {

int EmpId;

int ProNo;

char FName[15];

char LName[15];

struct date DateOfBirth;

float Salary;

struct EMPLOYEE *next;

}index EmpId; index ProNo;

Page 18: Management Information System 5

����������������������������������� ���������3��"��$� (Database Management System : DBMS) – �)*������1���&!+������+�1�������3��"��$� �-0#�)*��&���������#��+�%#6$"5�"���3��"��$� /!+�"/�05���&�"# �����5�"�"��$� +���)���)� #

Mr.Warawut KhangkhanChapter 5 Database System18

3��"��$� /!+�"/�05���&�"# �����5�"�"��$� +���)���)� #3��"��$�

� 5���/!#����3��"��$����"�#6%� DBMS / �����#

Page 19: Management Information System 5

�������� DBMS

� �������������� �� ������� (User View)

DBMS

Schema

Mr.Warawut KhangkhanChapter 5 Database System19

Subschema

B

Subschema

C

Subschema

A

User 1 User 2 User 3 User 4 User 5

������������������ �������������� !"�#�����$��%&� ��� ��!

Page 20: Management Information System 5

���������������� DBMSDBMS

� �������� !" ����'���� ��! – �4�� >:8�����"��$�(Data Definition Language : DDL)”�DDL �)*�:8/�0)����� )�"��� ��!&�0# ����9� 1��

�?��9@�/�05�"5����!+��2��#&�"#1���(�������������?��9@�/�05�"5����!+��2��#&�"#1���(��������������#�"��$� ���������&��'��(���+�%#�"��$�5�3��"��$� 5���&�"#3��"��$���������"�#�!+��2��#&�"#5+"����"��$�1�"� 6$"�$1�3��"��$���#���"�#���/! >'��� ����"��$�(Data Dictionary: DD)” 5�3��"��$�����"��

Mr.Warawut Khangkhan20 Chapter 5 Database System

Page 21: Management Information System 5

���������������� DBMSDBMS

� �������� !" ����'���� ��! – �4�� >:8�����"��$�(Data Definition Language : DDL)”������������� (Data Dictionary: DD) ��1&�#

�����������#�"��$�/��#+��/�0����$%5�3��"��$� �-0#�������������#�"��$�/��#+��/�0����$%5�3��"��$� �-0#��)����� )�"�� ��0� ������ )���:/ 1�������"#��#�"��$� ������+���+� ��#�"��$����� ��%� ��,$������5�"2��6$"5�"��5��"# ���! )5�"�'�0�&�"#��#�����5��"# �)*��"�

Mr.Warawut Khangkhan21 Chapter 5 Database System

Page 22: Management Information System 5

���������� ������ ��� ���������

��! )5�"�)*����3�5����!+�����1)��"��$�5���+�%#�������2)�1��� �"

� �)*�����0�#���&!+������!� #���83��"��$� +��"�#��2��#&�"#&%��5�/�0�"�#1�" � ��/!5+"�����2��#&�"# �"2��#&�"#&%��5�/�0�"�#1�" � ��/!5+"�����2��#&�"# �"#%��-��

Mr.Warawut Khangkhan22 Chapter 5 Database System

Page 23: Management Information System 5

���������� ������ ��� ���������

� �%���������!�"����#�"��$� ���0�#��5���+�%#�����/!'��� ����"��$� ��/!5+"/���%�"��$�5�/�0,$������;� )1�"� 1�������;� �"2��5�"��0��%��%# � �-0#+�'��%�"��$�����,$������;���!1�%5�"��0��%#����;��/!5+"1�" �'��%�"��$�����,$������;���!1�%5�"��0��%#����;��/!5+"1�" � �"/��/%�#/�

Mr.Warawut Khangkhan23 Chapter 5 Database System

Page 24: Management Information System 5

���������� ������ ��� ���������

� �'�0�����%���0�,��5+"����"��$� ���0�#���������;��"��$��"������3��"��$� ��&��,�!+��&�/(�A5�����",-# �����5�" 1��1�" ��"��$� �" ��#���� ��1�" ��"��$�5+"6�� )������)*����# �-#��2��&�����-�� �"�"�� /!5+"5+"6�� )������)*����# �-#��2��&�����-�� �"�"�� /!5+"�"��$�/�0�����;��������0�,�� �"

Mr.Warawut Khangkhan24 Chapter 5 Database System

Page 25: Management Information System 5

���������������� DBMSDBMS

� ���������( !"�������� ��! – �)*������#5��������;�1�������5�"�"��$�5�3��"��$� 2��5�"�!&�0# ��%� DBMS

� ����� ��� ���� ��

�� �� !"#�� $%� #

Physical Access Path

Mr.Warawut Khangkhan25 Chapter 5 Database System

3��"��$� 2��5�"�!&�0# ��%�“SELECT * FROM student;” �-0#�!&�0#�+�%�������)*��&"�/#5�����",-#�"��$����#����� “Logical Access Path (LAP)”

DBMS

&'"(�"�

")��� �*+ �

&'"(�"�

")��,��-%$�, !

&'"(�"�

")��-!��!.

/ � �+

Logical Access Path

Page 26: Management Information System 5

���������������� DBMSDBMS

� ��������)������(�� ��! !"������������� ���������������� ���

(Manipulation) �"1�% ���'�0�

DBMS

� ����� ��� ���� ��

�� �� !"#�� $%� #

Schema

Mr.Warawut Khangkhan26 Chapter 5 Database System

(Manipulation) �"1�% ���'�0� 1/�� �� 1�" � 1��)���)� #�"��$� �-0#�!&�0#/�05�"5����!����������"��$�2��&%��5+�% ����%�)*��� %�:8 “DML (Data Manipulation Language)”

SchemaB

Schema

A

SchemaC

/ � �+

")��� �*+ �")��,��-%$�, ! ")��-!��!.

Page 27: Management Information System 5

�� ������� ����� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMSApplicationPrograms

ProgrammersProgrammersDatabaseSchema

DBADBA

Queries

UsersUsers

DMLPreprocessor

DDLCompiler

QueryProcessor

Mr.Warawut Khangkhan27 Chapter 5 Database System

ProgramObject Code

DictionaryManager

DatabaseManager

AccessMethods

FileManager

DBMSDBMS

SystemBuffers

Database andSystem Catalog

Page 28: Management Information System 5

�� ������� ����� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMSApplicationPrograms

ProgrammersProgrammersDatabaseSchema

DBADBA

Queries

UsersUsers

DMLPreprocessor

DDLCompiler

QueryProcessor

Mr.Warawut Khangkhan28 Chapter 5 Database System

ProgramObject Code

DictionaryManager

DatabaseManager

AccessMethods

FileManager

DBMSDBMS

SystemBuffers

Database andSystem Catalog

�)*��#��)�����&!�����# DBMS /!+�"/�01)�#�!&�0#����� )�)*�� ��!&�0#������%#/�0������"5� 1�"�&%# ))�����6��%�/�0 Database Manager

Page 29: Management Information System 5

�� ������� ����� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMSApplicationPrograms

ProgrammersProgrammersDatabaseSchema

DBADBA

Queries

UsersUsers

DMLPreprocessor

DDLCompiler

QueryProcessor

Mr.Warawut Khangkhan29 Chapter 5 Database System

ProgramObject Code

DictionaryManager

DatabaseManager

AccessMethods

FileManager

DBMSDBMS

SystemBuffers

Database andSystem Catalog

/!+�"/�0�)*������#5�������!&�0#����� (Query) 1�"�'���9�%�!�"�#��������6��%��"��$�&%��5� �������-#&%#�!�"�# )��# File Manager �'�0��!���������!�"�#���%� )

Page 30: Management Information System 5

�� ������� ����� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMSApplicationPrograms

ProgrammersProgrammersDatabaseSchema

DBADBA

Queries

UsersUsers

DMLPreprocessor

DDLCompiler

QueryProcessor/!+�"/�0�!�������%#< /�0���0���"�#���1+�%#�����;��"��$���/�0

DBA �!+���% �" '�"��/��#���&�������/�05�1+�%#�����;��"��$�

Mr.Warawut Khangkhan30 Chapter 5 Database System

ProgramObject Code

DictionaryManager

DatabaseManager

AccessMethods

FileManager

DBMSDBMS

SystemBuffers

Database andSystem Catalog

DBA �!+���% �" '�"��/��#���&�������/�05�1+�%#�����;��"��$� ������&%#+�"/�0 )5+" Access Method ���6�����1/�

Page 31: Management Information System 5

�� ������� ����� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMSApplicationPrograms

ProgrammersProgrammersDatabaseSchema

DBADBA

Queries

UsersUsers

DMLPreprocessor

DDLCompiler

QueryProcessor

Mr.Warawut Khangkhan31 Chapter 5 Database System

ProgramObject Code

DictionaryManager

DatabaseManager

AccessMethods

FileManager

DBMSDBMS

SystemBuffers

Database andSystem Catalog

/!+�"/�01)�#� ��!&�0#5��� %� DML 5+"�)*��=#��������3��'�0���",-#�"��$� 2���=#�������,$��=#��$%5�2)�1�����#3��"��$� 1���"�#/!#��%����� Query Processor

Page 32: Management Information System 5

�� ������� ����� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMSApplicationPrograms

ProgrammersProgrammersDatabaseSchema

DBADBA

Queries

UsersUsers

DMLPreprocessor

DDLCompiler

QueryProcessor

Mr.Warawut Khangkhan32 Chapter 5 Database System

ProgramObject Code

DictionaryManager

DatabaseManager

AccessMethods

FileManager

DBMSDBMS

SystemBuffers

Database andSystem Catalog

/!+�"/�01)�#� ��!&�0#5��� %� DDL 5+"�)*� Table ��# Meta-data �-0# Table �+�%�����,$������;���$%5� Catalog ��#�����%� ) �'�0�5�"�)*��"��$��"#��#5���)�����6��"��$�

Page 33: Management Information System 5

�� ������� ����� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMSApplicationPrograms

ProgrammersProgrammersDatabaseSchema

DBADBA

Queries

UsersUsers

DMLPreprocessor

DDLCompiler

QueryProcessor

Catalog Manager /!+�"/�0�$1�1�������

Mr.Warawut Khangkhan33 Chapter 5 Database System

ProgramObject Code

DictionaryManager

DatabaseManager

AccessMethods

FileManager

DBMSDBMS

SystemBuffers

Database andSystem Catalog

Catalog Manager /!+�"/�0�$1�1�����������",-# Catalog ��#���� ��� �$1�����",-# Table Meta-data ��#����

Page 34: Management Information System 5

�������������������� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMS1. ����� �'���� ��! (Database Size) – �-����$%���

�!��� Record2. ����#���������*+ ��)�,�#"$�� ���� (Number of

Concurrent Users)Concurrent Users)3. ��"�)-%),�$ (Performance) – �����;�5���

��",-#�"��$�, ���&��,1�������;�5����$"�������(System Recovery), ���&��,5������� �������:��'�"�����

Mr.Warawut Khangkhan34 Chapter 5 Database System

Page 35: Management Information System 5

�������������������� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMS4. �����"������-����� (Integration) – /!#�

�%�����2)�1���)��� ���1��3��"��$���0�, ����)C������� (Operating System: OS)”

5. !��./"�����0 (Features) – �%�%���)*���/!#�5. !��./"�����0 (Features) – �%�%���)*���/!#�+����$)���89���#�����1���/�0�)*�������89��D'�5�DBMS 1�%��6���:�9@� &%��5+�%�����������0�#����'�0��%��5����!+���������8���)���:�� ���!+��&�/(�A5�����",-#�"��$�/�0�'�"����� DMBS �����,-# ��5�"#�/�0#%� ���$%���)�������5�"#�/�0��"5�#%� 1��������

Mr.Warawut Khangkhan35 Chapter 5 Database System

Page 36: Management Information System 5

�������������������� DBMSDBMSDBMSDBMSDBMSDBMSDBMSDBMS6. ����!)� !"������� (Vendor) – '���9 �"��

�����#�#���� �������0��&��# 1��&,��/#���#��

7. ���-�� (Cost) +�������# DBMS – �-����$%���&,��/#���#�� �2��� 1���#�0�� ���0�<&,��/#���#�� �2��� 1���#�0�� ���0�<

Mr.Warawut Khangkhan36 Chapter 5 Database System

Page 37: Management Information System 5

���� �������������� ����������(Database Model)(Database Model)(Database Model)(Database Model)(Database Model)(Database Model)(Database Model)(Database Model)

5�"�(���,-#2��#&�"#1�����&��'��(���+�%#�"��$�:�5�3��"��$�

Mr.Warawut KhangkhanChapter 5 Database System37

Page 38: Management Information System 5

����������� ����!�"������������ ����!�"�� �)*�3��"��$�/�0��2��#&�"#��%##%� � �����;��"��$�5�1�E��"��$��)*� Segment �����1�%��Segment 5�16�6�#�"� �"�% >2+�� (Node)” 2+��/�0��$%������%# ������% “2+���$� (Child Node)” &%����$%������%# ������% “2+���$� (Child Node)” &%��2+��/�0��$%������� ������% >2+��'%�1�% (Parent Node)” 1��2+��/�0��$%�������& � ������% “Root Node” �-0#���"�#���'��#2+��������/%����

� 2+��'%�1�%&��,���$� �"����% 1 2+�� 1�%2+���$�����'%�1�% �"�'��#2+��������/%���� ��������&��'��(����89�����% “One-to-Many Relationship”Mr.Warawut Khangkhan38 Chapter 5 Database System

Page 39: Management Information System 5

����������� ����!�"������������ ����!�"�

Mr.Warawut KhangkhanChapter 5 Database System39

Page 40: Management Information System 5

����������� ����!�"������������ ����!�"��� ��

� �������%�#���5���5�"#�

� ����",-#�"��$��%�"

� �%�+�������������"��$�/�0�"�#����������;� �'��

Mr.Warawut KhangkhanChapter 5 Database System40

� �%�+�������������"��$�/�0�"�#����������;� �'���"�#�4��2��#&�"#1�� Linked List /�0�"�#��'��������� (Pointer) ��� )��#�"��$� Record ,�� )���0��< �-# �%����5�"#������

Page 41: Management Information System 5

����������#��$�%������������#��$�%�����2��#&�"#��"����3��"��$�1���!�������

� 3��"��$�1��������%� 2+���$�&��,��2+��'%�1�% �"����% 1 2+�� 1��2+��'%�1�%�;&��,��2+���$� �"����% 1 2+����%��������� ��������&��'��(����89����

Mr.Warawut KhangkhanChapter 5 Database System41

����% 1 2+����%��������� ��������&��'��(����89�����% “Many-to-Many Relationship”

Page 42: Management Information System 5

����������#��$�%������������#��$�%��

Mr.Warawut KhangkhanChapter 5 Database System42

Page 43: Management Information System 5

����������#��$�%������������#��$�%���� �� �%���"��!������0�#���&��'��(�

�&����"�#������#�

�� ��� �����1��3��"��$�/!

�"�%���"#�� ���0�#���"�#�!+�����&��'��(�

Mr.Warawut KhangkhanChapter 5 Database System43

�&����"�#������#�������)*����#����%

�"�#�!+�����&��'��(�5+"������ �/ ��"��$� /!5+"���)��0��1)�#2��#&�"#�"��$��-#�)*����0�#��

Page 44: Management Information System 5

�������#!&����'��(��������#!&����'��(�� �)*�3��"��$�/�0��;��"��$� �"5����89���#��# 2 ���� (Table) 2��1�%#�)*�1,� (Row 1/� Record) 1��������� (Column 1/������ +���Attribute)

� 3��"��$����#&��'��(��-#)����� )�"���� %���#

Mr.Warawut KhangkhanChapter 5 Database System44

� 3��"��$����#&��'��(��-#)����� )�"���� %���#��#�"��$�+����# 1�%����#�����&��'��(�����"��Attribute 5�Attribute +�-0# �-#������"��$�1�%����#�% “Relation” +��� “Table”

Page 45: Management Information System 5

�������#!&����'��(��������#!&����'��(�

Mr.Warawut KhangkhanChapter 5 Database System45

Page 46: Management Information System 5

�������#!&�)���*�������#!&�)���*� �)*������3��"��$�����+�-0#/�0�����;��"��$�� ��!&�0# �"

�"����� �-0#&�0#/�0������������"��$�1���!&�0#5����!������5�< ��"�"����� ��,$�������% >���, (Object)” 1��3��"��$�/�0�!������;� Object

Mr.Warawut KhangkhanChapter 5 Database System46

(Object)” 1��3��"��$�/�0�!������;� Object

� �"��$�/�0�����;���$%5�3��"��$�������� ��,$���#�)*����, +��������;��� (�)���� �"���&������# Entity) 1�%�������;�������� 9���89�/�0������% “Attribute” �������������;�����#)����� )�"����(�� �-0#�)���� �"���'G��������#�����;��������$%�"��

Page 47: Management Information System 5

�������#!&�)���*�������#!&�)���*Person

name

birthdate

Mr.Warawut KhangkhanChapter 5 Database System47

Student

entrydate

Employee

hiredate

Teacher Support

Page 48: Management Information System 5

�������#!&�)���*�������#!&�)���*�� �

� 3��"��$����#���, &��,�����;��"��$�/�0���������"�� �"�)*���%#�� 2��

�� ��

� ���-#�"��$�+��< �"��$�����)��&�/(�:'�"����%3��"��$����#

Mr.Warawut KhangkhanChapter 5 Database System48

����"�� �"�)*���%#�� 2��&��,�����;��"��$�/�0�)*�Multi-valued �" �)*������"��!�����#3��"��$����#&��'��(�

�"����%3��"��$����#&��'��(�

Page 49: Management Information System 5

������������&�&������������&�&� �)*�3��"��$�/�0'�H����3��"��$����#&��'��(� 2��1�%

��1,� ��� >��������I �-0#/!5+"/��� 9���89���#�"��$�5�<

� ����#�"��$��)*��������� ,���%�)*�����#1�����������

Mr.Warawut KhangkhanChapter 5 Database System49

� ����#�"��$��)*��������� ,���%�)*�����#1�����������

Page 50: Management Information System 5

������������&�&������������&�&!"#$!%& '(")%* +%,)%-.*$/ ,0(1%,

��!- H�!� A 18,000

��!- H�!� B 15,000

��!- " �� A 10,000

��!- " �� B 12,500

�H�O� H�!� A 35,000

Mr.Warawut KhangkhanChapter 5 Database System50

�H�O� H�!� A 35,000

�H�O� H�!� B 37,500

�H�O� " �� A 25,000

�H�O� " �� B 20,000

�R H�!� A 20,000

�R H�!� B 18,000

�R " �� A 15,000

�R " �� B 12,500

Page 51: Management Information System 5

������������&�&������������&�&

Mr.Warawut KhangkhanChapter 5 Database System51

����/�0 1 ��� :$��:� (Region)����/�0 2 ��� G�$�� (Season)����/�0 3 ��� &���6��� (Production Line)

Page 52: Management Information System 5

������������&�&������������&�&

� ��1&�#�"��$�+������ ��/!5+"��������+��"��$� ��������/ �G�$��1��/ �:$��:�/! �"#%��-�� �"��

Mr.Warawut KhangkhanChapter 5 Database System52

/ �:$��:�/! �"#%��-�� �"����(��� “�D��� (Slicing)” �$��4������)*�&%�� < ��/�0�"�#���!����/%����

�$���N (Dicing)

Page 53: Management Information System 5

������������&�&������������&�&� ��(��� “Slice and Dice” ����)*��/����/�05�"5���

������+��"��$���3��"��$� >��"���/1�����#�"��$�(Data Mart and Data Warehouse)I �/�������������% 1�����"�#!�!��)�#)����"�& (( ��!�&

Mr.Warawut KhangkhanChapter 5 Database System53

������% 1�����"�#!�!��)�#)����"�& (( ��!�&(Online Analytical Processing : OLAP)” �-0#�)*���������+��"��$��!�����/�0�����;���$%5�3��"��$� �'�0����+&�&��/4/�0��#������"�#����#6$"5�" 2��/�06$"5�" �%�!�)*��"�#�! )������+��%����

Page 54: Management Information System 5

!�&����������!�&����������

Mr.Warawut KhangkhanChapter 5 Database System54

Page 55: Management Information System 5

�����������)�+���������������)�+����(Centralized Database)(Centralized Database)(Centralized Database)(Centralized Database)(Centralized Database)(Centralized Database)(Centralized Database)(Centralized Database)

� �������;�3��"��$�1�� DBMS �"/�0 ���#������ 2��&%��5+�%���)*�4$�����#��#�#����

� 3��"��$����������&��,��#�����5�"#���6$"5�"+���� �"'�"������� �"'�"�����

Mr.Warawut Khangkhan55 Chapter 5 Database System

CentralDatabase

Page 56: Management Information System 5

��������������������������������(Distributed Database(Distributed Database(Distributed Database(Distributed Database(Distributed Database(Distributed Database(Distributed Database(Distributed Database))))))))

� �������;�3��"��$� 1�� DBMS �"5�+��< &,�/�0+���+�� ��� 1�%�� ��������������'��������)*���#�����#

Mr.Warawut Khangkhan56 Chapter 5 Database System

Page 57: Management Information System 5

��������������������������������(Distributed Database)(Distributed Database)(Distributed Database)(Distributed Database)(Distributed Database)(Distributed Database)(Distributed Database)(Distributed Database)

3��"��$�1���������#,$��!1���)*� 2 �����%�� �"1�%�Homogeneous System - 1�%�� ���#�5�

�����1��� DBMS ������������ �$)1����#�"��$��-#�+������� ���!�"��$��%# ����5�"#��-#/! �"#%� �%�+������� ���!�"��$��%# ����5�"#��-#/! �"#%� �%�"�#�&�����5���1)�#�$)1���"��$�

�Heterogeneous System - 1�%�� ���������3��"��$� 1�� DBMS 1���%#��� /!5+"�"�#����1)�#�$)1���"��$��%���&�� ���0��"�#5�"#��"��$��%�����

Mr.Warawut Khangkhan57 Chapter 5 Database System

Page 58: Management Information System 5

����������������������������

�)*��������&!�����#��������'�H�3��"��$��)*����!+��2��#�%#��#3��"��$�

Mr.Warawut KhangkhanChapter 5 Database System58

�)*����!+��2��#�%#��#3��"��$�

Page 59: Management Information System 5

����)�������������������)���������������1�%#����)*� 3 �������

� �����1��5������1����� (Conceptual Design)

� �����1������������ (Logical Design)

� �����1���������:' (Physical Design)� �����1���������:' (Physical Design)

Mr.Warawut Khangkhan59 Chapter 5 Database System

Page 60: Management Information System 5

� ������������������

(Conceptual Database Design)

� �)*����������#���!+��2��#�%#+���< ��#3��"��$���1�����5������:'���

� 2��#�%#��#3��"��$�/�0 �"�-#�)*�2��#�%#5������1����� ������% >Conceptual Schema”������% >Conceptual Schema”

Mr.Warawut Khangkhan60 Chapter 5 Database System

Page 61: Management Information System 5

� ������������������

(Conceptual Database Design)E-R Diagram Class Diagram

Mr.Warawut Khangkhan61 Chapter 5 Database System

Page 62: Management Information System 5

� �����������������

(Logical Database Design)

� �)*��������/�0�! Conceptual Schema �1)�#5+"�)*� Logical Schema /�0��$%5��$)1����#3��"��$�/�0�����5�" �-0#����$%5��$)��# Relation (+��)*�3��"��$����#&��'��(�) +����)*� Object (+��)*�3��"��$����#&��'��(�) +����)*� Object (+��)*�3��"��$����#���, )

� ��+�%#��&�"#2��#�%#3��"��$�5������������"�#����)���2��#�%#+������# �'�0�5+"�����&��$�9����-�� &!+���3��"��$����#&��'��(�1�"� ��(���+�-0#5���)���2��#�%#�;��� >Normalization”

Mr.Warawut Khangkhan62 Chapter 5 Database System

Page 63: Management Information System 5

� ������������� � �

(Physical Database Model)

� �������������! Logical Schema ��!+��2��#&�"#5��������;��"��$��#5�� )��9������;��"��$� 1����(�����",-#�"��$�

� 2��#�%#/�0 �"������������ ������% “Physical Schema” � 2��#�%#/�0 �"������������ ������% “Physical Schema” /�0&��,�! )&�"#�)*�3��"��$����# �"

Mr.Warawut Khangkhan63 Chapter 5 Database System

Page 64: Management Information System 5

NormalizationNormalizationNormalizationNormalizationNormalizationNormalizationNormalizationNormalization� ���, )��&#���'�0��������!�"����#�"��$� 1����)=�+/�0

���������!�������%#< ����"��$�

�Normalization ��� ��������)���)� #2��#&�"#�"��$���#3��"��$�/�0�������!�"��5+"��$%5��$)1��/�0�)*��"��$���#3��"��$�/�0�������!�"��5+"��$%5��$)1��/�0�)*����/��3� (Normal Form) �'�0���)=�+/�0�������� Update 1���������!�"����#�"��$��#

�Normalization ��/��#+�� 6 �$)1�� �"1�% 1NF, 2NF, 3NF, BCNF, 4NF 1�� 5NF (NF –Normal Form) Mr.Warawut Khangkhan64 Chapter 5 Database System

Page 65: Management Information System 5

NormalizationNormalizationNormalizationNormalizationNormalizationNormalizationNormalizationNormalization

EmpId EmpName DepNo DeptName Salary CourseNo CourseName DateComplete

2��#�%#�"��$�2��#�%#�"��$� SEmployeeWSEmployeeW �%��/!�%��/! NormalizationNormalizationEmployeeEmployee DepartmentDepartment

Mr.Warawut Khangkhan65 Chapter 5 Database System

EmpId EmpName DepNo Salary CourseNo

EmployeeEmployeeDepNo DeptName

DepartmentDepartment

CourseNo CourseName

CourseCourse

2��#�%#�"��$�2��#�%#�"��$� SEmployeeWSEmployeeW +��#/!+��#/! NormalizationNormalization

EmpId CourseNo DateComplete

Employee_CourseEmployee_Course

Page 66: Management Information System 5

��� �!�������������� �!�����������

Mr.Warawut KhangkhanChapter 5 Database System66

Page 67: Management Information System 5

��� �!�������������� �!������������ �������!�"����#�"��$� (Minimal Redundancy) �+������0�#������1�"#��#�"��$� (Data Inconsistency Avoidance)

� &��,5�"�"��$��%����� �" (Data Sharing)� &��,5�"�"��$��%����� �" (Data Sharing)� �!+���������)���:��5+"����"��$� �" (Uniform Security Privacy Control)

� ���8���,$��"�#��#�"��$� �" (Integrity Control)�/!5+"�"��$��)*���&����2)�1���/�05�"#��"��$�����(Data Independence)

Mr.Warawut Khangkhan67 Chapter 5 Database System

Page 68: Management Information System 5

��������������������������

Mr.Warawut KhangkhanChapter 5 Database System68

Page 69: Management Information System 5

��������������������������� &�0#/�0����!�-#,-# ��� >���!+���2�����/!#�(Policy)” /�0���%��5+"&��,������"��$� �"��%#��)��&�/(�:' �"��$���#�#�������)*��"��$�/�0,$��"�# ���0�,�� �" 1�������'�"���%���5�"#���$%�&��

Mr.Warawut KhangkhanChapter 5 Database System69

���0�,�� �" 1�������'�"���%���5�"#���$%�&��

��2���&�&��/4 (Information Policy) ��� ���!+���?��9@�5���1�%#)=� �6�1'�% ���+ ���������� �!1�� 1�������;�&�&��/4

Page 70: Management Information System 5

����������������������������� �#���������;� 6$"/�0/!+�"/�0�!+���2���&�&��/4

&%��5+�%���)*�6$"���+�+�����"��#���8�/

� �#�������5+�%���"�#������#�)*�+�"/�01���!+��6$"���6�������%#������1���)*�/#��6$"���6�������%#������1���)*�/#��

Mr.Warawut Khangkhan70 Chapter 5 Database System

Page 71: Management Information System 5

���������������������������+�"/�0 1���(�)����� ��! (Data Administration)” ���6�����5����!+���2���1�����������������"��$� ��#���,-#���$1������1��3��"��$�1�������/!'��� ����"��$� ���������������5�"#��"��$���#6$"5�"/ ��� %� ���1��3��"��$�1�������/!'��� ����"��$� ���������������5�"#��"��$���#6$"5�"/ ��� %�

�+�"/�0�����+��"��$�5��#�#������������% 1Data Governance” �-0#������������##�/�0�'�0��-�� ��� �"�#/!5+"�"��$���#�#������� 9:'1�������)���:��

Mr.Warawut Khangkhan71 Chapter 5 Database System

Page 72: Management Information System 5

����������������������������#�#�����;���!+��5+"+�"/�0�����+��"��$��)*�+�"/�0

5��� 1(�)���'���� ��! (Database Administration)”

Mr.Warawut Khangkhan72 Chapter 5 Database System

Page 73: Management Information System 5

�������*���,!�������,�������$-��������*���,!�������,�������$-�

Mr.Warawut KhangkhanChapter 5 Database System73

Page 74: Management Information System 5

����������������(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)

��!���� ��! (Data Warehouse) +��,-# 3��"��$�/�0�����;��"��$�/�0 �"������-#�"��$�(Extract) ��3��"��$���0� �-0#����2��#&�"#1���%#���+�����$%������)C�������1���%#����; �" �'�0����+�����$%������)C�������1���%#����; �" �'�0�)��2����5���������+�1�����&��5����#( ����

� ���#�"��$�����%�)*�1+�%#�"��$����5+�%��#/��#�#����+���( ���� 1�%���#�������"�#����1�%#&%����/!#�����)*�&%���%�� �-����$%���+�"/�0��/!#� ��%� ��1�%#&%������)*���6��� ���#�� ����� ���� ������� �)*��"�

Mr.Warawut Khangkhan74 Chapter 5 Database System

Page 75: Management Information System 5

����������������(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)(Data Warehouse)

� 5��#��9��"�#/!&!���"��$�/�0������!�)*��"�#5�"#���#1�%��&%�� ������;� �":�5�&%����/!#��%���"�� �����1+�%#�"��$�/�0�����;��"��$�/�0,$�&!�������% 1��������&- (Data Mart)”���&- (Data Mart)”

� ���#�"��$��"�#&��,�"�+�"��$����#������+��'�0�5+" �"�"��$�/�0���������+��&����)=�+ �"�������-�� �-0#���"�#�4���/������%#+�-0#/�0������% “���* ��� ��!(Data Mining)”

Mr.Warawut Khangkhan75 Chapter 5 Database System

Page 76: Management Information System 5

����� ���

�� � ��� � ����

�� �� ��

�� ����

Mr.Warawut KhangkhanChapter 5 Database System76

����� ����� ����

�� ���

�� � ��� �

�� � ��� ���� ����

Page 77: Management Information System 5

� ��� !"�#����� (Data Mining)

��#����#������% >���"�'��#������$" (Knowledge Discovery)” �)*��/����/�05�"5����"�+�"��$����#������+�����&$#

� 5�"���������"��$�/�0�!�����5�3��"��$� )����� )� 5�"���������"��$�/�0�!�����5�3��"��$� )����� )�"�����"�+ 1��1���� %��"��$� 1���������E��"��$�/�0��� 9�%

� ���, )��&#��+��� �'�0�5�"�(����"��$�5�����1������9��"��$�5�����

� &� ) �;��� ��/!�+���#�"��$� �;��� ���!�"��$�5������������+��'�0�5+"�"�'��"��$�+����"��/;����#5+�%Mr.Warawut Khangkhan77 Chapter 5 Database System

Page 78: Management Information System 5

���������#).����������#).�(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)

� '���� ��!(��#�( ��� ��&�"#��;��'�/�06$"5�"&��,������$5�&�0#/�0�"�#�� �"

� 5�� ��%����;��'������&��,�'��#1&�#6��"��$� 6$"5�"/! �"�'��#�)*�������"��$��/%���� �������;��'����89����/! �"�'��#�)*�������"��$��/%���� �������;��'����89�����% “Static Web” 1�%���0������!3��"��$��)��� ��������&�"#��;��'� /!5+"��;��'������&��,�'�0����-���)*���%#�� ��%� 6$"5�"&��,)E���"����1&�#�������+;� �"����;��'� �" �)*��"� �������;��'����89�����% “Dynamic Web”

Mr.Warawut Khangkhan78 Chapter 5 Database System

Page 79: Management Information System 5

���������#).����������#).�(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)

��!������ �'���� ��!(��#�( ��� ��&�"#3��"��$� �"/�0����0�#�����������/�05+"�������;� ��� ������&�"# ���&���)�� (Script) �'�0�)�����6��"��$�5�3��"��$���;� �"/�0����0�#�������������%���� ���0�������0�# ��������"�#�� �"/�0����0�#�������������%���� ���0�������0�# ��������"�#���"��$� ����0�#��������������!�%�"��$�/�0 �"����� ��������)�����6��%����� ���&���)�� 1�"��!��������",-#�"��$�5�3��"��$����!�"�#�� ������&%#6���'(����� )1&�#6�/�0����0�# �������

Mr.Warawut Khangkhan79 Chapter 5 Database System

Page 80: Management Information System 5

���������#).����������#).�(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)(Web Database)

1. � ����� ���!����"�# �������"��$�

Mr.Warawut Khangkhan80 Chapter 5 Database System

Server IBM CompatibleServer IBM CompatibleServer IBM CompatibleServer IBM Compatible Client IBM CompatibleClient IBM CompatibleClient IBM CompatibleClient IBM Compatible

2. ��"��� � 7��� � �����89�� :������"��$�# �; �����3. ��"��� � 7��� = >����?� �� ASP 9�>9=�� ����$B �= "����C� D� = HTML

4. ��"��� � 7��� C:����C� HTML # �;!� � ����� = >����!=���!����"�#