Lecture1 PDF
Lecture1 PDF
Information Technology
for
Hospitality and Tourism
Overview
1. Database
2. Relational Database Basics
2
Why Database?
we have many of Data in organization
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)
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
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
19
4) Distributed Database
20
Database Personnel (User)
1. Database Administrator
2. Database Programmer
3. End User
21
1) Database Administrator (DBA)
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
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
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.
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