DATABASE
A database is a structured collection of records or data that is stored in a computer system. The structure is achieved by organizing the data according to a database model. The model in most common use today is the relational model. Other models such as the hierarchical model and the network model use a more explicit representation of relationships.
DBMS ( Database Management System )
A database management system (DBMS) is computer software that manages databases. DBMSes may use any of a variety of database models, such as the network model or relational model. In large systems, a DBMS allows users and other software to store and retrieve data in a structured way.
BIT, BYTE, FIELD
Bit
A bit is a binary digit, taking a logical value of either "1" or "0" (also referred to as "true" or "false" respectively). Binary digits are a basic unit of information storage and communication in digital computing and digital information theory. Information theory also often uses the natural digit, called either a nit or a nat. Quantum computing user qubits; single piece of quantum information encoded on a two level quantum system and hence having the potential to exist in superposition of "true" and "false".
Byte
A byte is a basic unit of measurement of information storage in computer science In many computer architecture it is a unit of memory addressing . There is no standard but a byte most often consists of eight bits.
A byte is an ordered collection of bits, with each bit denoting a single binary value of 1 or 0. The byte most often consists of 8 bits in modern systems; however, the size of a byte can vary and is generally determined by the underlying computer operating system or hardware. Historically, byte size was determined by the number of bits required to represent a single character from a Western character set. Its size was generally determined by the number of possible characters in the supported character set and was chosen to be a divisor of the computer's word zize. Historically bytes have ranged from five to twelve bits.
Field
Field is a set of byte-byte similar, in the database used the term attribute
Attribute/field
Attribute or Field is a characteristic from entity, which preparing detailed explanation about that's entity.
A relation could have atribute too.
Example of Attribute :
- Student : NIM, Name, Sex, Address
- Car : Plat Number, Color, CC
- Book : ID, title, author
Type of Attribute
Single vs multivalue
Single > can only be filled at most one value
Multivalue > can be filled with more than one value with the same type of
Atomic vs composition
Atomic > can’t be divided into the attributes of smaller
composition > is a combination of several attributes of a smaller
Derived Attribute
attribute value can be derived from other attribute values, for example: age of the attributes generated from the date of birth.
Null Value Attribute
Attributes that have no value to a record
Mandatory Value Attribute
Attributes must have values
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 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 :
superkey
A superkey is defined in the relational model of database organization as a set of attributes of a relation variable (relvar) for which it holds that in all relations assigned to that variable there are no two distinct tuples (rows) that have the same values for the attributes in this set. Equivalently a superkey can also be defined as a set of attributes of a relvar upon which all attributes of the relvar are functionally dependent.
Candidate key
In the relational model, a candidate key of a relvar (relation variable) is a set of attributes of that relvar such that
1. at all times it holds in the relation assigned to that variable that there are no two distinct tuples with the same values for these attributes and
2. there is not a proper subset of this set of attributes for which (1) holds.
Since a superkey is defined as a set of attributes for which (1) holds, we can also define a candidate key as a minimal superkey, i.e. a superkey of which no proper subset can also be called as a candidate key.
The importance of candidate keys is that they tell us how we can identify individual tuples in a relation. As such they are one of the most important types of database constraint that should be specified when designing a database schema. Since a relation is a set (no duplicate elements), it holds that every relation will have at least one candidate key (because the entire heading is always a superkey). Since in some RDBMSs tables may also represent multisets (which strictly means these DBMSs are not relational), it is an important design rule to specify explicitly at least one candidate key for each relation. For practical reasons RDBMSs usually require that for each relation one of its candidate keys is declared as the primary key, which means that it is considered as the preferred way to identify individual tuples. Foreign keys, for example, are usually required to reference such a primary key and not any of the other candidate keys.
Primary Key
One of the key attributes of the candidate can be selected / specified a
primary key with the three following criteria:
1. Key is more natural to use as reference
2. Key is more simple
3. Key is guaranteed unique
Alternate Key
is an 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 kardinalitas 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)
Data models are tools used in analysis to describe the data requirements and assumptions in the system from a top-down perspective. They also set the stage for the design of databases later on in the SDLC.
There are three basic elements in ER models:
Entities are the "things" about which we seek information.
Attributes are the data we collect about the entities.
Relationships provide the structure needed to draw information from multiple entities.
Generally, ERD's look like this:
ELEMENTS OF THE 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
ER diagram on the 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 readings relationships.
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
Kardinalitas
tupel indicates the maximum number that can be berelasi with entities on the 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
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.
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 is viewed. For one incident in the first entity can have many relationships with the incident on the second entity, if the one incident in which two entities can have only one incident hubugan with the first entity.
Many To Many:
if any incident occurs in an entity has many relationships with other entities in the incident.
NOTATION (E-R DIAGRAM)
Symbolic notation in the ER diagram is:
1. Rectangle represent the collective entity
2. Circle represent the attributes
3. Rhomb represent collective relationships
4. Line as the set of relations between the Association and the collective entity with entity attributes
Reference:
ER Ngurah Agus Sanjaya. Slide Part 5 - Database Dan Er-Diagram.
http://en.wikipedia.org/wiki/Database
http://en.wikipedia.org/wiki/Database_management_system
http://kur2003.if.itb.ac.id/file/SE6162%20ERD.pdf
http://www.umsl.edu/~sauterv/analysis/er/er_intro.html
Tidak ada komentar:
Posting Komentar