Jumat, 17 April 2009

DATABASE AND ER-DIAGRAM

DATABASE AND ER-DIAGRAM
DATABASE
A database is a structured collection of records or data that is stored in a computer system (magnetic disk, optical disk, or other secondary store).
Database can meaning a collection of interconnection data for a enterprise (company, government institution or private sector).
Database example:
In Manufacture of company --> plan production data, produce actual data, ordering of material data, etc
In Hospital --> data of patient, doctor, nurse, etc



DATABASE MANAGEMENT SYSTEM (DBMS)
DBMS is collection of database with software of application being based on database or a computer database relies on software to organize the storage of data. This application programs used to access and protected database. For example: Oracle
First target of DBMS is provide an efficient and easy environment for the use and store information and data.


BIT, BYTE, AND FIELD

Bit is part of containing smallest data value 0 or 1
Byte is a collection of same bit. 1 byte = 8 bit.
Field is a group of same byte, in database used by attribute.


ATTRIBUTE / FIELD

Attribute or field is characteristic from an entity o provide description about entity. An relation can have attribute too.
Attribute example:
*
* Table UNIVERSITY STUDENT : NIM, NAME, ADDRESS
* Table CAR : NOMOR_PLAT, COLOR, KIND, CC
* Table BOOK : ID, NAME, PUBLISHER, COMPOSER


TYPE OF ATTRIBUTE

Single value Vs. Multi value Attributes - Single value --> only can fill at most one value. For example: ID
- Multi value --> can fill with interest from one value with same type. For example:
Hobbies(swimming, reading, shopping)


Composite Vs Atomic Attributes
- Atomic --> can not divide into smaller attribute. For example: ID
- Composite --> cluster from some smaller attribute. For example: Name ( First name, middle name, and last name)

Derived Attribute

- Value of attribute result from other attribute value. For example: age from attribute date of birthday

Null Value Attribute
- Attribute have not value to an record
Mandatory Value Attribute - Attribute must have value


RECORD / TUPLE Record is a data line in an relation. Consist of attributes where there attribute can interaction to completely information a entity / relation.


ENTITY / FILE

File is a group of same record and have same element, same attribute but different of each data value. Type File In application process, category of file such as: - File Mains - File Transaction - File Report - File History - File Protected - File Activity


DOMAIN Domain is collection of values enabled to stay in one or more attribute. Each attribute in database relational defined as a domain.


KEY OF ELEMENT DATA Key is the element of record which used to find the record when accessing or can used to identify every entity / record / row too.


TYPE OF KEY

- Super Key is one or more attribute from a table can used to identify entity / record of table as uniquely ( but not all attribute can become super key).

- Candidate Key is a super key with minimum attribute. Candidate key may not contain attribute of other tables so that candidate key is super key but not yet of course on the contrary.

- Primary Key
One of the attribute from candidate key can be selected / to be determined to become primary key with three criteria:
1. The Key more natural to be used as reference
2. The Key more simple
3. The Key well guarantee

- Alternate Key is attribute of candidate key which not chosen become primary key.

- Foreign Key is any attribute subjecting to primary key at other tables. Foreign key will happened at one particular at a relation is owning many to one cardinality ( one to many) or many to many. Foreign key usually put at table to many table.

- External Key is an attribute lexical ( or gathering of lexical attribute) which its values always identify one object of instance.


ERD (ENTITY RELATIONSHIP DIAGRAM)

ERD is a network model using word to keep in system abstract or an abstract and conceptual representation of data. ER diagrams often use symbols to represent three different types of information.

Difference between DFD and of ERD DFD represent a function network model to be executed by system, while
ERD represent data network model emphasizing at structure and relationship data.



ELEMENT OF ERD

Entity
An entity is an object or concept about which you want to store information. In ER Diagram, Entity draw with form a rectangle. Entity something in real system and also abstraction where on data storage or where there are data.

Relationship

Relationship illustrate how two entities share information in the database structure. Relationship is a natural relation between entity. In general called with elementary verb so can easy to read relationship.

Relationship Degree
Relationship Degree is the amount of entity participating in one relationship. Degree usually use in ERD.

Attribute

Attribute is characteristic of each entity and relationship

Cardinality

Can showing optimum of record to relationship with entity at other entity.


RELATIONSHIP
DEGREE
- Unary Relationship is a relationship model between entity coming from same entity set.
- Binary Relationship is a relationship model between 2 entity.
- Ternary Relationship is a relationship between instance from 3 type of entitas unilaterally.


CARDINALITY
There are three cardinality, that is:
1. One-to-One (1: 1)
Both entities can participate in only one relationship instance.
2. One-to-Many, 3. Many-to-One (1: N, N: 1)
One entity can participate in many relationship instances and contrary.
4. Many-to-Many (N: M)
Both entities can participate in many relationship instance.

For Example:
How many Employees can work in a Department?
One employee can work in only one department
How many Employees can be employed by a Department?
One department can employ many employees
How many managers can a department have?
One department can have only one manager
How many departments can an employee manage?
One employee can have manage only one department



NOTATION OF ERD
Symbolic notation in ERD:
1. Rectangle express gathering of entity
2. Radian express attribute
3. Rhombic express relationship gathering
4. Line as link between relationship gathering with gathering of entity Gathering and Entity with its attribute




References:
-
slide presentation "Database and ER-Diagram" by Agus Sanjaya ER, S.Kom, M.Kom
- http://en.wikipedia.org/wiki/Database
- http://iaprima.staff.gunadarma.ac.id/Downloads/files/5459/Bahasan9a_ERD.pdf
- http://www.smartdraw.com/tutorials/software/erd/tutorial_01.htm
- http://en.wikipedia.org/wiki/Entity-relationship_model

0 comments:

Posting Komentar