Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Database Management

Information Technology
for
Hospitality and Tourism
Overview
1. Database
2. Relational Database Basics

2
Why Database?
™ we have many of Data in organization

™ we need Information to support a decision


™ we need a Report at the end of day,
week, month and year

3
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

4
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)
5
Why database is important?
™ Today organization consider “data”
and “information” as one of the most
important resources.
™ Support Decision Making

6
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?

7
Changing data to information

Data Processing Information

* Your phone number


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

8
How is data stored in a
database?
™In a database, data is mostly stored in the
form of table.

9
HOW
Data Management
™ There are 2 ways to manage data:
1. File systems
2. Database systems

10
1) File Systems

11
Disadvantages of File Systems
™Uncontrolled Redundancy
™Inconsistent Data
™Limited Data Sharing
™Poor Enforcement of Standard

File Systems
12
2) Database Systems

13
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 MySql
Server.

Database Systems
14
Database Management System
(DBMS)

Database Systems
15
How is a database used?
1. Personal Computer Database
2. Central Computer Database
3. Client/Server Database or “Two-
Tiered Database”
4. Distributed Database

16
1) Personal Computer Database

17
2) Central Computer Database

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


interface only. 18
3) Client/Server DB or “Two-
Tiered DB”

19
4) Distributed Database

20
Database Personnel (User)
1. Database Administrator
2. Database Programmer
3. End User

21
1) Database Administrator (DBA)

™ Database Administrator (DBA)


™ The information specialist who is expert
in developing, providing, and securing
database
™ Oversee all database activities
™ Managerial skills, high technical skills
™ Must understand the business
operations of the firm

22
2) Database Programmer
™ Represent a high level of
specialization and selection
™ Write code to strip and/or aggregate
data from the database

23
3) End User
™ As important personnel who interact
with the database
™ Generate report and form
™ Post queries to the database
™ Use results from their database
inquiries to make decision

24
DBMS Advantage
™ Reduce data redundancy

™ Retrieve data and information rapidly


™ Improve security

25
DMBS Disadvantage
™ Obtain expensive software
™ Obtain a large hardware
configuration
™ Hire and maintain a DBA staff

26
2. Relational Database Basic
™ Table
™ Relationship
™ Primary key
™ Foreign key
™ And data integrity

27
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.

28
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.

29
Which field should be defined
as the primary key?

30
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. 31
2.3 Relationship
™ Data is stored in separated table.
Then you define relationships
between tables.
™ Relationship can be in 3 forms
™ One-to-one
™ One-to-many
™ Many-to-many

32
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

33
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.

34
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.

35
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.

36
Foreign key
BAD table

37
Primary key

Foreign Key

e 1
bl
Ta

Table
2
Primary key

38
Primary key
Foreign Key

Foreign key

Primary key

39
2.5 Integrity Rules
™ Must follows two rules:
™ Entity integrity
™ The primary key must be unique
™ and must not be null.
™ Referential Integrity
™ The foreign key must be in referenced
table
™ Or be null

40
Entity Integrity

41
Entity Integrity

42

You might also like