Sunday, April 19, 2009

DATABASE AND ER-DIAGRAM

Database definition:

  • Database are collection of data that saved on magnetic disk, optical is disk or another secondary storage.
  • Coherent collection of mutually data of an enterprise (firm, government or private business)

Examples:

  • Manufacturing business: production planning data, current production data, ordering data significant, etc.
  • Hospital: patient data, doctor, nurse, etc.

DBMS (DATABASE MANAGEMENT SYSTEM)

  • A set of database with application software that base of database.
  • This application program are utilized to access and maintain the databases.
  • The main purpose of DBMS is provide an easy and efficient environment for data and information employing, pulling and saving.

Bit, Byte, Field

  • Bit constitutes a smallest part of data that valuably 0 or 1.
  • Byte is a set of bits that have a same type.
  • Field is a set of bytes that have a same type, in database it is called attribute.

Attribute/field

  • Attribute or field constitutes character or characteristic of an entity that provide detail explanations about those entity.
  • A relationship can also have attribute.

Example of Attribute:

COLLEGE STUDENT has attribute as: NIM, NAME, ADDRESS

CAR has attribute as: COLOR, TYPE, CC


Type of Attribute

  • Single vs Multi-valued

Single : just can be filled at most one value
Multi-valued : can be filled by more than one value with same type.

  • Atomic vs composite

Atomic : indiscrete into smaller attribute
Composite : constitute set of some attribute which smaller

  • Derived Attribute : attribute that has a value which gets from value of another attribute, for example : age is resulted by birth date attribute.
  • Null Value Attribute : Attribute that have no value for a record
  • Mandatory Value Attribute : Attribute that must has a value


Record/ Tuple

Constitute a data row in a relationship
Consist from a set of attribute where that attribute interactions to inform the entity or relationship comprehensively.


Entity/File

File constitutes set of record that have a same type, element and attribute but have a different value.

File type :

In application processing, file can be categorized as:

  • Parent file
  • Transactions file
  • Report file
  • History file
  • Protecting file
  • Job file


Domain

Domain constitutes set of values that can be in place on one or more attribute.
Each attribute in a relational database is defined as a domain.


Key of Data Element

Key is record element that is used to find record on access time or can also be used to identify each entity / record / row.


Key Type

  • Super Key:
Super key constitutes one or more attribute of a table that can be used to identify entity / record of table uniquely (are not all attribute can be super key).
  • Candidate Key:

Candidate Key is super key with minimal attribute. Candidate key may not contain attribute from the other table therefore candidate key is definitely super key but was obviously on the contrary.

  • Primary Key:

One of attribute from candidate key that can be used as primary key with three criteria as follows:

1. That key more natural to used as hint

2. That key is simple

3. The uniqueness of that key is guarantee.

  • Alternate Key:

Are attribute from candidate key that don't be chosen becomes primary key.

  • Foreign Key:

A foreign key also called a foreign keyword, in a database table is a key from another table that refers to a specific key, usually the primary key, in the table being used. A primary key ca be targeted by necessarily have to be the target of any foreign keys.

  • External Key:

Constitute a lexical attribute (or lexical gathering attribute) which its point identify one of instance object


Entity Relationship Diagram

ERD is a network model which use word structure that saved in a system abstractly.

The different between DFD and ERD:

DFD constitutes a logistic network model that will be performed by system

ERD constitutes data network model that emphasizes on structure and data relationship


Elements of ERD

  • Entity

On ER diagram Entity is figured with rectangle. Entity is something in real system and also abstract where data is saved or where data is exists.

  • Relationship

On ER diagram relationship can be figured by diamond.

  • Relationship Degree

Are total of entity who participates in one relationship. Degree that frequent being used in ERD.

  • Attribute

Are characteristic of every entity and also relationship.

  • Cardinality

Refer total of optimum tupel that relation with entity on another entity.


Relationship Degree

  • Unary Relationship

Are model relationships that occur between entities that come from same entity set.

  • Binary Relationship

Are model relationships that occur between 2 entities.

  • Ternary Relationship

Are relationships between instances of 3 entities types unilaterally.

Cardinality












There are three cardinality of relationships:

One to One:
Level one to one relationship with the one stated in the entity's first event, only had one relationship with one incident in which the two entities and in contras.

One to Many or Many to One:
Level one to many relationship is the same as the one to many depending on the direction from which the relationship is look. For an incident on the first entity can have any relationship with many incident on the second entity, if the one incident on the the second entity can only have one relationship with the incident on the first entity.

Many To Many:
Occur if each event on one entity has many relationships with event on another entity

Notation of ERD

Notation of ERD:













Rectangles: declare entity sets

Circle: declare attribute of entity

Diamonds: declare relationship sets

Lines as connection between relationship sets with entity sets and entity sets with its attribute.

0 comments:

Post a Comment