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

Lecture 1

Uploaded by

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

Lecture 1

Uploaded by

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

Database Systems

Bushra

[email protected]
Course Outline
● Basic database concepts
● Data Model, schema architecture and data independence
● Classification of DBMS and Database systems environment.
● Relational Model Concepts, Constraints and Relational Databases
● Basic SQL
● Advanced SQL concepts
● Conceptual Modeling
● Relational Algebra
● Basics of Functional Dependencies and Normalization for Relational Databases
● Introduction to Transaction Processing Concepts and Theory
● Concurrency Control Techniques
● Database Recovery Techniques
● NOSQL Databases and Big Data Storage Systems
Books
Text Books

● Ramez Elmasri & Shamkant B. Navathe, Database Systems,


Models, Languages, Design and Application Programming, 7th
Edition, 2016.

Reference Books

● Thomas Connolly, Carolyn Begg, Database Systems: A practical


approach to design, implementation and Management, 6th
Edition, 2015.
● C.J. Date, An Introduction to Database Systems, 8th Edition,
2004
Assessment Plan
Assessment Weightage

Assignment 10

Mid Exams 30

Project 9

Final 50

Class Participation 1
A database is
a collection of
related What is a Database?
data.
Implicit properties of a
database
1. A database represents the miniworld or the
universe of discourse (UoD).
2. A database is a logically coherent collection of
data with some inherent meaning

3. A database is designed, built, and populated with


data for a specific purpose.
Database
● A database can be of any size and complexity.
● A database may be generated and maintained
manually or it may be computerized.
● A computerized database may be created and
maintained either by a group of application
programs written specifically for that task or by a
database management system.
DBMS
The DBMS is a general-purpose software system that
facilitates the processes of defining, constructing,
manipulating, and sharing databases among
various users and applications.
Defining a database

● Specifying the data types, structures, and


constraints of the data to be stored in the
database.
● The database definition or descriptive information
is also stored by the DBMS in the form of a
database catalog or dictionary; it is called
meta-data.
Constructing and Manipulating a database

Constructing a database
● Storing the data on some storage medium that is
controlled by the DBMS.

Manipulating a database
● functions such as querying the database to
retrieve specific data, updating the database to
reflect changes in the miniworld, and generating
Sharing a database

● Sharing a database allows multiple users and


programs to access the database simultaneously.
A Simplified Database Environment
Other Important Functions

● Protecting the database


○ system protection against hardware or software malfunction (or crashes)
○ security protection against unauthorized or malicious access.

● Maintaining it over a long period of time.


File based approach
Manual Filing System

● File-based systems were an early attempt to computerize the


manual filing system.
○ Example: An ecommerce company abc might have physical
files set up to hold all external and internal correspondence
relating to a product, client, or employee.
● Manual filing systems breaks down when we have to cross-
reference or process the information in the files.
○ Example: eCommerce site where manager wants annual
report of best selling products among the loyal customers
of the company in the city karachi. This query will require
data from clients, products, and sales files
File Based Approach

● a decentralized approach
○ where each department stored and controlled its own data
○ Data processing department would write programs for each
application each office needs.
○ The queries and the file structure would be hard-coded
within each program
Limitations of File Processing
● Separation and isolation of data
Approach
○ it is more difficult to access data that should be
available.
● Duplication of data
○ redundancy in defining and storing data results in wasted
storage space
○ in redundant efforts to maintain common up-to-date
data.
Limitations of File Processing
Program - Data dependence
Approach
● physical structure and records are defined in the application
code
● changes to an existing structure are difficult to make.
○ Example: if the employee name field is changed from 40 to
50 characters, then all programs that use a file which contains
the employee name field will need to be updated.
○ Additionally, the DP department must write a program to
transform each file that contains the employee name field to
the new format
Limitations of File Processing
● Incompatible file formats
Approach
○ the structures are dependent on the application
programming language as the structure is embedded
in application programs.
● Fixed queries/proliferation of application programs
○ file-based systems are very dependent upon the
application developer, who has to write any queries or
reports that are required.
Database Approach
Database Approach

● A single repository maintains data that is defined once and


then accessed by various users repeatedly through queries,
transactions, and application programs.
Characteristics of Database
Approach
Self-describing nature
of a database system

The database system


● The database holds not
only the database, but contains not only the

also metadata. database itself but also.


● Thus, a database is also
self-describing collection
of integrated records
Self-describing nature of a database system
Insulation between Programs and Data

In traditional file processing,

● the structure of data files is embedded in the application


programs, so any changes to the structure of a file may
require changing all programs that access that file.

DBMS have this property called program data independence,


where:

● access programs do not require such changes in most cases.


● The structure of data files is stored in the DBMS catalog
separately from the access programs.
Insulation between Programs and Data

● Example:

○ If we want to add another piece of data to each STUDENT


record, say the Birth_date, we only need to change the
description of STUDENT records in the catalog; no
programs are changed.

○ The next time a DBMS program refers to the catalog, the


new structure of STUDENT records will be accessed and
used.
Insulation between Programs and Data
Program-operation independence

● In some database systems:


○ users can define operations on data as part of the database
definitions
○ An operation (also called a function or method) is specified
in two parts.
■ The interface (or signature) of an operation
■ The implementation (or method) of the operation is specified
separately
○ User programs can operate on the data by invoking these
operations, regardless of how the operations are
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.

● Informally, a data model is a type of data abstraction that is used to


provide this conceptual representation.

Conceptual representation
of Student records
Characteristics of Database Approach

● Support of Multiple Views of the Data


○ A multiuser DBMS whose users have a variety of distinct
applications must provide facilities for defining multiple
views.

● Sharing of Data and Multi-User Transaction


Processing
○ A multiuser DBMS must allow multiple users to access
the database at the same time.
○ The DBMS must include concurrency control software to
ensure that several users trying to update the same data
Advantages of using DBMS

● Controlling Redundancy
● Restricting Unauthorized Access
● Providing Persistent Storage for Program Objects
○ Databases can be used to provide persistent storage for
program objects and data structures.
○ Object-oriented database systems are compatible with
programming languages
● Drawing inferences and actions from the stored data
Advantages of using DBMS

● Providing Storage Structures and Search Techniques for


Efficient Query Processing
● Providing Backup and Recovery
● Providing Multiple User Interfaces
● Representing Complex Relationships among Data
● Enforcing Integrity Constraints
● Potential for Enforcing Standards.
● Reduced Application Development Time.
○ Development time using a DBMS is estimated to be one
sixth to one-fourth of that for a file system
Advantages of using DBMS

● Flexibility.
● Availability of Up-to-Date Information.
● Economies of Scale.
● Data consistency
○ By eliminating or controlling redundancy, we reduce the
risk of inconsistencies occurring.
Disadvantages of DBMS
● Complexity
● Size
● Cost of DBMS
○ Maintenance Cost
○ Additional Hardware Cost
● Greater impact of a failure
When not to use a DBMS

● In a few situations DBMS may involve unnecessary overhead


costs that would not be incurred in traditional file processing.
● Therefore, it may be more desirable to develop customized
database applications under the following circumstances:
○ Simple, well-defined database applications that are not
expected to change at all
○ No multiple-user access to data
○ Embedded systems with limited storage capacity, where
a general-purpose DBMS would not fit
When not to use a DBMS

● If the database system is not able to handle the complexity


of data because of modeling limitations (e.g., in complex
genome and protein databases)
● If the database users need special operations not supported
by the DBMS (e.g., GIS and location based services).
● Stringent, real-time requirements for some application
programs that may not be met because of DBMS overhead
Discussion on
Files vs
Databases

You might also like