0% found this document useful (0 votes)
25 views

Unit#1 Introduction - Fall 2024

Uploaded by

mz8640073
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Unit#1 Introduction - Fall 2024

Uploaded by

mz8640073
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 55

CC-215

Database Systems

— Unit 1 —
Introduction

Dr. Asif Sohail


University of the Punjab
Department of Information Technology, FCIT
Text & Reference Books
Database Systems – Design, Implementation and
Management: Carlos Coronel, Steven Morris (13th Ed.)
Modern Database Management: Jeffery. A. Hoffer (12th Ed.)
Database Systems: Thomas M. Connolly (6th Ed.)
Fundamentals of Database Systems: Elmasri (7th Ed.)
Database System Concepts: Abraham Silberschatz (7th Ed.)
OCA Oracle Database SQL Fundamentals Exam Guide
Oracle Database 11g SQL: Jason Price
Introduction to PL\SQL: Oracle Press
Course Information
 Resources:
\\printsrv\\teacher data\\Asif Sohail\\Database
Systems
• Office: (Ground Floor) Graduate Building
• Students Counseling hours :
• Mon, Wed: 11:00 – 12:30 PM
• email: [email protected]

Assessment Category Marks


Quizzes 12
Assignments 6
Presentations 2
Project 5

3
Course Overview
Introduction
File Processing System (FPS)
Database Architecture and Components
Structured Query Language (SQL)
 Data Query Language – DQL (SELECT Statement)
Database Development and Data Modeling
Relational Data Model and Relational Keys
Integrity Constraints and Rules
SQL Functions
Entity-Relationship (E-R) Model
SQL Joins
Subqueries
Creating Database Tables (Data Definition Language - DDL)

4
Course Overview
Normalization
SQL – Data Manipulation Language (DML)
Database Objects (Views, Indexes, …)
Transaction Management
Controlling User Rights & Access (Data Control Language - DCL)
Concurrency Control
Procedural SQL (PL/SQL)
Stored Procedures, Functions, Triggers
Distributed Databases
Big Data and NoSQL
Data Quality and Integration
Future Trends, Revision

5
Lecture Outline
Introduction
Data? Information? Database?
File Processing System (FPS)
Drawbacks of FPS
Database System or Integrated Database
Environment(IDE)
Advantages of IDE
Types of Databases

6
Introduction
 A database is a collection of related data.
 Data refers to the raw facts & figures of an ENTITY.
 An entity can be People, Object, Event, Process, Concept etc.
 The selection of data to be included in a database depends
upon organizational objectives and information requirements.
 The part of real world presented in a database is called mini-
world or universe of discourse.
 Data characteristics
 Large volume of facts

 Difficult to interpret

 Not suitable for decision making

 Extraction of useful information from the raw facts is very


tedious. Accordingly, data is processed to produce information.

7
Data

8
Data vs. Information
Information is derived from data.
Information is the processed data.
The representation and amount
of information depends upon the
requirements of a user.
Drill-down, Rollup operations.
When data is processed and organized into a form
needed for its application, it is called an Information
Product (IP).
Information may be presented either Textually or
Graphically or both

9
Information
 Information is used to reveal the meaning of data.
 Accurate, reliable, relevant and timely information is key to
good decision making.
 Information is now increasingly viewed as an organizational
asset (Redman, 2008) which can be used to improve
organizational performance and help an organization gain a
competitive advantage in the marketplace.
Dunn's Book of Life (1946)
 “Each person in the world creates a Book of Life. This Book
starts with birth and ends with death. Its pages are made up
of the records of the principal events in life.
Database/Record linkage is the name given to the process
of assembling the pages of this Book into a volume.”

10
Increasing Need of Database Systems
• The Model of Generating/Consuming Data has
Changed

ld Model: Few companies are generating data, all others are consuming data

New Model: all of us are generating data, and all of us are


consuming data

11
12
Exponential Data Growth

13
Data Dynamics
 The amount of available data in the modern
computer world is literally exploding (3 Vs: Volume,
Velocity, Variety)
 The modern data sources/types include multimedia
data, sensor’s data, data on web and so on.
 To get most out of data, we require tools than can
simplify the task of managing the data and extract
useful information out of it in timely fashion.
 Data Hierarchy
Field (Data Item) Record

Database File

14
Database
 Database is a shared collection of logically related data, and a
description of this data, designed to meet the information
requirements of multiple users in an organization.
 Database is an organized collection of data (and metadata)
about entities and relationships among entities.
 Metadata: Data that describes properties or characteristics
of other data OR it is “data about data”.
 The description of data is also known as system catalog or
data dictionary.
 Metadata allows database designers & users to understand
what data exists and what the data mean?
 Metadata describes the domain (set of possible values) and
the constraints for a data item.

15
Metadata Example

Data Item Value


Name Type Length Min Max Description

Course Alphanumeric 30 Course ID & Name

Section Integer 1 1 9 Section Number


Semester Alphanumeric 10 1 8 Semester & Year
Name Alphanumeric 30 Student name
ID Integer 9 Student ID
Major Alphanumeric 4 Student Major
GPA Decimal 3 0.0 4.0 Student GPA
Database System
 Database System can simply be regarded as a computerized
record keeping system.
 Database System is a system whose overall purpose is to
maintain data and make the information available to its users
as per their requirements.
 The user of the system can perform the operations like:
 Defining structure and types of data
 Data manipulation (Insert, Delete, Update, Query etc.)
 Enforcing security restrictions
 A Database Management System (DBMS) is a collection of
programs that manages the database structure and controls
access to the data stored in the database.
 A database and DBMS together are called Database System.

17
Examples of Database
Applications
Databases play a critical role in almost all areas where
computers are used.
 Databases are everywhere …
• Student / Employee’s Information System
• Library System
• Hotel / Airline Reservation System
• Billing System
• Stock / Inventory System
• Payroll System
• Geographical Information Systems (GISs)
• Data Warehouses

Database Systems – Asif Sohail Slide 18


Modes of Database Systems
 Broadly speaking, there are two modes in which databases are used.
1.(Online) Transaction Processing: a large number of users use
the database
2.Data Analytics: processing of data to draw conclusions, and infer
rules or decision procedures, which are then used to drive business
decisions.
 For example, banks need to decide whether to give a loan to a loan
applicant, online advertisers need to decide which advertisement to
show to a particular user (Recommendation Systems). These tasks
are addressed in two steps. First, data-analysis techniques attempt
to automatically discover rules and patterns from data and create
predictive models. These models take as input attributes
(“features”) of individuals, and output predictions such as likelihood
of paying back a loan, or clicking on an advertisement, which are
then used to make the business decision.

19
Record Keeping Techniques
1. Manual Record Keeping.
2. Computerized Record Keeping
a) File Processing System.
b) Database System or Integrated Database
Environment. (The paradigm shift)

Database Systems – Asif Sohail Slide 20


Case Study
• Consider a College System consisting of the
following offices:
– Admission Office
– Academics Office
– Exam Office
• Each Office is maintaining its own set of files for
its day to day operations.
• Some of the files used in the system are Student’s
File, Faculty File, Course File, Correspondence
File etc.

Database Systems – Asif Sohail Slide 21


Manual System - Drawbacks
• High data volume
• Not reliable
• Inefficient
• Duplication of data
• Inconsistency
• A lot of data movement is required
• The System can’t answer complex queries
involving multiple departments.

Database Systems – Asif Sohail Slide 22


File Processing System
• File-based systems were an early attempt to computerize
the manual filing system.
• The manual files were replaced by computer files.
• A person responsible for developing and managing
computerized file processing system was called Data
Processing (DP) specialist.
• In the traditional file processing system, the existing
manual system is automated by focusing on the data
processing needs of the individual departments instead of
treating the organization as whole.
• Each application will have its own set of Private Files
designed to meet the needs of a particular department.

Database Systems – Asif Sohail Slide 23


File Processing System

App – 1
File – 1 (operations + data descriptions)

App – 2
File – 2 (operations + data descriptions)

App – n
File – n (operations + data descriptions)

Database Systems – Asif Sohail Slide 24


File Processing System
Duplicate
Data

Database Systems – Asif Sohail Slide 25


Drawbacks of File System
1. Redundancy of Data
2. Inconsistent Data
3. Poor Enforcement of Standards
4. Data Dependence
5. Limited Data Sharing
6. Extensive Development & Maintenance Effort
7. Limited Support for Queries
8. Inflexible
9. Lack of provision for security
10. Limited recovery from failure

Database Systems – Asif Sohail Slide 26


Drawbacks of File System
1. Redundancy of Data
• Redundancy means duplication of data.
• Since applications in FPS are independent, so unplanned
duplicate data is there.
• Same information is needed to be kept at different places. It
costs time and money.
• Same data may have to be input several times to update all the
occurrences.

Database Systems – Asif Sohail Slide 27


Drawbacks of File System
2. Data Inconsistencies or Data Anomalies
• Redundancy leads to data inconsistency or data anomalies.
• A data anomaly occurs if an operation (update, insert, delete) has not yet
been performed against all the occurrences. Consequently, same data
stored at different places will disagree with each other
• The use of different programming environment and platforms lead to
Heterogeneous Environment.
3. Poor Enforcement of Standards
 Organization wide enforcement of standards is poor. This leads to the
following types of inconsistencies:
a) Synonym: Using different names for same data item, e.g., Stu-Id, Reg-No.
b) Homonym: Using same name for different data items, e.g., "course" for a
single subject or entire program.
Drawbacks of File System
4. Structural and Data Dependence
• Structural Dependence: The applications are constrained to
work only with the given file description. Any change in the
file structure requires changes to all the applications using
that file.
• Data Dependence: The definition of data is embedded in
the application programs. Changes in the data type or
length require changes in the application programs.
• Structural & Data dependence are undesirable due to:
– Errors are often introduced when making changes.
– It is often difficult to locate all programs affected by change
– Incompatible file structures (use of different programming languages)
makes the situation even worse.

Database Systems – Asif Sohail Slide 29


Drawbacks of File System
5. Data Isolation or Limited Data Sharing
• As each application has its own private files so little
opportunity to share data with others.
• The filing system works well when we have to interact with
each file separately. However, it breaks down when we have
to cross-reference or process the information in the files. This
makes it hard to answer queries involving multiple files.
6. Extensive Development & Maintenance Effort
• The development of new application and the maintenance of
the existing applications require extra efforts due to:
– Structural and Data dependence
– Creation of new files and/or updating the structure of the existing files.

Database Systems – Asif Sohail Slide 30


Drawbacks of File System
7. Limited Support for Queries
8. Inflexible
9. Lack of provision for security
10. Limited recovery from failure

Database Systems – Asif Sohail Slide 31


Integrated Database Environment(IDE)
• The limitations of file-based approach can be attributed to the
following factors:
– Redundancy of data
– Data dependence
• In contrast to file processing system, the IDE has a single large
repository of data, where data definition is separated from application
programs.
• Emphasizes the integration & sharing of data throughout the
organization.
• The organization wide requirements are analyzed as a whole and
there is no longer concept of MY FILE or Private Files.
• A Database Management System (DBMS) is a software designed to
assist in maintaining and utilizing large collections of data.
• By storing data in a DBMS rather than as a collection of files, we
achieve enormous advantages.

Database Systems – Asif Sohail Slide 32


Integrated Database Environment (IDE)

D App – 1 (Operations)

B
App – 2 (Operations)
Database
(Data + M
Data Descriptions)
S App – n (Operations)

 Database system is Self-Describing, i.e., it contains not only


the database itself but also meta-data: complete definition or
description of the database structure and constraints.
 DBMS manages data resources like an operating system
manages hardware resources
Contrasting Database and File System

File System Database System

Adapted from Lecture slides of Werner Nutt

Database Systems – Asif Sohail Slide 34


Database Systems – Asif Sohail Slide 35
Advantages of Database Approach
1. Reduced or Controlled Data Redundancy
2. Improved Data Consistency
3. Enforcement of Standards
4. Reduced Program Maintenance
5. Data Sharing -> Economy of Scale
6. Data Integrity -> Improved Data Quality
7. Improved Security Restrictions
8. Improved Accessibility & Responsiveness
9. Improved Decision Making
10. Efficient Query Processing
11. Backup & Recovery
12.Concurrency Control
13.Data Independence
Database Systems – Asif Sohail Slide 36
Advantages of Database Approach
1. Reduced or Controlled Data Redundancy
• Since all the data items (data files) are integrated/stored in a
single database, therefore redundancy is minimized.
• Limited redundancy does exist for maintaining logical
connections among the related data items.
2. Improved Data Consistency
• Reduction in redundancy automatically avoids inconsistency.
• Wang and Wand describes data consistency as “a data value
can only be expected to be same for the same situation”.
• If a data item appears only once, any change to its value needs
to be performed only for once and the database will always be
in some consistent / correct state.

Database Systems – Asif Sohail Slide 37


Advantages of Database Approach
3. Enforcement of Standards
• This is possible as database is designed to meet the
organization wide requirements.
• The standards can be name of data items and their format,
data codes, documentation standards, operation standards,
security policies etc.
4. Reduced Program Maintenance & Development Cost
• When all the organization’s requirements are satisfied by
one database instead of many separate files, the
maintenance and development cost automatically reduces.

Database Systems – Asif Sohail Slide 38


Advantages of Database Approach
5. Data Sharing
• Sharing means that the same data source is used by multiple
applications.
• Data is centralized and hence can be shared not only by the
existing applications but also new applications can be
developed to operate against the same data. This results in
additional advantages such as; faster development of new
applications, and Economy of Scale.
• The applications that can access same data simultaneously
are called Online Transaction Processing (OLTP) applications
and DBMS uses Concurrency Control Mechanism to ensure
that multiple users can access and update data correctly.

Database Systems – Asif Sohail Slide 39


Advantages of Database Approach
6. Data Integrity (Improved Data Quality)
Data integrity refers to the correctness of data.
Integrity constraints or rules ensure that the data stored in the
database is purified and accurate.
Integrity constraints apply to items within a record (intra-record
constraints) or to records that are related to one another (inter-record
constraints), or they might be general business constraints.
7. Improved Security Restrictions
Database security is the protection of database from unauthorized
disclosure, alteration or destruction. DBMS provides strong security
measures, such as:
 Password checks
 User defined procedures
 Defining user privileges
 Restricted view of a certain portion of database
 Audit trial system
 Data encryption

40
Advantages of Database Approach
8. Improved Accessibility & Responsiveness
• In File Processing System, data accessibility is quite difficult
as it is procedural based. You should know the detailed
procedural steps. HOW TO DO?
• On the other hand, accessing data is lot easier in DBMS with
the help of a non procedural language – SQL. You only need
to know the simple commands or in other words WHAT TO
DO?
• SQL allows interactive access by users.
9. Improved Decision Making
• Consolidated reports
• Ad-hoc queries
• Multiple views of data
Database Systems – Asif Sohail Slide 41
Advantages of Database Approach
10. Efficient Query Processing
•Specialized data structures and search techniques
•Indexing
•Buffering or caching module
•Query processing and optimization
11. Backup & Recovery
•The backup and recovery subsystem of DBMS provides efficient
techniques for database recovery.
12. Concurrency Control
•Simultaneous access to the shared data is possible in non-
conflicting manner.

Database Systems – Asif Sohail Slide 42


Advantages of Database Approach
13. Data Independence
• The separation of data descriptions from the applications
using the data is called data independence.
• Data Independence can also be defined as: “The immunity of
an application to change in storage structure – which implies
that the applications don’t depend on any particular storage
structure”.
• Allows change & evolution of database systems without
changing the application programs
• Without data independence, it is must to understand the
arrangements of data elements in order to perform an
operation against them.
• Different data arrangements will need different algorithms
even for the same operation.
Database Systems – Asif Sohail Slide 43
Advantages of Database Approach
13. Data Independence.
• Clearly, data dependence is not desired because of the
following reasons:
a) Each user should be able to access data in a customized way.
b) Users should not have to deal directly with the physical
database storage details.
c) Different application may need different physical structure
for the efficiency of their operations.
d) The DBA should have freedom to change the storage
structure or access technique or both in response to
changing requirements without much disturbing the existing
applications.

Database Systems – Asif Sohail Slide 44


Advantages of Database Approach
13. Data Independence.
• A characteristics that allows data independence is called
data abstraction.
• A DBMS provides users with a conceptual representation of
data that does not include many of the details of how the
data is stored or how the operations are implemented.
• A data model is a type of data abstraction that is used to
provide this conceptual representation. The data model
hides storage and implementation details that are not of
interest to most database users.

Database Systems – Asif Sohail Slide 45


Cost & Risk of Database Approach
1. Need for new specialized personnel
2. Cost of DBMS and additional hardware cost
3. Installation cost & complexity
4. Conversion from legacy system to modern
database system
5. Organizational conflict
6. Higher impact of failure
7. Not suitable for applications with tight real-time
constraints

Database Systems – Asif Sohail Slide 46


Types of Databases
• Databases can be categories on the basis of
the following criterions:
Criteria Types
1. Number of users • Single User Database
• Multi-user Database
2. Data location • Centralized Database
• Distributed Database
3. Data usage • Operational (OLTP)
• Analytical (OLAP)
4. Form of data • Unstructured
• Structured
• Semi-structured (XML)
Database Systems – Asif Sohail Slide 47
Types of Databases

Single user with Mainframe computer


desktop computer with thousands of users

• Categories are:
– Personal computer databases(Single User)
– Workgroup databases(Multi-user)
– Department databases (Multi-user)
– Enterprise database (Multi-user)

Database Systems – Asif Sohail Slide 48


Types of Databases
Personal Computer Databases
• Support one user with a standalone PC
• E.g. a student’s own database or a sales person’s simple
database

Workgroup Databases
• Workgroup: relatively small group of people who
collaborate on same project/application.
• A workgroup DB supports the collaborative efforts of a
workgroup.
• Allows data sharing.
• Its model is shown on the next fig:
Database Systems – Asif Sohail Slide 49
Continued…

LAN

DB Server

Workgroup
DB

Workgroup DB on LAN
(Method of Data Sharing)

Database Systems – Asif Sohail Slide 50


Types of Databases
Department Databases
• Department: Functional unit within an organization
• Department DBs support function & activities of a
department.
• E.g. personnel DB to track employees, jobs, skills etc.

Enterprise Databases
• DB scope is the entire organization
• To support organization-wide operations & decision
making.

Database Systems – Asif Sohail Slide 51


Continued…

Hospital

Medical
Clinic

Corporate
Hospital Office

Nursing Data
Home Warehouse

Medical
Clinic

Database Systems – Asif Sohail Slide 52


Types of Databases

Internet, Intranet & Extranet Databases


• Internet: A worldwide network that connects users of multiple
platforms easily through an interface known as web browser
• Extranet: Use of Internet protocols to establish limited access to
company data & information by the company’s customers &
suppliers
• Intranet: Use of internet protocol to establish access to company
data and information that is limited to the organization

Centralized & Distributed Databases


• Centralized database system – supports a database located at a
single site
• Distributed database system – supports a database distributed
across several different sites

Database Systems – Asif Sohail Slide 53


Types of Databases
• The past few years have produced advances in technology leading to
exciting new applications of database systems such as:
– Multimedia databases
– Geographic information systems
– Data warehouses
• Multimedia databases – store pictures, video clips, and sound
messages
• Geographic information systems (GIS) – store and analyze maps,
weather data, and satellite images
• Data warehouses & on-line analytical processing (OLAP) is used to
extract and analyze useful information from very large databases for
decision-making.

Database Systems – Asif Sohail Slide 54


Reading Material
• Text Book: Chapter 1 (1.1 to 1.6)
• Ref. Book-A: Chapter 1 (page 2 to page 15)
• Ref. Book-B: Chapter 1 (1.1 to 1.6)
• Ref. Book-C: Chapter 1 (1.1 to 1.3, 1.6)

Database Systems – Asif Sohail Slide 55

You might also like