10:32 PM

QUIZ 7

NORMALIZATION

PROCESS OF DATABASE PLANING
- Collect needs for user/business and expand E-R model based on user business needs.
- Conversion of E-R model to collection relations.
- Normalization of relations for dissapear anomaly
- implementation the database in create table for user relation to normalize.


Normalization of Data Bases

- Normalization is process structure database form so that more of ambiguity can be disappeared.
- the step of normalization begun from easy step (INF) to hard step (5NF).
- It is usually until 3NF step or BCNF because it's provide enough for result good quality table.

Why normalization must be done?
- Optimalization the table structures
- Increase the speed
- Disappear input data that similar
- More efficient to use in storage media
- Decrease redundancy
- Avoid anomally (insertion anomalies, deletion anomalies, update anomalies).
- Increase the data integrity


Normalization done by because to Optimalisasi Structure of is tables, Improving speed, Eliminating same data inclusion, More efficient in storage media use, Lessening redundans, Avoiding anomali ( insertion anomalies, deletion anomalies, update the anomalies) and improved Data integrity.
A table can be said good ( efficient) or normal if fill in 3 criteria :
- If there is decompotition table, so its decompotition must secure (Lossless-Join Decomposition). It mean after decompotition become a new tables, the new tables result first similar table.
- Preserve the functional dependency when changing data(Dependency Preservation.
- not brake Boyce-Code Normal Form (BCNF)
- If the third criteria can be filled so the table not brake 3rd normal form/ 3NF.



Functional Dependency

Functional Dependency decribe attributes relationship in a relation
A attribute can be said FD if we use atribute value for determine other atribut value.
the simbol for represent FD is -->

Notation A ? B
A & B are arttribute from a table, it mean that functionally. A determine B or B hang up A, if only a 2 row data with A same value,so B same value too.

Notation A /-> B Or A x-> B

Are opposite from previously notation.


FUNCTIONAL DEPENDENCY (FD)



* Functional Dependency:
- NRP -> Name
- Subject_study,NRP -> VALUE

* Non Functional Dependency:
- Subject_study -> NRP
- NRP -> VALUE

Functional Dependency From value table
- NRP -> Name
Because for each same nrp value,so name value same too
- {Subject_study, NRP} -> Value
Because attribute value depend on subject_study and NRP togethe. In other mean for same subject_study and NRP, so the value same too, because subject_study and NRP are the key (unique).
- Subject_study -> NRP
- NRP -> value


First Normal Form - 1NF

A Table can be said in first normal form if it out in unnormalized table form, where doubling same field and enable null field

can be allowed to:
- Attribute that have more value.
- Both Combination attribute.

so:
- Domain value is atomic value



Second Normal Form - 2NF

- Normal form-2NF filled in a table if fill in 1NF form, and all atribute except primary key entirely have Functional Dependency in primary key.
- A table is not fill in 2NF, if there is attribute that Functional Dependency only partial ( only depend on half from primary key) .
- If there is attribute that not have dependency to primary key , so the attribute must be disappeare.
- Functional dependency X-> Y said full if deleting an attribute A from X mean Y not depending functional again.
- Functional Dependency X -> Y said partial if deleting an attribute A from X mean Y still depending functional.
- scheme R relation in 2NF form if each attribute non primary key A -> R depend functionally to primary key R.


Not fill in Second Normal Form - 2NF, because NIM, MKcode as a primary key
{NIM, KodeMk} → NameStudent
{NIM, KodeMk} → Address
{NIM, KodeMk} → Subjectstudy
{NIM, KodeMk} → Sks
{NIM, KodeMk} → LetterValue



Functional dependency :
{NIM, KodeMk} -> LetterValue (fd1)
NIM -> {NamaMhs, Address} (fd2)
KodeMk ? {Subjectstudy, Sks} (fd3)
becoming :

fd1 (NIM, KodeMk, LetterValue) → Tables Value
fd2 (NIM, NameMhs, Address) → Tables of student
fd3 (KodeMk, Matakuliah, Sks) → Tables Subjectstudy



Third Normal Form - 3NF

Normal form-3NF filled if fullfill in 2NF-form, and if there is not non primary key attribute that have dependency in other non primary key attribute (transitive dependency)
Because still have non PK attribute (that is city and regency) that have dependency to other non primary key attribute( postcode)
So that the tables require to discomosition become.:
Student (NIM, NameMhs, Jalan, KodePos)
KodePos (KodePos, Provinsi)


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 first 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 leader and each of the students be taught by one of the 2 leader in seminar. Each leader can only take one seminar course. In this example NPM and Seminar show a Seminar leader.







Fifth and Fourth normal form

- 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 appear and difficult to detect instantly.

12:50 AM

Quiz 6

DATABASE AND ER-DIAGRAM

DEFINITION OF DATABASE:

- A set of file data in magnetic disk, optical disk or other secondary storage.
- Collection of integrated data-related data of an enterprise (company,government or private).
for example:
Company data = manufacturing production planning, actual production data, data ordering materials, etc.
Hospital = patient data, doctor, nurse, etc.


DATABASE MANAGEMENT SYSTEM
-colection of database with the application software being based on database.
- program aplication is use to acess and protec database.
-the purpose of DBMs is prepare easy and efficiency to use data storage and information.

BIT, BYTE, FIELD

- Bit is small part of data that contains the value 0 or 1
- Byte is a set of bits similar
- Field is a set of byte-byte similar, in the database is called attribute.


ATRIBUT/FIELD
- Is a characteristic from an entity that provides detail explanation about these entity.
- A relationship have atributes,
for example : student :student number,name,address
Car :nomor_plat,colour,type,cc

ATTRIBUTE TYPE
1. Single vs multivalue

- Single
-> Single can be filled only one value.
- Multivalue
-> Can be filled with more than one value with the similar.

2. Atomic vs composition
- Atomic
-> Atomic can’t divided into smaller atribute.
- Composite
-> Is a composite from some smaller etribute.

3.Derived Attribute
- the atribute that value can be derived from other atribute value, for example age that derived from the atibute date of birth.

4.Null Value Attribute
- Atribut is not value to a record.

5.Mandatory Value Attribute
- Attributes must have values.

RECORD/TUPLE
Is a line of data in a relationship
Consists of a set atributes where the atributes make a relation to informing entity or relation completely



ENTITY/FILE
- File is collection from similar records and have same element, same atribute but different dat values

Type of file
- In the process of application, file can categories are:
1. Master File
2. Transaction File
3. File Report
4. File History
5. File Protection
6. File Work


DOMAIN

- Domain is a set of values that allowed into one or more atribute. Each atribute in one relational database is defined as a domain.


LOCK THE DATA ELEMENT

- Key is elements of record that used to find record in access time or used to identify each entityor record or line


SPECIES OF KEY

- Super Key
Superkey is one or more atribute from a table that can be used to identify entity or record from the table uniquely (not all of atribute become superkey)

- Candidate Key
Is superkey with minimal atribute. Candidate Key can not fill atribute from other table so that Candidate Key exactly Super Key

- Primary Key
One of the other atribute from Candidate Keycan be found as a PK with three categories are:
- Key is more natural to use as reference
- Key is more simple
- Key is guaranteed unique

- Alternate Key
Alternate Key is atribute from Candidate Key that not choosen as Primary Key

- Foreign Key
Foreign Key is any atribute that point to PK in other table. Foreign Key will be happened in a relation that have cardinality one to many or many to many. Foreign Key always located in table that aim to many.

- External Key
External key is a lexical atribute ( set lexical atribute) that its values always idetify one intance object.


ERD (ENTITY RELATIONSHIP DIAGRAM)

- ERD is model of function network that use word order that saved in abstract system.
- Differences between DFD and ERD
> DFD is model function network that will be done by system
> ERD is model data network that emphasize in structure and data relationship



ELEMENT ERD

- Entity
> In ER D E is described in rectangle. Entity is something in the real system and in abstract where the data stored.

- Relationship
> In ER D relationship can be described with belah ketupat. R is natural relation that happened between entity. Generally, the name is given to the verb base making easier to read the relations

- Relationship Degree
> Is number of entity that partisipate in one relationship. Degree that is often used in ERD.

- Attribute
> Is characteristic from each entity and relationship.

- Kardinalitas
> Indicate the number maximal tupel that relate to other entity.



RELATIONSHIP DEGREE

->>>Unary Relationship
Model relationship between entity come from same model relationship entity set.

->>>Binary Relationship
Model relationship between 2 entities.

->>>Ternary Relationship
Is relationship between instance from 3 type entities unilateraly.


KARDINALITAS

There are 3 kardinalitas 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 or many to one 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
-> Level many to many if each event in entity have more relationship with other entity event

EXEMPLARY KARDINALITAS


NOTATION (E-R DIAGRAM)

Symbolic notation in the ER diagram is:
- Rectangle represent the collective entity
- Circle represent the attributes
- Rhomb represent collective relationships
- Line as the set of relations between the Association and the

5:26 AM

QUIZ 5

DATA FLOW DIAGRAM


Data Flow Diagram

- Describing the distribution of system into small module is called data flow diagram(dfd)
- Make user easy to use which less understanding about computer and the system which will be done.


Contect Diagram

- Are a highest level from DFD which describe all of the scope of a system. This system is bounded by the boundary.
- Don’t have storage the data.

Zero Diagram

- Describe the process of DFD and support the all of opinion about the system that is handled, also need to storage data.
- For the process that not have more detail in next level so it must be added a symbol ‘*’ or ‘P’ in the end of number process
- Balancing of input and output between zero diagram and conteks diagram must be maintained

Detail Diagram

- Is the diagram that tell about the process what is there in zero diagram or the upper level
Numbering level in the DFD:


- In one level doesn’t have more than 7 process or the maximal is 9, if more than it so it need to dekomposition.


Specification Process

- In each process of DFD must have spesificasi process
- In top level method that used to describe a process, can use descriptif sentence
- In detail level that is in functional primitive need more structured spesificasi
- Spesificasi process will become orientation for the programmer to make coding
- The method that used in spesificasi process : the script of the process in a story, decision,decision tree.


External Entity

- Something that is in outside of system, but they give the data into system or give data from the system
- it is signed by notation box
- External entity is not part of system

naming:
- Name of terminal is noun

- The terminal is not have the same name exception in the same object


Data flow

- Is the palce of information flows
- Described by straight line that relate the component from the system.
- The flows data is signed by arrow and the line is given name the flows data that flow.

orientation prewsent name:

- The name data flow not be are same name and present name have agree with contents.
- Data Flow consists of some element can description are group element.
- Avoid to use a word like “data” and “information” for naming the data flow. And the name of data flow is written in complete name.



Certainty other:

- The name data flow that input in to a process not be same with the name data flow that output from process- Data
- Data flow that input or output from data storage not be need give name if:

- the data flow is simple and easy to understand
- the data flow describe all data item

- No be need data flow from terminal to data storage Because terminal is not part from the system, the terminal relation with data storage have to pass the process


Proces

- Process is what is worked by the system and it can manage the data or input data flow become output data flow.
- The function of process is transforms one or some input data become one or some output data with wanted specification .
- Each process have one or some input and produce one or some output.
- The process is also called bubble



The orientation naming process :

- Name of the process consists of verbs and nouns a that look up process function
- Don’t use “ process” as part of name a bubble.
- There is not same name in some process.
- The process given number : The structure of number must follow the flow proces, however it doesn’t mean absolutely and chronological structure process.


Data Storage

- Is a place to storage data in the system. The symbol is pararel line or two lines with one side is opened.
- Proces can take data from or given data to database
- The Orientation to give a name :
- The name must look like data storage.
- If name more than one word then must give continue sign.

Data Dictionary

- This function help user system for interpret aplication in detail and organize all elemen data are used in system exactly so that user and analysis system have same base understanding about input,output,storage and process.
- In analysis step, dictionary data is used as communication device between analyze system and user
- The data flow in DAD have global characterisic, more detail information can look in data dictionary


BALANCING in DFD

- Data flow that input and output from one process must same with detail data flow that in and out from under the level
- The name of data flow that input and output from a process must same with the name data flow process.
- Total and name external entitas from a proces have same with total and external entitas name from detail process.


The issues that must be considered in the DFD which have more than one level:

- There must be a balance between input and output of one level and next level

- Balance between level 0 and level 1 at input output of the flow of 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 and 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

- Data flow not from direct external entitas go on other external entitas without by a process.
- Data flow not from direct data storage go on external entitas without a process.
- Data flow not from direct data storage go on to other storage entitas without a proces
- Data flow from one direct process go on other process without a data storage or avoid it.