• Tidak ada hasil yang ditemukan

Staffsite STMIK PPKIA Pradnya Paramita DD_2_2

N/A
N/A
Protected

Academic year: 2017

Membagikan "Staffsite STMIK PPKIA Pradnya Paramita DD_2_2"

Copied!
24
0
0

Teks penuh

(1)
(2)

Database Design

2-2

(3)

Objectives

This lesson covers the following objectives:

• Define and give an example of an entity

• Distinguish between an entity and an instance of an entity

• Name and describe attributes for a given entity

• Distinguish between an attribute and its value

• Distinguish between mandatory and optional attributes, and between volatile and nonvolatile attributes

(4)

Purpose of Entities

• Knowing how to organize and classify data makes it possible to draw useful conclusions about seemingly random facts.

• Our technology-rich world produces vast quantities of facts in need of structure and order.

• It is important to learn about entities because they are the things about which we store data.

• For example:

(5)

Purpose of Attributes

• It is important to learn about attributes because they provide more specific information about an entity.

• Attributes help you distinguish between one instance and another by providing greater detail for the entity.

• For example:

– In a restaurant, you need to list the individual items on a customer’s order so that you can calculate the bill.

– When building several sales reports, you must be able to identify a specific report from the list of reports.

(6)

Purpose Unique Identifiers

• What about unique identifiers? It is important to learn about unique identifiers because they distinguish one instance of an entity from another.

• For example:

– In a classroom, you need to distinguish between one student and another.

– When classifying your CD collection, you need to distinguish between one CD and another.

(7)

Identifying Purpose

• Look at the magazine advertisements and the Internet sites identified by the teacher.

(8)

Entity Defined

An entity is:

• “Something” of significance to the business about which data must be known

• A name for a set of similar things that you can list

• Usually a noun

• Examples: objects, events, people

• Entities have instances.

(9)

Entities and Instances

Entities Instances

PERSON Mahatma Gandhi, George Washington

PRODUCT Nike Air Jordan, Gibson Les Paul Custom

PRODUCT TYPE Shoe, Video Game

JOB Electrician, IT Technician

SKILL LEVEL Beginner, Expert

CONCERT U2 at the Palladium, Beyoncé at the Greek Theatre L.A.

ANIMAL Dog, Cat

(10)

Entities and Instances

• A Dalmatian, a Siamese cat, a cow and a pig are instances of ANIMAL

• A convertible, a sedan and a station wagon are instances of CAR

• Some entities have many instances and some have only a few

• Entities can be:

– Tangible, like PERSON or PRODUCT

– Intangible, like SKILL LEVEL

(11)

Entities and Instances

• Is DOG an instance or an entity?

• It depends:

– If we consider many different kinds of animals, it makes sense to think of the entity ANIMAL to include instances DOG, CAT, HORSE and so on.

– But what if we run a dog-breeding business? We will need to keep data on many different breeds of dog, but not on other species of animal.

(12)

What is an Attribute?

• Like an entity, an attribute represents something of significance to the business.

• An attribute is a specific piece of information that helps:

– Describe an entity

– Quantify an entity

– Qualify an entity

– Classify an entity

– Specify an entity

(13)

Attributes

• Attributes have values. An attribute value can be a number, a character string, a date, an image, a sound, etc.

• These are called "data types" or "formats." Every attribute stores one piece of data of one specific data type.

Entities Attributes

CUSTOMER family name, age, shoe size, town of

residence, email

CAR model, weight, catalog price

ORDER order date, ship date

JOB title, description

TRANSACTION amount, transaction date

(14)

Attributes

• What is the data type of each attribute in CUSTOMER?

• For example: family name is a character string. Attributes are single-valued. Each attribute can have only one value (at any point in time) for each instance of the entity.

Entities Attributes

CUSTOMER family name, age, shoe size, town of

residence, email

CAR model, weight, catalog price

ORDER order date, ship date

JOB title, description

(15)

Attributes

• Some attributes (such as age) have values that constantly change.

• These are called volatile attributes.

• Other attributes (such as order date) will rarely change, if ever.

• These are nonvolatile attributes.

• If given a choice, select the nonvolatile attribute.

(16)

Attributes

• Some attributes must contain a value—these are mandatory attributes.

• For example: in most businesses that track personal information, name is required.

• Other attributes may either contain a value or be left null— these are optional attributes.

• For example: cell phone number is often optional except in mobile or wireless applications.

(17)

Attributes

(18)

Attributes

• If we were to model a Human Resource system, we would have an entity to store data for each worker called

EMPLOYEE.

• What attributes does EMPLOYEE have?

(19)

Identifiers

• An EMPLOYEE has a unique identifier (UID).

• A UID is either a single attribute or a combination of multiple attributes that distinguishes one employee from another.

• How do you find a specific employee that works for the company?

(20)

Identifiers

• Think about all the students in the classroom.

• Each student is described by several traits or attributes.

• Which attribute or attributes allow you to pick a single student from the rest of the class?

(21)

Terminology

Key terms used in this lesson included:

• Attribute

• Data type

• Entity

• Instance

• Mandatory

(22)

Terminology

Key terms used in this lesson included:

• Null

• Optional

• Single valued

• Tangible

• Unique identifier (UID)

(23)

Summary

In this lesson, you should have learned how to:

• Define and give an example of an entity

• Distinguish between an entity and an instance of an entity

• Name and describe attributes for a given entity

• Distinguish between an attribute and its value

• Distinguish between mandatory and optional attributes, and between volatile and nonvolatile attributes

(24)

Referensi

Dokumen terkait

reserved for describing how an entire script file works or to comment out an entire block of script.. jQuery and Third-Party

Uses JavaScript to pass data in the form of text strings between a client and server. • HTML =

Entity Relationship Diagram Komponen ERD Entit as Relations hip Kardinali tas Kata benda abstrak ataupun riil Mobil Pangka t Pegaw ai Gaji Hubungan antar Entitas menurut

constraint yang mernerangkan bahwa subclass-subclass dari spesialisasi tidak saling disjoint, artinya entity mungkin anggota lebih dari satu subclass. disjoint, artinya entity

Proseware, Inc. requires you to implement a 20-computer LAN. Fifteen of these computers will be Windows 7 clients, and five will be Windows Server 2008 computers. The company

process, translates the information modeled on the entity relationship diagram to a table instance chart.. Database

• 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

• Solve the business requirement of tracking changes in price or values by constructing a model that uses a historical entity.. • Describe the meaning