7/30/2019 Bab 3 Memodelkan Data Base
1/43
Introduction to Databases
Bab 3:
Memodelkan Data
7/30/2019 Bab 3 Memodelkan Data Base
2/43
Desain Database
Tiga bagian proses: Conceptual design: Identifikasi kebutuhan
stakeholder dan persyaratan data,
Logical design:Mengidentifikasi jenis aplikasi
database yang diperlukan; pemodelan data (mengidentifikasi entitas, atribut, hubungan)
Physical design: Implementasi; desain hardwaresecara fisik dan platform; instalasi dan konfigurasiserver dan pembuatan database
7/30/2019 Bab 3 Memodelkan Data Base
3/43
Desain Database
7/30/2019 Bab 3 Memodelkan Data Base
4/43
Jenis Database
Transactional Mendukung transaksi bisnis
contoh, sales, Online TransactionProcessing (OLTP)
Lingkungan client/server sederhana
Concerns : Concurrency, throughput
7/30/2019 Bab 3 Memodelkan Data Base
5/43
Database Types
Decision support system (DSS) Mendukung Keputusan Bisnis
Types: Data warehouses, reporting databases, datamarts
Tujuan Utama:Pemanggilan dan Evaluasi Data
Bulk loading used to add data
Concerns: Access speeds, throughput
Hybrid
Mixture of transactional and DSS types
7/30/2019 Bab 3 Memodelkan Data Base
6/43
Modeling Goals
Design with understanding that:
All applications written for database aredependent on database structure
If database is altered, applications may needto be altered or rewritten
Support business objectives
Simple, easy-to-read, easy-to-
comprehend structure Scalability
7/30/2019 Bab 3 Memodelkan Data Base
7/43
Business Rules
Business rules: Processes and flows used in organizations daily
work, including:
Organizational policies
Calculations and formulas
Rules and regulations
Database systems should supportbusiness rules
Some rules may be better enforced by databasedesign
Others may be better handled through databaseapplication
7/30/2019 Bab 3 Memodelkan Data Base
8/43
Entity-Relationship (E-R) Modeling
Entities: Things to track in database
Physical objects (people or products)
Conceptual entities (loan balances orinterest rates)
7/30/2019 Bab 3 Memodelkan Data Base
9/43
Entity-Relationship (E-R) Modeling
Attributes:
Information tracked about entity
Each entity has attributes
For example: Entity: Employees
Attributes: Hire Date, Pay Rate, Social Security ID,Employee Number, Home Address
One attribute used as unique identifier or
primary key
7/30/2019 Bab 3 Memodelkan Data Base
10/43
Entity-Relationship (E-R) Modeling
Relationships: When one entity references information from
another entity
For example:
Time Card entity must reference an Employeeentity
Time Card entity is referencing entity
Employee entity is referenced entity
Primary keys ensure referential integrity
7/30/2019 Bab 3 Memodelkan Data Base
11/43
Entity-Relationship (E-R) Modeling
7/30/2019 Bab 3 Memodelkan Data Base
12/43
Basic Database Objects
Tables: Store unique instances of entity Columns (fields) represent attributes
Rows (records) represent individual occurrences ofthat entity
Views: Customized representations of table information
7/30/2019 Bab 3 Memodelkan Data Base
13/43
Basic Database Objects
7/30/2019 Bab 3 Memodelkan Data Base
14/43
Basic Database Objects
Index: Organizes and sorts data
Provides pointer to specific physical location
of data on storage media May be:
Primary or secondary
Clustered or nonclustered
Balanced-tree index (b-tree, or binary treeindex):
Most common type of index in modern databases
7/30/2019 Bab 3 Memodelkan Data Base
15/43
B-Tree Index
7/30/2019 Bab 3 Memodelkan Data Base
16/43
Relationship Types
Three basic types:
Binary relationship:
Relationship between two types of entities
Unary relationship: Relationship with another occurrence
within same entity
Ternary relationship:
Relationship directly involving three entitytypes
7/30/2019 Bab 3 Memodelkan Data Base
17/43
Relationship Types
Cardinality:
Sets maximum number of entities inrelationship
One-to-one
One-to-many
Many-to-many
Modality:
Sets minimum number of entities inrelationship
7/30/2019 Bab 3 Memodelkan Data Base
18/43
Binary Relationships
Simplest type of relationship
Majority of relationships in most relationaldatabases are binary relationships
Entity can have separate binaryrelationships with any number of otherentities in database
7/30/2019 Bab 3 Memodelkan Data Base
19/43
Binary Relationships
7/30/2019 Bab 3 Memodelkan Data Base
20/43
Binary Relationships
7/30/2019 Bab 3 Memodelkan Data Base
21/43
Binary Relationships
7/30/2019 Bab 3 Memodelkan Data Base
22/43
Unary Relationships
Occurrences of an entity type areassociated with other occurrences ofsame entity type
Relate data in a table to itself For example:
Entity (table) Salesperson
One salesperson may act as a backup or
stand-in for another
7/30/2019 Bab 3 Memodelkan Data Base
23/43
Unary Relationships
7/30/2019 Bab 3 Memodelkan Data Base
24/43
Unary Relationships
7/30/2019 Bab 3 Memodelkan Data Base
25/43
Unary Relationships
7/30/2019 Bab 3 Memodelkan Data Base
26/43
Ternary Relationships
Involve three different entities
Can be considered sets of binaryrelationships
7/30/2019 Bab 3 Memodelkan Data Base
27/43
Ternary Relationships
7/30/2019 Bab 3 Memodelkan Data Base
28/43
Many-to-Many Relationships
Help minimize wasted space and optimizeperformance
Intersection data:
Data that is part of many-to-many relationshipand associated with specific, unique instanceof related entities
Associative entities:
Entity designed to associate key values fromtwo entities in many-to-many relationship
7/30/2019 Bab 3 Memodelkan Data Base
29/43
Many-to-Many Relationships
7/30/2019 Bab 3 Memodelkan Data Base
30/43
Associative Entities
7/30/2019 Bab 3 Memodelkan Data Base
31/43
Creating Data Models
To create data model: Identify entities
Identify attributes for each entity
Identify associations between entities
Modeling tools include: Manual (pencil and paper)
Generic draw program (e.g. Visio)
Custom modeling program
7/30/2019 Bab 3 Memodelkan Data Base
32/43
Visio Database Diagrams
7/30/2019 Bab 3 Memodelkan Data Base
33/43
Example: General Hardware Company
Wholesaler and distributor of variousmanufacturers tools and other hardwareproducts
Customers: Hardware and home improvement stores,
which in turn sell products at retail to individualconsumers
Acts as middleman: Buys goods from manufacturers and sells to
retail stores
7/30/2019 Bab 3 Memodelkan Data Base
34/43
Example: General Hardware Company
7/30/2019 Bab 3 Memodelkan Data Base
35/43
Example: General Hardware Company
7/30/2019 Bab 3 Memodelkan Data Base
36/43
Contoh: Good Reading Bookstores
Chain of bookstores
Needs to track data for: Books
Publishers Authors
Customers
7/30/2019 Bab 3 Memodelkan Data Base
37/43
Contoh: Good Reading Bookstores
7/30/2019 Bab 3 Memodelkan Data Base
38/43
Proses Desain Database: Conceptual, logicaldan design
Jenis-jenis database: Transactional, decisionsupport (DSS) dan hybrid
Tujuan Modeling Data: membuat modeldatabase yang strukturnya baik yang sederhana,mudah untuk dibaca dan dipahami serta terukur
Obyek Database: Tabel dan indeks
Tabel: Mendeskripsikan entiti; yang terdiri darikolom (field) dan baris (record), dengan primarykey digunakan sebagai identitas unik dari suaturecord
Ringkasan
7/30/2019 Bab 3 Memodelkan Data Base
39/43
Komponen yang menjadi kunci dari suatuDatabase relasional adalah: Entiti danrelationship
Relationships mungkin berupa binary, unary,
atau ternary, dan memiliki kardinalitas danmodalitas yang berbeda
Relasionship Many-to-many mendukungpersimpangan data dan asosiasi entiti
dalam membuat model data, tahapnya yaitu1. mengidentifikasi entiti,
2. mengidentifikasi atributnya, selanjutnya
3. mengidentifikasi hubungan antar entiti
Ringkasan
7/30/2019 Bab 3 Memodelkan Data Base
40/43
Kata Kunci
Associative entity
Balanced tree index
Base object
Binary relationship
Binary tree index
B-tree index
Bulk loading
Business rules Cardinality
Clustered index
Conceptual design
Concurrency
Database object
Data diagram
Data mart
Data model
Data warehouse Decision support
system (DSS)
7/30/2019 Bab 3 Memodelkan Data Base
41/43
Kata Kunci
Entity-Relationshipdiagram (ERD)
Entity-Relationship(E-R) modeling
Field
Hybrid database
Identifier
Index
Intersection data
Large object (LOB)data
Leaf node
Logical design
Many-to-many (M-M)binary relationship
Modality
Node
Nonclustered index
Object-relation model(ORM)
One-to-many (1-M)binary relationship
7/30/2019 Bab 3 Memodelkan Data Base
42/43
Kata Kunci
One-to-one (1-1)binary relationship
Online transactionprocessing (OLTP)
Physical design
Primary index
Primary key Record
Referenced entity
Referencing entity
Referential integrity
Reporting database
Scalable
Secondary index
Stakeholder
Ternary relationship
Transactionaldatabase
Throughput
Unary relationship
7/30/2019 Bab 3 Memodelkan Data Base
43/43
Copyright Notice
Copyright 2008 John Wiley & Sons, Inc.All rights reserved. Reproduction or translation ofthis work beyond that permitted in section 117 of the1976 United States Copyright Act without express
permission of the copyright owner is unlawful.Requests for further information should beaddressed to the Permissions Department, JohnWiley & Sons, Inc. The purchaser may make back-up copies for his/her own use only and not for
distribution or resale. The Publisher assumes noresponsibility for errors, omissions, or damagescaused by the use of these programs or from the
use of the information herein.