Jumat, April 24, 2009

NORMALIZATION

DRAFT PROCESS DATABASE
• Gathering user needs / business
• Develop the ER model based on user needs / business
• Convert ER Model to set the relation (table)
• Normalization relations, to remove anomalies
• to implement the database for each table to create relationships that have been in the normalization

DATABASE NORMALIZATION
• Normalization process is the establishment of the database structure so that most of the ambiguity can be removed.
• The normalization stage starting from the light (1NF) to most stringent (5NF)
• Usually only up to the level of 3NF or BCNF because already sufficient to generate the table-a table of good quality.
• Why do normalization?
Optimization table structures, Increase the speed, Eliminate income data the same, More efficient use of storage media, Reduce redundancy, Avoiding anomalies (insertion anomalies, deletion anomalies, update anomalies), Improved data integrity
• A table said good (efficient) or if the normal 3 to meet the following criteria:
• If there is decomposition (decomposition) table, it must be guaranteed safe described (Lossless-Join Decomposition). That is, after the table is described a new table-table, the table-table can generate a new table with the same exact.
• Maintain the functional dependence on the change data (Dependency preservation).
• Not violate Boyce-Code Normal Form (BCNF)
• If the three criteria (BCNF) can not be met, then at least the table does not violate the Normal Form of the third stage (3rd Normal Form / 3NF)

FUNCTIONAL DEPENDENCY
• Functional Dependency attributes describe the relationship in a relationship
• An attribute said functionally dependent on the other, if we use the value attribute to determine the value of the other attributes.
• Symbols used are --> to represent the functional dependency. --> reads determine the functional
• Notation: A-->B
• A and B are attributes of a table. A means of determining the functional B or B depends on A, if and only if there are 2 rows of data with the same value of A, then B is also the same value
• Notation: A -/-> B or A x --> B
It is the opposite of the previous notation.
• Example:

Functional Dependency:
NRP --> Nama
Mata_Kuliah, NRP --> Nilai
Non Functional Dependency:
Mata_Kuliah--> NRP
NRP --> Milai
• Functional Dependency of the table value
Nrp --> Nama
Because for each value Nrp the same, then the value of the same name
(TMata_Kuliah, NRP) --> Nilai
Because the value of attributes depending on the study eye and NRP together. In another sense for the university and The NRP is the same, then the same value, because lecture The NRP is the key, and (is unique).
Mata_Kuliah -/-> NRP
NRP -/-> Nilai

FIRST NORMAL FORM - 1NF
A table on the form said to be normal if I did not reside in the un normalized form of a table, where there is a kind of field multiplication and field that allows a null (empty)

Not the allowed:
• Attribute values, many (Multi valued attributes).
• Attribute a composite or a combination of both.
So:
• Price is the domain attribute must be atomic rates
Eg Student Data as follows:

Or

•Table-the table above does not meet the requirements 1NF

Decomposition becomes:
• Student Table:

• Table Hobbies:


SECOND NORMAL FORM - 2NF
• The form of normal 2NF met in a table if it meets the form of 1NF, and all the attributes than the primary key, have a full Functional Dependency on primary key
• A table does not meet 2NF, if there are attributes that dependence (Functional Dependency) are only partial (only depending on the part of the primary key).
• If there are attributes that have no dependence on the primary key, then the attributes must be moved or removed
• Functional dependence X-->Y if it is said of a remove attribute A from X means that Y is no longer dependent functional.
• Functional dependence X-->Y if it is said partial delete an attribute A from X means that Y is functionally dependent.
• The scheme in the form of the relation R 2NF if every non-primary key attribute A ÎR depend on the full primary key functional R.
• Example
The following table meet 1NF, 2NF, including but not

o Not fulfill 2NF, because (NIM, KodeMK) is regarded as the primary key:
NamaMhs -->(NIM, KodeMk)
Alamat-->(NIM, KodeMk)
Matakuliah-->(NIM, KodeMk)
SKS-->(NIM, KodeMk)
NilaiHuruf-->(NIM, KodeMk)
o Table in the decomposition should be some tables that are eligible 2NF
o Functional dependency as follows:
NilaiHuruf (fd1)-->(NIM, KodeMk)
(NamaMhs , Alamat) (fd2)-->NIM
(Matakuliah, SKS) (fd3)-->KodeMk
o So:
Value Table-->fd1 (NIM, KodeMk, NilaiHuruf)
Table Student-->fd2 (NIM, NamaMhs , Alamat)
Table Course-->fd3 (KoeMk, Matakuliah, SKS)

THIRD NORMAL FORM - 3NF

Third NORMAL FORM - 3NFBentuk normal 3NF met if the form meets 2NF, and if there are no non-primary key attribute that has a dependence on non-primary key attributes of the other (transitive dependencies).

Example:
• Table the following students qualified 2NF, 3NF, but does not meet

• Because there are non-primary key attribute (namely, City and Provincial), which has a dependence on non-primary key attributes of (City, Province)the other (namely Poscode): Poscode
• So that the table should be in the decomposition:
• Students (NIM, NameofStudent, Road, Poscode)
o Poscode (Poscode, Province, City)

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 Normal onity and forced each of the attributes depends on the function in the super key attributes.
In the example below there is a relationship seminar, is the Primary Key NPM + Seminar.
Students may take one or two seminars. Each seminar requires 2 each of the students and led by one of the 2 seminar. Each leader can only take one seminar course. This is a sample:

Relations Seminar is a form of Third Normal, but not BCNF
Seminar Code because the function depends on the guide, if any guide can only teach a seminar. Seminar depend on one key attribute is not as super in terms of by BCNF. So
Seminar relations must be parsed into two namely:


NORMAL FORM FOURTH AND FIFTH
• Relations in fourth normal form (NF 4) if the relation in BCNF and dependency not contain many 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.

Sabtu, April 18, 2009

DATABASE AND ERD

DEFINITION DATABASE
•Set of data stored in the magnetic disk, optical disk or other secondary storage integrated collection of data-related data of an enterprise (company, government or private)
•Companies manufacturing production planning data, actual production data, data ordering materials, etc.

DATA BASE MANAGEMENT SYSTEM
•Bundles / database combined with software applications that are based database
•Programs are used for applications to access and maintain databases
•The main purpose DBMS is to provide an environment that is efficient and easy to use, withdrawal and storage of data and information

BIT, BYTE, Field
•Bit is the smallest pieces of data that contains the value 0 or 1
•Byte is the set of bit-bit similar
•Field set of byte-byte similar, in the database used the term attribute

ATTRIBUTE / FIELD
•It is the nature or characteristics of an entity that provides provide detail on these entities
•A relationship can also have attributes
•Example attributes:
teachers : NIP, name, address
book: id book, title, publisher

TYPE-TYPE ATTRIBUTE
•Single vs. Multi value
Single --> can be filled only at most one value
Multi value --> can be filled with more than one value with the same of type
•Atomic vs. Composition
Atomic --> can not be divided into the attributes of smaller
composition --> combination of several attributes of a smaller
•Derived Attribute
attribute value can be derived from other attribute values, expl -> age resulting from the date of birth attribute
•Null Value attribute
Attributes that have no value to a record
•Mandatory attribute Value
Attributes must have values

RECORD / TUPLE
It is a line of data in a relationship. Consist of collection of attribute-attribute-attribute where the attribute is to inform each other entity / relationship fully

ENTITY/ FILE
The file is a collection of similar records and have the same elements, the same attributes but different data value.

FILE TYPE
- Master File
- Transaction File
- File Report
- File History
- File Protection
- Job File

DOMAIN
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
•Super key
Super key is one 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
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 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. Unique
•Alternate Key
Alternate Key is an attribute of the candidate key is not selected to be primary key.
•Foreign 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 cardinalitas one to many (one to many) or many to many (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 network model which uses word order is stored in the abstract system.
Differences between the 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

ELEMENT-ELEMENT 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 the reading relation.
•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
•Cardinalitas
tupel indicates the maximum number that can be relation with entities on the other entity

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
is a relationship between the instance of 3 types of entities are unilateral.

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 of view .for an incident on the first entity can have any relationship with many incident on the second entity, if the one incident in which two entities can only have one with relation incident on the first entity.
Many To Many:
if any incident occurs in an entity has many relationships with other entities in the incident.

ER DIAGRAM NOTATION

Symbolic notation in the ER diagram is
Rectangle represent the collective entity
Circle represent the attributes
Rhomb collective relationships
Line as the link of relationships between the entity and the collective entity with collection of attribute

this is example for implementation

Sabtu, April 04, 2009

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM
Can be called the Data Flow Diagram (DFD). Describe the distribution of the modules in the system to a smaller. Easy to understand the less the field to understand the computer system that will be done
CONTEXT DIAGRAM
Consists of a process and describe the scope of a system . It is the highest level of the DFD that describes the entire system to input and output of the system. The system is limited by Boundary (depicted by broken lines). No storage (storage)
ZERO DIAGRAM
Describe the process of the DFD. Provide views on the overall system in which, showing the main function or process that is, the flow of data and entity external. At this level of data storage possible. For processes that do not detail again on the next level then added the symbol '*' or 'P' at the end of the process. Input and output balance (balancing) between 0 to diagram context diagram should be maintained
DETAILED DIAGRAM
It is a process diagram that decipher what is in the diagram zero level or above. Numbering level in the DFD:

In the one level there should be no more than 7 units and the maximum of 9, when more should be done in the decomposition
SPECIFICATION PROCESS
Each process in the DFD must have a specification process. At the top level method is used to describe the process can use a sentence with descriptive. On a more detailed level, namely on the bottom (functional primitive) requires specification of a more structured. Specification process will be the guideline for the programmer to make this program (coding). Methods used in the specification process: the process of disintegration in the form of a story, decision table, decision tree
ON FOREIGN
Something that is outside the system, but it provides data in the system or to provide data from the system. with the notation described. External entity not part of the system including. Naming: (The name of the form of noun. Terminal may not have the same name unless the object is the same.
CASH DATA
It is a place where information flows. Described the straight line that connects the components of the system. Flow data is shown with the direction arrows and the name on the flow of data that flows. Flow data flow between processes, data storage and data flow indicates that the form of data input for the system. Guidelines of the name: ( Name of the flow of data that consists of some words associated with the flow lines connect. No flow data is the same name and the name should reflect its content. Flow of data that consists of several elements can be expressed with the group element. Avoid using the word 'data' and 'information' to give a name to the flow of data. T he extent possible the flow of data is complete). Terms of others: (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. Data flow into or out of data storage does not need to be given a name if: (Flow of data simple and easy to understand. Flow of data describing all the data items). No flow 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 a process)
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: (Name of the process consists of a verb and noun, which reflects the function of the process. Do not use the process as part of the name of a bubble. There may be some process that has the same name. 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)
DATA STORAGE
Data storage is a storage place for data that exists in the system. Ilustratation with a pair of parallel lines or two lines with one side open side. The process can retrieve data from or provide data to the database. Guidelines of the name: (The name should reflect the data storage. If the name more than one word must be marked with the number )
DFD Symbols

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. At the analysis stage, the data dictionary is used as a means of communication between the systems analyst with the. At the system design, 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: (Name of the data flow: must note that readers who need further explanation about a flow of data can find it easily. Other name of the data can be written when there is. The form 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: provides an explanation about the meaning of the data flow
BALANCING IN DFD
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. Name of the data flow into and out of the process must match the name of the flow of data into and out of the details of the process. Number and name of an entity outside the process must be equal to the number of names and entities outside of the details of the process. The issues that must be considered in the DFD which have more than one level: (There should be a balance between input and output of one level and next level. 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 / output of stream data to / from the process concerned. 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 of data from one process directly to the other without going through the process of saving data should / be avoided as much as possible