Minggu, 19 April 2009

DATABASE AND ER-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)

DBMS is a collection of databases or a combination of software-based database applications. DBMS is a software designed to assist in the maintenance and utility data collection in large numbers. Application programs are used to access and maintain databases. The main purpose DBMS is to provide an environment that is efficient and easy to use, withdrawal and storage of data and information.


BIT, BYTE, Field

- Bit is the smallest pieces of data that contains the value 0 or 1

- Byte is a set of bit-bit similar

- Field is a set of byte-byte similar, in the database used the term attribute








ATTRIBUTE OR FIELD

Attribute is the nature or characteristics of an entity that provides provide detail on these entities. A relationship can also have attributes. Example attributes:

  1. STUDENTS: NIM, NAME, ADDRESS
  2. CAR: NOMOR_PLAT, COLOR, TYPE, CC

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 / TUPLE

Record is a data line in a relationship. Record consists of a set of attributes where the attribute is an attribute-related entity or to inform the full relationship.


Entity / FILE
File is a collection of similar records and have the same elements, the same attributes but different data value.


File Type
In processing applications, files can category as follows:
- Master File
- Transaction Files
- File Reports
- File History
- File Protection
- File Work
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
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 / record / line.


DOMAIN

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


KEY DATA ELEMENT

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 / record / line.

Kind of key:
Super key is one or more attribute from a table which can be used for identifying entity / record from table uniquely
Candidate key is super key with minimum attribute. Candidate key may not contain attribute of other table so that the candidate is super key, but not the contrary
Primary key
One of the attribute of candidate key can be selected / determined into primary key with 3 criteria:
- The key is more natural for use as reference
- The key is simpler
- The key is unique
Alternate key
Alternate key is attribute of candidate key which is not chosen become primary key
Foreign key
Foreign key is any attribute subjecting to primary key at other tables. Foreign key will be happened in a relation which have one to many cardinality or many to many cardinality. Foreign key usually put at the table which direct to many cardinality.
External key
External key is lexical attribute or collection of lexical attribute which values always identify one object instance


ERD (Entity Relationship Diagram)
ERD is a model of a network that uses word order is stored in the abstract system.
Differences between the DFD and ERD
DFD is a model of network functions that will be implemented by the system
ERD is a model that emphasizes the network data on the structure and relationship data
Elements of the ERD

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


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