48
1

01. Introduction to Database Management System

Embed Size (px)

Citation preview

Page 1: 01. Introduction to Database Management System

1

Page 2: 01. Introduction to Database Management System

• Introduction to Database Management System

• Database Background

• Advantages and Disadvantages of DBMS

• Database Case:– Premier Product– Hendry Book– Alexamara Marina Group

2

Page 3: 01. Introduction to Database Management System

• Introduce Premiere Products, the company that is used as the basis for many of the examples throughout the text

• Introduce basic database terminology• Describe database management systems (DBMSs)• Explain the advantages and disadvantages of

database processing• Introduce Henry Books, the company that is used in a

case that appears throughout the text• Introduce Alexmara Marina Group, the company that

is used in another case that appears throughout the text

3

Page 4: 01. Introduction to Database Management System

• Premiere Products– Distributor of appliances, houseware, and

sporting goods– Uses spreadsheet software to maintain

important data– Recent growth has made spreadsheet

approach problematic

4

Page 5: 01. Introduction to Database Management System

FIGURE 1-1: Sample orders spreadsheet5

Page 6: 01. Introduction to Database Management System

• Problems using spreadsheet

– Redundancy

• Duplication of data or the storing of the same data in more than one place

– Difficulty accessing related data

– Limited security

– Size limitations

6

Page 7: 01. Introduction to Database Management System

FIGURE 1-3: Entities and attributes

7

Page 8: 01. Introduction to Database Management System

FIGURE 1-4: One-to-many relationship

8

Page 9: 01. Introduction to Database Management System

• Data file– File used to store data– Computer counterpart to ordinary paper file

• Database– Structure that can store information about:

• Multiple types of entities• Attributes of those entities• Relationships between the entities

9

Page 10: 01. Introduction to Database Management System

FIGURE 1-5: Sample data for Premiere Products

10

Page 11: 01. Introduction to Database Management System

FIGURE 1-5: Sample data for Premiere Products

11

Page 12: 01. Introduction to Database Management System

FIGURE 1-5: Sample data for Premiere Products

12

Page 13: 01. Introduction to Database Management System

FIGURE 1-6: Alternative Orders table structure

13

Page 14: 01. Introduction to Database Management System

• Entity-relationship (E-R) diagram– Visual way to represent a database– Rectangles represent entities– Lines represent relationships between

connected entities

14

Page 15: 01. Introduction to Database Management System

FIGURE 1-7: E-R diagram for the Premiere Products database

15

Page 16: 01. Introduction to Database Management System

• Database management system (DBMS)– Program, or collection of programs, through

which users interact with a database

• Popular DBMSs: Access, Oracle, DB2, MySQL, and SQL Server

• Premiere Products decides to use Access• Database design

– Determining the structure of the required database

16

Page 17: 01. Introduction to Database Management System

17

FIGURE 1-8: Using a DBMS directly

Page 18: 01. Introduction to Database Management System

18

FIGURE 1-9: Using a DBMS through another program

Page 19: 01. Introduction to Database Management System

• Forms– Screen objects used to maintain, view, and

print data from a database– DBMS creates forms that Premiere Products

needs

• Reports– DBMS creates reports for Premiere Products

based on user’s answers about the desired content and appearance of each report

19

Page 20: 01. Introduction to Database Management System

FIGURE 1-10: Part form

20

Page 21: 01. Introduction to Database Management System

FIGURE 1-11: Orders form

21

Page 22: 01. Introduction to Database Management System

FIGURE 1-12: Parts report

22

Page 23: 01. Introduction to Database Management System

1. Getting more information from the same amount of data

2. Sharing data3. Balancing conflicting requirements

– Database administrator or database administration (DBA): person or group in charge of the database

4. Controlling redundancy5. Facilitating consistency

23

Page 24: 01. Introduction to Database Management System

6. Improving integrity• Integrity constraint: a rule that data must

follow in the database

7. Expanding security• Security: prevention of unauthorized access

8. Increasing productivity9. Providing data independence

– Data independence: can change structure of a database without changing the programs that access the database

24

Page 25: 01. Introduction to Database Management System

1. Larger file size

2. Increased complexity

3. Greater impact of failure

4. More difficult recovery

25

Page 26: 01. Introduction to Database Management System

• Henry Books– Book store chain operated by Ray Henry

• Henry decided to use database to gather and store information on:– Branches– Publishers– Authors– Books

26

Page 27: 01. Introduction to Database Management System

FIGURE 1-15: Sample branch and publisher data for Henry Books

27

Page 28: 01. Introduction to Database Management System

FIGURE 1-15: Sample branch and publisher data for Henry Books28

Page 29: 01. Introduction to Database Management System

FIGURE 1-16: Sample author data for Henry Books29

Page 30: 01. Introduction to Database Management System

FIGURE 1-17: Sample book data for Henry Books30

Page 31: 01. Introduction to Database Management System

FIGURE 1-18: Sample data that relates books to authors and books to branches for Henry Books

31

Page 32: 01. Introduction to Database Management System

FIGURE 1-18: Sample data that relates books to authors and books to branches for Henry Books (continued)

32

Page 33: 01. Introduction to Database Management System

FIGURE 1-19: E-R diagram for the Henry Books database

33

Page 34: 01. Introduction to Database Management System

• Alexamara Marina Group offers in-water boat storage to owners– Provides boat slips that boat owners can rent

on an annual basis– Two marinas: Alexamara East and Alexamara

Central– Provides boat repair and maintenance

services

• Database used to store data

34

Page 35: 01. Introduction to Database Management System

FIGURE 1-20: Sample marina data for Alexamara Marina Group

35

Page 36: 01. Introduction to Database Management System

FIGURE 1-21: Sample owner data for Alexamara Marina Group

36

Page 37: 01. Introduction to Database Management System

FIGURE 1-22: Sample data about marina slips for Alexamara Marina Group

37

Page 38: 01. Introduction to Database Management System

FIGURE 1-23: Sample data about service categories for Alexamara Marina Group

38

Page 39: 01. Introduction to Database Management System

FIGURE 1-24: Sample data about service requests for Alexamara Marina Group39

Page 40: 01. Introduction to Database Management System

FIGURE 1-24: Sample data about service requests for Alexamara Marina Group (continued)

40

Page 41: 01. Introduction to Database Management System

FIGURE 1-25: E-R diagram for the Alexamara Marina Group database

41

Page 42: 01. Introduction to Database Management System

1. What is Problems with non-database approaches to data management?

2. Give an examples for Entity, Attribute and Relationship

3. What is ER Diagram?4. What is Relationship means in DBMS?5. Write down advantages and disadvantages of

DBMS.6. Why a data is better storage to DBMS not in

spreadsheet?

42

Page 43: 01. Introduction to Database Management System

43

CUSTOMER

Cust. Code

Cust. Name Cust. AddressCust.

PhoneCust.

NationalityC0101 Philip Gobarvhe St. Address No. 1 555-7878 RussianC0102 Hiroshi Kimura St. Address No. 2 555-7879 JapaneseC0103 Robert Walter St. Address No. 3 555-7880 EnglishC0104 Ming San Lung St. Address No. 4 555-7881 ChineseC0105 Alliz Silverbert St. Address No. 5 555-7882 AustralianC0106 Dorris Muchter St. Address No. 6 555-7883 GermanyC0107 Steve Chen St. Address No. 7 555-7884 SingaporeanC0108 Zheng Hui Wen St. Address No. 8 555-7885 Chinese

RoomID Room Name Room RateR0001 Single 80R0002 Double 120R0003 Dexule 180R0004 VIP Suite 230R0005 President Suite 480

ROOM

RSID Service Name Service Price

RS001 Beverage 12

RS002 Breakfast Buffet 25

RS003 Lunch Buffet 28

RS004 Dinner Buffet 32

SERVICE

Page 44: 01. Introduction to Database Management System

44

STAYRECAP

Date ChkIn Date ChkOutStay

Day(s)Cust. Code Cust. Name

Cust. Nationality

Total Price

01 Januari 2007

05 Januari 2007 4 day(s)C0103 Robert Walter English 170

01 Januari 2007

03 Januari 2007 2 day(s)C0101 Philips Gobarvhe Russian 130

01 Januari 2007

04 Januari 2007 3 day(s)C0102 Hiroshi Kimura Japanese 502

02 Januari 2007

04 Januari 2007 2 day(s)C0105 Alliz Silverbert Australian 254

02 Januari 2007

06 Januari 2007 4 day(s)C0106 Dorris Muchter Germany 480

03 Januari 2007

08 Januari 2007 5 day(s)C0104 Ming San Lung Chinese 461

03 Januari 2007

05 Januari 2007 2 day(s)C0108 Zheng Hui Wen Chinese 531

03 Januari 2007

09 Januari 2007 6 day(s)C0107 Steve Chen Singaporean 380

Page 45: 01. Introduction to Database Management System

45

Cust. Code Transaction ID Transaction Name Qty Price Sub Total

C0101 R0001 Single 1 80,00 80,00

C0101 RS002 Breakfast Buffet 2 25,00 50,00 C0102 R0004 VIP Suite 1 230,00 230,00 C0102 RS002 Breakfast Buffet 4 25,00 100,00

C0102 RS001 Beverage 2 12,00 24,00

C0102 RS003 Lunch Buffet 3 28,00 84,00

C0102 RS004 Dinner Buffet 2 32,00 64,00 C0103 R0002 Double 1 120,00 120,00

C0103 RS002 Breakfast Buffet 2 25,00 50,00

TRANSACTION

Page 46: 01. Introduction to Database Management System

46

Page 47: 01. Introduction to Database Management System

47

Page 48: 01. Introduction to Database Management System

48