12/20/16
Kicking off..
Class Rules
On Time
Disciplined
Participative
Decide what will happen if any of the above rule is violated?
Grading Policy
Mid-Term
Final Exam
Teacher Evaluation
25%
50%
25%
Class participation/Attendence
Assignment/Quiz
Project
12/20/16
5%
10%
10%
Chapter 6:
INPUT AND OUTPUT
HARDWARE
3
12/20/16
Data Processing
Data processing:
Any operation or set of operations performed
upon data, whether or not by automatic
means, such as collection, recording,
organization,
storage,
adaptation
or
alteration to convert it into useful information.
1.
2.
3.
Simple example
Example
Data Processing
Disk
File Organization
Describes
how records
are stored within a file
Two organization
methods
Sequential
Direct (relative)
File Access
Method by which computer programs read or
write records on a file
Sequential access
Direct (random) access
Sequential Access
Every
Sequential Access
gap (IRG)
Blocking:
14
15
SEQUENTIAL
Data stored on a CD device (direct-access) can be accessed either
sequentially or nonsequentially
Data stored on a tape (sequential access) can be accessed only
sequentially
Main Disadvantage of
Nonsequential Access
DATA MANAGEMENT
21
12/20/16
Motivation
22
Storage of data
Organization of data
Access to data
Processing of data
CNG 351
involve:
Representation of Data
+
Operations for accessing data
Difference:
23
Data
dependence
dependence
Data Redundancy
Data redundancy results in data inconsistency
Different and conflicting versions of the same
data appear in different places
Errors more likely to occur when complex entries
are made in several different files and/or recur
frequently in one or more files
Data anomalies develop when required changes
in redundant data are not made successfully
Data Redundancy
Types of data anomalies:
Update
anomalies
Insertion
Deletion
anomalies
anomalies
Database Systems
Problems
Database
Database Systems
30
CNG 351
File Attributes
Knowledge Generation
DATA
INFORMATION
File Management
File
Delivery
List
Toys
Addresses
Coal
Estimation
Naughty
Just what
asked for
Nice
Toys
Enterprise:
Application
System A
Application
System B
Application
Program A
Application
Program B
File System A
Customer
File System B
Invoice
File System N
Inventory
Application
System N
Application
Program N
1-37
Customer
Customer No.
Customer Name
Customer Addr.
Social Security ID
Inventory
Part No.
Part Description
Unit Price
Supplier
Quantities Remain
Quantities Ordered
Invoice
Customer No.
Customer Name
Part No.
Quantities
Unit Price
Parts
Part No.
Part Description
Supplier
Quantities Ordered
Customer Name
1-38
Unit Price
39
12/20/16
Inconsistent Data
Inflexibility
Limited Data Sharing
Poor enforcement of standards
Excessive program maintenance
Database:
Description of fields
Display and format instructions
Structure of files and tables
Security and access rules
Triggers and operational rules
Meta-Data
Program 2
Meta-Data
Program 3
Meta-Data
Program 1
Program 2
Program 3
FILE SYSTEM
Data
DATABASE
MetaData
Data
Database
A Database
Paper Databases
Still
Application
program
1-45
Basic Principles
DATABASE: A shared collection of interrelated data
designed to meet the varied information needs of
an organization.
DATABASE MANAGEMENT SYSTEM: A collection
of programs to create and maintain a database.
Define
Construct
Manipulate
Database
DATA
METADATA
ACCESS ENGINE
UTILITIES
Database Access
USER
INTERFACE
DATABASE
PROGRAM
DBMS Benefits
Minimal Data Redundancy
Consistency of Data
Integration of Data
Sharing of Data
Ease of Application Development
Uniform Security, Privacy, and Integrity Controls
Data Accessibility and Responsiveness
Data Independence
Reduced Program Maintenance
Why Database ?
VIEWS
MULTIPLE USERS
Management Systems
Hierarchical Model
IBM Information Management System (IMS) 1966
Network
Model
Model
Data
Model:
A set of concepts to describe the structure of a
database, and certain constraints that the
database should obey.
Data
Model Operations:
Operations for specifying database retrievals
and updates by referring to the concepts of
the data model.
Structured Databases
Relationships were implemented by physical
pointers (called sets) which allowed records
to be connected in different files.
Hierarchical databases allow only one parent
set; networks allow several. These permit
efficient processing but the sets must be
constructed on data entry and cannot be
rearranged later.
Relational Models
Relational models implement relationships
with matched data values in related files
(called primary and foreign keys).
Any
attributes can be matched. The connection
is established at retrieval so interconnections
can be developed as needed.
Relational Database
Primary Key (PK, Key)
Customer(CustomerID, Name, )
Order(OrderID, CustomerID, OrderDate, )
ItemOrdered(OrderID, ItemID, Quantity, )
Item(ItemID, Description, Price, )
Data organized as logical tables, consisted of rows (records) and
columns (attributes), and connected via key attributes.
Possible to retrieve almost any combination of rows and columns,
and a specific piece of data within a row.
Pointers transparent to developers, just need to specify Primary
Key (PK)Foreign Key (FK) relationships.
58
of
HIERARCHICAL MODEL
ADVANTAGES:
DISADVANTAGES:
Hierarchical Database
First commercial standard (IBMs IMS)
Still used in legacy systems
Customers
file folders which contain
orders which contain items
Entry point
Customer
XYZ
pointers
Order 2
Order 1
Order
files
pointers
Item A
Items
Item# ItemName
998 Dog Food
764 Cat Food
64
of
Quantity
12
11
Item B
Item A
Item C
Hierarchy
SECTION
STUDENT
COLLEGE
INSTRUCTOR
COLLEGE
Each file can have only one parent. To implement a second parent (COLLEGE)
we have to implement a shadow copy.
NETWORK MODEL
ADVANTAGES:
DISADVANTAGES:
Network Database
Entry point
Relationships between records also
supported by pointers;
complex programming.
Customer
XYZ
Order 1
Order 2
Entry points
Item A
Item B
Item C
Network
SECTION
STUDENT
INSTRUCTOR
COLLEGE
Each file can have several parents. Both SECTION and COLLEGE are parent
files..
Relational
SECTION
SECTION-STUDENT
SECTION-KEY
STUDENT-KEY
SECTION-INSTRUCTOR
SECTION-KEY
INSTRUCTOR-KEY
INSTRUCTOR
STUDENT
COLLEGE-KEY
COLLEGE-KEY
COLLEGE
Each file can have several parents. Both SECTION and COLLEGE are parent
files..
Relational Terminology
Entity
Attribute
property of an entity
Relationship
Advantages of Database
Processing
More
information
from same data
Shared data
Balancing conflicts
among users
Controlled
redundancy
Consistency
Integrity
Security
Increased
productivity
Data
independence
Disadvantages of Database
Processing
Increased
size
Increased complexity
Increased
impact of failure
Difficulty of recovery
Cost
Health
Law Enforcement
Automotive Repair
Libraries
Agriculture
80
12/20/16
81
12/20/16