Sabtu, 18 April 2009

DATABASE AND ER-DIAGRAM

DEFINITION OF DATABASE

- Database is group of data that stored into magnetic disk, optical disk, or other secondary data storage.

- Data base can also be defined as the collection of data, which can be described as the activities of one or more organizations that be relations. The database can be a collection of integrated data-related data of an enterprise (company, government or private).

- For example : manufacture company -> production planning data, actual production data, material ordering data, etc

DBMS (Database Management System)

- DBMS is software designed to assist in the maintenance and utility data collection in large numbers. DBMS can be the alternative specifically to the use of applications, such as data storage in field and write code for a specific application settings.

- The main purpose DBMS is to provide an environment that is efficient and easy to use, saving data and information.

- The main components DBMS can be divided into 4 types:

1. Hardware

2. Software

3. Data

4. User

BIT, BYTE, FIELD

- Bit is the smallest of data that contains value 0 and 1.

- Byte is collection of same bits.

- Field is collection of same bytes as known as attribute. Attribute is characteristics of an entity that provides a detailed explanation of these entities.

TYPES OF ATTRIBUTE

- Single attribute vs multivalue attribute

  • Single attribute is an attribute that can only be filled at most one value.
  • Multivalue attribute is an attribute that can be filled with more than one value with the same type.

- Atomic vs composition

  • Atomic attribute is an attribute that can not be divided into smaller attributes.
  • Composite attribute is a combination of several attributes of a smaller.

- Derived attribute is an attribute whose value can be derived from the value of other attributes, example : age can be yield from birth date attribute

- Null Value attribute is an attribute that has no value to a record.

- Mandatory Value attribute is a 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

ENTITY 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, can be categorized as :

  • Main file
  • Transaction file
  • Report file
  • History file
  • Protector file
  • Work file

DOMAIN

Domain is the set of values that are allowed to reside in one or more attributes. Each attribute in a database relational is defined as a domain

ELEMENT KEY OF DATA

Key elements of record which is used to find these records at the time of access, or can also be used to identify each entity or record.

TYPES OF KEY

- Superkey is one or more attribute that can be used for identification entity or 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 ( ENTITY RELATIONSHIP DIAGRAM )

ERD is a model using word structure that saved in system as abstract. Difference between DFD and ERD :

o DFD is a function network model that will executed by system

o ERD is data network model that emphasize in structure and relationship data.

ELEMENTS OF THE ERD

1. Entity is 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.

2. Relationship is natural relation happened between entity. Generally, given name with basic verb making it easier to reading it relations. Symbolized as rhomb.

3. Relationship Degree is the number of entities participating in a relationship.

4. Attribute is characteristic of each entity or relationship. Symbolized as circle

5. Cardinality show tupple maximum amount that can be relations with entities on the other entity.

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 relations, namely

1. 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

2. 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 view. For an incident on the first entity can have any relationship with many incident on the second entity, if the one incident on the second entity can only have one relation with the incident on the first entity.

3. Many To Many: if any incident occurs in many entity have relationships with other entities in the incident.




NOTATION (E-R DIAGRAM)

1. Rectangle represent the collective entity

2. Circle represent the attributes

3. Rhomb represent collective relationships

4. Line as the set of relationships between the entity and the collective entity with the attribute



REFERENCES :

- ER Ngurah Agus Sanjaya. Presentation Slide Part 5 - DATABASE DAN ER-DIAGRAM.
- Fathansyah, Basis Data, Informatika Bandung, Bandung, 2002




Tidak ada komentar:

Posting Komentar