4/19/2009

DATABASE AND ER-Diagram

DATABASE DEFINITION
Database can be definition by collection of data which stored in magnetic disk, optical disk or other secondary storage. In other word database is collection of data which is linked one to other of an enterprise (factory, governmental institution, or private section). he database can be a collection of integrated data-related data of an enterprise (company, government or private). For example:
1. In Company data à manufacturing production planning, actual production data, data, material ordering, and so forth.
2. In hospital patient data, doctor, nurse, and so forth.
Database Management System
Database management System is database collection with software application in based of database. This application programs used to access and protected database. The purpose DBMS is to provide an environment for using, collecting and storing data and information.

Definition of bit, byte, field
- Bit: is the smaller part of data, which contain of value 1 or 0
- Byte is a collection of same bit. 1 byte = 8 bit.
- Field set of byte-byte similar, in the database used the term 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 BOOK : ID, NAME, PUBLISHER, COMPOSER
Table CAR : NOMOR_PLAT, COLOR, KIND, CC

ATTRIBUTE TYPES
• 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 which its value can be produced from other attribute
• Null Value attribute is an attribute that has no value to a record.
• Value attribute is a mandatory attribute that must have a value.




RECORD or 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
Entity is the object or objects in a certain mini world represented in the database and 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:
- Master File
- File Transaction
- File Report
- File History
- File Protected
- File Activity
- File Work

Domain Domain is collection of values which enabled to stay in one or more attribute. Every attribute in a relational database is defined as 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
• Superkey is one or more attributes of a table that can be used to identify entityty / record of the table are unique (not all attributes can be superkey)
• Cadidate 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 key attributes of the candidate can be selected / specified a primary key with the three criteria, namely:
1. Key is more natural to use as reference
2. Key is more simple
3. Key is guaranteed unique
• Alternate Key is the attribute of the candidate key is not selected to be primary key.
• Foreign Key is any attribute that points to the primary key in another table. Foreign key will be going on a relationship that has cardinality one to many or many to many. Foreign key usually put at the table which direct to many cardinality.
• External Key is a lexical attribute (or set of lexical attributes) that values are always identify an object 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. Difference between DFD and of ERD: DFD represent a function network model to be executed by system and ERD represent data network model emphasizing at structure and relationship data.
Elements in ERD
- Entity
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, relationship can be described with a lozenge. 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 it relations.
- Relationship degree
Relationship degree is the number of entities which participating in a relationship. Degree is unit which is often used in the ERD.
- Attribute
Attribute is the nature or characteristics of each entity and relationship
- Cardinality
Cardinality indicates the maximum number of record/tuple that can be relation with the entity on the other entity.
Degree of relationship
- Unary relationship is the relationship model between the entity originating from the same entity set.
- Binary relationship is the relationship model between 2 entities
- Ternary relationship is a relationship between the instances of 3 types of entities is unilateral

Cardinality
There are three cardinality relations, thas is:
• One to One: Level one to one relationship stated with one event in the first entity, only had one relationship with one event in the second entities and conversely.
• 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.
• Many To Many: happening if each event on one entities has a many relationship with event on another entities.
Notation in ER-Diagram



The notation symbol of ER-Diagram is:
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:
- Agus Sanjaya ER, S.Kom, M.Kom, slide presentation : Database and ER-Diagram
- http://en.wikipedia.org/wiki/Database



Tidak ada komentar:

Posting Komentar