1 course contents lesson 1: introduction to the database lesson 1: introduction to the database...

51
1 Course Contents Course Contents Lesson 1: Introduction to the Lesson 1: Introduction to the Database Database Lesson 2: Basic Vocabulary, Lesson 2: Basic Vocabulary, Concept and Database Approach Concept and Database Approach Lesson 3: The Database Lesson 3: The Database Environment Environment Lesson 4: The Relational Model Lesson 4: The Relational Model Lesson 5: E-R Modelling Lesson 5: E-R Modelling Lesson 6: Normalization I Lesson 6: Normalization I Lesson 7: Normalization II Lesson 7: Normalization II

Upload: penelope-tate

Post on 03-Jan-2016

225 views

Category:

Documents


3 download

TRANSCRIPT

11

Course Contents Course Contents

Lesson 1: Introduction to the DatabaseLesson 1: Introduction to the Database Lesson 2: Basic Vocabulary, Concept and Lesson 2: Basic Vocabulary, Concept and

Database ApproachDatabase Approach Lesson 3: The Database EnvironmentLesson 3: The Database Environment Lesson 4: The Relational ModelLesson 4: The Relational Model Lesson 5: E-R ModellingLesson 5: E-R Modelling Lesson 6: Normalization ILesson 6: Normalization I Lesson 7: Normalization IILesson 7: Normalization II

22

Course Contents (cont’)Course Contents (cont’)

Lesson 8: Logical Database Design Lesson 8: Logical Database Design and Physical Database Designand Physical Database Design

Lesson 9: SQL ILesson 9: SQL I Lesson 10: SQL IILesson 10: SQL II Lesson 11: Database Administration Lesson 11: Database Administration

and Internetand Internet PresentationPresentation Summary of the Course and Revision Summary of the Course and Revision

3

Introduction to the Introduction to the Database: Basic Vocabulary Database: Basic Vocabulary

and Conceptand Concept

Lesson 1Lesson 1::

44

Lesson OverviewLesson Overview

1.11.1 IntroductionIntroduction 1.2 Information System1.2 Information System 1.3 Databases1.3 Databases 1.4 From Files To Database1.4 From Files To Database

55

1.1 Introduction1.1 Introduction

What is data ?What is data ? Data is facts about objects, Data is facts about objects,

people or entities. people or entities. Data may be meaningless or Data may be meaningless or

otherwise.otherwise. Data may come from strange Data may come from strange

places. For e.g. a long distance places. For e.g. a long distance phone call generates data for phone call generates data for billing purposes.billing purposes.

66

1.1 Introduction (cont’)1.1 Introduction (cont’)Information NeedsInformation Needs Organizations need accurate, relevant, Organizations need accurate, relevant,

comprehensive and timely information to comprehensive and timely information to perform their tasks effectively and perform their tasks effectively and efficientlyefficiently

Info. is vital for business decision makingInfo. is vital for business decision making Type of info. needed varies between Type of info. needed varies between

organizationorganization Most organization are hierarchically Most organization are hierarchically

structured with top management making structured with top management making tactical decisionstactical decisions

77

1.1 Introduction (cont’)1.1 Introduction (cont’)

Information CharacteristicsInformation Characteristics

Data vs InformationData vs Information

• What is data?What is data?• What is information?What is information?

88

DataData : unprocessed data : unprocessed data Data may or may not have any value to Data may or may not have any value to

the user or decision makerthe user or decision maker InformationInformation : processed data : processed data

offers value to the decision maker, like offers value to the decision maker, like finished productfinished product

Data -> Data Operations -> Data -> Data Operations -> InformationInformation

1.1 Introduction (cont’)1.1 Introduction (cont’)

99

Data OperationsData Operations• CapturingCapturing• ValidationValidation• SortingSorting• ClassifyingClassifying• CalculationCalculation• SummarizingSummarizing• StoringStoring• RetrievingRetrieving• ReplicatingReplicating• CommunicatingCommunicating

1.1 Introduction (cont’)1.1 Introduction (cont’)

1010

CapturingCapturingCaptured during transaction takes placeCaptured during transaction takes placeExample?Example?

ValidationValidationChecking to ensure that data are captured and recorded correctlyChecking to ensure that data are captured and recorded correctlyExample?Example?

SortingSortingArranges data in specified orderArranges data in specified orderExample?Example?

1.1 Introduction (cont’)1.1 Introduction (cont’)

1111

ClassifyingClassifyingPPuts data into categoryuts data into categoryExample?Example?

CalculationCalculationComputation performed on dataComputation performed on dataExample?Example?

SummarizingSummarizingAggregation of dataAggregation of dataExample?Example?

1.1 Introduction (cont’)1.1 Introduction (cont’)

1212

StoringStoringStoring data in some storage mediumStoring data in some storage mediumExample?Example?

RetrievingRetrievingExtracting data or information stored on a storage Extracting data or information stored on a storage mediummediumExample?Example?

ReplicatingReplicatingMaking multiple copies of dataMaking multiple copies of dataExample?Example?

1.1 Introduction (cont’)1.1 Introduction (cont’)

1313

CommunicatingCommunicating

Transfer of data from one Transfer of data from one person/location to another person/location to another person/locationperson/location

Example?Example?

1.1 Introduction (cont’)1.1 Introduction (cont’)

1414

Information Attributes• Accuracy Degree info. is free from error• Completeness Degree info. is free from omission• Relevance How relevant the info. is to decision making• Timelines How current or up-to-date the info. is

1.1 Introduction (cont’)1.1 Introduction (cont’)

1515

1.2 Information Systems1.2 Information Systems Many org. are data rich but information poorMany org. are data rich but information poor IS turns those data into useful information for IS turns those data into useful information for

decision decision making making data information system data information system

information+decisioninformation+decision Decision makers must have information in the Decision makers must have information in the

right right form, at the right time and at the right placeform, at the right time and at the right place Uneffective org. : X appropriate IS, X well-Uneffective org. : X appropriate IS, X well-

designed DBdesigned DB Early IS :Early IS : stand-alone –> limited capabilitiesstand-alone –> limited capabilities Now :Now : online (interactive) & real time -> online (interactive) & real time ->

greater flexibilitygreater flexibility

1616

1.2 Information Systems 1.2 Information Systems (cont…)(cont…)

EDI (Electronic Data Interchange)EDI (Electronic Data Interchange)

Org. communicate with one another by Org. communicate with one another by accessing each other’s DBaccessing each other’s DB

Internet & Web based ISInternet & Web based IS

Transcends the distance and time barriersTranscends the distance and time barriers

1717

1.2 Information Systems 1.2 Information Systems (cont…)(cont…)

Types of ISTypes of IS• Transaction Processing System (TPS)Transaction Processing System (TPS)• Management Information System (MIS)Management Information System (MIS)

• Executive Information System (EIS)Executive Information System (EIS)• Decision Support Systems (DSS)Decision Support Systems (DSS)• Expert System (ES)Expert System (ES)• Accounting Information System (AIS)Accounting Information System (AIS)• Human Resource Information System (HRIS)Human Resource Information System (HRIS)

Find out details about each systems?Find out details about each systems?

1818

Supporting TechnologiesSupporting Technologies

Hardware TechnologiesHardware TechnologiesSophisticated hardware, software and Sophisticated hardware, software and

communication technologies are communication technologies are needed to build successful needed to build successful information systeminformation system

1919

Supporting Technologies Supporting Technologies (cont…)(cont…)

Software TechnologiesSoftware Technologies OSOS

CompilersCompilers

Office softwareOffice software

Multimedia softwareMultimedia software

CASE toolsCASE tools

Internet softwareInternet software

2020

Supporting Technologies Supporting Technologies (cont…)(cont…)

Database TechnologiesDatabase Technologies• File based and developed using File based and developed using

Access, DB2, Oracle…Access, DB2, Oracle…• Hierarchical, network and relational Hierarchical, network and relational

modelmodel• Object oriented data modelObject oriented data model

2121

1.3 Databases1.3 Databases Collection of related dataCollection of related data

A system by which data can be A system by which data can be managedmanaged ( (insertedinserted, , updatedupdated, , deleteddeleted) in an ) in an efficientefficient and and convenientconvenient manner. manner.

A system that can extractA system that can extract meaningful meaningful informationinformation from the from the stored datastored data

22

Example – MatchmakerExample – Matchmaker Client ID Name Phone email Gender Age

123 Edward 223-4432 [email protected] M 20574 Sally 394-0293 [email protected] F 22

Hobby ClientID Hobby Name Desc Hobby Type Name Category123 Baseball Like to pitch Baseball Sports574 Baseball like to bat Drawing Art574 Drawing charcoal Movies Leisure

Matching Type Name Matches Type Client1 Client2Date Date 123 574Friend Friend 123 574Roommate

Client Ratings Rator Ratee Rating123 574 5574 123 1

2323

Types of DatabasesTypes of Databases

Some Databases Are Used By A Some Databases Are Used By A Single User and Contains a Relatively Single User and Contains a Relatively Small Amount of Data Such As The Small Amount of Data Such As The House Painting Database.House Painting Database.

Some Databases Have More Than One Some Databases Have More Than One User But Fewer Than 20 - 30 Users. User But Fewer Than 20 - 30 Users. These Contain A Moderate Amount of These Contain A Moderate Amount of Data e.g. The Departmental Database.Data e.g. The Departmental Database.

The Largest Database Are Usually The Largest Database Are Usually Organisational Such As The Vehicle Organisational Such As The Vehicle Licensing & Registration DatabaseLicensing & Registration Database

2424

Why use “the database Why use “the database approach”?approach”?

Many software tools are available: Many software tools are available: Database Management Systems Database Management Systems (DBMS)(DBMS)

Robust theoretical background AND Robust theoretical background AND proven in practiceproven in practice

The typical alternative to a database The typical alternative to a database is a customis a custom data file (the “file system data file (the “file system approach”)approach”). .

2525

1.4 From Files To Database1.4 From Files To Database

Files vs. DatabaseFiles vs. Database

Which one should org. use?Which one should org. use? Database is a set of linked Database is a set of linked

tables tables A file system consist of a set of A file system consist of a set of

disjoint files disjoint files

2626

In past, org. kept data in manual or In past, org. kept data in manual or paper files and stored them in filing paper files and stored them in filing cabinetscabinets

Now….switch from manual files to Now….switch from manual files to computer filescomputer files

Same method but now we can Same method but now we can retrieve and process data much retrieve and process data much fasterfaster

1.4 From Files To Database 1.4 From Files To Database (cont’)(cont’)

2727

1.4 From Files To Database (cont’)1.4 From Files To Database (cont’)

Early Computer Systems Were Early Computer Systems Were Designed To Meet The Needs Of A Designed To Meet The Needs Of A Particular Department, Group or Particular Department, Group or Individual In An Organization.Individual In An Organization.

These Systems Known As File These Systems Known As File Processing Systems Included Processing Systems Included Applications Such AS Accounts Applications Such AS Accounts Receivable, Inventory Control, Receivable, Inventory Control, Demand Deposit System,etc.Demand Deposit System,etc.

2828

1.4 From Files To Database 1.4 From Files To Database (cont’)(cont’)

The Sales Department Of An The Sales Department Of An Organization May Request For An Organization May Request For An Accounts Receivable System And Accounts Receivable System And The Warehouse May Request For The Warehouse May Request For An Inventory System.An Inventory System.

Each Type Of User Request Is Each Type Of User Request Is Translated Into Application Programs Translated Into Application Programs Which Were Designed Individually Which Were Designed Individually When The Needs Arise.When The Needs Arise.

2929

1.4 From Files To Database (cont’)1.4 From Files To Database (cont’)

Each New Application Was Designed Each New Application Was Designed With Its Own Set Of Data FilesWith Its Own Set Of Data Files

Some Of These Data Files May Have Some Of These Data Files May Have Been Available In Existing Files For Been Available In Existing Files For Other Applications.Other Applications.

3030

1.4 From Files To Database (cont’)1.4 From Files To Database (cont’) File Processing Systems Are Accurate File Processing Systems Are Accurate

And Faster Than Manual Record-And Faster Than Manual Record-Keeping Systems,but... Keeping Systems,but...

File Processing Applications Could Not File Processing Applications Could Not Access Other Application Files.Access Other Application Files.

When New Systems Were Designed When New Systems Were Designed Much Of The Data Needed For The Much Of The Data Needed For The Systems Were Collected And Maintained Systems Were Collected And Maintained In Separate In Separate

Files With Very Little Thought As To Files With Very Little Thought As To How These Data Are InterrelatedHow These Data Are Interrelated

3131

The Executive ClubThe Executive Club Consider A File Processing System of The Consider A File Processing System of The

Executive Club.Executive Club. The First System Processes The Club’s The First System Processes The Club’s

Subscription And Is Maintained By The Club’s Subscription And Is Maintained By The Club’s Financial Secretary; Financial Secretary;

The Second System Processes Data About The The Second System Processes Data About The Club's Cafetaria and Dining Facilities And Is Club's Cafetaria and Dining Facilities And Is Maintained By The Catering Secretary;Maintained By The Catering Secretary;

The Third Processes The Club's Fund - Raising The Third Processes The Club's Fund - Raising Projects and Is Maintained By The Projects Projects and Is Maintained By The Projects Coordinator. Coordinator.

32

Membership File of The Membership File of The Executive ClubExecutive Club

Mem No.

Name Add Tel. No

Age Sex Occupation Subscript

005 D'Cruz ------ 37785462 32 M Doctor 7000

085 Lee ----- 37894212 35 F Lawyer 7000

043 Abraham ---- 45667876 40 M Accountant 2500

011 Liam ---- 26554343 35 F Teacher 2500

33

Catering FileCatering FileMembersMembers

hip Nohip NoNameName AddressAddress TelephoTelepho

nene

Restaurant & Restaurant & CafeteriaCafeteria

005005 D’CruzD’Cruz 7778546777854622

20002000

085085 LeeLee 82942128294212 15001500

043043 AbrahamAbraham 5666767566676766

320320

011011 LiamLiam 2655434265543433

10301030

34

Fund-Raising FileFund-Raising FileCodeCode NameName AddAdd TelTel AmouAmou

ntnt

085085 LeeLee xxxxxx 82942128294212 50005000

011011 LiamLiam xxxxxx 2655434265543433

300300

099099 JansonJanson xxxxxx 5388788538878899

30003000

034034 NunisNunis xxxxxx 7877300787730000

25892589

3535

The Executive ClubThe Executive Club Each of These Files Contains Data Each of These Files Contains Data

Such As Name, Address and Such As Name, Address and Telephone Number. Telephone Number.

A Club Member Who Has Paid His A Club Member Who Has Paid His Membership Subscription, Used The Membership Subscription, Used The Cafetaria And Also Made a Personal Cafetaria And Also Made a Personal Contribution To The Club's Fund - Contribution To The Club's Fund - Raising Project Would Have His Raising Project Would Have His Name, Address And Tel. No. In All Name, Address And Tel. No. In All Three Files.Three Files.

3636

-Continue ...-Continue ...

This This RedundancyRedundancy Results In Wasted Results In Wasted Storage Space. Storage Space.

If The Address Of A Member Is Updated If The Address Of A Member Is Updated In One File But Not In the Remaining In One File But Not In the Remaining Files Where the Member's Name Files Where the Member's Name Appears, This Will Lead To A Situation Appears, This Will Lead To A Situation Where The Address Of The Same Where The Address Of The Same Member Is Inconsistent. Member Is Inconsistent.

Data That Is Data That Is Inconsistent Inconsistent In A System In A System May Lead To The System's Lack Of May Lead To The System's Lack Of IntegrityIntegrity Or Reliability. Or Reliability.

37

File Processing SystemsFile Processing Systems

Subscription applicationprograms

Catering applicationprograms

Projects applicationprograms

SubscriptionFile

Catering File

Projects File

3838

-Continue ...-Continue ...

If the club secretary wanted the If the club secretary wanted the name of a member who has paid a name of a member who has paid a subscription fee of RM2000, spent subscription fee of RM2000, spent over RM1000 in the cafeteria and over RM1000 in the cafeteria and contributed more than RM3000 contributed more than RM3000 towards the fund-raising project , towards the fund-raising project ,

He would have to search the He would have to search the membership file, the catering file membership file, the catering file and the fund-raising file separately. and the fund-raising file separately.

3939

File based system lack of flexibility. File based system lack of flexibility. Why?Why?

Hence, needed more flexible data Hence, needed more flexible data management softwaremanagement software

Resulted with the development of Resulted with the development of DBMSDBMS

Database Management SystemsDatabase Management Systems

1.4 From Files To Database 1.4 From Files To Database (cont’)(cont’)

4040

File Based ApproachFile Based Approach

Early years, data processing tended to be Early years, data processing tended to be largely departmental in naturelargely departmental in nature

Each dept. developed own applications Each dept. developed own applications

with the help of Computer or Info. with the help of Computer or Info.

Systems dept.Systems dept.

4141

File Based Approach (cont…)File Based Approach (cont…)

If another dept. need the same data, they have to do it themselves

Maybe because different format or

developed in another system

Lack of data sharing…increased cost of

data collection and processing

4242

Limitations of File Based Limitations of File Based ApproachApproach

1.1. Data Duplication or Data Data Duplication or Data RedundancyRedundancy

2.2. Limitations in Data SharingLimitations in Data Sharing3.3. Data Inconsistency Data Inconsistency (due to updates (due to updates

of only some of the related files)-of only some of the related files)-Resulting in Lack of data integrityResulting in Lack of data integrity

4.4. Inflexibility - Inflexibility - Dependence of Dependence of programs on physical data structureprograms on physical data structure

5.5.   ExpenseExpense

4343

Limitations of File Based ApproachLimitations of File Based Approach1. 1. Data Duplication or Data RedundancyData Duplication or Data Redundancy

The same data is stored in different The same data is stored in different

filesfiles

Results in waste of valuable spaceResults in waste of valuable space• It wastes valuable disk spacesIt wastes valuable disk spaces

Same data entered more than once Same data entered more than once

(wasting staff time)(wasting staff time)

4444

2.Limitations in Data Sharing2.Limitations in Data Sharing

Each user has own files or Each user has own files or applicationsapplications

Difficult to share when different Difficult to share when different applications create their own applications create their own data filesdata files

Same information stored in Same information stored in different fields and may use different fields and may use different data types and formatdifferent data types and format

4545

3.Data Inconsistency3.Data Inconsistency

Happens when same data is Happens when same data is stored in multiple filesstored in multiple files

Data may be updated in one file, Data may be updated in one file, but not updated in another filebut not updated in another file

This may lead to errorsThis may lead to errors

4646

4.Inflexibility4.Inflexibility Application Programs Are Dependent Application Programs Are Dependent

on File Formats. on File Formats.

Each File Serves Specific Application.Each File Serves Specific Application.

Ad Hoc Inquiries Cannot Be Carried Ad Hoc Inquiries Cannot Be Carried

Out Without Restructuring File or Out Without Restructuring File or

Reorganising Data.Reorganising Data.

4747

5.Expense5.Expense

Due to the problems 1,2,3,4 Due to the problems 1,2,3,4

mentioned, file processing mentioned, file processing

systems are expensive and time systems are expensive and time

consuming.consuming.

4848

SummarySummary

Data = facts about objects, Data = facts about objects, people or entities. people or entities.

Information = processed data, Information = processed data, offers value to the decision offers value to the decision maker, like finished productmaker, like finished product

4949

Summary (cont’)Summary (cont’)

Database = Database = Collection of related dataCollection of related data A system by which data can be A system by which data can be

managed (inserted, updated, managed (inserted, updated, deleted) in an efficient and deleted) in an efficient and convenient manner.convenient manner.

A system that can extract A system that can extract meaningful information from the meaningful information from the stored datastored data

5050

Summary (cont’)Summary (cont’)

Limitations of File Based Limitations of File Based ApproachApproach Data Duplication or Data Data Duplication or Data

RedundancyRedundancy Limitations in Data SharingLimitations in Data Sharing Data Inconsistency (due to Data Inconsistency (due to

updates of only some of the updates of only some of the related files)-Resulting in Lack of related files)-Resulting in Lack of data integritydata integrity

5151

Summary (cont’)Summary (cont’)

Inflexibility - Dependence of Inflexibility - Dependence of programs on physical data programs on physical data structurestructure

  ExpenseExpense