79
8/14/2019 MELJUN Database Lecture Meljun http://slidepdf.com/reader/full/meljun-database-lecture-meljun 1/79 DATABAS ATABAS E SYSTEM YSTEM MELJUN CORTES ELJUN CORTES

MELJUN Database Lecture Meljun

Embed Size (px)

Citation preview

Page 1: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 1/79

DATABASATABAS

E

SYSTEMYSTEMMELJUN CORTESELJUN CORTES

Page 2: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 2/79

Page 3: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 3/79

ATA ORGANIZATIOTA ORGANIZATIOTERTER is the basic building block of DATADATA which

consist of upper & lower case letter numericdigit (0, 1, 2, etc.) or special character (-, +,

ACTERCTER are put together to form a FACTFACT.re called Field, Item, Word, or String of Chara number, a name, or a combination of Char

RD – a collection of related FACTS.

:loyee Record – it is collection of FACT about one emicates name, address, phone #, pay rate, earning m

date & so on.

MELJUN CORTESELJUN CORTES

Page 4: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 4/79

is a collection of related RECORDRECORD.:1.) A collection of all employee record for one com

would be an Employee FileEmp

loyee File.2.)

Inventory FileInventory

File – collection of all inventory recoa particular company or organization.

ATA ORGANIZATIOTA ORGANIZATIO

Student ID# : 034456

Student Name : MELJUN CORTESCourse : BSCS – 4

Birthday : October 2, 1975

Zodiac Sign : Libra

Student ID# : 034456Student Name : MELJUN CORTES

Course : BSCS – 4

Birthday : October 2, 1975

Zodiac Sign : Libra

Student ID# : 034456Student Name : MELJUN CORTES

Course : BSCS – 4

Birthday : October 2, 1975

Zodiac Sign : Libra

FILEILE

RECORDECORD

MELJUN CORTES

Page 5: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 5/79

ATA ORGANIZATIOTA ORGANIZATIOHIERARCHY OF DATAIERARCHY OF DATA :

HARACTER – are combined to make a Fact.

ACT – are combined to make Record.

ECORD – are combined to make File.

ILE – are combined to make DataBase

DataBase

File

Record

Fact

Character

ote: The Heart of most Organization is DATAATA.

DataBase – is a collection of integrated & related master filemaster file.

Note: A data base is used as the raw materialraw material or input datainp

ut data

for all of the application system perform by the

organization.MELJUN CORTESELJUN CORTES

Page 6: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 6/79

 YSTEMSTEM

MELJUN CORTESELJUN CORTES

Number Date Customer Amount

101 Oct 30, 2009 MELJUN CORTES 12,500

102 Dec. 12, 2009 PIOLO PASCAUL 78,452

103 Nov. 15,2009 MARTIN RIVERA 89,500

104 Jan. 14,2010 SAM MELBY 10,500

ROW is a RECORD.ROW is a RECORD.

COLUMN is a FIELD.COLUMN is a FIELD.

UMN TITLES are FIELD NAME.MN TITLES are FIELD NAME.type of DATA stored in a FIELD is a FIELD TYPE.ype of DATA stored in a FIELD is a FIELD TYPE.

number of CHARACTER in a FIELD is its FIELD WIDTH.umber of CHARACTER in a FIELD is its FIELD WIDTH.

TABASE is composed of one or more TABLE.ABASE is composed of one or more TABLE.

TABASE is a FILE which is created in automated DBMS SOFTWABASE is a FILE which is created in automated DBMS SOFTW

FIELD NAMEIELD NAME

RECORD

RECORD

RECORD

RECORD

TABLE

Page 7: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 7/79MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEMMPLE OF DATABASE STRUCTURE:

cture for Database :C:\STLMASTER.dbfture for Database :C:\STLMASTER.dbfber of Data Records : 268 recordser of Data Records : 268 records

of last update : 10/26/1996of last update : 10/26/1996

ame of DATABASE FILE : STLMASTER.dbfme of DATABASE FILE : STLMASTER.dbf

Field NameField Name Field Data Types Field Width Dec Indexield Data Types Field Width Dec Index

AppNumberppNumber character 6haracter 6AppDateppDate datedate 88

Nameame character 20haracter 20

Address character 30ddress character 30

LoanAmount numeric 12 2oanAmount numeric 12 2

Rebate numeric 7 2ebate numeric 7 2Interest numeric 7 2nterest numeric 7 2

Balance numeric 12 2alance numeric 12 2

Penalty numeric 7 2enalty numeric 7 2

Page 8: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 8/79

ATA ORGANIZATIOTA ORGANIZATIO

DATA – is a raw materials or input to

any data processing

system.

- is considered as INPUT DATA.

- is manipulated to provide

OUTPUT DATA.

Example: Student Admission Form & Enrollment Form

Pay Slip of an employee

 INFORMATION – when this OUTPUT DATA can be

used to help people make economic

decision making.

DATA PROCESSING – is that procedures of transforming 

INPUT DATA into

desired OUTPUT DATA.

MELJUN CORTESELJUN CORTES

Page 9: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 9/79

ATA ORGANIZATIOTA ORGANIZATIO

INFORMATION PROCESSING – a special case of data

processing is the

procedure of transforming dataata into

informationnformation which

can be used to make betterdecision.

Data Processing System – includes all people, procedures &

computer device used to produce

desirable outputor meaningful

information.Information Processing System – includes all people,

procedures, computer

devices used to procedure

useful that can be used in

decision making

  MELJUN CORTESELJUN CORTES

Page 10: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 10/79

ATA ORGANIZATIOTA ORGANIZATIO

verview of DATA ProcessingEx. Payroll System 

INPUT PROCESSING OUTPUT

Example:

1.) Pay Rate

2.) HoursWorked

3.) Payroll

Deduction

Example:

1.) Classifying

2.) Sorting

3.) Calculating

4.) Storing

5.) Summarizing

6.) Reproducing

Example:

1.) Pay Slip

2.) PayrollReport

MELJUN CORTESELJUN CORTES

Page 11: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 11/79

FORMATION SYSTEORMATION SYSTEHardware, Software, People,

Procedures, Policies, DATA arecombined to create an

INFORMATIONNFORMATION

SYSTEMYSTEM.The term INFORMATION SYSTEM is a generic reference to a

Computer-Based

System that provides the following:

1.) DATA PROCESSING – capabilities for a company .- DATA PROCESSING capability

refers to the System’s ability to handle

and process DATA.

2.) INFORMATION SYSTEM – people need to make better more

informed Decisions.

- The more sophisticated INFORMATIONMELJUN CORTESELJUN CORTES

Page 12: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 12/79

DATABASATABAS

E

SYSTEMYSTEMMELJUN CORTESELJUN CORTES

Page 13: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 13/79

ATABASE SYSTEMTABASE SYSTEM

Database

Concepts

Datavs.Information

MELJUN CORTESELJUN CORTES

Page 14: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 14/79

DatabaseDatabaseComputerized Record

Keeping System

Collection of Data usedby an organization to

1. Record its Operations

2. Support Decision Making

MELJUN CORTESELJUN CORTES

Page 15: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 15/79

Dataa ta

Raw facts and figures

Can be of typeText

Number

Sound, Image, Chart,Video

MELJUN CORTESELJUN CORTES

DATABASE SYSTEATABASE SYSTE

Page 16: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 16/79

I n fo rmat ioo rma o

nProcessed Data

Used for Decision Making

Data is alsoINFORMATION

Information createsDATA

MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 17: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 17/79MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEMMPLE OF DATABASE STRUCTURE:

cture for Database :C:\STLMASTER.dbfture for Database :C:\STLMASTER.dbf

ber of Data Records : 268 recordser of Data Records : 268 records

of last update : 10/26/1996of last update : 10/26/1996

ame of DATABASE FILE : STLMASTER.dbfme of DATABASE FILE : STLMASTER.dbf

Field NameField Name Field Data Types Field Width Dec Indexield Data Types Field Width Dec Index

AppNumberppNumber character 6haracter 6AppDateppDate datedate 88

Nameame character 20haracter 20

Address character 30ddress character 30

LoanAmount numeric 12 2oanAmount numeric 12 2

Rebate numeric 7 2ebate numeric 7 2Interest numeric 7 2nterest numeric 7 2

Balance numeric 12 2alance numeric 12 2

Penalty numeric 7 2enalty numeric 7 2

Page 18: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 18/79

 YSTEMSTEM

MELJUN CORTESELJUN CORTES

Number Date Customer Amount

101 Oct 30, 2009 MELJUN CORTES 12,500

102 Dec. 12, 2009 PIOLO PASCAUL 78,452

103 Nov. 15,2009 MARTIN RIVERA 89,500

104 Jan. 14,2010 SAM MELBY 10,500

ROW is a RECORD.ROW is a RECORD.

COLUMN is a FIELD.COLUMN is a FIELD.

UMN TITLES are FIELD NAME.MN TITLES are FIELD NAME.type of DATA stored in a FIELD is a FIELD TYPE.ype of DATA stored in a FIELD is a FIELD TYPE.

number of CHARACTER in a FIELD is its FIELD WIDTH.umber of CHARACTER in a FIELD is its FIELD WIDTH.

TABASE is composed of one or more TABLE.ABASE is composed of one or more TABLE.

TABASE is a FILE which is created in automated DBMS SOFTWABASE is a FILE which is created in automated DBMS SOFTW

FIELD NAMEIELD NAME

RECORD

RECORD

RECORD

RECORD

TABLE

Page 19: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 19/79

A DataBase Management SysteDataBase Management Syste

  (DBMS)DBMS)often just called ‘Database

Software’InputInput

Processin

g Outpututput

Storing

Querying

Sorting

FORMSORMS REPORTSEPORTS

SourcesDocuments

Like:

Enrollment

Forms

Printed

Documents

Like:

Assessment Forms

MELJUN CORTESELJUN CORTES

Page 20: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 20/79

Databaseatabase

TerminologyerminologyTerm Meaning

Database

Table

Record

Field

Data Type

An organised collection (or Store) of data.

A collection of related records, such

as all the pupil records in a class.

A collection of related fields,such as a pupil’s record.

An individual data item, such

as Firstname or Date of Birth.

Type of information in a field such

astext, numeric, date and boolean

(Yes/No)

MELJUN CORTESELJUN CORTES

Page 21: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 21/79

The Russian Dollhe Russian Doll

Analogynalogy

Fields

inside of…

A

Database

Tables

inside

of…ecords

inside of…

Data

inside of…

MELJUN CORTESELJUN CORTES

TABASE SYSTEM

Page 22: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 22/79

 YSTEMSTEM

MELJUN CORTESELJUN CORTES

Number Date Customer Amount

101 Oct 30, 2009 MELJUN CORTES 12,500

102 Dec. 12, 2009 PIOLO PASCAUL 78,452

103 Nov. 15,2009 MARTIN RIVERA 89,500

104 Jan. 14,2010 SAM MELBY 10,500

ROW is a RECORD.ROW is a RECORD.

COLUMN is a FIELD.COLUMN is a FIELD.

UMN TITLES are FIELD NAME.MN TITLES are FIELD NAME.type of DATA stored in a FIELD is a FIELD TYPE.ype of DATA stored in a FIELD is a FIELD TYPE.

number of CHARACTER in a FIELD is its FIELD WIDTH.umber of CHARACTER in a FIELD is its FIELD WIDTH.

TABASE is composed of one or more TABLE.ABASE is composed of one or more TABLE.

TABASE is a FILE which is created in automated DBMS SOFTWABASE is a FILE which is created in automated DBMS SOFTW

FIELD NAMEIELD NAME

RECORD

RECORD

RECORD

RECORD

TABLE

Page 23: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 23/79MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEMMPLE OF DATABASE STRUCTURE:

cture for Database :C:\STLMASTER.dbfture for Database :C:\STLMASTER.dbf

ber of Data Records : 268 recordser of Data Records : 268 records

of last update : 10/26/1996of last update : 10/26/1996

ame of DATABASE FILE : STLMASTER.dbfme of DATABASE FILE : STLMASTER.dbf

Field NameField Name Field Data Types Field Width Dec Indexield Data Types Field Width Dec Index

AppNumberppNumber character 6haracter 6AppDateppDate datedate 88

Nameame character 20haracter 20

Address character 30ddress character 30

LoanAmount numeric 12 2oanAmount numeric 12 2

Rebate numeric 7 2ebate numeric 7 2Interest numeric 7 2nterest numeric 7 2

Balance numeric 12 2alance numeric 12 2

Penalty numeric 7 2enalty numeric 7 2

Page 24: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 24/79

What is ahat is a DBMSBMS?

A collection of computer programs that allow

storage, modification, and extraction of 

information from a databasenformation from a database. There are

many different types of DBMS ranging from

small systems that run on personalcomputers to huge systems that run on

mainframes.

Examples--

Computerized library systemsComputerized library systems, automated

teller machines, flight reservation systems,

computerized parts inventory systemscomputerized parts inventory systems.

MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 25: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 25/79

Introductiontroductio

n To DBMSTo DBMS

ConceptsonceptsMELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 26: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 26/79

What is ahat is a DBMSBMS?

A collection of computer programs that allowstorage, modification, and extraction of 

information from a databasenformation from a database. There are

many different types of DBMS ranging from

small systems that run on personalcomputers to huge systems that run on

mainframes.

Examples--

Computerized library systemsComputerized library systems, automated

teller machines, flight reservation systems,

computerized parts inventory systemscomputerized parts inventory systems.

MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 27: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 27/79

Examples ofxamples of

DATABASE(1)ATABASE(1)Admission System

Examination System

Library SystemPayroll & Personnel

Management System

Accounting SystemHotel Reservation System

Airline Reservation System

MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 28: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 28/79

Examples of DATABASExamples of DATABASE  

(2)Patient Recording System

Inventory System

Sales and Purchase and AccountingSystem

Enrollment System

Knowledge-Based ManagementSystem

Every Government, Military, Privateand other organizations plusIndividual can make use of DB

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 29: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 29/79

Data Managementata Management

Manual Filing Systemanual Filing System

Computerized Filingomputerized Filing

Systemystem

Database Systemsatabase Systems

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 30: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 30/79

Filing SystemFiling SystemEvery Department/Company has its ownEvery Department/Company has its own

Data File(s)Data File(s)

Application to Maintain Data File(s)Application to Maintain Data File(s)

-- Computerized Data Maintenance-- Computerized Data Maintenance

SystemSystem

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 31: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 31/79

Page 32: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 32/79

Databaseatabase

Systemystemingle, Central, Large Repository

Shared Resource

Have Logical Connectionsamong data items

DBA is responsible of itsdesign, creation andmaintenance

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Is a PERSONs a PERSON

Page 33: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 33/79

Members

Management

Application

Catalog

Management

Application

Transaction

Management

Application

Lists of All Members,

 New Members,

Joins between

specified Dates. etc

Lists of All Books,

 New Books,

Issued Books,

Lost Books,. etc

Books Issued Today,

Books Receipt Today,

etc

Members

Catalog

Register

DBMSBMS

atabasetabase

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Library Systemibrary System -- Exaxa

Page 34: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 34/79

DBMSBMSSoftware Package that providesoftware Package that provides

Support to applicationsupport to applicationssystemystem

-- Computerized DATA- Computerized DATA

HandlingandlingUser-interface for on-lineser-interface for on-line

queriesueries

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 35: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 35/79

Advantages of DBMS (1dvantages of DBMS (1)

Sharing of Data

Control of Redundancy

-(unnecessary wastage of disk space)

Data Consistency

Improvement of Data Standards

Improvement of Data Integrity

-(Intra-record, inter-record, referential)

Balancing of ConflictsFaster Development of New Applications

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 36: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 36/79

Advantages of DBMSdvantages of DBMS

(2)2)Better Security

Passwords

Encryption

Views and Stored Procedures

Better Data Accessibility

(query language- SQL programming)

Economy of Scale

Transaction handling

Better backup and Recovery Procedures

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 37: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 37/79

Disadvantages ofisadvantages of

DBMSBMSHigher Costs of

DBMS

Hardware

ConversionProgramming

Slow Processing of Some

ApplicationsMore Security Risks

More Difficult Recovery

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 38: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 38/79

Kinds of Databaseinds of DatabaseRelational: Oracle 9i/8i, SQL-Server 2000/7.0/6.5,Relational: Oracle 9i/8i, SQL-Server 2000/7.0/6.5,

Teradata, Sybase(SQL Anywhere),Teradata, Sybase(SQL Anywhere),

DB2, InformixDB2, Informix

MS-Access, Foxpro 2.6/2.5,dbase IV/3 +MS-Access, Foxpro 2.6/2.5,dbase IV/3 +

Network e.g.Network e.g. IDS Server IDS Server 

Paradox, FoxBase, Dbase3+, DbaseIVParadox, FoxBase, Dbase3+, DbaseIV

DBU, Visual FoxPro, MS-Access – Windows 7DBU, Visual FoxPro, MS-Access – Windows 7

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 39: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 39/79

Relational DBMSRelational DBMSATABASE SYSTEMTABASE SYSTEM

TABLETABLE

TABLETABLE

TABLETABLETABLETABLE

Page 40: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 40/79

Important RDBMSmportant RDBMS

ObjectsbjectsTablesables

Viewsiews

TriggersriggersStored Procedurestored Procedures

Functionsunctions

Primary Keyrimary Key

Foreign Keyoreign Key

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 41: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 41/79

SQL

Page 42: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 42/79

SQL:

It is an acronym for Structuredt is an acronym for Structured

Query Language.uery Language.

It is the language in which, thet is the language in which, theclient sends the requestlient sends the request

to the database forto the database fordataata

Eg. Select name, addressg. Select name, address

From emprom emp

SQL:

MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 43: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 43/79

PL/SQL:PL/SQL:It is an acronym for Programming Language/Structured QueryProgramming Language/Structured Query

LanguageLanguage

Apart from writing the SQL you also have the programminglanguage constructs like

• If then else (checking conditions)

Looping (Executing the set of statements more that once)• Exception and error handling (Taking care of run time errors)

MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 44: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 44/79

Database Designatabase Design

Database designis the process of producing a detailed

data model of a database. This logical data model contains all theneeded logical and physical design choices and physical storageparameters needed to generate a design in a Data DefinitionLanguage, which can then be used to create a database. A fullyattributed data model contains detailed attributes for each entity.

Process:• Determine the data to be stored in the database• Determine the relationships between the different data elements• Superimpose a logical structure upon the data on the basis of 

these relationships.

MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 45: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 45/79

Page 46: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 46/79

In database packagesatabase packages, the term Cursor refers to a controlstructure for the successive traversal (and potentialprocessing) of records in a result set.

A Transaction Log (also database log or binary log) is ahistory of actions executed by a database managementsystem to guarantee ACID properties over crashes or

hardware failures. Physically, a log is a file of updates doneo the database, stored in stable storage.

A Database Index is a data structure that improves thespeed of operations in a table. Indexes can be created usingone or more columns, providing the basis for both rapid

random lookups and efficient ordering ofaccess to records.

A Stored Procedure is a subroutine available to applicationsaccessing a relational database system. Stored procedures(sometimes called a sproc or SP) are actually stored in the

database.

Databaseatabase

Objectsbjects

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 47: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 47/79

Page 48: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 48/79

TRANSACTIONRANSACTION

MANAGEMENTANAGEMENT

What is a Database Transaction ?

A database transactiondatabase transaction is a unit of interaction with a

database management system or similar system that istreated in a coherent and reliable way independent of other transactions. In general, a database transaction must be

atomic, meaning that it must be either entirely completedor aborted. Ideally, a database system will guarantee theproperties of Atomicity, Consistency, Isolation andDurability (ACID) for each transaction.

A Simple Transaction1. Begin the transaction2. Execute several queries3. Commit the transaction

MELJUN CORTESELJUN CORTES

ATABASE SYSTEMTABASE SYSTEM

Page 49: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 49/79

ACIDCIDIn computer scienceomputer science, ACID (Atomicity, Consistency,

Isolation, Durability) is a set of properties that guarantee thatdatabase transactions are processed reliably. In the context of databases, a single logical operation on the data is called a

transaction.

Atomicity - Atomicity refers to the ability of the DBMS to guaranteethat either all of the tasks of a transaction are performed or none of them are.Consistency - Consistency refers to the database being in a legal state

when the transaction begins and when it ends. This means that atransaction cannot break the rules, or integrity constraints, of thedatabase.Isolation - Isolation refers to the ability of the application tomake operations in a transaction appear isolated fromall other operationsDurability -Durability ensures that the results of a completedtransaction are permanent and can survive future system and

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 50: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 50/79

Kinds of Databaseinds of Database

Consultantsonsultants

DATABASE DesignersDATABASE Designers

is a personis a personDATABASE DevelopersDATABASE Developers

is a personis a person

DBA (Data Base Administrator)DBA (Data Base Administrator)is a personis a person

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 51: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 51/79

DATABASEATABASE

Designers:esigners:These consultants Analyze,hese consultants Analyze,

design the completeesign the complete

structure of the database.tructure of the database.

They design Tables, Views,hey design Tables, Views,

Normalization, ER Diagram,ormalization, ER Diagram,

Integrity constraints, etc.ntegrity constraints, etc.

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 52: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 52/79

Page 53: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 53/79

DBB ADMINISTRATORDMINISTRATOR :These consultants’ profilehese consultants’ profileincludes installation,ncludes installation,configuration, migration,onfiguration, migration,

backup, recovery operationsackup, recovery operationsVarious Tasks of the DBA are:arious Tasks of the DBA are:

a) Granting access) Granting access

b) User creation and deletion) User creation and deletion

c) Performance tuning) Performance tuning

d) Query optimization) Query optimization

ATABASE SYSTEMTABASE SYSTEM

MELJUN CORTESELJUN CORTES

Page 54: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 54/79

Related Skills in DATABASE

SYSTEMata Warehousingata Warehousing

Development of a data warehouse includes development of systems toextract data from operating systems plus installation of a warehouse

database system that provides managers flexible access to the dataData Miningata Mining

A class of database applications that look for hidden patterns in a groupof data that can be used to predict future behavior

Data Modelingata Modeling

The analysis of data objects and their relationships to other data objects.Data modeling is often the first step in database design and object-oriented programming as the designers first create a conceptual model of

how data items relate to each other. Data modeling involves a progressionfrom conceptual model to logical model to physical schema.

MELJUN CORTESELJUN CORTES

Page 55: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 55/79

MELJUN CORTESELJUN CORTES

Page 56: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 56/79

MELJUN CORTESELJUN CORTES

Page 57: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 57/79

Page 58: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 58/79

MELJUN CORTESELJUN CORTES

Page 59: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 59/79

MELJUN CORTESELJUN CORTES

Page 60: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 60/79

MELJUN CORTESELJUN CORTES

Page 61: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 61/79

Page 62: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 62/79

Page 63: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 63/79

Page 64: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 64/79

Page 65: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 65/79

Page 66: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 66/79

Page 67: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 67/79

Page 68: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 68/79

Page 69: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 69/79

Page 70: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 70/79

Page 71: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 71/79

Page 72: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 72/79

Page 73: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 73/79

Page 74: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 74/79

Page 75: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 75/79

Page 76: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 76/79

Page 77: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 77/79

Page 78: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 78/79

Page 79: MELJUN Database Lecture Meljun

8/14/2019 MELJUN Database Lecture Meljun

http://slidepdf.com/reader/full/meljun-database-lecture-meljun 79/79