Normalisasi Basis Data 1NF, 2NF, 3NF dan Contoh Kasus Sederhana
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
📚 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.
🔍 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.
🛠️ 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
💡Dependencies
💡First Normal Form (1NF)
💡Partial Dependency
💡Second Normal Form (2NF)
💡Transitive Dependency
💡Third Normal Form (3NF)
💡Atomic Value
💡Anomalies
💡Consistency
💡Boy Scout Normal Form (BCNF)
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
Hai Hai guys kita sekarang akan bahas
mengenai normalisasi jadi normalisasi
itu sebenarnya proses yang digunakan
untuk menentukan pengelompokan
atribut-atribut atau gampangnya
kolom-kolom dalam sebuah tabel sehingga
nanti tabel kalian akan terstruktur
dengan baik nah gimana sih sebenarnya
tabel yang terstruktur dengan baik atau
tabel yang normal itu gitu ya jadi
idealnya tabel mengandung the dan si
atau data yang duplikat duplikasi data
itu seminim mungkin nggak bisa nol
sehingga bisa hilang sih kalau
benar-benar hilang itu artinya
tabel-tabel kalian di dalam database itu
tidak terelasi dong ditekan kalau selama
tabel-tabel nya masih relasi itu akan
ada si data yang duplikat tapi kita
usahakan seminimal mungkin Kemudian yang
kedua yang paling penting adalah
tabel bebas dari anomali dan datanya
konsisten
Apa itu anomali sudah saya jelaskan di
video yang sebelumnya kalian bisa lihat
dulu video sebelumnya biar kalian tuh
nggak bingung gitu ujug-ujug normalisasi
tapi kalau kalian udah paham apa itu
dependensi atau ketergantungan dan Apa
itu anomali lanjutkan Nonton videonya
oke nah kita disini melaksanakan
normalisasi itu dalam beberapa langkah
jadi nanti setiap langkah studinya
berhubungan dengan satu bentuk normal
tertentu jadi bentuk Normal itu ada
levelnya gitu loh guys jadi mulai dari
dia nggak normal kemudian ada bentuk
normal kesatu kedua ketiga terus sebelum
keempat itu ada namanya boy scout atau
BC normal form baru ke normal keempat
dan baru ke normal kelima Nah jadi
normal kelima itu udah-udah yang
terakhir jadi tuh itu level-level dari
kenormalan si kenormalan dari normalized
jadi level-level dari normalisasi ketiak
ah cuman di sini yang kita bahas itu Hai
sampai bentuk normal ketiga aja dulu
gitu ya nah oh jadi bentuk Normal itu
adalah keadaan yang dihasilkan ketika
kita menerapkan aturan-aturan sederhana
yang berhubungan dengan dependensi
fungsional tadi makanya kalian harus
banget paham dulu apa itu dependensi
kalau nggak nanti
amin bisa jadi salah dong hasil
normalisasinya gitu ya
Nah ini adalah langkah-langkah untuk
melakukan normalisasi nah yang pertama
biasa kita cek dulu kan Apakah tabelnya
itu benar-benar Eh nggak normal Nah
Enggak normal atau abnormal wis pom itu
biasanya ditandai dengan dibentuknya
tidak sempurna itu biasanya
dalam satu file satu sel itu adalah
perpotongan baris dan kolom
itu datanya itu masih bernilai banyak
gitu dia bukan Atomic dia bukan satu
nilai nanti deh kita saya akan berikan
contoh kasus Hai yang mana Kalau dia ufb
itu itu ada nanti contohnya kemudian
kita lakukan kita ubah dia menjadi
bentuk normal yang ke-1 atau first
normal form atau 1mf pernah jadi disini
setiap perpotongan baris dan kolom atau
selnya itu itu hanya berisi satu nilai
pastikan satu nilai tidak ada nilai yang
lebih dari satu itu berarti udah normal
yang pertama normal yang kedua itu
adalah dia udah pastinya udah 1mf dulu
kemudian tidak ada lagi ketergantungan
parsial nah ini mulai Munculnya istilah
nih ketergantungan parsial itu harus
hilang dibentuk normal yang kedua sekali
lagi kalau kalian masih bingung apa itu
ketergantungan atau dependensi parsial
kalian bisa nonton video jenis-jenis
dependensi
nah kemudian yang terakhir itu adalah
bentuk normal yang ketiga atau 3mf jadi
disini pasti ini dia sudah memenuhi
aturan 2mf dulu Nah setelah itu tidak
ada ketergantungan transitif Nah jadi
ketergantungan transitif harus hilang di
sini makanya dari itu kalian harus
memahami dulu jenis-jenis dependensi
oke kita cek dulu ini adalah contoh
sebuah contoh aja gitu ya nanti kalau
kalian ingin melihat contoh yang lebih
detail lagi atau contoh kasus lainnya
kalian bisa lihat video yang berikutnya
ya nah jadi sini ada data seperti ini
nah ini udah 1mf kenapa Karena disini
setiap selnya ini setiap sel ya
perpotongan baris dan kolom nih setiap
satu kotak satu kotak inilah cuman
satu-satunya M16 A1 Prodi S1 jurusan
satu kode matakuliah nih nih
Iya ini satu-satu Brarti udah dia udah
bentuk normal yang pertama Nah setelah
memenuhi bentuk kau yang pertama berarti
kita sekarang mau ke step yang
berikutnya yaitu Apakah dia memenuhi
bentuk normal yang kedua Nah agar kita
tahu apakah dia memenuhi bentuk normal
Yang kedua kita harus menghilangkan
ketergantungan parsial menghilangkan
ketergantungan parsial kita harus
mengetahui dulu
kunci primernya habis itu yang mana yang
memiliki ketergantungan partial well
untuk kasus yang ini kita udah bahas
jenis-jenis ketergantungannya dan kita
udah Gambarkan diagram dependensi nya
itu di video yang membahas mengenai
jenis-jenis dependensi kalian bisa cek
videonya
sehingga kalian bisa paham kenapa kok
ada diagram ini karena dengan diagram
ini kita akan lebih mudah melakukan
normalisasi Nah jadi disini jelas ya
kunci primernya NIM dan kode matkul Ia
memiliki ketergantungan parsial itu
kepada salah satu dari salah satu bagian
kunci primer Hai kepada Denim saja atau
kepada matkul saja yang kepada mint saja
disini ketergantungan mahasiswa Prodi
dan jurusan Nah jadi parsial yang
pertama ini mahasiswa nama mahasiswa
Prodi dan jurusan ini kita akan bentuk
menjadi sebuah tabel jadi ini parsial
pertama menjadi sebuah tabel misalnya
karena isinya NIM nama mahasiswa Prodi
dan jurusan kita kasih nama tabelnya
tabel mahasiswa Nah yang kedua ini ada
ketergantungan parsial kepada kode
matakuliah nah jenis ini kode mata
kuliah nama mata kuliah dan SKF
kumpulkan menjadi satu tabel misalnya
tabel matakuliah Nah jadi Udah ada dua
tabel ya dan yang terakhir adalah
seluruh kunci primernya minim dan kode
matkul digabungkan jadi satu tabel dan
apabila ada yang bergantung sepenuhnya
itu ikut mereka menjadi bagian dari
tabel yang ketiga jadi nimco Demak cool
dan kebetulan di sini yang bergantung
sepenuhnya yaitu nilai maka nilai ini
akan ikut membentuk tabel yang ketiga
bersama nindan kode matkul jadi Isinya
intim kode matkul dan nilai tuh kita
kasih misalnya nama tabel nilai seumpama
enggak ada nilai itu tetap harus ada
tabel yang ketiga walaupun tidak ada
ketergantungan sepenuhnya terus isi
tabelnya apa dong Isi tabelnya adalah
hanya kunci-kunci primernya saja karena
kalau tidak ada tampilan ketimbang ada
yang merelasikan dong antara mahasiswa
dengan mata kuliah jadi seperti itu ya
jadi dari hasil dari 2nf tadi dengan
menghilangkan ketergantungan parsial
adalah ini tabel-tabel nya tabel
mahasiswa ada empat mahasiswa tabel mata
kuliah dengan lima mata kuliah dan tabel
nilai yang memuat detail dari Enin kode
dan kode matkul yang diambil serta nilai
yang didapatkan
ini adalah hasil dari 2mf Anda tidak
tabel Nah apakah masih ada nyali seperti
itu ya kita cek nih acontoh atau
biasanya anomali itu Adi 2mf itu ada
akibat masih adanya ketergantungan
transitif itu ya ketergantungan parsial
tu udah hilang tinggal ketergantungan
sepenuhnya ajakan Nah mungkin enggak sih
masih ada ketergantungan transitif Nah
kalau masih ada ketergantungan transitif
pasti ada anomali dong gitu karena
ketergantungan contoh misalnya nih ah di
sini kalau misalnya saya mau menambahkan
sebuah sini kan kunci primernya minimnya
ingat ya ketika mereka keluar dari Eh
keluar membentuk tabel itu adalah
penentunya yang akan menjadi kunci
primer ini penentu penentu ditekan
sehingga di tabel mahasiswa ini kunci
primernya adalah Ning misalnya ada Prodi
baru yang baru saja terbentuk Misalnya
namanya Pro DX nah tentu saja Pro DX ini
belum punya mahasiswa dong karena Prodi
X ini Mau ditambahkan berarti
mahasiswanya kosong minimnya kosong ke
sehingga enggak boleh nol kan aturannya
Anda anomali Insert clodi baru Enggak
bisa ditambah Nah karena masih ada
anomali berarti masih dia masih belum
normal harus kita normalkan lagi nah
bagaimana cara menormalkan 3nf kita
lihat ada ketergantungan parsial ada
ketergantungan transitif gak ingat
ketergantungan transitif itu adalah
paling panah memanah Nah jadi sini nih
Prodi memanah jurusan ini memanah
prodi-prodi memanah jurusan ini bagian
transitif nya bagaimana caranya memecah
yang transitif ini caranya adalah
Prodi akan ikut Gening jadi dengan tabel
lamanya awalnya kan disini Prodi itu dia
ada di sini ya Ups sorry ya Gimana ya
ini dua enaknya chord
awalnya kan Prodi itu dia ikut dengan
tabel mahasiswa ya karena Prodi ini
berada di inin menentukan prodi-prodi
menentukan jurusan maka disini akan
pecah jadi dua tabel dimana Prodi tetap
di tabel mahasiswa dan Prodi juga
membentuk tabel baru yaitu tabel
periodik gitu jadi Prodi ini akan ikut
ditabel lama dan dia juga membentuk
tabel baru jadi hasilnya Ya dia ikut
kedua-duanya nanti si protein Nah ini
dia jadi di ambil mahasiswa tetap isinya
Ning nama mahasiswa dan profesi itu
sendiri nah jadi produknya topiku disini
Lalu ada tabel Prodi yang isinya adalah
Prodi dan jurusan aja jadi yang awalnya
tabel mahasiswa itu juga berisi jurusan
sekarang jurusannya dia udah di tabel
lain ikut dengan si Prodi nah berhubung
si Prodi ini dia keluar dan membentuk
tabel baru dia akan menjadi kunci primer
karena disini dia penentu jurusan dia
akan jadi kunci primer yaitu prodina
kalau udah kayak gini nih mau ngincer
Prodi baru Kya tinggal tambah aja Pro DX
jurusan misalnya jurusan Aa udah deh
gitu enggak ada kaitanya dengan tabel
mahasiswa jadi enggak masalah gitu nanti
ketika udah ada mahasiswa yang daftar di
Probe X baru tinggal ditambahkannya
namanya dan di sini ada Prodi X ghetto
jadi ini tabel totalnya ada empat ya
tabel mahasiswa tabel periodik tabel
matakuliah dan tabel nilai ini hasil
dari 2mf sedangkan tabel mahasiswa dan
Prodi itu adalah pecahan dari tabel
mahasiswa di tuh karena masih mengandung
anomali tadi akibat adanya
ketergantungan transitif Nah jadi Itulah
contoh kasus sederhana dari
langkah-langkah normalisasi dari 1nf
sampai dengan 3nf Oke di video-video
Berikutnya saya akan membahas mengenai
studi kasus dari normalisasi
Oke terima kasih Semoga hari kalian
indah dan semoga
kalian mendapatkan pemahaman baru dan
تصفح المزيد من مقاطع الفيديو ذات الصلة
What is Normalization in SQL? | Database Normalization Forms - 1NF, 2NF, 3NF, BCNF | Edureka
1NF 2NF 3NF DBMS
Boyce-Codd Normal Form (BCNF) | Database Normalization | DBMS
Lec-22: Finding Closure of Functional dependency in DBMS | Easiest & Simplest way
Lec-20: Introduction to Normalization | Insertion, Deletion & Updation Anomaly
Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
5.0 / 5 (0 votes)