• Tidak ada hasil yang ditemukan

Staffsite STMIK PPKIA Pradnya Paramita DD_8_1

N/A
N/A
Protected

Academic year: 2017

Membagikan "Staffsite STMIK PPKIA Pradnya Paramita DD_8_1"

Copied!
16
0
0

Teks penuh

(1)
(2)

Database Design

8-1

(3)

Objectives

This lesson covers the following objectives:

• Identify the need to track data that changes over time

• Construct ERD models that incorporate elements of “data over time”

(4)

Purpose

• How tall were you at age 5? How tall were you at age 10? How tall are you right now?

• If your parents wrote this down when you were young, they were keeping track of historical data.

• Most businesses need to track some historical data.

• This helps them find trends and patterns that are the basis for business innovations or process improvements.

(5)

Model Data Over Time

• When is it necessary to model data over time?

• Ask your client:

– Is an audit trail required?

– Can attribute values change over time?

– Can relationships change over time?

– Do you need to produce reports on older data?

– Do you need to keep previous versions of the data? If so, for

(6)

Data Over Time Example

• An organization needs to keep data about employees’ salaries.

• All employees are paid weekly.

• Initially, the following EMPLOYEE entity was modeled.

• Additional requirements now specify that the organization needs to keep a

historical record of how and when

employees’ salaries have changed during their employment.

EMPLOYEE # id

* first name * last name

(7)

Model Salary Changes

• To model salary changes over time, add a SALARY HISTORY entity.

• The UID of the SALARY HISTORY entity is the related EMPLOYEE id and the salary start date.

for

having

EMPLOYEE # id

* first name * last name SALARY HISTORY

# salary start date o salary end date

(8)

Model Rental Over Time

• A jewelry store rents pieces (necklaces, bracelets and so on) to movie stars for special occasions, such as award

ceremonies or movie premieres.

• They would like to track the rental history of a jewelry piece.

• The following ER model will only track the current renter of a piece of jewelry.

• How would you revise the relationship to track history?

JEWELRY PIECE # code

* description * rental rate * insured value

MOVIE STAR # id

* first name * last name

(9)

Resolve M:M

• The relationship between JEWELRY PIECE and MOVIE STAR should be revised to a M:M, which is then resolved with an intersection entity RENTAL HISTORY.

• Next we need to determine the UID of RENTAL HISTORY.

JEWELRY PIECE # code

* description * rental rate * insured value

MOVIE STAR # id

* first name * last name rented by

renting

The M:M relationship is resolved with an intersection entity.

JEWELRY PIECE # code

* description * rental rate * insured value

MOVIE STAR # id

* first name * last name RENTAL HISTORY

* rental date * date returned

for

on for

(10)

Determine UID

• Option 1: Barred relationship.

• Drawing a Barred relationship is not a suitable UID here, as this would not allow a MOVIE STAR to rent the same JEWELRY PIECE on different dates

JEWELRY PIECE

# Code

* Description * Rental rate * Insured value

RENTAL HISTORY

(11)

Determine UID

• Option 2: Barred

relationship and Rental Date.

• Adding rental date to the UID would allow a MOVIE STAR to rent the same

JEWELRY PIECE on different dates, but would also permit

different MOVIE STARS to rent the same JEWELRY PIECE on the same date!

JEWELRY PIECE

# Code

* Description * Rental rate * Insured value

RENTAL HISTORY

(12)

Determine UID

• Option 3: Barred

relationship between MOVIE STAR and

RENTAL HISTORY with Rental Date.

• This model would not permit the same

MOVIE STAR to rent more than one

JEWELRY PIECE on a given day.

JEWELRY PIECE

# Code

* Description * Rental rate * Insured value

RENTAL HISTORY

(13)

Determine UID

• Option 4: Barred

relationship between JEWELRY PIECE and RENTAL HISTORY with Rental Date.

• This model says that a JEWELRY PIECE can be rented only once on the same date.

JEWELRY PIECE

# Code

* Description * Rental rate * Insured value

RENTAL HISTORY

(14)

Terminology

Key terms used in this lesson included:

• Audit trail

(15)

Summary

In this lesson, you should have learned how to:

• Identify the need to track data that changes over time

• Construct ERD models that incorporate elements of “data over time”

(16)

Referensi

Dokumen terkait

¾ Teknik pengkodean data yang berguna untuk menjaga data / file baik di dalam komputer maupun pada jalur komunikasi dari pemakai yang tidak dikehendaki. ¾ Enkripsi diperlukan

Mahasiswa dapat m en ciptakan pelan ggan n ya sen diri un tuk m em asarkan produk yan g ada.5. Stan dar kom

• An entity relationship diagram (ERD) is a consistent tool that can be used to represent the data requirements of a business regardless of the type of database that is used, and

• Distinguish between using date as an attribute and DAY as an entity in a data model, depending on business requirements. • Solve the problem of keeping characteristics of a date by

– Columns: Each table gets a column for all attributes of the entity it is based on, with the original optionality. • Identifiers: The primary UID of the supertype level

Pada jendela dnsmgmt sebelah kiri klik BEJOAGAIN > Forward Lookup Zones dan pada jendela sebelah kanan klak > New Zone.... Pada tampilan New Zone Wizard pilih

Pada contoh ini saya membuat folder FTPQ di Local Disk C, lalu klik

Task 3 dan 4 dibentuk oleh module transfer file, yang secara detail dalam transfer data dan perintah masing-masing module transfer fite menumpang pada module service