SlideShare a Scribd company logo
1 of 20
Perancangan Tabel
Database dengan
menggunakan Entity
Relationship Diagram




             Oleh : P. Hendradi, M.Kom
                      @ 2004
Introduction
 Perkembangan IT, CBIS dan Programming
 Pemrograman Terstruktur VS Object
 Oriented Programmning
 Database dalam Programming
Database VS Table
 Database : Kumpulan data tentang suatu
 benda atau kejadian yang saling
 berhubungan satu sama lain.
 Data : kumpulan fakta yang mewakili suatu
 objek (manusia, benda, keadaan dll.)
 Pengelola Database : DBMS
 Gabungan DBMS dan Database dlm
 program disebut dengan Sistem Basis Data.

   Sumber : Sistem Basis Data – Waljianto
Database VS Table (lanjutan)
 Dalam Aplikasi, Database = Sekumpulan
 tabel.
 Tabel terdiri dari beberapa field
 Field muncul dari suatu objek=Attribut




Sumber : Pemrograman basis data dengan Vfoxpro – Abdul Kadir
Kunci dalam attribut
  Pendekatan Gramatikal : Satu atau satu set attribut
  minimal yang dapat mewakili suatu kejadian
  secara uniq.
      Kunci Kandidat=Semua yang mungkin
      Kunci Utama=Yang dipilih
      Kunci Alternatif=Selain yang utama
      Kunci Tamu=Relasi ke tabel induk
  Kunci Alternatif = Kunci kandidat – kunci Utama


Sumber : Perancangan database – Haryanto Kristanto
Contoh kasus data pegawai
data         Kunci kandidat      Kunci utama Kunci alternatif
No ktp       No ktp              No Peg       No ktp
No SIM       No SIM                           No SIM
No Peg       No Peg
Nama         Nama+Alamat                      Nama+Alamat
Alamat       Nama + Tempat tgl                Nama + Tempat tgl
             lahir                            lahir
Tempat tgl
lahir
Jkelamin
Pendidikan
Dekomposisi Tabel(Hilang-lossy)
                              Ricky yang
    Kd_Sopir      Nama            lain
                                         Kd_Mobil    Nama_Mbl
    SP1001        Suprianto    (kebetulanMB0001      L-300A
                              nama sama)
    SP2021        Fred Da Costa        MB0002        Mazda
    SP1002        Ricky                MB0003        KIA

    SP2001        Ricky                MB0004        L-300B


Kd_Sopir     Nama                    Kd_Mobil       Nama_Mbl    Nama
SP1001       Suprianto               MB0001         L-300A      Suprianto
SP2021       Fred Da Costa           MB0002         Mazda       Fred Da Costa
SP1002       Ricky                   MB0003         KIA         Ricky

SP2001       Ricky                   MB0004         L-300B      Ricky
Dekomposisi Tabel(TakHilang-Lossless)
                               Ricky yang
     Kd_Sopir      Nama            lain
                                          Kd_Mobil   Nama_Mbl
     SP1001        Suprianto    (kebetulanMB0001     L-300A
                               nama sama)
     SP2021        Fred Da Costa        MB0002       Mazda
     SP1002        Ricky                MB0003       KIA

     SP2001        Ricky                MB0004       L-300B


Kd_Sopir   Nama                        Kd_Mobil      Nama_Mbl   Kd_Sopir
SP1001     Suprianto                   MB0001        L-300A     SP1001
SP2021     Fred Da Costa               MB0002        Mazda      SP2021
SP1002     Ricky                       MB0003        KIA        SP1002

SP2001     Ricky                       MB004         L-300B     SP2001
latihan
     Kd_MK           Nm_MK        SKS            Kd_dsn          Nm_dosen




No.nota   Tgl_nota   Kd    Nm    Hrg   Qty   jumlah   Total   diskon   bayar
                     Brg   brg   sat
No.nota   Tgl_nota   Qty   jumlah   Total    diskon   bayar




                            Kd      Nm      Hrg
                            Brg     brg     sat
Entity Relationship Diagram
 Symbol :
 Membuat : dengan real word
 Susunan : Subjek – Predikat – Objek
 Derajat Hubungan : 1-1, 1-M, N-M
 Partisipasi Hubungan :Wajib dan Tidak
 Wajib
Representasi Tabel Entity
 Hubungan 1 : 1 (wajib kedua sisi)
              1                         1
  SOPIR                     R1                  MOBIL


 Kd_Sopir   Nama             Kd_Mobil   Nama_Mbl
 SP1001     Suprianto        MB0001     L-300
 SP2021     Fred Da Costa    MB0002     Mazda
 SP1002     Ricky            MB0003     KIA
Representasi Tabel Entity
 Hubungan 1 : 1 (tidak wajib pada satu sisi)
              1                             1
  SOPIR                     R1                        MOBIL




 Kd_Sopir   Nama                 Kd_Mobil       Nama_Mbl      Kd_Sopir
 SP1001     Suprianto            MB0001         L-300         SP1001
 SP2021     Fred Da Costa        MB0002         Mazda         SP2021
 SP1002     Ricky                MB0003         KIA           SP1002

 SP2201     Hendrik
Representasi Tabel Entity
         Hubungan 1 : 1 (tidak wajib kedua sisi)
                        1                         1
           SOPIR                 R1                    MOBIL


Kd_Sopir    Nama            Kd_Mobil   Nama_Mbl

SP1001      Suprianto       MB0001     L-300A

SP2021      Fred Da Costa   MB0002     Mazda          Kd_Mobil   Kd_Sopir
SP1002      Ricky           MB0003     KIA            MB0001     SP1001
SP2201      Dayat           MB004      L-300B         MB0002     SP2021
                            MB005      L-300C
                                                      MB0005     SP2201
Representasi Tabel Entity
 Hubungan 1 : M (wajib kedua sisi)                               Kunci
                                                               tamu (hrs
                                                                  dari
                                                               derajat 1)
              1                               M
  SOPIR                     R1                         MOBIL


 Kd_Sopir   Nama                 Kd_Mobil     Nama_Mbl     Kd_Sopir
 SP1001     Suprianto            MB0001       L-300A       SP1001
 SP2021     Fred Da Costa        MB0002       Mazda        SP2021
 SP1002     Ricky                MB0003       KIA          SP1002

                                 MB0004       L-300B       SP1001



                                   Lebih
                                  dari satu
Representasi Tabel Entity
     Hubungan 1 : M (tidak wajib sisi M)
                          1                         M
         SOPIR                     R1                       MOBIL


Kd_Sopir      Nama            Kd_Mobil   Nama_Mbl
                                                        Kd_Sopir    Kd_Mobil
SP1001        Suprianto       MB0001     L-300A
                                                        SP1001      MB0001
SP2021        Fred Da Costa   MB0002     Mazda
                                                        SP2021      MB0002
SP1002        Ricky           MB0003     KIA
                                                        SP1002      MB0004
                              MB0004     L-300B


  Ada mobil
     tak
   bersopir
Partisipasi
                                                                   tidak
                                                                berpengaruh

  Representasi Tabel Entity
     Hubungan N : M
                       N                         M
         SOPIR                  R1                       MOBIL


Kd_Sopir   Nama            Kd_Mobil   Nama_Mbl       Kd_Sopir    Kd_Mobil
SP1001     Suprianto       MB0001     L-300A         SP1001      MB0001
SP2021     Fred Da Costa   MB0002     Mazda
                                                     SP2021      MB0002
SP1002     Ricky           MB0003     KIA
                                                     SP1002      MB0004
                           MB0004     L-300B
                                                     SP2021      MB0004
                                                     SP1002      MB0003
ERD dalam sistem administrasi
akademik
  Studi kasus :

Mhs          ambil          Mkul     diampu   dosen


•Jelaskan hubungan antar entitynya
•Jelaskan tingkat partisipasinya
•Buatlah tabel yang dihasilkannya
RESUME
Representasi hubungan Entity
mempengaruhi produksi tabel
Partisipasi hubungan tidak berlaku untuk
tipe hubungan N:M (many to many)
Pustaka
---,Pengantar Basis Data, Gunadarma, Jakarta, 1990
Abdul Kadir, Pemrograman Basis data dengan Vfoxpro,
Andi Offset, Pemrograman Basis data dengan Vfoxpro, Andi
Offset, Yogyakarta, 2002
Fatansyah, Ir., Basis Data, Informatika, Bandung, 2001
Hariyanto Kristanto, Perancangan system database, 1999
Waljianto, Sistem Basis Data, JJ Learning,Yogyakarta, 2000

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Perancangan tabel database dengan menggunakan entity relationship diagram

  • 1. Perancangan Tabel Database dengan menggunakan Entity Relationship Diagram Oleh : P. Hendradi, M.Kom @ 2004
  • 2. Introduction Perkembangan IT, CBIS dan Programming Pemrograman Terstruktur VS Object Oriented Programmning Database dalam Programming
  • 3. Database VS Table Database : Kumpulan data tentang suatu benda atau kejadian yang saling berhubungan satu sama lain. Data : kumpulan fakta yang mewakili suatu objek (manusia, benda, keadaan dll.) Pengelola Database : DBMS Gabungan DBMS dan Database dlm program disebut dengan Sistem Basis Data. Sumber : Sistem Basis Data – Waljianto
  • 4. Database VS Table (lanjutan) Dalam Aplikasi, Database = Sekumpulan tabel. Tabel terdiri dari beberapa field Field muncul dari suatu objek=Attribut Sumber : Pemrograman basis data dengan Vfoxpro – Abdul Kadir
  • 5. Kunci dalam attribut Pendekatan Gramatikal : Satu atau satu set attribut minimal yang dapat mewakili suatu kejadian secara uniq. Kunci Kandidat=Semua yang mungkin Kunci Utama=Yang dipilih Kunci Alternatif=Selain yang utama Kunci Tamu=Relasi ke tabel induk Kunci Alternatif = Kunci kandidat – kunci Utama Sumber : Perancangan database – Haryanto Kristanto
  • 6. Contoh kasus data pegawai data Kunci kandidat Kunci utama Kunci alternatif No ktp No ktp No Peg No ktp No SIM No SIM No SIM No Peg No Peg Nama Nama+Alamat Nama+Alamat Alamat Nama + Tempat tgl Nama + Tempat tgl lahir lahir Tempat tgl lahir Jkelamin Pendidikan
  • 7. Dekomposisi Tabel(Hilang-lossy) Ricky yang Kd_Sopir Nama lain Kd_Mobil Nama_Mbl SP1001 Suprianto (kebetulanMB0001 L-300A nama sama) SP2021 Fred Da Costa MB0002 Mazda SP1002 Ricky MB0003 KIA SP2001 Ricky MB0004 L-300B Kd_Sopir Nama Kd_Mobil Nama_Mbl Nama SP1001 Suprianto MB0001 L-300A Suprianto SP2021 Fred Da Costa MB0002 Mazda Fred Da Costa SP1002 Ricky MB0003 KIA Ricky SP2001 Ricky MB0004 L-300B Ricky
  • 8. Dekomposisi Tabel(TakHilang-Lossless) Ricky yang Kd_Sopir Nama lain Kd_Mobil Nama_Mbl SP1001 Suprianto (kebetulanMB0001 L-300A nama sama) SP2021 Fred Da Costa MB0002 Mazda SP1002 Ricky MB0003 KIA SP2001 Ricky MB0004 L-300B Kd_Sopir Nama Kd_Mobil Nama_Mbl Kd_Sopir SP1001 Suprianto MB0001 L-300A SP1001 SP2021 Fred Da Costa MB0002 Mazda SP2021 SP1002 Ricky MB0003 KIA SP1002 SP2001 Ricky MB004 L-300B SP2001
  • 9. latihan Kd_MK Nm_MK SKS Kd_dsn Nm_dosen No.nota Tgl_nota Kd Nm Hrg Qty jumlah Total diskon bayar Brg brg sat
  • 10. No.nota Tgl_nota Qty jumlah Total diskon bayar Kd Nm Hrg Brg brg sat
  • 11. Entity Relationship Diagram Symbol : Membuat : dengan real word Susunan : Subjek – Predikat – Objek Derajat Hubungan : 1-1, 1-M, N-M Partisipasi Hubungan :Wajib dan Tidak Wajib
  • 12. Representasi Tabel Entity Hubungan 1 : 1 (wajib kedua sisi) 1 1 SOPIR R1 MOBIL Kd_Sopir Nama Kd_Mobil Nama_Mbl SP1001 Suprianto MB0001 L-300 SP2021 Fred Da Costa MB0002 Mazda SP1002 Ricky MB0003 KIA
  • 13. Representasi Tabel Entity Hubungan 1 : 1 (tidak wajib pada satu sisi) 1 1 SOPIR R1 MOBIL Kd_Sopir Nama Kd_Mobil Nama_Mbl Kd_Sopir SP1001 Suprianto MB0001 L-300 SP1001 SP2021 Fred Da Costa MB0002 Mazda SP2021 SP1002 Ricky MB0003 KIA SP1002 SP2201 Hendrik
  • 14. Representasi Tabel Entity Hubungan 1 : 1 (tidak wajib kedua sisi) 1 1 SOPIR R1 MOBIL Kd_Sopir Nama Kd_Mobil Nama_Mbl SP1001 Suprianto MB0001 L-300A SP2021 Fred Da Costa MB0002 Mazda Kd_Mobil Kd_Sopir SP1002 Ricky MB0003 KIA MB0001 SP1001 SP2201 Dayat MB004 L-300B MB0002 SP2021 MB005 L-300C MB0005 SP2201
  • 15. Representasi Tabel Entity Hubungan 1 : M (wajib kedua sisi) Kunci tamu (hrs dari derajat 1) 1 M SOPIR R1 MOBIL Kd_Sopir Nama Kd_Mobil Nama_Mbl Kd_Sopir SP1001 Suprianto MB0001 L-300A SP1001 SP2021 Fred Da Costa MB0002 Mazda SP2021 SP1002 Ricky MB0003 KIA SP1002 MB0004 L-300B SP1001 Lebih dari satu
  • 16. Representasi Tabel Entity Hubungan 1 : M (tidak wajib sisi M) 1 M SOPIR R1 MOBIL Kd_Sopir Nama Kd_Mobil Nama_Mbl Kd_Sopir Kd_Mobil SP1001 Suprianto MB0001 L-300A SP1001 MB0001 SP2021 Fred Da Costa MB0002 Mazda SP2021 MB0002 SP1002 Ricky MB0003 KIA SP1002 MB0004 MB0004 L-300B Ada mobil tak bersopir
  • 17. Partisipasi tidak berpengaruh Representasi Tabel Entity Hubungan N : M N M SOPIR R1 MOBIL Kd_Sopir Nama Kd_Mobil Nama_Mbl Kd_Sopir Kd_Mobil SP1001 Suprianto MB0001 L-300A SP1001 MB0001 SP2021 Fred Da Costa MB0002 Mazda SP2021 MB0002 SP1002 Ricky MB0003 KIA SP1002 MB0004 MB0004 L-300B SP2021 MB0004 SP1002 MB0003
  • 18. ERD dalam sistem administrasi akademik Studi kasus : Mhs ambil Mkul diampu dosen •Jelaskan hubungan antar entitynya •Jelaskan tingkat partisipasinya •Buatlah tabel yang dihasilkannya
  • 19. RESUME Representasi hubungan Entity mempengaruhi produksi tabel Partisipasi hubungan tidak berlaku untuk tipe hubungan N:M (many to many)
  • 20. Pustaka ---,Pengantar Basis Data, Gunadarma, Jakarta, 1990 Abdul Kadir, Pemrograman Basis data dengan Vfoxpro, Andi Offset, Pemrograman Basis data dengan Vfoxpro, Andi Offset, Yogyakarta, 2002 Fatansyah, Ir., Basis Data, Informatika, Bandung, 2001 Hariyanto Kristanto, Perancangan system database, 1999 Waljianto, Sistem Basis Data, JJ Learning,Yogyakarta, 2000