Jumat, 17 April 2009

Database and Entity Relationship Diagram

Database and Entity Relationship Diagram


The Definition of database
collection of data which stored in magnetic disk, optical disk or other secondary storage. Or in other word, collection of data which is linked one to other of an enterprise.example:

* Manufactur company -> production planning data, actual production data, data ordering material
* Hospital -> data of patient, doctor, nurse, etc
Database Management System
Database Management System is computer software that manages databases. DBMSes may use any of a variety of database models, such as the network model or relational model. Collection a database with software application in based of database and this software application is use for accessing and maintaining the database. The first aim of DBMS is to preparing an easy and efficient environment for using, collecting, and storing data and information.
Bit, Byte, Field
* Bit : is the smaller part of data, which contain of value 1 or 0
* Byte : collection of same kind of bit
* Filed : collection of same kind of byte, which in database is called "attribute"

** GAMBAR 1.1**

Attribute or field
Attribute or field is a characteristic from entity, which preparing detailed explanation about that's entity and a relation could have atribute too.
Example :
- car : number plate, colour, type, etc
- university student : name, ID, Faculty, etc

Type of Attribute
* single vs multivalue
single :is only can fill by one value
multivalue :is can fill with more one value with the same of kind

* atomic vs composition
atomic : can not divided into smaller attribute
composition : boundle from some smaller attribute

* derived attribute
derived attribute is an attribute which it's value can be produced from other attribute

* null value attribute
null value attribute is an attribute with no value for a record

* mandatory value attribute
mandatory value attribute is an attribute which must have value

Record or Tuple
Record or Tuple is a line of data in a relationship and consist of collection attribut, where the attribute is related one to other to give detailed information of the entity or relation

Entity or File
Entity is a collection of same kind of record and having same element, same attribute however different in their data value
type of Entity:
in processing application, file can be categorized likes:
- mains file
- transaction file
- report file
- history file
- protector file
- work file

Domain
Domain is collection of values which enabled to stay in one or more attribute. Every attribute in a relational database is defined like a domain

Key of element data
Key is the element of record which used to find the record when accessing or can also used to identify every entity / record / row

Type of key :
* Super key
Super keyis one or more attribute from a table which can be used for identifying entity / record from table uniquely

* Candidate key
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
Primary key is one of the attribute of candidate key. Primary key can be selected / determined with 3 rule:
- the key is more natural for use as reference
- the key is more simple
- 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 happend 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
ERD is a model of a network that uses word order is stored in the system of abstract. And the different between DFD and ERD is:
- 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 in ERD
* Entity or file
In the ER Diagram, Entity is described with the form of a rectangle. Entity is something that exists in the real system and the abstract where the data stored or where there are data.

* Relationship
In the ER diagram, the relationship can be described with a rhomb. Relationship is a natural relationship that occurs between entities. In general, the name given to the verb base making it easier to do the reading the relation. Relationship degree is the number of entities which participating in a relationship. Degree is unit which is often used in the ERD.

Degree of relationship
- Unary relationship
Unary relationship is the relationship model between the entity originating from the same entity set.
- Binary relationship
Binary relationship is the relationship model between 2 entities
- Ternary relationship
Ternary relationship is a relationship between the instance of 3 types of entities are unilateral

* Attribute
Attribute is the nature or characteristics of each entity and relationship

* Cardinality
Cardinality indicates the maximum number of tables that can be relation with the entity on the other entity
Type of Cardinality :

* 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 vice versa.

Gambar 1.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 have to seen.For an incident on the first entity can have many relationships with the incident on the second entity, if the one incident in which two entities can only have a relationship with one incident on the first entity.

Gambar 1.3

* many to many
if any incident occurs in an entity has many relationships with other entities in the incident.

Gambar 1.4

Notation in ER-Diagram
The notation symbol of ER-Diagram is:
- Rectangle represent the collective entity
- Circle represent the attributes
- Rhomb is represent collective relationships
- Line as the link of relationships between the entity and the collective entity with collection of attribute

0 komentar:

Posting Komentar