Sistem Basis Data

advertisement
Sistem Basis Data
Pertemuan 2 : Pemodelan Data & Pemilihan Tipe Data
Andronicus Riyono, M.T.
Enterprise Data Model
• The first step in database development, in
which the scope and general contents
of organizational databases are specified.
• Preliminary Data Model
Entity-Relationship
Model Constructs
• Basic Symbols
• Entity
• Attribute
• Relationship
• Relationship degree
• Relationship cardinality
Basic Symbols
Derived Attribute
Contoh 1
Derived Attribute
Contoh II
Derived Attribute
Contoh II
Associative Entity
Relationship degree
Relationship Cardinality
Entity
• Entity: A person, place, object, event, or
concept in the user environment about which
the organization wishes to maintain data.
• Orang: Pegawai, Mahasiswa, Pasien
• Tempat: Toko, Gudang, Provinsi
• Obyek: Mesin, Gedung, Mobil
• Event: Penjualan, Pendaftaran, Perpanjangan
• Konsep: Matakuliah, Pekerjaan
Entity vs Entity Instance
• Entity type: A collection of entities that share
common properties or characteristics.
• Entity instance: A single occurrence of an
entity type.
• satu macam entity Pelatihan banyak
instances (Pelatihan PHP, Pelatihan Oracle,
Pelatihan Web Design, Pelatihan MS Office)
Entity vs
Input/Output/User
Entity vs
Input/Output/User
Entity = hanya yang perlu dicatat datanya saja
Entity Naming
Guidelines
• Kata Benda Tunggal (MAHASISWA,
PEGAWAI, MOBIL, EMPLOYEE)
• Spesifik (CUSTOMER or CLIENT)
• Singkat (REGISTRATION vs STUDENT
REGISTRATION FOR CLASS)
• Konsisten di seluruh E-R Diagram
Memilih Tipe Data
• Hemat Media Penyimpanan
• Mampu Mewakili Semua Nilai yang
Diperlukan
• Menjaga/Memperbaiki Kualitas Data
• Mendukung dan Memudahkan Semua
Manipulasi Data yang Diperlukan
MySQL 5
Numeric Data Types
• TINYINT
• SMALLINT
• MEDIUMINT
• INT
• BIGINT
Menyimpan Kode
• Mencatat Teks vs. Tabel Referensi
• Meminimalkan Kesalahan Pengetikan
• Memudahkan Update
Download