meljun cortes - database system/dbms
TRANSCRIPT
-
8/9/2019 MELJUN CORTES - Database System/DBMS
1/53
File SystemsFile Sy
stems
& Databases& Databases
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
http://meljuncortes.blogspot.com
-
8/9/2019 MELJUN CORTES - Database System/DBMS
2/53
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
2
Examples of Use of DatabaseSystems
Banks
Travel Agents
Scientific Data Collection
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
3/53
3
Introducing the Database
Major Database Concepts
Data and information
Data - Raw facts
Information - Processed data
Data management
Database
Metadata (=Data about data)
Database management system (DBMS)
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
4/53
4
Introducing the Database
Database management system (DBMS) DBMS is the software that interacts with the users, application
programs, and the database. Example : IBM DB2, Microsoft
SQL Server, Oracle, MySQL etc.
Data DBMSApplication
Programs
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
5/53
5
Introducing the Database
Importance of DBMS
It helps make data management moreefficient and effective.
It provides end users better access to moreand better-managed data.
It promotes an integrated view of
organizations operations -- big picture. It reduces the probability of inconsistent
data.
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
6/53
6
The DBMS Manages the Interaction
Between the End User and the Database
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
7/53
7
The Importance of Database Design
A well-designed database facilitates datamanagement and becomes a valuable
information generator.
A poorly designed database is a breedingground for uncontrolled data redundancies.
A poorly designed database generates
errors that lead to bad decisions.
Introducing the Database
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
8/53
8
Basic File Terminology
Data Raw facts that have little meaning unlessthey have been organized in some logicalmanner.
Field A character or group of characters
(alphabetic or numeric) that has a specificmeaning. A field might define a telephonenumbers, a birth date, a customer name, ayear-to-date (YTD) sales value, and so on.
Record A logically connected set of one or morefields that describes a person, place, orthing.
File A collection of related records.
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
9/53
-
8/9/2019 MELJUN CORTES - Database System/DBMS
10/53
10
Data Model - A collection of concepts that
can be used to describe the structure ofdatabase.
Database instance Separate location ofmemory reserved for running a specificdatabase
Database Schema- the description of adatabase, which is specified duringdatabase design and is not expected tochange frequently.
Basic File Terminology
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
11/53
11
A Simple File System
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
12/53
12
File SystemCritique File System Data Management
File systems require extensive programming ina third-generation language (3GL).
As the number of files expands, systemadministration becomes difficult.
Making changes in existing file structures isimportant and difficult.
Security features to safeguard data aredifficult to program and usually omitted.
Difficulty to pool data creates islands of
information.
-
8/9/2019 MELJUN CORTES - Database System/DBMS
13/53
F t
-
8/9/2019 MELJUN CORTES - Database System/DBMS
14/53
14
Field Definitions and Naming Conventions
A good (flexible) record definitionanticipates reporting requirements bybreaking up fields into their components.
Example:
Customer Name --> Last Name, FirstName, Initial
Customer Address --> StreetAddress, City, State
F e ystemCritique
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
15/53
F t
-
8/9/2019 MELJUN CORTES - Database System/DBMS
16/53
16
FIELD CONTENTS
CUS_LNAME Customer last nameCUS_FNAME Customer first name
CUS_INITIAL Customer initial
CUS_AREACODE Customer area code
CUS_PHONE Customer phone
CUS_ADDRESS Customer street address or box number
CUS_CITY Customer city
CUS_STATE Customer state
F e ystemCritique
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
F t
-
8/9/2019 MELJUN CORTES - Database System/DBMS
17/53
17
Data Redundancy:
Uncontrolled data redundancy sets thestage for
Data Inconsistency (lack of data integrity)
Data anomalies
Modification anomalies
Insertion anomalies
Deletion anomalies
F e ystemCritique
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
D t
-
8/9/2019 MELJUN CORTES - Database System/DBMS
18/53
18
The Database System Components
Hardware
Computer
Peripherals
Software
Operating systems software
DBMS software Applications programs and
utilities software
Data aseSystems
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
D t
-
8/9/2019 MELJUN CORTES - Database System/DBMS
19/53
19
The Database System Components
People
Systems administrators (SA)
Database administrators (DBAs) / Owner (Dbo)
Database designers Systems analysts and programmers
End users
Procedures (sp)
Instructions and rules that govern the designand use of the database system
Data
Collection of facts stored in the database
Data aseSystems
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
D t
-
8/9/2019 MELJUN CORTES - Database System/DBMS
20/53
20
The Database System Components
The complexity of database systems dependson various organizational factors:
Organizations size
Organizations function
Organizations corporate culture
Organizational activities and environment
Database solutions must be cost effective ANDstrategically effective.
Data aseSystems
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
Data ase
-
8/9/2019 MELJUN CORTES - Database System/DBMS
21/53
21
Types of Database Systems
Number of Users
Single-user
Desktop database
Multiuser
Workgroup database
Enterprise database
Scope/limitation
Desktop
Workgroup
Enterprise
Data aseSystems
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
Data ase
-
8/9/2019 MELJUN CORTES - Database System/DBMS
22/53
22
The types of Database Systems
Location
Centralized Database
Distributed Database
Use
Transactional (Production)
Decision supportData warehouse
Data aseSystems
MELJUN CORTES MBA MPAMELJUN CORTES,MBA,MPAMELJUN CORTES,MBA,MPAMELJUN CORTES,MBA,MPA Data ase
-
8/9/2019 MELJUN CORTES - Database System/DBMS
23/53
23
DBMS Functions
1.Data Dictionary Management
2.Data Storage Management
3.Data Transformation and Presentation
4.Security Management
5.Multi-User Access Control
6.Backup and Recovery Management
7.Data Integrity Management
8.Database Access Languages (DDL and DML) andApplication Programming Interfaces
9.Database Communication Interfaces
Data aseSystems
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
b d l
-
8/9/2019 MELJUN CORTES - Database System/DBMS
24/53
24
A database model is a collection of logical constructsused to represent the data structure and the datarelationships found within the database.
Two Categories of Database Models
Conceptual models focus on the logical nature ofthe data representation. They are concerned withwhatis represented rather than how it is
represented.
Implementation models place the emphasis on howthe data are represented in the database or on howthe data structures are implemented.
Database Models
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
25/53
25
Three Types of Relationships
One-to-many relationships (1:M)
A painter paints many different paintings, but each oneof them is painted by only that painter.
PAINTER (1) paints PAINTING (M)
Many-to-many relationships (M:N) An employee might learn many job skills, and each job
skill might be learned by many employees.
EMPLOYEE (M) learns SKILL (N)
One-to-one relationships (1:1)
Each store is managed by a single employee and eachstore manager (employee) only manages a single store.
EMPLOYEE (1) manages STORE (1)
Database Models
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
26/53
26
Three Types of ImplementationDatabase Models
Hierarchical database model
Network database model
Relational database model
Database Models
MELJUN CORTES MBA MPAMELJUN CORTES,MBA,MPAMELJUN CORTES,MBA,MPAMELJUN CORTES,MBA,MPA M d l
-
8/9/2019 MELJUN CORTES - Database System/DBMS
27/53
27
Hierarchical Database Model
Basic Structure
Collection of records logically organized to conformto the upside-down tree (hierarchical) structure.
The top layer is perceived as the parent of thesegment directly beneath it.
The segments below other segments are thechildren of the segment above them.
A tree structure is represented as a hierarchicalpath on the computers storage media.
Models
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
28/53
Types of Database Data Models -
Hierarchical
The first database systems developed were
hierarchical
Databases using the hierarchical model
usephysical pointers to link records
MELJUN CORTES MBA MPAMELJUN CORTES,MBA,MPAMELJUN CORTES,MBA,MPAMELJUN CORTES,MBA,MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
29/53
29
Pointer Based
Linkages BetweenEntities
Location Prof# Name Office# 1st Stude
P10 J13 Jones SB312 P203
P11 M7 Morgen BA 218 P200P12 D23 Davis SB 106 P201
Location Stud# S_name
Class
Standing
Next
Prof_Stud
P200 1234 Smith Fr P202
P201 4678 Davis So P204P202 2943 Evans Fr P206
P203 1874 Allen Jr P205
P204 4017 Lloyd Fr *
P205 2318 Marx Sr P207
P206 6021 Keen So *
P207 5503 Watts Jr *
Pointers give thephysical location of a
related set of data, thelocation values(P10, P201, etc.) in ourexample are meant torepresent this type ofphysical location. Realpointers usually
indicate a displacementin a file. Instead of theP203 value in the firstprofessor record
we would see anindicator that therelated data begins at
the 4028th byte of thefile that stores studentMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
30/53
30
Location Prof# Name Office# 1st StudentP10 J13 Jones SB312 P203
P11 M7 Morgen BA218 P200
P12 D23 Davis SB 106 P201
Location Stud# S_name
Class
Standin
g
Next
Prof_Stud
P200 1234 Smith Fr P202
P201 4678 Davis So P204
P202 2943 Evans Fr P206
P203 1874 Allen Jr P205P204 4017 Lloyd Fr *
P205 2318 Marx Sr P207
P206 6021 Keen So *
P207 5503 Watts Jr *
Pointer Based LinkagesBetween Entities
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
31/53
Types of Database Data Models -
Hierarchical
The first database systems developed were
hierarchical
Databases using the hierarchical model
use physical pointers to link records
allow only hierarchical relationships
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
32/53
32
Hierarchical
A hierarchical relationship is onewhere each entity at a lower levelof the hierarchy is related to onlyone type of entity at a higherlevel of the hierarchy (a higherlevel entity can be linked to twoor more lower level childentities)
AA
BB CC
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA Types of Database Data
-
8/9/2019 MELJUN CORTES - Database System/DBMS
33/53
Types of Database Data
Models -HierarchicalThe first database systems developed were hierarchical
Databases using the hierarchical model
use physical pointers to link records
allow only hierarchical relationships
+Hierarchical databases provide very efficient high-speed retrieval
They are difficult to modify as an organizations data
needs change It is difficult to use them to represent non-
hierarchical relationships
(essentially you must create multiple linkedhierarchical databases in order to representnetwork relationships)
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
Types of Database Data
-
8/9/2019 MELJUN CORTES - Database System/DBMS
34/53
34
Types of Database Data
Models -NetworkThe next type of data model developed was the network model
Databases using the Network model use physical pointers to link records - like the hierarchical model
do support network as well as hierarchical relationships
+Network databases provide very efficient high-speed retrieval
+Can represent network, as well as, hierarchical relationshipseasily
Are difficult to modify as an organizations data needs change
Have complex pointer structures which can be difficult tomanipulate and hard for end-users to understand.
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
35/53
35
A network relationship is one in whichan entity at a lower level can be linkedto two or more entities at a higherlevel.
E.G. - an order is related to both acustomer who placed it and asalesperson who made the sale
The hierarchical model does notsupport network relationships.
To capture them a second database
would have to be created and linkedto the first.
Network Relationships
AA
BBCC
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
36/53
36
Types of Database Data Models -
Relational Relational Database Model
Basic Structure
RDBMS allows operations in a human logicalenvironment.
The relational database is perceived as acollection of tables.
Each table consists of a series of row/columnintersections.
Tables (or relations) are related to eachother by sharing a common entitycharacteristic.
The relationship type is often shown in arelational schema.
A table yields complete data and structuralindependence.
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
37/53
37
Repetition of Identifying
Data to Link Related Data
Prof# Name Office#
J13 Jones SB312
M7 Morgen BA218
D23 Davis SB 106
Stud# S_name
Class
Standing Prof#
1234 Smith Fr M7
4678 Davis So D23
2943 Evans Fr M7
1874 Allen Jr J13
4017 Lloyd Fr D23
2318 Marx Sr J13
6021 Keen So M7
5503 Watts Jr J13
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
38/53
38
Linking Relational Tables
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
39/53
39
Relational Database
Model- Advantages Structural independence
Improved conceptual simplicity
Easier database design, implementation, management,
and use Ad hoc query capability (SQL)
Powerful database management system
Disadvantages
Substantial hardware and system software overhead
Possibility of poor design and implementation
Potential islands of information problems
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
40/53
40
A Relational Schema
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
41/53
41
Entity-Relationship Data Model
It is one of the most widelyaccepted graphical data modeling
tools.
It graphically represents data asentities and their relationships ina database structure.
It complements the relational datamodel concepts.
Entity-Relationship Data
Model
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
42/53
42
Entity Relationship Data Model
Basic Structure
E-R models are normally represented in anentity relationship diagram (ERD).
An entity is represented by a rectangle.
Each entity is described by a set of attributes.An attribute describes a particularcharacteristics of the entity.
A relationship is represented by a diamondconnected to the related entities.
Model
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
43/53
43
The ER Diagram
Complements the relational data model concepts
Represented in an entity relationship diagram (ERD)
Based on entities, attributes, and relationships
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA -
-
8/9/2019 MELJUN CORTES - Database System/DBMS
44/53
44
Entity-Relationship Data Model
Advantages
Exceptional conceptual simplicity
Visual representation
Effective communication tool
Integrated with the relational database model
Disadvantages
Limited constraint representation
Limited relationship representation
No data manipulation language Loss of information content
-Model
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA Types of Database Data
-
8/9/2019 MELJUN CORTES - Database System/DBMS
45/53
45
Types of Database Data
Models - Object Oriented Object-Oriented Database Model
Basic Structure
Objects are abstractions of real-world entities or events.
Attributes describe the properties of an object.
Objects that share similar characteristics are grouped inclasses.
A class is a collection of similar objects with sharedstructure (attributes) and behavior (methods).
Classes are organized in a class hierarchy.
An object can inherit the attributes and methods of theclasses above it.
-
8/9/2019 MELJUN CORTES - Database System/DBMS
46/53
46
Object-Oriented Database Model
Characteristics
An object is described by its factual content.
An object includes information aboutrelationships between the facts within theobject, as well as with other objects.
An object is a self-contained building block
for autonomous structures.
Types of Database Data
Models - Object Oriented
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
47/53
47
Object-Oriented Database Model
Advantages
Add semantic content
Visual presentation includes semantic content
Database integrity
Both structural and data independence
Disadvantages
Lack of OODM standards
Complex navigational data access
Steep learning curve
High system overhead slows transactions
Types of Database Data
Models - Object Oriented
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
48/53
48
A Comparison: The OO Data Model and
the ER Model
MELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
49/53
49
Centralized Versus Decentralized
Database Systems
Centralized Database with remote Access
All processing to support the database system is
performed on a central computer. Only input/outputfunctions are performed remotely.
(If PCs are used for remote access theyoperate in terminal emulation mode anddo not perform processing)
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
50/53
Centralized Database with Remote
Access
Terminal
Only I/Odone here
Terminal
Only I/Odone here
Terminal
Only I/Odone here
Terminal
Only I/Odone here
Central DBComputer
All processingrelated to DBSystem done
here
-
8/9/2019 MELJUN CORTES - Database System/DBMS
51/53
51
Centralized Database with remote Access All processing to support the database system is
performed on a central computer. Only
input/output functions are performed remotely. Client-Server Database
All data reside on a central server
Core database management processing isperformed on server
Application files and processing to request data,manipulate results and manage the userinterface is performed on client computers
Centralized Versus DecentralizedDatabase Systems
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
52/53
Client-Server Database System
Server
ComputerAll Database
access, retrievaland, manipula-tion processesperformed here
Client Comp
Syntax checksof SQL stmts.Manipulation- presentationof retrieved
data done here
Client Comp
Syntax checksof SQL stmts.Manipulation- presentationof retrieved
data done here
MELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPAMELJUN CORTES MBA MPA
-
8/9/2019 MELJUN CORTES - Database System/DBMS
53/53
53
References
ROB, P. AND CORONEL, C., 2004, Database
Systems. 6th Ed., Thomson Course Technology