0% found this document useful (0 votes)
20 views66 pages

Chapter (1) - Introduction

The document provides an introduction to databases and database management systems (DBMS). It discusses common uses of databases and characteristics of traditional file-based systems. The key limitations of file-based systems are data duplication, isolation of data between programs, and program-data dependence where changes to file structures require code changes. The document gives examples of database applications in various domains like retail, banking, travel, and education to illustrate the widespread use of databases.
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)
20 views66 pages

Chapter (1) - Introduction

The document provides an introduction to databases and database management systems (DBMS). It discusses common uses of databases and characteristics of traditional file-based systems. The key limitations of file-based systems are data duplication, isolation of data between programs, and program-data dependence where changes to file structures require code changes. The document gives examples of database applications in various domains like retail, banking, travel, and education to illustrate the widespread use of databases.
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/ 66

Chapter 1

Introduction to Databases
Ahmed M. Zeki

ITIS 213
Objectives
 Some common uses of database systems.
 Characteristics of file-based systems.
 Problems with file-based approach.
 Meaning of the term database.
 Meaning of the term Database Management System
(DBMS).
 Typical functions of a DBMS.
 Major components of the DBMS environment.
 Personnel involved in the DBMS environment.
 History of the development of DBMSs.
 Advantages and disadvantages of DBMSs.
2 / 66
Introduction
 The importance of DB System has increased with
the significant developments in:
◦ Hardware capability
◦ Hardware capacity
◦ Communication
 Emergence of the Internet
 Electronic Commerce
 Business Intelligence
 Mobile Communications
 Grid Computing

3 / 66
Introduction
 The DB system is arguably the most important
development in the field of SE.
 The DB is now the underlying framework of the IS.
 DB is fundamentally changing the way that many

organizations operate.
 DB technology has been the catalyst for many

important development in SE.


 We are only at the end of the beginning of the

development.

4 / 66
Database Applications
 DB is now an integral part of our day-to-day life
that often we are not aware we are using one.
 DB is a collection of related data.
 DBMS is the software that manages and controls

access to the DB.


 DB application is a program that interacts with the

DB at some point in its execution.


 DB system is a collection of application programs

that interact with the DB along with the DBMS and


DB itself.

5 / 66
Examples of Database Applications
 Purchases from the supermarket
◦ Bar code reader
◦ Linked to an application program
◦ Find out the price
◦ Product DB
◦ Reduce the number of such items in stock
◦ Display the price
◦ Automatically place an order

6 / 66
Examples of Database Applications
 Purchases using your credit card
◦ Sufficient credit left to make the purchase
◦ DB application program
◦ The price is within the credit limit
◦ The credit card is not on the list of stolen or lost cards
◦ Monthly statement application

7 / 66
Examples of Database Applications
 Booking a holiday at the travel agents
◦ Two different agents don’t book the same holiday or
overbook the seats on the flight.
◦ Separate DB for invoicing.

8 / 66
Examples of Database Applications
 Using the local library
◦ Details of the books
◦ Details of the readers
◦ Reservations
◦ Allow readers to find a book based on its title, authors, or
subject areas
◦ Reminders to borrowers
◦ Barcode readers

9 / 66
Examples of Database Applications
 Taking out insurance
◦ Personal details
◦ Determining the cost of insurance
◦ The broker can search several DBs to find the organization
that gives the best deal

10 / 66
Examples of Database Applications
 Renting a video
◦ Available video titles
◦ Number of copies available
◦ Availability of a copy / on loan
◦ Which videos they are currently renting
◦ Dates they are returned
◦ Predicting future buying

11 / 66
Examples of Database Applications
 Using the Internet
◦ Many sites are driven by DB applications
 Online bookstores
◦ Browse by categories, authors, etc
◦ Display shipping, stock levels, and on-order information
◦ Sales history
◦ Reviews
◦ Cross reference: listed under different categories
◦ Credit card details
◦ Personalization of services for customers
◦ Keeping records of previous transactions
◦ Recommended titles based on previous purchases
12 / 66
Examples of Database Applications
 Studying at university
◦ Students information
◦ Courses you are enrolled in, you have taken in the past
◦ Details about the grant
◦ Examination results
◦ Next year admission
◦ University staff

13 / 66
File-Based Systems
 Early attempts to computerize the manual filing
systems
 Collection of application programs that perform

services for the end users (e.g. reports).


 Each program defines and manages its own data.
 Obsolete

◦ Understanding the problems inherent in file-based systems


may prevent us from repeating these problems in DB
systems.
◦ Convert a file-based system to a DB systems

14 / 66
File-Based Systems
 Search through the system starting from the first
entry until we find what we want.

 Indexing system

 Division in the filing system or separate folders for


different types of item that are in some way logically
related.

15 / 66
File-Based Systems
 Works well while the number of items to be stored is
small.

 Works well when there are large numbers of items


and we have only to store and retrieve them.

 Breaks down when we have to cross-reference or


process the information in the files.

16 / 66
File-Based Systems
 Difficult to answer those questions?.
◦ What 3-bedroom properties do you have for sale with a
garden and garage?
◦ What flats do you have for rent within three miles of the
city centre?
◦ What is the average rent for a two bedroom flat?
◦ What is the total annual salary bill for staff?
◦ How does last month’s turnover compare with the projected
figure for this month?
◦ What is the expected monthly turnover for the next finical
year?

17 / 66
File-Based Systems
 A decentralized approach was taken first.
◦ Each department stores and controls its own data with the
assistance of the Data Processing (DP) staff.
 Example of DreamDepartment
◦ Forms are filled up by the DP
 A file is a collection of records which contains
logically related data.
 Each record contains a logically connected set of

one or more fields.


 Each field represents some characteristic of the

object.
18 / 66
File-Based Systems
 Each Dept accesses its own files and handles its own data
entry, file maintenance, and the generation of reports.

19 / 66
Limitations of File-Based Approach
 Separation and isolation of data
◦ Each program maintains its own set of data.
◦ Difficult to access data.
◦ Users of one program may be unaware of
potentially useful data held by other programs.

◦ Example: if we want to produce a list of all houses that


match the requirement of clients, we first need to create a
temporary file of those clients who have ‘house’ as
preferred type. We then search the PropertyForRent file for
those properties where the property type is ‘house’ and the
rent is less than the client’s maximum rent.

20 / 66
Limitations of File-Based Approach
 Duplication of data
◦ Same data is held by different programs.
◦ Wasted space and potentially different values and/or
different formats for the same item.
◦ It costs time and money to enter the data more than
once.
◦ Loss of data integrity, data is no longer consistent.

21 / 66
Limitations of File-Based Approach
◦ Example: if a member of staff moves house and the
change of address is communicated only to Personnel and
not to Payroll, the person’s payslip will be sent to the
wrong address.
◦ Example: an employee is promoted with an associated
increase in salary.
◦ When the error is detected, it will take time and effort to
resolve.
◦ No automatic way for Personnel to update the data in the
Payroll files. Even if Payroll is notified of the changes, it is
possible that the data will be entered incorrectly.

22 / 66
Limitations of File-Based Approach
 Data dependence
◦ File structure is defined in the application code, i.e
changes to an existing structure are difficult to make.
 Example increasing the size of a field from 40 to 41
characters.
 Open original file for reading
 Create temporary file with the new structure
 Read a record from the original file, convert the data to
conform to the new structure, and write it to the temporary
file. Repeat for all records.
 Delete the original file
 Rename the temporary as the original
 All programs accessing the original file must be modified to
conform to the new structure. (This characteristic of file-based
system is called program-data dependence)
23 / 66
Limitations of File-Based Approach
 Incompatible file formats
◦ Programs are written in different languages, and so
cannot easily access each other’s files.

24 / 66
Limitations of File-Based Approach
 Fixed Queries/Proliferation of application programs
◦ i.e. Not ad-hoc or unplanned queries.
◦ Programs are written to satisfy particular functions.
◦ Any new requirement needs a new program.

25 / 66
Limitations of File-Based Approach
 All this put tremendous pressure on the DP staff

 Certain types of functionality were omitted


including:
◦ There was no provision for security or integrity
◦ Recovery, in the event of a hardware or software failure,
was limited or non-existent
◦ Access to the files was restricted to one user at a time

26 / 66
Database Approach
 Arose because:
◦ Definition of data was embedded in application
programs, rather than being stored separately and
independently.
◦ No control over access and manipulation of data beyond
that imposed by application programs.

 Result:
◦ the database and Database Management System
(DBMS).

27 / 66
Database
 Shared collection of logically related data (and a
description of this data), designed to meet the
information needs of an organization.

 It is a single, possibly large repository of data that


can be used simultaneously by many departments
and users.

  instead of disconnected files with redundant


data, all data items are integrated with a minimum
amount of duplication.

28 / 66
Database
 DB is no longer owned by one department, but is a
shared corporate resource.

 DB holds not only the organization's operational


data, but also a description of this data.

 System catalog (metadata or data dictionary or data


about data) provides description of data to enable
program–data independence.

29 / 66
Database
 Definition of data is separated from the application
programs. Similar to the approaches taken in
modern software development.

◦ The users see only the external definition and are unaware
of how the object is defined and how it functions.

◦ Advantage: Data Abstraction: we can change the internal


definition of an object without affecting the users of the
object.

30 / 66
Database
◦ If new data structures are added or existing structures are
modified then the application programs are unaffected,
provided they don’t directly depend upon what has been
modified.

 Adding new filed  applications are unaffected.


 Removing a field from a file that an application uses 
applications are affected.

31 / 66
Database
 Logically related data comprises entities, attributes,
and relationships of an organization’s information.

 An entity is a distinct object (person, place,


concept, thing, event) in an organization that is to
be represented in the DB.

 An attribute is a property that describes some aspect


of the object that we wish to record.

 A relationship is an association between entities.


Figure 1.6
32 / 66
Database Management System (DBMS)

 A software system that enables users to define,


create, maintain, and control access to the database.

33 / 66
DBMS
 Allows users to define the DB, usually
through Data Definition Language (DDL),
which allows users to specify the data types
and structures and the constrains on the data
to be stored in the DB.

 Allows users to insert, update, delete, and


retrieve data from the DB, usually through
Data Manipulation Language (DML).
◦ Because it is centralized, DML can provide a general
inquiry facility to this data, called a query language
such as SQL (Structured Query Language).
34 / 66
DBMS
 Provides controlled access to the DB such as:
◦ Security system: prevents unauthorized users
◦ Integrity system: maintains the consistency of
stored data
◦ Concurrency control system: allows shared access
of the DB
◦ Recovery control system: restores the DB to a
previous consistent state following a hardware or
software failure
◦ User accessible catalog: contains descriptions of
the data in the DB

35 / 66
DB Application Program
 A computer program that interacts with the
DB by issuing an appropriate request
(typically an SQL statement) to the DBMS.

 These programs can be a conventional batch


applications or online applications.

 They are developed using programming


languages.

36 / 66
Database Management System (DBMS)

Each set of departmental application programs handles data


entry, data maintenance, and the generation of reports.
However, compared with the file-based approach, the
physical structure and storage of the data are now managed
by the DBMS. 37 / 66
Views
 Powerful and useful tool.

 Allows each user to have his or her own view of the


DB.

 A view is essentially some subset of the DB.

38 / 66
Views - Benefits
 Reduce complexity
 Provide a level of security
 Provide a mechanism to customize the appearance

of the database
 Present a consistent, unchanging picture of the

structure of the database, even if the underlying


database is changed

39 / 66
Components of DBMS Environment

40 / 66
Components of DBMS Environment
 1. Hardware
◦ Applications require hardware to run.
◦ Can range from a PC to a network of computers.
◦ Hardware depends on:
 The organization’s requirement.
 The DBMS, because some DBMS run only on certain
OSs and hardware.
◦ DBMS requires minimum amount of RAM and disk space.

41 / 66
Components of DBMS Environment
 DB backend: part of the DBMS that manages and
controls access to the DB. (Server)

 DB frontend: part of the DBMS that interfaces with


the user. (Clients)

 This is called client-server architecture.

42 / 66
Components of DBMS Environment
 2. Software: consists of:
◦ DBMS
◦ OS
◦ Network software (if necessary)
◦ Application programs: written in 3GL such as C,
C++, Java, etc, or 4GL such as SQL embedded in a
3GL.
 DBMS may have its own 4GL tools

◦ Allow rapid development of applications


◦ Improve productivity
◦ Produce programs that are easy to maintain
◦ Examples of those tools: Report, form, graphics,
and application generators 43 / 66
Components of DBMS Environment
 3. Data
◦ Most important component.
◦ Acts as a bridge between machine and human
◦ Contains
 Operational data
 Metadata
◦ Structure of the DB is called the schema
◦ The schema consists of 4 tables
 Each table consists of attributes
 E.g. The ownerNo attribute models the
relationship between PropertyForRent and PrivateOwner, i.e.
The owner owns a property for rent

44 / 66
Components of DBMS Environment
 4. Procedures
◦ Instructions and rules that govern the design and
use of the database and DBMS.

45 / 66
Components of DBMS Environment
◦ Users and DBAs require documented procedure:
 Log on to the DBMS
 Use a particular DBMS facility or application program
 Start and stop the DBMS
 Make backup copies of the DB
 Handle hardware or software failures.
 How to identify the failed component
 How to fix
 How to recover the DB
 Change the structure of a table
 Recognize the DB across multiple disks
 Improve performance
 Archive data to secondary storage
46 / 66
Components of DBMS Environment
 5. People
◦ Data Administrator (DA): responsible for the management
of the data resource including:
 DB planning development
 Maintenance of standards, policies and procedures
 Conceptual/logical DB design.

DA consults with and advises senior managers, ensuring


that the direction of DB development will ultimately
support corporate objectives.

47 / 66
Components of DBMS Environment
 5. People
◦ Database Administrator (DBA): responsible for physical
realization of the DB including:
 Physical DB design and implementation
 Security and integrity control
 Maintenance of the operational system
 Ensuring satisfactory performance of the applications of users

48 / 66
Components of DBMS Environment
 5. People
◦ The role of the DBA is more technically oriented than the
role of the DA, requiring detailed knowledge of the target
DBMS and the system environment.

◦ In some organizations there is no distinction between these


two roles.

49 / 66
Components of DBMS Environment
 5. People
A. Logical DB Designer: is concerned with identifying:
 The data (i.e. Entities and Attributes)
 The relationships between the data
 The constraints (business rules) on the data that is to be stored
in the DB

◦ The logical DB designer must understand the


organization’s data and any constraints in this data

50 / 66
Components of DBMS Environment
 5. People
◦ Constraints: describe the main characteristics of the data as
viewed by the organization:
 A member of staff can’t manage more than 100 properties for
rent or sale at the same time
 A member of staff can’t handle the sale or rent of his own
property
 A solicitor can’t act for both the buyer and seller of a property

◦ The logical DB designer must involve all prospective DB


users in the development of the data model, and this
involvement should begin as early in the process as
possible.
51 / 66
Components of DBMS Environment
 5. People
◦ Logical DB design consists of two stage:
 Conceptual DB design, which is independent of implementation
details such as:
 the target DBMS
 application programs
 programming languages
 or any other physical considerations
 Logical DB design, which targets a specific data model, such as:
 Relational
 Network
 Hierarchical
 Object oriented

52 / 66
Components of DBMS Environment
 5. People
B. Physical DB designer decides how the logical DB design is
to be physically realized which involves:
 Mapping the logical DB design into a set of tables and integrity
constraints
 Selecting specific storage structures and access methods for the
data to achieve good performance
 Designing any security measures required on the data

53 / 66
Components of DBMS Environment
 5. People
◦ Many parts of physical DB design are highly dependent on
the target DBMS and there may be more than one way of
implementing a mechanism. Hence the physical DB designer:
 Must be fully aware of the functionality of the target DBMS
 Must understand the advantages and disadvantages of each
alternative for a particular implementation.
 Must be capable of selecting a suitable storage strategy that takes
account of usage.

◦ Conceptual and logical DB design are concerned with the


“what”, physical DB design is concerned with the “how”.

54 / 66
Components of DBMS Environment
 5. People
◦ Application Developer: responsible for developing
application programs that provide the required functionality
for the end-users.
◦ The application developers work from a specification
produced by systems analysts.
◦ Each program contains statements that request the DBMS to
perform some operation on the DB.
 Retrieving data, inserting, updating, and deleting data.
◦ The programs may be written in a 3GL or a 4GL.

55 / 66
Components of DBMS Environment
 5. People
◦ End-users (clients):
 Naive users:
 Unaware of the DBMS
 They access the DB through specially written applications programs
that attempt to make the operations as simple as possible.
 They invoke DB operations by entering simple commands or
choosing options from a menu.
 They do not need to know anything about the DB or the DBMS.
 The checkout assistant at the local supermarket uses a bar code reader
to find out the price of the item. The rest of the job is done by the
program.

56 / 66
Components of DBMS Environment
 5. People
◦ End-users (clients):
 Sophisticated users:
 Familiar with the structure of the DB and the facilities offered by the
DBMS.
 May use the high-level query language such as SQL to perform the
required operations.
 May write applications for their own use.

57 / 66
History of Database Systems
 File-based system
 DBMS – 1960s
 1st Generation: Hierarchical structure: smaller components
come together as parts of larger components
 Magnetic tapes, serial storage devices
 Network DBMS – Mid 1960s
 2nd generation: Relational DBMS
 3rd Generation: Object-Relational DBMS

58 / 66
Advantages of DBMSs
 Control of data redundancy
◦ By integrating the files so that multiple copies of the same
data are not stored

 Data consistency
◦ Any update to its value has to be performed only once and
the new value is available immediately to all users
◦ If a data item is stored purposely more than once, the
system can ensure that all copies of the item are kept
consistent (not all DBMS do this)

59 / 66
Advantages of DBMSs
 More information from the same amount of data
◦ With the integration of the operational data, it is possible
to derive additional information from the same data

 Sharing of data
◦ Files are owned by departments but can be shared by all

 Improved data integrity


◦ DB integrity: validity and consistency of stored data. It is
usually expressed in terms of constraints, which are
consistency rules that the DB is not permitted to violate.
◦ Constraints may apply to data items or to relationships.

60 / 66
Advantages of DBMSs
 Improved security
◦ DBA will define the security and the DBMS to enforce

 Enforcement of standards
◦ Whether organizational standards or international

 Economy of scale
◦ Cost saving due to centralization

61 / 66
Advantages of DBMSs
 Balance conflicting requirements
◦ The DBA will control the conflicting requirements

 Improved data accessibility and responsiveness


◦ Users can use SQL to ask ad hoc questions without
requiring a programmer to develop software

 Increased productivity
◦ Ready made functions and standards

62 / 66
Advantages of DBMSs
 Improved maintenance through data independence
◦ Data-independence: DBMS separates the data descriptions
from the applications
◦ Applications are prevented from changes

 Increased concurrency
◦ Managing concurrent DB access

 Improved backup and recovery services


◦ Can be automatic
◦ Minimize the amount of processing that is lost following a
failure.
63 / 66
Disadvantages of DBMSs
 Complexity
◦ Complex software
◦ Failure to understand the functionality (by some levels of
users) can lead to bad design decisions

 Size
◦ Complexity and functionality makes it a large software

 Cost of DBMS
◦ Personal DB ≈ $100
◦ Multiuser DBMS ≈ $100k – $1 million
64 / 66
Disadvantages of DBMSs
 Additional hardware costs
◦ Because of the large disk space requirement

 Cost of conversion
◦ Cost of converting existing applications to work on new
DBMS
◦ Cost of training staff to use new systems
◦ Cost of employment of new specialist
◦ That is why some organizations are tied to their current
systems and can’t switch to more modern DB technology

65 / 66
Disadvantages of DBMSs
 Performance
◦ DBMS is more general to cater for many applications 
the application may not run as fast as they used to.

 Higher impact of a failure


◦ Because of the centralization

66 / 66

You might also like