Minggu, 19 April 2009

Database and Entity Relationship Diagram

DATABASE DEFINITION
• A set of data, stored in magnetic disc, optical disc, or other secondary storage
• A collection of interconnected data from some enterprise (companies, governments institute, or private)
- Manufacture company --> production planning data, actual production data, material ordering data, etc
- Hospital --> patient data, doctor, nurse, etc
• A structured collection of records or data that is stored in a computer system. The structure itself is achieved by organizing the data according to a database model. Where the model in most common use today is the relational model.

DATABASE MANAGEMENT SYSTEM
• A software to organize the storage of data
• A collection / combination of database with a data based application software
• These application program was used to accessing and maintaining database
• Main objectives of DBMS are to provide an easy and efficient environment for usage, retrieval and storing data and information

BIT, BYTE, and FIELD
• Bit is the smallest part of data contains a 0 or 1 value
• Byte --> a collection of one kind bits
• Field --> a collection of one kind bytes where in database often called attribute
ATTRIBUTE / FIELD
• Attribute / field is a characteristic from one entity which provide a detailed explanation about that entity
• A relation can also have attributes
• Example of attribute :
- MAHASISWA : NIM, NAMA, ALAMAT
- MOBIL : NOMOR_PLAT, WARNA, JENIS, CC

ATTRIBUTE TYPES
• Single Vs Multivalue
- Single --> can also be stored with at most one value
- Multivalue --> can also be stored with more than one value but still in one type
• Atomic Vs Composition
- Atomic --> cannot be divided into a smaller attribute
- Composition --> a combination of some smaller attribute
- Derived Aatribute
• An attribute which its value can be produced from value of other attribute
• Ex : age can be produced from attribute birthdate
- Null value attribute
• An attribute which doesn't have a value for certain record
- Mandatory Value Attribute
• An attribute which must have a value

RECORD / TUPPLE
• Record / tupple is a row of data in certain relation
• Consist of a collection of atribute which its attribute interrelated each other to inform the entity / relation completely

Entity / File
• File is a collection of one types record and have a same element, same attribute but different data value
• File Types
- In application processing, file can be categorize by :
• Main file
• Transaction file
• Report file
• History file
• Protection file
• Working file

DOMAIN
• Domain is a set of value which permitted to be in one or more attribute
• Every attribute in certain relational database was defined as a domain

ELEMENT DATA KEY
• Key is a record element which used to find that record in access time or can also be used to identify every entity / record / row

KEY TYPES
• Superkey is one or more attribute from certain table which can be used to identify entity / record from table in unique way (not all attribute can be a superkey)
• Candidate key is a superkey with minimal attribute. Candidate key cannot be filled with attribute from other table so a candidate key is definitely a superkey, but not in the contrary
• Primary key
- One of attribute from candidate key can be choosen / specified into primary key with these three criteria :
• That key must be more natural to be used as a reference
• That key must be simpler
• That key must be ensured its uniqueness
• Alternate key is an attribute from unchosen candidate key which was chosen to be primary key
• Foreign key is a random attribute which points to primary key in other table. Foreign key can exist in certain relation which have a one to many cardinality or many to many. Foreign key usually placed in a table that connects to many
• External key is a lexical attribute (lexical attribute compilation) which its value often identifies one instance object

ERD (ENTITY RELATIONSHIP DIAGRAM)
• ERD is a networking model which used a structured word which stored in the system abstractly
• The differences between DFD and ERD :
- DFD is a functional networking model which will be applied by the system
- ERD is a data networking model which emphasizes in structured and data relationship

ERD ELEMENTS
• Entity
In ER Diagram, entity was denoted with rectangle shape. Entity is something that exist in real system as well as abstract where lies the storage of the data or the data being stored
• Relationship
This relationship ER Diagram was denoted with a rhombus shape. Relationship is a natural relation that exists between entity. Generally named with a basic verb in order to easy to do the reading of the relation
• Relationship Degree
Denoting a number of entity which participated in one relationship. A degree which often used in ERD.
• Attribute
Denoting a characteristic from every entity or relationship
• Cardinality
Shows a maximum number of tupple that can be related with entity, in other entity

RELATIONSHIP DEGREE
• Unary Relationship
Denoting a relationship model which exist between entity that come from same entity set
• Binary Relationship
Denoting a relationship model which exist between 2 entity
• Ternary Relationship
Denoting a relationship between instance from 3 entity type unilaterally

CARDINALITY
There're 3 cardinality relation, those are :
• One To One
Relation One To One denoted with one event in the first entity, only have one relation with one event in the second entity, and vice versa
• One To Many or Many To One
Relation One To Many is the same with Many To One, depends from which direction that relation is seen. For one event in the first entity can have many relation with event in the second entity. If otherwise, one event in the second entity only can have relation with one event in the first entity
• Many To Many
This relation exists, if every event in certain entity have many relation with event in other entity

CARDINALITY EXAMPLE

NOTATION (ER DIAGRAM)
Simbolic notation in ER Diagram are :
• Rectangle denoting an entity community
• Circle round shape denoting attribute
• Rhombus denoting a relation community
• Line as a connector between relation community with entity community and Entity Community with its attribute

Tidak ada komentar:

Posting Komentar