Minggu, 19 April 2009

Database and ERD


Database

The database is a set of data stored in the magnetic disk, optical disk or other secondary storage. Besides, the 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).


DBMS (Database Management System)

Database management system represent database aliance or corps with software of application being based on database. This application programs is used to access and look after database. Especial target of DBMS is to provide a efficient and easy environment for the usage of, to withdrawal and is depository of information and data.

A Relational Database Management System (RDBMS) implements the features of the relational model outlined above. In this context, Date’s “Information Principle” states: “the entire information content of the database is represented in one and only one way. Namely as explicit values in column positions (attributes) and rows in relations(tuples). Therefore, there are no explicit pointers between related tables.”

BIT,BYTE,FIELD
- Bit representing part of containing smallest data of value 0 or 1.
- Byte representing corps of beets which of a kind.
- Field representing a group of byte-byte which of a kind, in data bases used by attribute term.

Field example:

Fields can be one of a range of different data types, including: Text, Integer, Real number, Yes/No (Boolean), Date, Time, Sound, and Video.


ATTRIBUTE


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, Faculty
  2. CAR: Colour, Brand, 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 row of data in a relationship. Consists of the set of attributes where the attribute-attribute-attribute is to inform each other entity / relationship fully. The main advantage of using records instead of tuples is that fields in a record are accessed by name, whereas fields in a tuple are accessed by position. To illustrate these differences, suppose that we want to represent a person with the tuple {Name, Address, Phone}.

We must remember that the Name field is the first element of the tuple, the Address field is the second element, and so on, in order to write functions which manipulate this data. For example, to extract data from a variable P which contains such a tuple we might write the following code and then use pattern matching to extract the relevant fields.

Name = element(1, P),
Address = element(2, P),
...

Code like this is difficult to read and understand and errors occur if we get the numbering of the elements in the tuple wrong. If we change the data representation by re-ordering the fields, or by adding or removing a field, then all references to the person tuple, wherever they occur, must be checked and possibly modified.

Records allow us to refer to the fields by name and not position. We use a record instead of a tuple to store the data. If we write a record definition of the type shown below, we can then refer to the fields of the record by name.

-record(person, {name, phone, address}).

For example, if P is now a variable whose value is a person record, we can code as follows in order to access the name and address fields of the records.


ENTITY / FILE

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

In processing applications, files / entity can categoried with several types as follows:

- Master File
- Transaction Files
- File Reports
- File History
- File Protection
- File Work


DOMAIN

Domain represent corps of values enabled to stay in one or more attribute. Every attribute in data bases of relasional defined by 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.

TYPES OF KEY

Super key

Super keyis one or more attribute that can be used for identification entity/record in table as uniquely (not all of attribute can be superkey).
Candidate key

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

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

Alternate key is attribute from candidate key that not chosen as primary key

Foreign 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 of a network that uses word order is stored in the system of abstract.


The different between 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.

The elements of ERD

Entity

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

Relationship

  • Natural Relation happened between entity.
  • Generally, given name with basic verb that facilitating for reading its relation.
  • Symbolized as rhomb

Relationship degree

  • Account of entity that participated inside a relationship.
  • Degree is often used in ERD\

Attribute

  • Characteristic of each entity or relationship
  • Symbolized as circle

Cardinality

  • Showing maximal account tupel that can be relation with entity in the other one.

Relationship of degree

- 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 instance of 3 types of entities are unilateral

Cardinality example of types




NOTATIONS OF E-R DIAGRAM

Symbolic notations in the ER diagram are :

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

Entity Relationship Diagram Notations
Peter Chen developed ERDs in 1976. Since then Charles Bachman and James Martin have added some sligh refinements to the basic ERD principles.


Entity


An entity is an object or concept about which you want to store information.


Weak Entity

Attributes are the properties or characteristics of an entity.


Key attribute


A key attribute is the unique, distinguishing characteristic of the entity. For example, an employee's social security number might be the employee's key attribute.


Multivalued attribute

A multivalued attribute can have more than one value. For example, an employee entity can have multiple skill values.


Derived attribute

A derived attribute is based on another attribute. For example, an employee's monthly salary is based on the employee's annual salary.


Relationships


Relationships illustrate how two entities share information in the database structure.

Reffrences :

1. ER Ngurah Agus Sanjaya. Slide Part 5 - DATABASE DAN ER-DIAGRAM.

2. Elmasri & Navathe, Fundamental of Database Systems, 5th Edition, Chapter 3, 2007.

3. http://erlang.org/doc/programming_examples/records.html

4. http://www.smartdraw.com/tutorials/software/erd/tutorial_01.htm

Tidak ada komentar:

Posting Komentar