Normalisasi Basis Data 1NF, 2NF, 3NF dan Contoh Kasus Sederhana

P Indah Ciptayani
7 Oct 202112:02

Summary

TLDRThis video script discusses the concept of normalization in database management, a process used to organize attributes or columns within a table to minimize duplicate data and ensure consistency. It explains the different forms of normalization, starting from the first normal form (1NF) where each cell contains a single value, to the third normal form (3NF), which eliminates transitive dependencies. The script guides viewers through the steps of normalization, using examples to illustrate how to identify and resolve partial and transitive dependencies, ultimately aiming to achieve a well-structured database free from anomalies.

Takeaways

  • 😀 Normalization is a process used to organize attributes or columns in a table to ensure a well-structured database with minimal duplicate data.
  • 🔑 The ideal structured table should contain data with minimal duplication, aiming for the absence of duplicate data if possible.
  • 🔍 Normalization involves breaking down tables into simpler forms to eliminate redundancy and ensure consistency, starting from the first normal form (1NF) to the third normal form (3NF).
  • 📚 Understanding functional dependencies is crucial for proper normalization, as it helps identify how data should be structured to avoid anomalies.
  • 🚫 Anomalies in data, such as insert, update, and delete issues, can occur if tables are not normalized properly, leading to inconsistent and unreliable data.
  • 📈 The first normal form (1NF) requires that each cell in a table contains a single value, ensuring atomicity and no multi-valued attributes.
  • 🔄 The second normal form (2NF) builds on 1NF by eliminating partial dependencies, where non-key attributes are dependent on only a part of a composite key.
  • 🔄 The third normal form (3NF) further refines the structure by removing transitive dependencies, ensuring that non-key attributes are only dependent on the primary key.
  • 📝 The process of normalization involves checking the current state of a table, applying rules to achieve 1NF, then 2NF by removing partial dependencies, and finally 3NF by eliminating transitive dependencies.
  • 🔍 Examples and case studies are essential for understanding normalization, as they provide practical scenarios to apply the concepts and rules of database normalization.

Q & A

  • What is normalization in the context of database management?

    -Normalization is a process used to organize attributes or columns in a table to structure the database well, minimizing duplicate data and ensuring consistency.

  • Why is it important to minimize duplication in a database?

    -Minimizing duplication is important to avoid redundancy and maintain data integrity, which simplifies updates and reduces storage space.

  • What are the different forms of normality in normalization?

    -There are several forms of normality, starting from unnormalized to first normal form (1NF), second normal form (2NF), third normal form (3NF), Boyce-Codd normal form (BCNF), and fifth normal form (5NF).

  • What is the first step in the normalization process?

    -The first step is to check if the table is in 1NF, which means each cell contains only a single value and there are no repeating groups.

  • How do you identify partial dependencies in a table?

    -Partial dependencies are identified by checking if any non-prime attribute is dependent on a part of the primary key, rather than the whole key.

  • What is the purpose of moving to 2NF in normalization?

    -The purpose of 2NF is to eliminate partial dependencies, ensuring that all non-prime attributes are fully functionally dependent on the primary key.

  • What is a transitive dependency and why is it a concern in normalization?

    -A transitive dependency is when an attribute is dependent on another non-key attribute. It's a concern because it can lead to anomalies and is removed in 3NF.

  • How can you tell if a table is in 3NF?

    -A table is in 3NF if it is in 2NF and has no transitive dependencies, meaning there are no dependencies between non-key attributes.

  • What is the significance of understanding dependencies when normalizing a database?

    -Understanding dependencies is crucial for proper normalization because it helps identify and eliminate anomalies and redundancies, leading to a more efficient and consistent database structure.

  • Can you provide an example of how to break down a table to achieve 3NF?

    -An example would be to take a table with a composite key and separate it into multiple tables where each non-key attribute is dependent only on the primary key, thus eliminating transitive dependencies.

Outlines

00:00

📚 Introduction to Normalization

The paragraph introduces the concept of normalization in database management. Normalization is a process that organizes attributes or columns in a table to ensure a well-structured database. The ideal structured table should contain minimal duplicate data. The speaker explains that normalization aims to reduce data redundancy and anomalies, leading to consistent data. The explanation includes the different forms of normalization, starting from unnormalized to the first normal form (1NF), second normal form (2NF), third normal form (3NF), and beyond, with a focus on understanding dependencies and anomalies to achieve a normalized database.

05:02

🔍 Achieving Second Normal Form (2NF)

This section delves into the process of achieving the second normal form (2NF) in database normalization. The speaker explains that to reach 2NF, partial dependencies must be eliminated. The explanation involves identifying the primary key and understanding which non-key attributes are dependent on it. The example given involves a student database with attributes like NIM, student name, major, and department. The process involves creating separate tables for students and courses to remove partial dependencies, resulting in a more normalized structure. The speaker also discusses how to identify and resolve anomalies that may still exist after attempting to achieve 2NF.

10:02

🛠️ Moving Towards Third Normal Form (3NF)

The final paragraph focuses on the steps to achieve third normal form (3NF). The speaker discusses the concept of transitive dependency and how it can lead to anomalies if not addressed. The example continues with the student database, explaining how to identify and remove transitive dependencies. The process involves further splitting the tables to ensure that each table only contains data that is directly related to its primary key, thus eliminating any non-key attributes that do not depend on the entire primary key. The result is a set of tables that are in 3NF, with each table having a clear relationship defined by its primary key and no transitive dependencies remaining.

Mindmap

Keywords

💡Normalization

Normalization is a database design process used to organize data to reduce redundancy and improve data integrity. In the context of the video, normalization is described as a method to structure tables by grouping attributes or columns effectively. The video emphasizes that a well-structured table should minimize duplicate data, which aligns with the ideal of normalization where the database tables are not interrelated in a way that causes data redundancy.

💡Dependencies

Dependencies, or dependenci, refer to the relationships between different data elements within a database. The video script discusses the importance of understanding functional dependencies to correctly apply normalization rules. Dependencies are crucial for determining how data should be organized to avoid anomalies and ensure consistency across the database.

💡First Normal Form (1NF)

First Normal Form (1NF) is the initial step in the normalization process where a table is structured such that each cell contains a single value, and there are no repeating groups or arrays. The video script uses the term to describe the condition where each row and column intersection contains only one value, which is a fundamental requirement for a table to be considered in 1NF.

💡Partial Dependency

Partial Dependency is a term used to describe a situation where a non-key attribute is dependent on only a part of a composite key. The video script explains that to achieve the Second Normal Form (2NF), partial dependencies must be eliminated. This is illustrated in the script with examples of how to break down tables to remove such dependencies.

💡Second Normal Form (2NF)

Second Normal Form (2NF) is a level of database normalization that builds upon 1NF by eliminating partial dependencies. A table is in 2NF if it is in 1NF and every non-key attribute is fully functionally dependent on the primary key. The video script discusses how to identify and remove partial dependencies to achieve 2NF.

💡Transitive Dependency

Transitive Dependency occurs when an attribute is dependent on another attribute that is not a prime attribute or part of the primary key. The video script mentions that to reach the Third Normal Form (3NF), transitive dependencies must be removed. This ensures that there are no indirect dependencies that could lead to anomalies in data insertion, update, or deletion.

💡Third Normal Form (3NF)

Third Normal Form (3NF) is a normalization level that ensures that a table is not only free from partial and transitive dependencies but also that all its attributes are directly dependent on the primary key. The video script provides an example of how to identify and eliminate transitive dependencies to achieve 3NF.

💡Atomic Value

An atomic value is a data element that cannot be further divided into smaller pieces. In the context of normalization, ensuring that each table cell contains an atomic value is part of achieving 1NF. The video script uses this term to contrast with non-atomic values, which would violate the principles of 1NF.

💡Anomalies

Anomalies in database normalization refer to issues that arise due to poor data organization, such as update, insert, or delete problems. The video script discusses how normalization aims to eliminate anomalies by structuring data in a way that each piece of information is stored only once and is easily accessible.

💡Consistency

Consistency in the context of the video refers to the uniformity and reliability of data across a database. Achieving normalization helps maintain consistency by ensuring that there are no duplicate data entries and that data dependencies are logically structured.

💡Boy Scout Normal Form (BCNF)

The Boy Scout Normal Form (BCNF) is a stricter version of 3NF that requires every determinant to be a candidate key. The video script mentions BCNF as part of the higher levels of normalization beyond the scope of the discussed 1NF to 3NF, indicating a further step in the process of refining database structure.

Highlights

Normalization is a process used to organize attributes or columns in a table to ensure a well-structured database with minimal duplicate data.

An ideally structured table contains data with minimal duplication, aiming for no duplication if possible.

The importance of tables being free from anomalies and having consistent data is emphasized.

Understanding dependencies or functional dependencies is crucial for the normalization process.

The concept of partial dependency and its role in the second normal form (2NF) is introduced.

Transitive dependency and its impact on the third normal form (3NF) are explained.

The process of checking if a table is in the first normal form (1NF) involves ensuring each cell contains a single value.

To achieve 2NF, remove partial dependencies by identifying primary keys and their related partial dependencies.

An example of breaking down a table into multiple tables to eliminate partial dependencies is provided.

The process of eliminating transitive dependencies to achieve 3NF is discussed.

An example is given to illustrate how to split a table to remove transitive dependencies and anomalies.

The final result of normalization includes multiple tables with minimized dependencies and anomalies.

The video promises to cover more detailed examples and case studies in upcoming videos.

The significance of understanding different types of dependencies for successful normalization is reiterated.

The video concludes with a reminder to watch the next videos for further study cases on normalization.

The presenter wishes the viewers a good day and hopes they gain new understanding from the video.

Transcripts

play00:00

Hai Hai guys kita sekarang akan bahas

play00:02

mengenai normalisasi jadi normalisasi

play00:05

itu sebenarnya proses yang digunakan

play00:07

untuk menentukan pengelompokan

play00:10

atribut-atribut atau gampangnya

play00:12

kolom-kolom dalam sebuah tabel sehingga

play00:15

nanti tabel kalian akan terstruktur

play00:17

dengan baik nah gimana sih sebenarnya

play00:19

tabel yang terstruktur dengan baik atau

play00:21

tabel yang normal itu gitu ya jadi

play00:24

idealnya tabel mengandung the dan si

play00:29

atau data yang duplikat duplikasi data

play00:31

itu seminim mungkin nggak bisa nol

play00:34

sehingga bisa hilang sih kalau

play00:36

benar-benar hilang itu artinya

play00:38

tabel-tabel kalian di dalam database itu

play00:40

tidak terelasi dong ditekan kalau selama

play00:44

tabel-tabel nya masih relasi itu akan

play00:45

ada si data yang duplikat tapi kita

play00:47

usahakan seminimal mungkin Kemudian yang

play00:50

kedua yang paling penting adalah

play00:52

tabel bebas dari anomali dan datanya

play00:56

konsisten

play00:58

Apa itu anomali sudah saya jelaskan di

play01:01

video yang sebelumnya kalian bisa lihat

play01:02

dulu video sebelumnya biar kalian tuh

play01:04

nggak bingung gitu ujug-ujug normalisasi

play01:07

tapi kalau kalian udah paham apa itu

play01:09

dependensi atau ketergantungan dan Apa

play01:12

itu anomali lanjutkan Nonton videonya

play01:14

oke nah kita disini melaksanakan

play01:18

normalisasi itu dalam beberapa langkah

play01:20

jadi nanti setiap langkah studinya

play01:23

berhubungan dengan satu bentuk normal

play01:26

tertentu jadi bentuk Normal itu ada

play01:28

levelnya gitu loh guys jadi mulai dari

play01:30

dia nggak normal kemudian ada bentuk

play01:33

normal kesatu kedua ketiga terus sebelum

play01:37

keempat itu ada namanya boy scout atau

play01:39

BC normal form baru ke normal keempat

play01:43

dan baru ke normal kelima Nah jadi

play01:45

normal kelima itu udah-udah yang

play01:47

terakhir jadi tuh itu level-level dari

play01:50

kenormalan si kenormalan dari normalized

play01:53

jadi level-level dari normalisasi ketiak

play01:56

ah cuman di sini yang kita bahas itu Hai

play02:00

sampai bentuk normal ketiga aja dulu

play02:02

gitu ya nah oh jadi bentuk Normal itu

play02:05

adalah keadaan yang dihasilkan ketika

play02:07

kita menerapkan aturan-aturan sederhana

play02:10

yang berhubungan dengan dependensi

play02:12

fungsional tadi makanya kalian harus

play02:15

banget paham dulu apa itu dependensi

play02:17

kalau nggak nanti

play02:19

amin bisa jadi salah dong hasil

play02:22

normalisasinya gitu ya

play02:24

Nah ini adalah langkah-langkah untuk

play02:26

melakukan normalisasi nah yang pertama

play02:29

biasa kita cek dulu kan Apakah tabelnya

play02:32

itu benar-benar Eh nggak normal Nah

play02:36

Enggak normal atau abnormal wis pom itu

play02:39

biasanya ditandai dengan dibentuknya

play02:40

tidak sempurna itu biasanya

play02:43

dalam satu file satu sel itu adalah

play02:46

perpotongan baris dan kolom

play02:48

itu datanya itu masih bernilai banyak

play02:53

gitu dia bukan Atomic dia bukan satu

play02:55

nilai nanti deh kita saya akan berikan

play02:59

contoh kasus Hai yang mana Kalau dia ufb

play03:01

itu itu ada nanti contohnya kemudian

play03:04

kita lakukan kita ubah dia menjadi

play03:07

bentuk normal yang ke-1 atau first

play03:10

normal form atau 1mf pernah jadi disini

play03:15

setiap perpotongan baris dan kolom atau

play03:18

selnya itu itu hanya berisi satu nilai

play03:21

pastikan satu nilai tidak ada nilai yang

play03:24

lebih dari satu itu berarti udah normal

play03:27

yang pertama normal yang kedua itu

play03:30

adalah dia udah pastinya udah 1mf dulu

play03:33

kemudian tidak ada lagi ketergantungan

play03:36

parsial nah ini mulai Munculnya istilah

play03:39

nih ketergantungan parsial itu harus

play03:42

hilang dibentuk normal yang kedua sekali

play03:44

lagi kalau kalian masih bingung apa itu

play03:46

ketergantungan atau dependensi parsial

play03:49

kalian bisa nonton video jenis-jenis

play03:52

dependensi

play03:53

nah kemudian yang terakhir itu adalah

play03:56

bentuk normal yang ketiga atau 3mf jadi

play03:59

disini pasti ini dia sudah memenuhi

play04:01

aturan 2mf dulu Nah setelah itu tidak

play04:05

ada ketergantungan transitif Nah jadi

play04:08

ketergantungan transitif harus hilang di

play04:10

sini makanya dari itu kalian harus

play04:11

memahami dulu jenis-jenis dependensi

play04:15

oke kita cek dulu ini adalah contoh

play04:20

sebuah contoh aja gitu ya nanti kalau

play04:23

kalian ingin melihat contoh yang lebih

play04:25

detail lagi atau contoh kasus lainnya

play04:27

kalian bisa lihat video yang berikutnya

play04:30

ya nah jadi sini ada data seperti ini

play04:34

nah ini udah 1mf kenapa Karena disini

play04:37

setiap selnya ini setiap sel ya

play04:39

perpotongan baris dan kolom nih setiap

play04:41

satu kotak satu kotak inilah cuman

play04:43

satu-satunya M16 A1 Prodi S1 jurusan

play04:46

satu kode matakuliah nih nih

play04:51

Iya ini satu-satu Brarti udah dia udah

play04:55

bentuk normal yang pertama Nah setelah

play04:59

memenuhi bentuk kau yang pertama berarti

play05:01

kita sekarang mau ke step yang

play05:03

berikutnya yaitu Apakah dia memenuhi

play05:06

bentuk normal yang kedua Nah agar kita

play05:09

tahu apakah dia memenuhi bentuk normal

play05:11

Yang kedua kita harus menghilangkan

play05:14

ketergantungan parsial menghilangkan

play05:16

ketergantungan parsial kita harus

play05:19

mengetahui dulu

play05:22

kunci primernya habis itu yang mana yang

play05:25

memiliki ketergantungan partial well

play05:27

untuk kasus yang ini kita udah bahas

play05:30

jenis-jenis ketergantungannya dan kita

play05:32

udah Gambarkan diagram dependensi nya

play05:35

itu di video yang membahas mengenai

play05:37

jenis-jenis dependensi kalian bisa cek

play05:39

videonya

play05:40

sehingga kalian bisa paham kenapa kok

play05:43

ada diagram ini karena dengan diagram

play05:45

ini kita akan lebih mudah melakukan

play05:47

normalisasi Nah jadi disini jelas ya

play05:50

kunci primernya NIM dan kode matkul Ia

play05:54

memiliki ketergantungan parsial itu

play05:56

kepada salah satu dari salah satu bagian

play05:59

kunci primer Hai kepada Denim saja atau

play06:01

kepada matkul saja yang kepada mint saja

play06:04

disini ketergantungan mahasiswa Prodi

play06:07

dan jurusan Nah jadi parsial yang

play06:08

pertama ini mahasiswa nama mahasiswa

play06:11

Prodi dan jurusan ini kita akan bentuk

play06:14

menjadi sebuah tabel jadi ini parsial

play06:17

pertama menjadi sebuah tabel misalnya

play06:19

karena isinya NIM nama mahasiswa Prodi

play06:21

dan jurusan kita kasih nama tabelnya

play06:24

tabel mahasiswa Nah yang kedua ini ada

play06:27

ketergantungan parsial kepada kode

play06:29

matakuliah nah jenis ini kode mata

play06:32

kuliah nama mata kuliah dan SKF

play06:34

kumpulkan menjadi satu tabel misalnya

play06:37

tabel matakuliah Nah jadi Udah ada dua

play06:39

tabel ya dan yang terakhir adalah

play06:43

seluruh kunci primernya minim dan kode

play06:46

matkul digabungkan jadi satu tabel dan

play06:49

apabila ada yang bergantung sepenuhnya

play06:52

itu ikut mereka menjadi bagian dari

play06:55

tabel yang ketiga jadi nimco Demak cool

play06:59

dan kebetulan di sini yang bergantung

play07:00

sepenuhnya yaitu nilai maka nilai ini

play07:03

akan ikut membentuk tabel yang ketiga

play07:07

bersama nindan kode matkul jadi Isinya

play07:09

intim kode matkul dan nilai tuh kita

play07:13

kasih misalnya nama tabel nilai seumpama

play07:15

enggak ada nilai itu tetap harus ada

play07:18

tabel yang ketiga walaupun tidak ada

play07:20

ketergantungan sepenuhnya terus isi

play07:22

tabelnya apa dong Isi tabelnya adalah

play07:24

hanya kunci-kunci primernya saja karena

play07:27

kalau tidak ada tampilan ketimbang ada

play07:29

yang merelasikan dong antara mahasiswa

play07:30

dengan mata kuliah jadi seperti itu ya

play07:33

jadi dari hasil dari 2nf tadi dengan

play07:37

menghilangkan ketergantungan parsial

play07:39

adalah ini tabel-tabel nya tabel

play07:41

mahasiswa ada empat mahasiswa tabel mata

play07:44

kuliah dengan lima mata kuliah dan tabel

play07:47

nilai yang memuat detail dari Enin kode

play07:51

dan kode matkul yang diambil serta nilai

play07:53

yang didapatkan

play07:55

ini adalah hasil dari 2mf Anda tidak

play07:58

tabel Nah apakah masih ada nyali seperti

play08:01

itu ya kita cek nih acontoh atau

play08:04

biasanya anomali itu Adi 2mf itu ada

play08:06

akibat masih adanya ketergantungan

play08:08

transitif itu ya ketergantungan parsial

play08:12

tu udah hilang tinggal ketergantungan

play08:13

sepenuhnya ajakan Nah mungkin enggak sih

play08:16

masih ada ketergantungan transitif Nah

play08:18

kalau masih ada ketergantungan transitif

play08:19

pasti ada anomali dong gitu karena

play08:22

ketergantungan contoh misalnya nih ah di

play08:26

sini kalau misalnya saya mau menambahkan

play08:29

sebuah sini kan kunci primernya minimnya

play08:31

ingat ya ketika mereka keluar dari Eh

play08:36

keluar membentuk tabel itu adalah

play08:39

penentunya yang akan menjadi kunci

play08:41

primer ini penentu penentu ditekan

play08:43

sehingga di tabel mahasiswa ini kunci

play08:45

primernya adalah Ning misalnya ada Prodi

play08:47

baru yang baru saja terbentuk Misalnya

play08:50

namanya Pro DX nah tentu saja Pro DX ini

play08:53

belum punya mahasiswa dong karena Prodi

play08:55

X ini Mau ditambahkan berarti

play08:57

mahasiswanya kosong minimnya kosong ke

play09:00

sehingga enggak boleh nol kan aturannya

play09:01

Anda anomali Insert clodi baru Enggak

play09:04

bisa ditambah Nah karena masih ada

play09:05

anomali berarti masih dia masih belum

play09:09

normal harus kita normalkan lagi nah

play09:12

bagaimana cara menormalkan 3nf kita

play09:15

lihat ada ketergantungan parsial ada

play09:17

ketergantungan transitif gak ingat

play09:20

ketergantungan transitif itu adalah

play09:22

paling panah memanah Nah jadi sini nih

play09:24

Prodi memanah jurusan ini memanah

play09:27

prodi-prodi memanah jurusan ini bagian

play09:30

transitif nya bagaimana caranya memecah

play09:32

yang transitif ini caranya adalah

play09:36

Prodi akan ikut Gening jadi dengan tabel

play09:42

lamanya awalnya kan disini Prodi itu dia

play09:45

ada di sini ya Ups sorry ya Gimana ya

play09:49

ini dua enaknya chord

play09:53

awalnya kan Prodi itu dia ikut dengan

play09:56

tabel mahasiswa ya karena Prodi ini

play09:59

berada di inin menentukan prodi-prodi

play10:01

menentukan jurusan maka disini akan

play10:04

pecah jadi dua tabel dimana Prodi tetap

play10:08

di tabel mahasiswa dan Prodi juga

play10:10

membentuk tabel baru yaitu tabel

play10:13

periodik gitu jadi Prodi ini akan ikut

play10:16

ditabel lama dan dia juga membentuk

play10:20

tabel baru jadi hasilnya Ya dia ikut

play10:23

kedua-duanya nanti si protein Nah ini

play10:25

dia jadi di ambil mahasiswa tetap isinya

play10:28

Ning nama mahasiswa dan profesi itu

play10:31

sendiri nah jadi produknya topiku disini

play10:33

Lalu ada tabel Prodi yang isinya adalah

play10:37

Prodi dan jurusan aja jadi yang awalnya

play10:40

tabel mahasiswa itu juga berisi jurusan

play10:41

sekarang jurusannya dia udah di tabel

play10:44

lain ikut dengan si Prodi nah berhubung

play10:46

si Prodi ini dia keluar dan membentuk

play10:48

tabel baru dia akan menjadi kunci primer

play10:52

karena disini dia penentu jurusan dia

play10:54

akan jadi kunci primer yaitu prodina

play10:56

kalau udah kayak gini nih mau ngincer

play10:59

Prodi baru Kya tinggal tambah aja Pro DX

play11:02

jurusan misalnya jurusan Aa udah deh

play11:05

gitu enggak ada kaitanya dengan tabel

play11:07

mahasiswa jadi enggak masalah gitu nanti

play11:10

ketika udah ada mahasiswa yang daftar di

play11:11

Probe X baru tinggal ditambahkannya

play11:13

namanya dan di sini ada Prodi X ghetto

play11:16

jadi ini tabel totalnya ada empat ya

play11:19

tabel mahasiswa tabel periodik tabel

play11:21

matakuliah dan tabel nilai ini hasil

play11:23

dari 2mf sedangkan tabel mahasiswa dan

play11:26

Prodi itu adalah pecahan dari tabel

play11:29

mahasiswa di tuh karena masih mengandung

play11:32

anomali tadi akibat adanya

play11:33

ketergantungan transitif Nah jadi Itulah

play11:37

contoh kasus sederhana dari

play11:39

langkah-langkah normalisasi dari 1nf

play11:42

sampai dengan 3nf Oke di video-video

play11:46

Berikutnya saya akan membahas mengenai

play11:48

studi kasus dari normalisasi

play11:51

Oke terima kasih Semoga hari kalian

play11:54

indah dan semoga

play11:56

kalian mendapatkan pemahaman baru dan

Rate This

5.0 / 5 (0 votes)

関連タグ
Database ManagementNormalization ProcessData Structure1NF to 3NFData RedundancyDatabase DesignData IntegrityTutorialsTech EducationSQL Fundamentals
英語で要約が必要ですか?