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). For example:
- Company data à manufacturing production planning, actual production data, data, material ordering, and so forth.
- à hospital patient data, doctor, nurse, and so forth.
DBMS (Database Management System)
BIT, BYTE, Field
1. Data bit is the part that contains the smallest value of 0 or 1
2. Bytes-bit set of bit similar
3. Field 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:
- STUDENTS: NIM, NAME, ADDRESS
- CAR: NOMOR_PLAT, COLOR, TYPE, CC
- 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 whose value can be derived from the value of other attributes, such as age that resulted from birth date 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 / 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. Entity can be:
- Things that have physical (people, cars, houses, etc.)
- think that there are conceptual (enterprise, employment, discipline, etc.)
File is a collection of similar records and have the same elements, the same attributes but different data values. In processing applications, files can categories with several types 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 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.
SPECIES OF KEY
There are several types of key in the ERD, namely:
- 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 a super key with minimal attributes. Candidate must not contain a key attribute of the table so that the other candidate key is certain superkey but not necessarily vice versa.
- 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 is usually always put on the table that point to many.
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 model of a network that uses word order is stored in the abstract system.
Differences between the DFD and ERD, namely:
1. DFD is a model of network functions that will be implemented by the system.
2. ERD is a model that emphasizes the network data on the structure and relationship data.
Elements of the ERD
In the ER Diagram, Entity is described with the rectangular shape. Entity is something that exists in the real system and the abstract where the data stored or where there are data.
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 participating in a relationship. Degree which is often used in the ERD.
Attribute is the nature or characteristics of each entity and relationship.
Cardinality show tuple maximum amount that can be relations with entities on the other entity.
There are several types of degree of relationship, namely:
- Unary Relationship
Unary Relationship model is the relationship between the entity originating from the same entity set.
- Binary Relationship
- Ternary Relationship
There are 3 cardinality relations, namely
- 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.
- 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: if any incident occurs in many entity have relationships with other entities in the incident.
Notation (E-R diagram)
Symbolic notation in the ER diagram, namely:
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
- ER Ngurah Agus Sanjaya. Slide Part 5 - DATABASE DAN ER-DIAGRAM.
- Elmasri & Navathe, Fundamental of Database Systems, 5th Edition, Chapter 3, 2007. ¨