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

Database Management System: Lec - 1: Basic Database Concepts

The document discusses database management systems and basic database concepts. It defines a database as a collection of related data and a DBMS as software that manages access to the database. It also discusses the roles of data administrators and database administrators in managing databases.

Uploaded by

Mamoon Haider
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Database Management System: Lec - 1: Basic Database Concepts

The document discusses database management systems and basic database concepts. It defines a database as a collection of related data and a DBMS as software that manages access to the database. It also discusses the roles of data administrators and database administrators in managing databases.

Uploaded by

Mamoon Haider
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Database Management

System

Lec – 1: Basic Database Concepts


IQRA BASHARAT
Instructor’s Snr. Lecturer
Introduction [email protected]
⸙ Database Systems: A Practical Approach to Design,
Implementation, and Management, 6th Edition, Thomas
Connolly, Carolyn Begg, Addison Wesley, 2015.
Recommended ⸙ Modern Database Management by Fred McFadden,
Text Books: Jeffrey Hoofer, Mary Prescott, Prentice Hall; 11th Edition
(July 26, 2012). ISBN-10: 0132662256

Reference Books:
⸙ Fundamentals Of Database System, 7Th Edn by Elmasri
Ramez And Navathe Shamkant | 2016
⸙Assignments/projects 20%
⸙Quizzes 10%
Evaluation Criteria: ⸙Mid-Term 20%
⸙Final 50%
• We consider a database to be a collection of
related data and a database management
system (DBMS) to be the software that
manages and controls access to the database.

• Formally, a database is a shared collection of


Database logically related data and its description,
designed to meet the information needs of an
organization.

• A database application is simply a program


that interacts with the database at some point in
its execution.
Purchases from the supermarket

Purchases using your credit card

Use of
Booking a vacation with a travel agent
Database in
Our Daily Using the local library
Lives
Using the Internet

Studying at College
• Conventionally, the data were stored and processed
using traditional file processing systems.

Traditional • In these traditional file systems, each file is


File-based independent of other file.
Systems
• The data and the application programs that uses the
data are so arranged that any change to the data
requires modifying all the programs that uses the data.
Traditional File-based Systems
The manual filing system works
well as long as the number of items
to be stored is small. It even works
adequately when there are large
numbers of items and we only have
to store and retrieve them.

Traditional
File-based
Systems
However, the manual filing system
breaks down when we have to
process the information in the files.
• For example, a typical real estate agent’s office might have a separate file for each
property for sale or rent, each potential buyer and renter, and each member of staff.
Consider the effort that would be required to answer the following questions:

• What three-bedroom properties do you have for sale with an acre of land and a garage?
• What apartments do you have for rent within three miles of downtown?
• What is the average rent for a two-bedroom apartment?
• What is the annual total for staff salaries?
• How does last month’s net income compare with the projected figure for this month?
Example of a Traditional Database
Application
Suppose we are building a system
to store the information about:
• students
• courses
• professors
• who takes what, who teaches what

11
Can we do it without a DBMS ?
Sure we can! Start by storing the data in files:

students.txt courses.txt professors.txt

Now write C or Java programs to implement specific tasks

12
Doing it without a DBMS...
• Enroll “Mary Johnson” in “CSE444”:

Write a C program to do the following:

Read
Read ‘students.txt’
‘students.txt’
Read
Read ‘courses.txt’
‘courses.txt’
Find&update
Find&update the
the record
record “Mary
“Mary Johnson”
Johnson”
Find&update
Find&update the
the record
record “CSE444”
“CSE444”
Write
Write “students.txt”
“students.txt”
Write
Write “courses.txt”
“courses.txt”

13
Problems without a DBMS...
• System crashes: Read ‘students.txt’
Read ‘students.txt’
Read
Read‘courses.txt’
‘courses.txt’
Find&update
Find&updatethetherecord
record“Mary
“MaryJohnson”
Johnson”
CRASH !
Find&update the record “CSE444”
Find&update the record “CSE444”
Write
Write“students.txt”
“students.txt”
Write
Write“courses.txt”
“courses.txt”

• What is the problem ?


• Large data sets (say 50GB)
• What is the problem ?
• Simultaneous access by many users
• Need locks: we know them from OS, but now data on
disk; and is there any fun to re-implement them ?

14
When we analyze the information needs
of an organization, we attempt to
identify entities, attributes, and
relationships.

An entity is a distinct object (a person,


place, thing, or event) in the
Database organization that is to be represented in
the database.

An attribute is a property that describes


some aspect of the object that we wish
to record, and a relationship is an
association between entities.
• A software system that enables users to define,
create, maintain, and control access to the
database.
• Typically, a DBMS provides the following
DBMS facilities:

Components • It allows users to define the database, usually


through a Data Definition Language (DDL).
• The DDL allows users to specify the data types
and structures and the constraints on the data to
be stored in the database.
• It allows users to insert, update, delete, and retrieve
data from the database, usually through a Data
Manipulation Language (DML).

• Having a central repository for all data and data


DBMS descriptions allows the DML to provide a general
inquiry facility to this data, called a query language.
Components
(Contd.) • The most common query language is the Structured
Query Language (SQL, pronounced “S-Q-L”, or
sometimes “See-Quel”), which is now both the
formal and de facto standard language for relational
DBMSs.
1. Data and Database Administrators
• Data and database administration are the roles generally
associated with the management and control of a DBMS
Roles in the and its data.

Database • Data Administrator (DA) is responsible for the


Environment management of the data resource, including database
planning; development and maintenance of standards,
policies and procedures; and conceptual/logical database
design.
• The Database Administrator (DBA) is responsible for the physical realization of
the database, including physical database design and implementation, security and
integrity control, maintenance of the operational system, and ensuring satisfactory
performance of the applications for users.

• The role of the DBA is more technically oriented than the role of the DA,
requiring detailed knowledge of the target DBMS.
• In large database design projects, we can
distinguish between two types of designer:
logical database designers and physical
database designers.
2. Database
Designers • The logical database designer is concerned
with identifying the data (that is, the entities and
attributes), the relationships between the data,
and the constraints on the data that is to be
stored in the database.
• The physical database designer decides how the logical database design is to be
physically realized. This involves:

• mapping the logical database 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.


• Once the database has been implemented, the
application programs that provide the required
functionality for the end-users must be
implemented.

• This is the responsibility of the application


3. Application developers. Typically, the application developers
Developers work from a specification produced by systems
analysts.

• Each program contains statements that request the


DBMS to perform some operation on the database,
which includes retrieving data, inserting, updating,
and deleting data.
• The end-users are the “clients” of the database. End-users
can be classified according to the way they use the system:

• Naïve users are typically unaware of the DBMS. They


access the database through specially written application
programs that attempt to make the operations as simple as
4. End-Users possible.

• They invoke database operations by entering simple


commands or choosing options from a menu. This means
that they do not need to know anything about the database
or the DBMS.
• The sophisticated end-user is familiar with the
structure of the database and the facilities
offered by the DBMS.
5. Sophisticated
users: • Sophisticated end-users may use a high-level
query language such as SQL to perform the
required operations.
Control of Data Redundancy

Advantages of • In contrast to traditional file system, the


DBMS database approach attempts to eliminate the
redundancy by integrating the files so that
multiple copies of the same data are not stored.
Data Consistency

• By eliminating or controlling redundancy, we reduce


the risk of inconsistencies occurring.

Advantages of • If a data item is stored only once in the database, any


DBMS 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 more than once and the system


is aware of this, the system can ensure that all copies of
the item are kept consistent.
More information • With the integration of the operational data,
from the same it may be possible for the organization to
derive additional information from the same
amount of data data.
Typically, files are owned by the
people or departments that use
them.

On the other hand, the database


Sharing of belongs to the entire organization
and can be shared by all
data authorized users.

In this way, more users share more


of the data.
Database integrity refers to the validity and consistency of
stored data. Integrity is usually expressed in terms of
constraints, which are consistency rules that the database
is not permitted to violate.

Improved
Data Constraints may apply to data items within a single record
or to relationships between records.

Integrity
For example, an integrity constraint could state that the
salary of a staff’s member cannot be greater than $40,000
or that the branch number contained in a staff record,
representing the branch where the member of staff works,
must correspond to an existing branch office.
• Database security is the protection of the database
from unauthorized users.
• This security may take the form of user names and
passwords to identify people authorized to use the
database.

Improved • The access that an authorized user is allowed on the


data may be restricted by the operation type
Security (retrieval, insert, update, delete).
• For example, the DBA has access to all the data in
the database; a branch manager may have access to
all data that relates to his or her branch office; and a
sales assistant may have access to all data relating to
properties but no access to sensitive data such as
staff salary details.
Complexity

• The provision of the functionality that we expect of a


good DBMS makes the DBMS an extremely complex
Disadvantages piece of software.

of DBMS • Failure to understand the system can lead to bad design


decisions, which can have serious consequences for an
organization.
Size

• The complexity and breadth of functionality makes the


DBMS an extremely large piece of software,
Disadvantages occupying many megabytes of disk space and requiring
substantial amounts of memory to run efficiently.
of DBMS
• The cost of DBMSs varies significantly, depending on the
environment and functionality provided.

• For example, a single-user DBMS for a personal computer


may only cost $100.
Cost of DBMSs
• However, a large mainframe multi-user DBMS servicing
hundreds of users can be extremely expensive, perhaps
$100,000 or even $1,000,000.

• There is also the recurrent annual maintenance cost.


• The disk storage requirements for the DBMS and the
database may necessitate the purchase of additional
storage space.

Additional • Furthermore, to achieve the required performance, it


Hardware Costs may be necessary to purchase a larger machine,
perhaps even a machine dedicated to running the
DBMS.

• The procurement of additional hardware results in


further expenditure.
• In some situations, the cost of the DBMS and
extra hardware may be relatively small
compared with the cost of converting existing
applications to run on the new DBMS and
hardware.
Cost of
Conversion • This cost also includes the cost of training staff
to use these new systems, and possibly the
employment of specialist staff to help with the
conversion and running of the systems.
• This cost is one of the main reasons why some
organizations feel tied to their current systems
Cost of and cannot switch to more modern database
technology.
conversion
(Contd.)
• The term legacy system is sometimes used to
refer to an older, and usually inferior, system.
• Typically, a file-based system is written for a
specific application, such as invoicing.

• As a result, performance is generally very good.

Performance • However, the DBMS is written to be more


general, to cater for many applications rather
than just one.

• The result is that some applications may not run


as fast as they used to.
• The centralization of resources increases the
vulnerability of the system.
Greater Impact
of a Failure • Because all users and applications rely on the
availability of the DBMS, the failure of certain
components can bring operations to a halt.

You might also like