database

46
Database Management 818-201 Information Technology for Hospitality and Tourism by Lerluck Boonlamp 7/08

Upload: srividya

Post on 20-Jul-2016

40 views

Category:

Documents


0 download

DESCRIPTION

Database

TRANSCRIPT

Page 1: Database

Database Management

818-201 Information Technology for

Hospitality and Tourism

byLerluck Boonlamp

7/08

Page 2: Database

2

Overview

1. Database2. Relational Database Basics3. Using Excel as a Database4. Using Microsoft Access

Page 3: Database

3

Why Database?

we have many of Data in organizationwe record many of Data processeswe record many of Data transactionwe need Information to support a decisionwe need a Report at the end of day,

week, month and year

Page 4: Database

4

1. What is Database?

A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. It is designed to meet the information needs and shared among users in an organization

Page 5: Database

5

Examples of database:Guest History List (name, addresses, how long they

stayed, room, etc)

Supplier Information (name, addresses, what they sell, etc.)

Travel Agent Data (name, addresses, # guests they have sent, etc)

Sales Database (product name, supplier detail, customer detail, shipping detail)

Corporate Database (data about management, marketing, materials, manufacturing and accounting)

Page 6: Database

6

Why database is important?

Today organization consider “data”and “information” as one of the most important resources.Support Decision Making

Page 7: Database

7

Data & Information

Data is raw facts about anything. Data is what stored in database.Ex. About people, events

Information is the data that has been processed or transformed so that it is more meaningful for analysis and decision making

Information consists of a set of data which is an answer to a particular question.

Ex. what products sold well in the past week, month or year?

Page 8: Database

8

Changing data to information

Data InformationProcessing

* Your phone number

* The number that you call* Time you start* Time you finish

Telephone Bill

Page 9: Database

9

How is data stored in a database?

In a database, data is mostly stored in the form of table.

Page 10: Database

10

Data Management

There are 2 ways to manage data:1. File systems2. Database systems

HOW

Page 11: Database

11

1) File Systems

Page 12: Database

12

Disadvantages of File Systems

Uncontrolled RedundancyInconsistent DataLimited Data SharingPoor Enforcement of Standard

File Systems

Page 13: Database

13

2) Database Systems

Page 14: Database

14

Database Management System (DBMS)

DBMS is a kind of software that is used to manage a database.

Ex. Microsoft Access, MS Foxpro, Lotus Smart Suite, Oracal Server, IBM DB2, Microsoft SQL Server and MySqlServer.

Database Systems

Page 15: Database

15

Database Management System (DBMS)

Database Systems

Page 16: Database

16

How is a database used?

1. Personal Computer Database2. Central Computer Database3. Client/Server Database or “Two-

Tiered Database”4. Distributed Database

Page 17: Database

17

1) Personal Computer Database

Page 18: Database

18

2) Central Computer Database

Terminal is a computer that has no processing unit. It acts as an interface only.

Page 19: Database

19

3) Client/Server DB or “Two-Tiered DB”

Page 20: Database

20

4) Distributed Database

Page 21: Database

21

Database Personnel (User)

1. Database Administrator2. Database Programmer3. End User

Page 22: Database

22

1) Database Administrator (DBA)

Database Administrator (DBA)The information specialist who is expert

in developing, providing, and securing databaseOversee all database activitiesManagerial skills, high technical skillsMust understand the business

operations of the firm

Page 23: Database

23

2) Database Programmer

Represent a high level of specialization and selection Write code to strip and/or aggregate

data from the database

Page 24: Database

24

3) End User

As important personnel who interact with the database

Generate report and formPost queries to the databaseUse results from their database

inquiries to make decision

Page 25: Database

25

DBMS Advantage

Reduce data redundancyAchieve data independenceRetrieve data and information rapidlyImprove security

Page 26: Database

26

DMBS Disadvantage

Obtain expensive softwareObtain a large hardware

configurationHire and maintain a DBA staff

Page 27: Database

27

2. Relational Database Basic

TableRelationshipPrimary keyForeign keyAnd data integrity

Page 28: Database

28

2.1 Table

In relational database, a relation is looks like a table. Thus, relation and table are the term used interchangeably.

Row is also record. Column is also called field.

Page 29: Database

29

2.2 Primary

In relational database, each record in a table must be unique. That means there must be a field that contains a value that is different from other records. That filed that make records unique

is called a primary key.

Page 30: Database

30

Which field should be defined as the primary key?

Page 31: Database

31

Primary key

Adding an extra field that contains unique value in each record to represent a primary key is a technique that often used to simplify table design when there is no appropriate field (or fields) to use as primary key.

Page 32: Database

32

2.3 Relationship

Data is stored in separated table. Then you define relationships between tables.Relationship can be in 3 forms

One-to-oneOne-to-manyMany-to-many

Page 33: Database

33

One-to-one relationship (1:1)

One-to-one relationship means that one record in the first table has a relationship with only one record in the 2nd table, and vice versa

Page 34: Database

34

One-to-Many Relationship (1:M)

Means that one record in the first table has a relationship with many records in the 2nd

table, and vice versa.

Page 35: Database

35

Many to Many relationship (M:M)

Means that many records in the first table has a relationship with many records in the 2nd table, and vice versa.

Page 36: Database

36

2.4 Foreign Key

A database generally contains more than one table that are related. A relationship is established through a foreign key.

A foreign key is a field that is its value is taken from the value in primary key field in another table.

Page 37: Database

37

Foreign keyBAD table

Page 38: Database

38

Foreign KeyPrimary key

Primary key

Table 1

Table 2

Page 39: Database

39

Foreign KeyPrimary key

Foreign key

Primary key

Page 40: Database

40

2.5 Integrity Rules

Must follows two rules:Entity integrity

The primary key must be unique and must not be null.

Referential IntegrityThe foreign key must be in referenced

table Or be null

Page 41: Database

41

Entity Integrity

Page 42: Database

42

Entity Integrity

Page 43: Database

43

3. Using Excel as Database

As data mostly stored in the form of tables. Excel is often used to store data and do simple “queries” to get information that is needed.

Page 44: Database

44

4. Access

Data TypeType of Number

Page 45: Database

45

Data Type

Page 46: Database

46

Type of Number