-=- yOe -=-

Jumat, 17 April 2009

ER-Diagram

Database and ERD (Entity Relationship Diagram)
definition of database
- database is group of data that stored into magnetic disk, optical disk, or another secondary data storage.
- fused collection of datas, that connected mutually, from an enterprise (a company, firm, and government).
  • manufacture company -> production planning data, actual production data, material ordering data, etc
  • hospital -> data of patient, doctor, nurse, etc

DBMS (Database Management System)

- compilation of database with software application based on database

- the programs of application used for access and take care of database

- main purpose of DBMS is to provide an environment that easier and efficient for using, drawing and saving data and information.

definition of bit, byte, and field

- bit -> smallest part that have some value of 0 and 1

- byte -> collection of same bits

- field -> collection of same bytes as known as attribute


types of attribute

- single vs multivalue

  • single -> only can containing mostly 1 value
  • multivalue -> can containing more than 1 value with same kind value
- atomic vs composition
  • atomic -> cannot divided into smaller attribute
  • composition -> alliance of smaller attribute

- derived attribute -> attribute that can be yield from other attribute value, for example : age can be yield from attribute of birth datenull

- value attribute -> attribute with no value for a record

- mandatory value attribute -> attribute that must have a value
record or tupple
- a data row inside a relation
- consist of attribute collection which attribute interaction for advising entity or relation as detail
entiry or file
- file is collection of record that have same kind and same element, which the same attribute, but different data value.
- Type of file
In application process, file can be categorized as :
  • Main file
  • Transaction file
  • Report file
  • History file
  • Protector file
  • Activity file

Domain

- collection of value that can be inside one or more attribute.

- Each attribute in database relation defined as domain.

Element key of data

- Key is element of record that used for finding its in access time or can be used for identification each entity/record/row.

Types of key
- Superkey is one or more attribute that can be used for identification entity/record in table as uniquely (not all of attribute can be superkey).
- Candidate key is supperkey with minimal attribute. Candidate key cannot containing the attribute from other table, so candidate key already definite as superkey but not yet the other way.
- Primary key is one of candidate key that can be chosen or determined as primary key with 3 category, that is :
  1. key is more natural for used as reference
  2. key is more simple
  3. key is guaranteed the unique

- alternate key is attribute from candidate key that not chosen as primary key

- Foreign key is any kind attribute that showing to primary key in other table. Foreign key happen in a relation that having cardinality one-to-many or many-to-one. Usually, Foreign key always put in table direct to many.
External key is a lexical attribute (or compilation of lexical attribute) that its value always identification one object instance.

ERD or Entity Relationship Diagram

- A model using word structure that saved in system as abstract,

- Difference between DFD and ERD

  • DFD is a function network model that will executed by system
  • ERD is data network model that emphasize in structure and relationship data.

The elements of ERD

- Entity
  • Something exist inside real system or abstract system which data stored or where are the data.
  • Symbolized as square of length. There are also line symbol as link between compilation of entity with entity and compilation entity with its attribute.

- Relationship

  • Natural Relation happened between entity.
  • Generally, given name with basic verb that facilitating for reading its relation.
  • Symbolized as rhomb

- Relationship degree

  • Account of entity that participated inside a relationship.
  • Degree is often used in ERD\

- Attribute

  • Characteristic of each entity or relationship
  • Symbolized as circle
- Cardinality
  • Showing maximal account tupel that can be relation with entity in the other one.

Relationship degree

- Unary relationship is Relationship model happen between the entity which coming from the same entity set.

- Binary relationship is relationship model happen between 2 entity.
- Ternary relationship between instance of 3 entity unilaterally.
Cardinality

- There are 3 cardinality relation, that is :

  • One-to-one : relationship degree one-to-one expressed by one event in first entity, only have one relation with one event in second entity and on the contrary.
  • One-to-many or many-to-one : relationship degree one-to-many is equal many-to-one dependent from where that relationship seen. For one event in first entity can have many relationship with event in second entity, the other way, one event in second entity only have relationship with one event in first entity.
  • Many-to-many : happen if each event in an entity having a lot of relationship with event in other entity

Example : cardinality



reference :
- NGURAH AGUS SANJAYA ER, S.KOM, M.KOM. Slide presentasi : Part 5 - DATABASE DAN ER-DIAGRAM.


Tidak ada komentar:

Posting Komentar