Archive for April, 2009

NORMALIZATION

Posted in Uncategorized on April 26, 2009 by ibel69

NORMALIZATION
Database Plan Process (Review)

  • Gather user/business need
  • Develop ER model based on user/business need
  • Conversion ER model to relation collection (table)
  • Relation normalization to cause the loss of anomaly
  • Implementation to database with make table for every relation that normalization

Data Base Normalization

Normalization process is the establishment of the database structure so that most of the ambiguity can be removed. Normalization process of decomposition is also a relationship that is still “bad” with break the attributes to build some relationships. Normalization stage, starting from the most mild (1NF) to most stringent (5NF). Normalization is usually only up to the level of 3NF or BCNF because already sufficient to generate the table-a table of good quality.

Why normalization done?

o        Table structures optimalization

o        Increase speed

o        Cause the loss of the same data entering

o        Efficienter in storage media use

o        Decrease redundancy

o        Avoid anomaly (insertion anomalies, deletion anomalies, update anomalies).

o        Data integrity that increased

  • A table is said good (efficient) or normal if fulfil 3 criterias as follows:
    • If there is decomposition (decomposition) table, then the decomposition will be guaranteed safe (Lossless-Join Decomposition). That is, after the table is described / in the decomposition into a new table-table, the table-table can generate a new table with the same exact.
    • Functional dependence when data change (dependency preservation) was kept.
    • No violate Boyce-Code Normal Form (BCNF)
  • If the third criteria (BCNF) can not be fulfilled, then at least the table does not violate the Normal Form of the third stage (3rd Normal Form / 3NF).

Functional Dependency

  • Functional Dependency describe a attributes connection in a relation
  • A attribute said functionally dependant in other attribute if we use attribute value to determine other attribute value.
  • Symbol that used is à for representing functional dependency.

§         Read : functionally to determine

Notation: A à B

A and B attribute from a table. That’s mean functionally A determine B or B depend on A, if and only if there 2 data lines which have a same value with A value , so B value also same.

Notation: A11 B or A à B

Is the contrary from previous notation.

Example :

2

Functional Dependency:

  • NRP à Nama
  • Mata_Kuliah, NRPà Nilai

Non Functional Dependency:

  • Mata_Kuliah à NRP
  • NRP à Nilai
  • Functional Dependency From Value Table
  • Nrp à Nama
  • because for every same Nrp value , so also same Nama value
  • {Mata_kuliah, Nrp } à Value
  • because Value attribute depend on Mata_kuliah and Nrp according to together. In other meaning for Mata_kuliah and same Nrp , so Value also same , because Mata_kuliah and Nrp is key (has unique).
  • Mata_kuliah 11Nrp
  • Nrp 11Value

First Normal Form – 1NF

  • A table is said present in normal form I if it doesn’t present in form unnormalized table, where happen multiplication of a kind field and there possible field that null (empty)
  • Forbidden of existence:
    • Attribute that have multivalue (multivalued attribute).
    • Composite attribute or combination of both.
  • So:
    • Value of domain attribute must be atomic value

Example 1:

Student university data example as follows:

3

Or

4

  • Tables above doesn’t up to standard in 1NF

Example 2 :

dekomposition be:

student university table:

6

Hobby table :

7

Second Normal Form – 2NF

  • Normal form 2NF has been fulfilled in a table if form 1NF has been fulfilled, and all attributes besides primary key, according to intact has functional dependency in primary key
  • A table doesn’t fulfil 2nf, if there is an attribute the dependence (functional dependency) has only partial (only depend on some of primary key)
  • If found attribute doesn’t has dependence towards primary key, so the attribute must moved or caused
  • Functional dependence X à Y is said full if wipe off a A attribute from X that’s mean Y not again depend on functional.
  • Functional dependence X à Y is said partial if wipe off a A attribute from X that’s mean Y still to depend on functional.
  • R relation scheme in the form of 2NF if every attribute non primary key A Î R depend on full according to fungsional in R primary key.

Example 1 :

Table follows to fulfil 1NF, but doesn’t belong 2NF :

8

Example 2 :

  • Doesn’t fulfil 2NF, because {NIM, KodeMk that assumed as primary key but:
    • {NIM, KodeMk}à NamaMhs
    • {NIM, KodeMk} à Alamat
    • {NIM, KodeMk} à Matakuliah
    • {NIM, KodeMk} à Sks
    • {NIM, KodeMk} à NilaiHuruf
  • That’s table necessary decompositioned be several tables that up to standard 2NF

Example 3 :

  • That’s Functional dependency as follows:
    • {NIM, KodeMk}à NilaiHuruf (fd1)
    • NIM à {NamaMhs, Alamat} (fd2)
    • KodeMk à {Matakuliah, Sks} (fd3)
  • Then :
    • fd1 (NIM, KodeMk, NilaiHuruf) à Tabel Nilai
    • fd2 (NIM, NamaMhs, Alamat) à Tabel Mahasiswa
    • fd3 (KodeMk, Matakuliah, Sks) à Tabel MataKuliah

Third Normal Form – 3NF

Normal form 3NF has been fulfilled if fulfil form 2NF, and if there is no non primary key attribute that has dependence towards non primary key attribute the other ( transitive dependence)

Example 1:

  • Student university table follows up to standard 2NF, but doesn’t fulfil 3NF

9

  • Because still found non primary key attribute (that is Kota and Provinsi) has dependence towards other non primary key attribute (that is KodePos):

kodepos à {Kota, Provinsi}

Example 2 :

  • so that the table necessary decompositioned be :
  • Mahasiswa (NIM, NamaMhs, Jalan, KodePos)
    • KodePos (Kodepos, Provinsi, Kota)

Boyce-Codd Normal Form (BNCF)

Boyce-Codd Normal Form constraint has a stronger form of the Normal third. To be BNCF, relations must be in the form of First Normal form and forced each of the attributes depends on the function in the super key attributes.

In this example : found Seminar relation, primary key is NPM + Seminar.

Student may take one or two seminars. Every seminar need 2 guides and every student is guided by one of between 2 seminar guides. Every guide only may take one seminar. In this example is NPM and seminar shows a guide.

Seminar Relation

10

Seminar relation form is third normal form, but not BCNF Because seminar code stills to depend on function in guide, if every guide can teach only one seminar. Seminar depend on one attribute not super key like condition in bcnf. So

Seminar relation must devided be two that is:

Guide Relation Seminar-Guide Relation

111

Normal Form Fourth And Fifth

Relations in fourth normal form (4NF) if the relation in BCNF and does not contain a lot of dependence values. To remove the dependency of many values from a relation, we divide the relationship into two new relations. Each relation contains two attributes that have a lot of relationship value.

Relations in fifth normal form (5NF) deal with the property called the join without any loss of information (lossless join). Fifth normal form also called the 5 NF PJNF (projection join normal form). The case is very rare and appear difficult to detect in practice.

ERD

Posted in Uncategorized on April 19, 2009 by ibel69

DATABASE

Database is structured group of records (magnetic disk, optical disk, or other secondary store).

Database can indicate a group of interconnection data for venture (company, government institution).

Database example:

In School –> data of Student, Teacher, etc
DATABASE MANAGEMENT SYSTEM (DBMS)

Collection / database combined with software-based database applications. Application programmed are used to access and maintain databases The main purpose DBMS is to provide an environment that is efficient and easy to use, with draw and storage of data and information


BIT, BYTE, AND FIELD

Bit is a part of contain 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

It is the nature or characteristics of an entity that provides provide detail on these entities. A relation can have attribute too.

Attribute example:

Table MAHASISWA : NIM, NAMA, ALAMAT

Table PENDUDUK : NOMOR PENDUDUK, NAMA, AGAMA, JENIS KELAMIN

Table BUKU : ID, JUDUL, PENERBIT, PENGARANG
TYPE OF ATTRIBUTE

Single value Vs. Multi value Attributes

-          Single value –> only can fill at most one value. For example: NIM

-          Multi value –> can fill with interest from one value with same type. For example:
Dislike(Reading, Snake, Spider)

Composite Vs Atomic Attributes

-          Atomic –> can’t divide into smaller attribute. For example: NIM

-          Composite –> group from some smaller attribute. For example: Name ( First name, middle name, and last name)

Derived Attribute

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

Null Value Attribute

-          The Attribute that have not value to an record

Mandatory Value Attribute

-          Attribute must have value
RECORD / TUPLE

Record is a data line in a relation. Consist of attributes where there attribute can interface to fully information an entity / relation.

ENTITY / FILE

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

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

TYPE OF KEY

- Super Key is or more attributes of a table that can be used to identify entity / record of the table are unique (not all attributes can be super key).
- Candidate 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 super key but not necessarily vice versa.

- 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 an attribute of the candidate key is not selected to be 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 a lexical attribute (or set of lexical attributes) that values are always identifying an object instance.

ERD (ENTITY RELATIONSHIP DIAGRAM)

Entity relationship is a network that uses the order of the data stored in the abstract of the system. Entity-relationship model consists of elements of the entity and entity-relationship between these entities.

Differences 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 a concept which you want to store information. In ER Diagram, Entity draws with form a rectangle.


Relationship

Relationship illustrates how two entities share information in the database structure. Relationship is a natural relation between entities.
Relationship Degree

Relationship Degree is the number of entities participating in a relationship. Degree which is often used in the ERD.

Degree of relationship:

-          Unary Relationship
Model is the relationship between the entity originating from the same entity set.

-          Binary Relationship
Model is the relationship between 2 entities.

-          Ternary Relationship

Relationship between the instances of 3 types of entities is unilateral.


Attribute

Attribute is the collection of data elements that form an entity


Cardinality

Can showing optimum of record to relationship with entity at other entity.
There are three cardinalities, 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

PHASE DEVELOPMENT ER DIAGRAM

  • There are 2 groups of phasing the usual place, namely:
    1. Phase Diagram of making E-R initial (preliminary design).
    2. Phase Diagram optimize E-R (final design)
  • The first stage is to obtain the design minimal database that can accommodate the needs data storage to the system that is being reviewed.
  • The second phase, attention to aspects of efficiency, performance and flexibility.

MAKING ER DIAGRAM START
Technical steps:
1. Identify and define the entire set of entity.
2. Determining attribute-key attribute of each collective entities.
3. Identify and define the entire set of relations between the collective entity, the collective entity with no foreign-key it.
4. Determine the degree / cardinalities relation to each the collective.
5. Complete set of entities and collective relations with attribute-attribute descriptive (non-key).

CASE STUDIES
In the scope of the system indeed lecture (real word) there are many entities that we can involve such as Mahasiswa, Kuliah, Pratikum, Dosen, Asisten, Kelas, Literarur and others.

  • To step-1, Identify and define all set of entities that will be involved.
  • To Step-2, Determining attribute-key attribute of each set of entities.
  • To step-3, Identify and define whole set of relationships between the collective entity collective entities that have foreign-key with it.
  • To step-4, determining degrees / cardinalities relations for each set of relationships.
  • To step-5, Complete set of entities and set of relations with the attribute-descriptive attributes (non key).

ER DIAGRAM WITH THE DATA DICTIONARY

ER Diagram with the data dictionary is The bolt main objective of ER diagram is to show the objects (the collective entity) is just want to be involved in a data base and What’s going on in the relationship between objects it.

  • In the space of a system-wide and complex, drawing attributes-attributes in an ER diagram often even with the objective who want to achieve it.
  • separation attribute-attribute of ER diagram can be expressed in a Data Dictionary
  • The data dictionary contains a list of attributes that wedge in brackets brace.
  • Attribute that functions as a key to be the non-key attribute is the underline.

Data Dictionary:

  • Mahasiswa = { nim, nama_mhs, alamat_mhs, tgl_lahir }
  • Kuliah = { kode_kul, nama_kul, sks, semester }
  • Dosen = { nama_dos, alamat_dos }
  • Mempelajari = { nim, kode_kul, indeks_nil }
  • Mengajar = { kode_kul, nama_dos, waktu, tempat }

Data Flow Diagram

Posted in Uncategorized on April 5, 2009 by ibel69

Data flow diagram
Data Flow Diagram (DFD) is a graphic illustration of the system that uses a number of forms of symbols to describe how data flows through a process of inter-related. DFD can be a program with the algorithm using circle and arrow symbol to represent the flow of data in the design program. The use of notation in the data flow diagram is very helpful to understand a system. DFD will help the user understand the missing field to understand the computer system that will be done because DFD describes the flow of data in the system with a structured and clear.

Some symbols used in the DFD to represent:

1. External entity

2. Data Flow

3. Process

4. Data Storage

Context Diagram

-          The diagram which consists of a process and illustrate the range of a system.

-          The highest level of the DFD that describes the entire system to input and output of the system

-          System is limited by boundary

-          There is No storage

Zero Diagram

-          Diagram illustrating the process of the DFD. Giving view on the whole of system in which, showing the main function or process the flow of data and external entity.

-          At this level of data storage is possible.

-          To process in depth no longer on the next level then added the symbol ‘*’ or ‘P’ at the end of the process.

-          Input and output balance between 0 to diagram context, diagram should be maintained.

Detailed Diagram
Is a diagram that interpret what is the process in the diagram zero level or above. On this diagram, a clarification of the process above will be done in a play. In one level there should be less than 7 units and the maximum of 9, when more should be done in the disintegration.

Numbering of level at DFD:

Level Name Diagram Name Number of Process

0

Context

1

Diagram 0 1.0, 2.0, 3.0, …

2

Diagram 1.0 1.1, 1.2, 1.3, …

3

Diagram 1.1 1.1.1, 1.1.2, …

Specification process
Each process in the DFD must have a specification of the process, to explain the functioning of the process is in our system, the specification method used is the process of disintegration in the form of a sentence describe, decision table, decision tree. This specification will be a programmer for coding rule, because in this specification clearly visible flow process, and steps in each process. At the top level method is used to describe the process can use a sentence with descriptive and in a more detailed level, namely on the bottom (functional primitive) require a more structured specification.

Cash Data
Data flow in DFD is given an arrow symbol. This data flow indicates flow of data from the data that can be input to the system or the results of the processing system.

-          Flow data consist of a group of related data elements in a logical move from one process to another process.

-          Depicted with a straight line connecting the components of the system.

-          Flow data is shown with the direction arrows and the name on the flow of data that flows.

-          Cash flow of data between processes, saving data, the unit outside, and shows data flow from data in the form of inputs to the system.

Guidelines of the name:

  1. Name of the flow of data that consists of some words associated with the flow lines connect
  2. No flow data for the same and the name should reflect its content
  3. The flow of data that consists of several elements can be expressed with the group element
  4. Avoid using the word ‘data’ and ‘information’ to give a name to the flow of data
  5. Wherever possible the complete flow of data is written
  6. Name of the flow of data into a process may not be the same as the name of the data flow out of the process
  7. Data flow into or out of data storage does not need to be given a name if:

7.1.  The flow of data simple and easy to understand

7.2.  Data flow describe the entire data item

  1. There can be no flow of data from the terminal to the data storage, or vice versa because the terminal is not part of the system, the relationship with the terminal data storage must be through

Process

-          The process is what is done by the system

-          The process can process data flows or data entry into the flow of data out

-          The transform function of one or more of data input into one or more of the output data in accordance with the desired specifications

-          Each process has one or more inputs and produce one or more output

-          The process is also often called bubble

-          Guidelines of the process:

1.      Name of the process consists of a verb and noun, which reflects the function of the process

2.      Do not use the process as part of the name of a bubble

3.      May not have some process that has the same name

4.      The process should be given a number. Order number wherever possible to follow the flow of the process or sequence, but the sequence number does not mean that the absolute is a process in chronological order

DFD Symbols

DFD Symbol


v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
<!– /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:”"; margin-top:0in; margin-right:0in; margin-bottom:10.0pt; margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:Calibri; mso-fareast-font-family:Calibri; mso-bidi-font-family:”Times New Roman”;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} –>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Table Normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:”";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:”Times New Roman”;
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}

Data Storage
Savings is a savings of data from the data can be:
a. Database file
b. Archive
c. Table
Here, a process can take data from the savings of this data. explained with a pair of parallel lines or two lines with one of the side open.
Guidelines of the name:
1. Name should reflect the data storage
2. When his name more than one word must be marked with the number

Data Dictionary
Working to help the system to interpret the application in detail and organize all elements of the data used in the system precisely so that the system analyst and have a basic understanding of the same input, output, storage and process

1)      At the analysis stage, the data dictionary is used as a means of communication between the systems analyst with the

2)      At the system design, data dictionary is used to design input, reports and databases

3)      Flow data on the global DAD, further details can be seen in the data dictionary

4)      load the data dictionary as follows:

  • Name of data flow: must note that readers who need further explanation about a flow of data can find it easily
  • Alias: alias or other name of the data can be written when there is
  • Forms of data: used to segment the data dictionary to use when designing the system
  • Flow data: indicates from which data flows and where the data

Description: to give an explanation of the meaning of the data flow

Database
Work to help the system to interpret the application in detail and organize all elements of the data used in the system precisely so that the system analyst and have a basic understanding of the same input, output, storage and processing. At analysis, the data dictionary is used as a means of communication between system analysts and users with the system design phase, the data dictionary is used to design input, reports and databases. Flow data on the global DAD, further details can be seen in the data dictionary
Load the data dictionary as follows:
1. Name of data flow: must note that readers who need further explanation about a flow of data can find it easily
2. Alias: alias or other name of the data can be written when there is
3. Forms of data: used to segment the data dictionary to use when designing the system
4. Flow data: indicates from which data flows and where the data

Balancing In DFD
The flow of data into and out of a process must be the same as the flow of data into and out of the details of the process on the level / levels below it. This is not to be confusion in the process of the program, and the flow of data in accordance with the structure. Name of the flow of a process, must match the name of the details of the process flow diagram in the lower, the number and the name of an entity outside of the process, must be the same as the number and the name of the details of the process.
The issues that must be considered in the DFD which have more than one level:

1.            There must be a balance between input and output of one level and the next level. Do not until the input and output level of 0 does not exist in the level 1.

2.            Balance between level 0 and level 1 at the input / output of stream data to or from the terminal on level 0, while the balance between level 1 and level 2 is seen on the input or output of stream data to / from the process concerned

3.            Name of the flow of data, data storage and terminals at each level must be the same if the same object

Restrictions in DFD

  • Flow data may not be from outside the entity directly to other outside entities without going through a process
  • Flow data may not be from the savings directly to the data to outside entities without going through a process
  • Flow data may not be saving the data directly from the savings and other data without going through a process
  • Flow data from one process directly to the other without going through the process of saving data should / be avoided as much as possible
Follow

Get every new post delivered to your Inbox.