database
DESCRIPTION
DatabaseTRANSCRIPT
![Page 1: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/1.jpg)
Database Management
818-201 Information Technology for
Hospitality and Tourism
byLerluck Boonlamp
7/08
![Page 2: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/2.jpg)
2
Overview
1. Database2. Relational Database Basics3. Using Excel as a Database4. Using Microsoft Access
![Page 3: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/3.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/4.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/5.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/6.jpg)
6
Why database is important?
Today organization consider “data”and “information” as one of the most important resources.Support Decision Making
![Page 7: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/7.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/8.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/9.jpg)
9
How is data stored in a database?
In a database, data is mostly stored in the form of table.
![Page 10: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/10.jpg)
10
Data Management
There are 2 ways to manage data:1. File systems2. Database systems
HOW
![Page 11: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/11.jpg)
11
1) File Systems
![Page 12: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/12.jpg)
12
Disadvantages of File Systems
Uncontrolled RedundancyInconsistent DataLimited Data SharingPoor Enforcement of Standard
File Systems
![Page 13: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/13.jpg)
13
2) Database Systems
![Page 14: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/14.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/15.jpg)
15
Database Management System (DBMS)
Database Systems
![Page 16: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/16.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/17.jpg)
17
1) Personal Computer Database
![Page 18: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/18.jpg)
18
2) Central Computer Database
Terminal is a computer that has no processing unit. It acts as an interface only.
![Page 19: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/19.jpg)
19
3) Client/Server DB or “Two-Tiered DB”
![Page 20: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/20.jpg)
20
4) Distributed Database
![Page 21: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/21.jpg)
21
Database Personnel (User)
1. Database Administrator2. Database Programmer3. End User
![Page 22: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/22.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/23.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/24.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/25.jpg)
25
DBMS Advantage
Reduce data redundancyAchieve data independenceRetrieve data and information rapidlyImprove security
![Page 26: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/26.jpg)
26
DMBS Disadvantage
Obtain expensive softwareObtain a large hardware
configurationHire and maintain a DBA staff
![Page 27: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/27.jpg)
27
2. Relational Database Basic
TableRelationshipPrimary keyForeign keyAnd data integrity
![Page 28: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/28.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/29.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/30.jpg)
30
Which field should be defined as the primary key?
![Page 31: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/31.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/32.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/33.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/34.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/35.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/36.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/37.jpg)
37
Foreign keyBAD table
![Page 38: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/38.jpg)
38
Foreign KeyPrimary key
Primary key
Table 1
Table 2
![Page 39: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/39.jpg)
39
Foreign KeyPrimary key
Foreign key
Primary key
![Page 40: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/40.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/41.jpg)
41
Entity Integrity
![Page 42: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/42.jpg)
42
Entity Integrity
![Page 43: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/43.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/44.jpg)
44
4. Access
Data TypeType of Number
![Page 45: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/45.jpg)
45
Data Type
![Page 46: Database](https://reader035.vdocument.in/reader035/viewer/2022062819/577cc6cb1a28aba7119f21f4/html5/thumbnails/46.jpg)
46
Type of Number