meljun cortes database system

79
DATABASE DATABASE SYSTEM SYSTEM MELJUN CORTES MELJUN CORTES

Upload: meljun-cortes

Post on 06-May-2015

1.569 views

Category:

Technology


1 download

DESCRIPTION

MELJUN CORTES DATABASE SYSTEM DATABASE MANAGEMENT SYSTEM LECTURE IN CS 104, major subject in BS in Computer Science.

TRANSCRIPT

Page 1: MELJUN CORTES DATABASE SYSTEM

DATABASE DATABASE SYSTEMSYSTEM

MELJUN CORTESMELJUN CORTES

Page 2: MELJUN CORTES DATABASE SYSTEM

We Are Learning Today

To recognize what a database is and identify where one might be used in and out of school.

To reconize the meaning of key database terms such as Table, Record, Field, Form, ReportTable, Record, Field, Form, Report and Queryuery.

To understand what querying a database is.

Understanding Basic Database concepts

MELJUN CORTESMELJUN CORTES

Page 3: MELJUN CORTES DATABASE SYSTEM

DATA ORGANIZATIONDATA ORGANIZATIONCHARACTERCHARACTER is the basic building block of DATADATA which consist of upper & lower case letter numeric digit (0, 1, 2, etc.) or special character (-, +, -).

CHARACTERCHARACTER are put together to form a FACTFACT. FACTFACT are called Field, Item, Word, or String of Character.FACTFACT – a number, a name, or a combination of Character.

RECORD – a collection of related FACTS.Example:1.) Employee Record – it is collection of FACT about one employee.2.) It indicates name, address, phone #, pay rate, earning made to

date & so on.

MELJUN CORTESMELJUN CORTES

Page 4: MELJUN CORTES DATABASE SYSTEM

FILEFILE – is a collection of related RECORDRECORD.Example: 1.) A collection of all employee record for one company would be an Employee FileEmployee File. 2.) Inventory FileInventory File – collection of all inventory record for a particular company or organization.

DATA ORGANIZATIONDATA ORGANIZATION

Student ID# : 034456Student Name : MELJUN CORTESCourse : BSCS – 4Birthday : October 2, 1975Zodiac Sign : Libra

Student ID# : 034456Student Name : MELJUN CORTESCourse : BSCS – 4Birthday : October 2, 1975Zodiac Sign : Libra

Student ID# : 034456Student Name : MELJUN CORTESCourse : BSCS – 4Birthday : October 2, 1975Zodiac Sign : Libra

FILEFILERECORDRECORD

MELJUN CORTESMELJUN CORTES

Page 5: MELJUN CORTES DATABASE SYSTEM

DATA ORGANIZATIONDATA ORGANIZATIONHIERARCHY OF DATA HIERARCHY OF DATA :

CHARACTER – are combined to make a Fact.

FACT – are combined to make Record.

RECORD – are combined to make File.

FILE – are combined to make DataBase

DataBase

File

Record

Fact

Character

Note: The Heart of most Organization is DATADATA..

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

Note: A data base is used as the raw materialraw material or input datainput data for all of the application system perform by the organization.

MELJUN CORTESMELJUN CORTES

Page 6: MELJUN CORTES DATABASE SYSTEM

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN 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

Each ROW is a RECORD.Each ROW is a RECORD.Each COLUMN is a FIELD.Each COLUMN is a FIELD.COLUMN TITLES are FIELD NAME.COLUMN TITLES are FIELD NAME.The type of DATA stored in a FIELD is a FIELD TYPE.The type of DATA stored in a FIELD is a FIELD TYPE.The number of CHARACTER in a FIELD is its FIELD WIDTH.The number of CHARACTER in a FIELD is its FIELD WIDTH.A DATABASE is composed of one or more TABLE.A DATABASE is composed of one or more TABLE.A DATABASE is a FILE which is created in automated DBMS SOFTWARE.A DATABASE is a FILE which is created in automated DBMS SOFTWARE.

FIELD NAMEFIELD NAME

RECORD

RECORD

RECORD

RECORD

TABLE

Page 7: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEMEXAMPLE OF DATABASE STRUCTURE:Structure for Database :C:\STLMASTER.dbfStructure for Database :C:\STLMASTER.dbfNumber of Data Records : 268 recordsNumber of Data Records : 268 recordsDate of last update : 10/26/1996Date of last update : 10/26/1996Filename of DATABASE FILE : STLMASTER.dbfFilename of DATABASE FILE : STLMASTER.dbf

Field Field Name Field Field Name Field Data Types Field Width Dec IndexField Data Types Field Width Dec Index

11 AppNumberAppNumber character 6 character 6 22 AppDateAppDate date date 8 833 NameName character 20character 2044 Address character 30Address character 3055 LoanAmount numeric 12 2LoanAmount numeric 12 266 Rebate numeric 7 2Rebate numeric 7 277 Interest numeric 7 2Interest numeric 7 288 Balance numeric 12 2Balance numeric 12 299 Penalty numeric 7 2Penalty numeric 7 2

Page 8: MELJUN CORTES DATABASE SYSTEM

DATA ORGANIZATIONDATA ORGANIZATIONDATA – 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 CORTESMELJUN CORTES

Page 9: MELJUN CORTES DATABASE SYSTEM

DATA ORGANIZATIONDATA ORGANIZATIONINFORMATION PROCESSING – a special case of data

processing is the procedure of transforming datadata into informationinformation which

can be used to make better decision.

Data Processing System – includes all people, procedures & computer device used to produce

desirable output or meaningful information.

Information Processing System – includes all people, procedures, computer

devices used to procedure useful that can be used in decision making

MELJUN CORTESMELJUN CORTES

Page 10: MELJUN CORTES DATABASE SYSTEM

DATA ORGANIZATIONDATA ORGANIZATIONOverview of DATA Processing

Ex. Payroll System

INPUT PROCESSING OUTPUT

Example:1.) Pay Rate2.) Hours Worked3.) Payroll

Deduction

Example:

1.) Classifying

2.) Sorting

3.) Calculating

4.) Storing

5.) Summarizing

6.) Reproducing

Example: 1.) Pay Slip 2.) Payroll Report

MELJUN CORTESMELJUN CORTES

Page 11: MELJUN CORTES DATABASE SYSTEM

INFORMATION SYSTEMINFORMATION SYSTEMHardware, Software, People, Procedures, Policies, DATA are combined to create an INFORMATIONINFORMATION

SYSTEMSYSTEM. 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 INFORMATION SYSTEMS

provide Decision Makers with ON-DEMAND REPORTS and INQUIRY CAPABILITIES as well as routine

periodic reports.MELJUN CORTESMELJUN CORTES

Page 12: MELJUN CORTES DATABASE SYSTEM

DATABASE DATABASE SYSTEMSYSTEM

MELJUN CORTESMELJUN CORTES

Page 13: MELJUN CORTES DATABASE SYSTEM

DATABASE SYSTEMDATABASE SYSTEM

Database ConceptsData vs.Information

DBMSMELJUN CORTESMELJUN CORTES

Page 14: MELJUN CORTES DATABASE SYSTEM

DatabaseDatabaseComputerized Record Keeping SystemCollection of Data used by an organization to

1. Record its Operations2. Support Decision Making

MELJUN CORTESMELJUN CORTES

Page 15: MELJUN CORTES DATABASE SYSTEM

DataDataRaw facts and figures

Can be of typeTextNumberSound, Image, Chart, Video

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 16: MELJUN CORTES DATABASE SYSTEM

InformatioInformationnProcessed Data

Used for Decision Making

Data is also INFORMATIONInformation creates DATA

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 17: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEMEXAMPLE OF DATABASE STRUCTURE:Structure for Database :C:\STLMASTER.dbfStructure for Database :C:\STLMASTER.dbfNumber of Data Records : 268 recordsNumber of Data Records : 268 recordsDate of last update : 10/26/1996Date of last update : 10/26/1996Filename of DATABASE FILE : STLMASTER.dbfFilename of DATABASE FILE : STLMASTER.dbf

Field Field Name Field Field Name Field Data Types Field Width Dec IndexField Data Types Field Width Dec Index

11 AppNumberAppNumber character 6 character 6 22 AppDateAppDate date date 8 833 NameName character 20character 2044 Address character 30Address character 3055 LoanAmount numeric 12 2LoanAmount numeric 12 266 Rebate numeric 7 2Rebate numeric 7 277 Interest numeric 7 2Interest numeric 7 288 Balance numeric 12 2Balance numeric 12 299 Penalty numeric 7 2Penalty numeric 7 2

Page 18: MELJUN CORTES DATABASE SYSTEM

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN 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

Each ROW is a RECORD.Each ROW is a RECORD.Each COLUMN is a FIELD.Each COLUMN is a FIELD.COLUMN TITLES are FIELD NAME.COLUMN TITLES are FIELD NAME.The type of DATA stored in a FIELD is a FIELD TYPE.The type of DATA stored in a FIELD is a FIELD TYPE.The number of CHARACTER in a FIELD is its FIELD WIDTH.The number of CHARACTER in a FIELD is its FIELD WIDTH.A DATABASE is composed of one or more TABLE.A DATABASE is composed of one or more TABLE.A DATABASE is a FILE which is created in automated DBMS SOFTWARE.A DATABASE is a FILE which is created in automated DBMS SOFTWARE.

FIELD NAMEFIELD NAME

RECORD

RECORD

RECORD

RECORD

TABLE

Page 19: MELJUN CORTES DATABASE SYSTEM

A DataBase Management SystemA DataBase Management System

(DBMS)(DBMS)often just called ‘Database Software’

InputInput Processing OutputOutput

StoringQueryingSorting

FORMSFORMS REPORTSREPORTS

Sources Documents

Like:

Enrollment Forms

Printed

Documents

Like:

Assessment Forms

MELJUN CORTESMELJUN CORTES

Page 20: MELJUN CORTES DATABASE SYSTEM

Database TerminologyDatabase TerminologyTerm 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 CORTESMELJUN CORTES

Page 21: MELJUN CORTES DATABASE SYSTEM

The Russian Doll AnalogyThe Russian Doll Analogy

Fields inside of…

A Database

Tables inside of…

Records inside of…

Data inside of…

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 22: MELJUN CORTES DATABASE SYSTEM

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN 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

Each ROW is a RECORD.Each ROW is a RECORD.Each COLUMN is a FIELD.Each COLUMN is a FIELD.COLUMN TITLES are FIELD NAME.COLUMN TITLES are FIELD NAME.The type of DATA stored in a FIELD is a FIELD TYPE.The type of DATA stored in a FIELD is a FIELD TYPE.The number of CHARACTER in a FIELD is its FIELD WIDTH.The number of CHARACTER in a FIELD is its FIELD WIDTH.A DATABASE is composed of one or more TABLE.A DATABASE is composed of one or more TABLE.A DATABASE is a FILE which is created in automated DBMS SOFTWARE.A DATABASE is a FILE which is created in automated DBMS SOFTWARE.

FIELD NAMEFIELD NAME

RECORD

RECORD

RECORD

RECORD

TABLE

Page 23: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEMEXAMPLE OF DATABASE STRUCTURE:Structure for Database :C:\STLMASTER.dbfStructure for Database :C:\STLMASTER.dbfNumber of Data Records : 268 recordsNumber of Data Records : 268 recordsDate of last update : 10/26/1996Date of last update : 10/26/1996Filename of DATABASE FILE : STLMASTER.dbfFilename of DATABASE FILE : STLMASTER.dbf

Field Field Name Field Field Name Field Data Types Field Width Dec IndexField Data Types Field Width Dec Index

11 AppNumberAppNumber character 6 character 6 22 AppDateAppDate date date 8 833 NameName character 20character 2044 Address character 30Address character 3055 LoanAmount numeric 12 2LoanAmount numeric 12 266 Rebate numeric 7 2Rebate numeric 7 277 Interest numeric 7 2Interest numeric 7 288 Balance numeric 12 2Balance numeric 12 299 Penalty numeric 7 2Penalty numeric 7 2

Page 24: MELJUN CORTES DATABASE SYSTEM

What is a What is a DBMSDBMS??A collection of computer programs that allow storage, modification, and extraction of information from a databaseinformation from a database. There are many different types of DBMS ranging from small systems that run on personal computers 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 CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 25: MELJUN CORTES DATABASE SYSTEM

Introduction Introduction To DBMS To DBMS ConceptsConcepts

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 26: MELJUN CORTES DATABASE SYSTEM

What is a What is a DBMSDBMS??A collection of computer programs that allow storage, modification, and extraction of information from a databaseinformation from a database. There are many different types of DBMS ranging from small systems that run on personal computers 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 CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 27: MELJUN CORTES DATABASE SYSTEM

Examples of DATABASE(1)Examples of DATABASE(1)Admission System Examination System Library SystemPayroll & Personnel Management SystemAccounting SystemHotel Reservation SystemAirline Reservation System

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 28: MELJUN CORTES DATABASE SYSTEM

Examples of DATABASEExamples of DATABASE (2)Patient Recording SystemInventory SystemSales and Purchase and Accounting SystemEnrollment SystemKnowledge-Based Management System

Every Government, Military, Private and other organizations plus Individual can make use of DB

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 29: MELJUN CORTES DATABASE SYSTEM

Data ManagementData Management

Manual Filing SystemManual Filing System

Computerized Filing Computerized Filing SystemSystem

Database SystemsDatabase Systems

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 30: MELJUN CORTES DATABASE SYSTEM

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 System-- Computerized Data Maintenance System

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 31: MELJUN CORTES DATABASE SYSTEM

Library SystemLibrary System - Example - Example

Members

Catalog

Register

MembersManagementApplication

CatalogManagementApplication

TransactionManagementApplication

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

FilesFiles ApplicationsApplications OperationsOperations

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 32: MELJUN CORTES DATABASE SYSTEM

Database SystemDatabase SystemSingle, Central, Large Repository

Shared Resource

Have Logical Connections among data items

DBA is responsible of its design, creation and maintenance

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Is a PERSONIs a PERSON

Page 33: MELJUN CORTES DATABASE SYSTEM

MembersManagementApplication

CatalogManagementApplication

TransactionManagementApplication

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

DBMSDBMS

DatabaseDatabase

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Library SystemLibrary System - - ExampleExample

Page 34: MELJUN CORTES DATABASE SYSTEM

DBMSDBMSSoftware Package that providesSoftware Package that provides

Support to applications systemSupport to applications system

-- Computerized DATA Handling-- Computerized DATA Handling

User-interface for on-line queriesUser-interface for on-line queries

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 35: MELJUN CORTES DATABASE SYSTEM

Advantages of DBMS (1)Advantages of DBMS (1)Sharing of DataControl of Redundancy

-(unnecessary wastage of disk space)Data ConsistencyImprovement of Data StandardsImprovement of Data Integrity

-(Intra-record, inter-record, referential)Balancing of ConflictsFaster Development of New Applications

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 36: MELJUN CORTES DATABASE SYSTEM

Advantages of DBMS Advantages of DBMS (2)(2)Better Security

PasswordsEncryptionViews and Stored Procedures

Better Data Accessibility(query language- SQL programming)

Economy of ScaleTransaction handlingBetter backup and Recovery Procedures

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 37: MELJUN CORTES DATABASE SYSTEM

Disadvantages of DBMSDisadvantages of DBMSHigher Costs of

DBMSHardwareConversionProgramming

Slow Processing of Some ApplicationsMore Security RisksMore Difficult Recovery

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 38: MELJUN CORTES DATABASE SYSTEM

Kinds of DatabasesKinds of DatabasesRelational: 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 ServerIDS Server

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

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

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 39: MELJUN CORTES DATABASE SYSTEM

Relational DBMSRelational DBMSDATABASE SYSTEMDATABASE SYSTEM

TABLETABLE

TABLETABLE

TABLETABLETABLETABLE

Page 40: MELJUN CORTES DATABASE SYSTEM

Important RDBMS ObjectsImportant RDBMS Objects

TablesTables

ViewsViews

TriggersTriggers

Stored ProceduresStored Procedures

FunctionsFunctions

Primary KeyPrimary Key

Foreign KeyForeign Key

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 41: MELJUN CORTES DATABASE SYSTEM

Networked DBMSNetworked DBMS

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 42: MELJUN CORTES DATABASE SYSTEM

SQL:

It is an acronym for Structured Query It is an acronym for Structured Query Language. Language.

It is the language in which, the client It is the language in which, the client sends the request sends the request to the to the database for data database for data

Eg. Select name, address Eg. Select name, address

From emp From emp

Where city = ‘BUTUAN CITY’Where city = ‘BUTUAN CITY’

SQL:

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 43: MELJUN CORTES DATABASE SYSTEM

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

Language Language

Apart from writing the SQL you also have the programming language 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 CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 44: MELJUN CORTES DATABASE SYSTEM

Database DesignDatabase DesignDatabase design is the process of producing a detailed data model of a database. This logical data model contains all the needed logical and physical design choices and physical storage parameters needed to generate a design in a Data Definition Language, which can then be used to create a database. A fully attributed 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 CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 45: MELJUN CORTES DATABASE SYSTEM

Database ObjectsDatabase ObjectsA Database Trigger is procedural code that is automatically executed in response to certain events on a particular table in a database. Triggers can restrict access to specific data, perform logging, or audit data modifications.

A Database View is a virtual or logical table composed of the result set of a query. Unlike ordinary tables (base tables) in a relational database, a view is not part of the physical schema: it is a dynamic, virtual table computed or collated from data in the database. Changing the data in a table alters the data shown in the view

In relational databasesrelational databases, SQL databases, and flat file databases,a Table is a set of data elements (values) that is organized using a model of horizontal rows and vertical columns.

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 46: MELJUN CORTES DATABASE SYSTEM

In database packagesdatabase packages, the term Cursor refers to a control structure for the successive traversal (and potential processing) of records in a result set.

A Transaction Log (also database log or binary log) is a history of actions executed by a database management system to guarantee ACID properties over crashes or hardware failures. Physically, a log is a file of updates done to the database, stored in stable storage.

A Database Index is a data structure that improves the speed of operations in a table. Indexes can be created using one or more columns, providing the basis for both rapid random lookups and efficient ordering of access to records.

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

Database ObjectsDatabase ObjectsDATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 47: MELJUN CORTES DATABASE SYSTEM

NormalizatioNormalizationnWhy Normalize?

Ideally, a relational databaserelational database table should be designed in such a way as to exclude the possibility of update, insertion, and deletion anomalies. The normal forms of relational database theory provide guidelines for deciding whether a particular design will be vulnerable to such anomalies. It is possible to correct an unnormalized design so as to make it adhere to the demands of the normal forms: this is called normalization.

A table that is not sufficiently normalized can suffer from

logical inconsistencies of various types, and fromanomalies involving data operations causingUpdate, Insert and Delete Anomalies.

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 48: MELJUN CORTES DATABASE SYSTEM

TRANSACTION MANAGEMENTTRANSACTION MANAGEMENTWhat is a Database Transaction ?

A database transactiondatabase transaction is a unit of interaction with a database management system or similar system that is treated 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 completed or aborted. Ideally, a database system will guarantee the properties of Atomicity, Consistency, Isolation and Durability (ACID) for each transaction.

A Simple Transaction1. Begin the transaction2. Execute several queries 3. Commit the transaction

MELJUN CORTESMELJUN CORTES

DATABASE SYSTEMDATABASE SYSTEM

Page 49: MELJUN CORTES DATABASE SYSTEM

ACIDACIDIn computer sciencecomputer science, ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database 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 guarantee that 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 a transaction cannot break the rules, or integrity constraints, of the database.Isolation - Isolation refers to the ability of the application to make operations in a transaction appear isolated from all other operationsDurability -Durability ensures that the results of a completed transaction are permanent and can survive future system and media failures; that is, once they are done, they can not be undone. can not be undone.

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 50: MELJUN CORTES DATABASE SYSTEM

Kinds of Database Kinds of Database ConsultantsConsultants

DATABASE DesignersDATABASE Designersis a personis a person

DATABASE DevelopersDATABASE Developersis a personis a person

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

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 51: MELJUN CORTES DATABASE SYSTEM

DATABASE Designers:DATABASE Designers:

These consultants Analyze, These consultants Analyze, design the complete design the complete structure of the database.structure of the database.

They design Tables, Views, They design Tables, Views, Normalization, ER Diagram, Normalization, ER Diagram, Integrity constraints, etc.Integrity constraints, etc.

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 52: MELJUN CORTES DATABASE SYSTEM

DATABASE DevelopersDATABASE Developers::These consultant write stored These consultant write stored procedures, triggers, functions, etc.procedures, triggers, functions, etc.

Technical terms found in the resume Technical terms found in the resume of such consultants —of such consultants —

TriggersTriggers

Stored ProceduresStored Procedures

PackagesPackages

Unix Shell ScriptingUnix Shell Scripting

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 53: MELJUN CORTES DATABASE SYSTEM

DBDBADMINISTRATORADMINISTRATOR::These consultants’ profile These consultants’ profile includes installation, includes installation, configuration, migration, configuration, migration, backup, recovery operationsbackup, recovery operationsVarious Tasks of the DBA are:Various Tasks of the DBA are:

a) Granting accessa) Granting accessb) User creation and deletionb) User creation and deletionc) Performance tuningc) Performance tuningd) Query optimizationd) Query optimization

DATABASE SYSTEMDATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 54: MELJUN CORTES DATABASE SYSTEM

Related Skills in DATABASE SYSTEMData WarehousingData Warehousing

Development of a data warehouse includes development of systems to extract data from operating systems plus installation of a warehouse database system that provides managers flexible access to the data Data MiningData MiningA class of database applications that look for hidden patterns in a group of data that can be used to predict future behavior Data ModelingData ModelingThe 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 progression from conceptual model to logical model to physical schema.

MELJUN CORTESMELJUN CORTES

Page 55: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 56: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 57: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 58: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 59: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 60: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 61: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 62: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 63: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 64: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 65: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 66: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 67: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 68: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 69: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 70: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 71: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 72: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 73: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 74: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 75: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 76: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 77: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 78: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES

Page 79: MELJUN CORTES DATABASE SYSTEM

MELJUN CORTESMELJUN CORTES