Chapter 1
Introduction
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Outline
▪ Introduction (General Definitions)
▪ An Example
▪ Database Systems Vs File Systems
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Introduction
▪ Databases play a critical role in almost all
areas where computers are used, including:
• Business
• Electronic commerce
• Social media
• Engineering
• Medicine
• Genetics
• Law
• Education
• Library science
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Introduction
▪ Database: is a collection of related data
▪ Data: are known facts that can be recorded and that
have implicit meaning. For example, names, phone
numbers, and addresses of the people.
▪ Database properties:
▪ Represents some aspect of the real world,
sometimes called the Miniworld or universe of
discourse (UoD)
▪ Logically coherent collection of data with inherent
meaning
▪ Built for a specific purpose
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Introduction (cont'd.)
▪ A database can be of any size and
complexity.
▪ Example of a large commercial database is
[Link]
▪ A database may be generated and
maintained manually (e.g. library card
catalog) or it may be computerized (e.g.
DBMS)
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Introduction (cont'd.)
▪ Database management system (DBMS)
▪ Collection of programs
▪ Enables users to define, construct,
manipulate, and sharing a database.
▪ Functions provided by DBMS:
1) Defining a database
▪ Specify the data types, structures, and
constraints of the data to be stored
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Introduction (cont'd.)
2) Constructing a database
▪ Storing database definition or descriptive
information in the form of a database catalog or
dictionary; it is called meta-data.
3) Manipulating a database
▪ Includes functions such as:
• Querying to retrieve specific data.
• Updating the database to reflect changes in the
miniworld
• Generating reports from the data.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Introduction (cont'd.)
4) Sharing a database
▪ Allow multiple users and programs to access
the database simultaneously
5) Application program
▪ Accesses database by sending queries for
data to DBMS
6) Query
▪ Causes some data to be retrieved
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Introduction (cont'd.)
7) Transaction
▪ May cause some data to be read and some data
to be written into the database
8) Protection includes:
▪ System protection (hardware or software
malfunction (or crashes))
▪ Security protection (unauthorized or malicious
access)
9) Maintain the database system
▪ Allow the system to evolve as requirements
change over time
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
An Example
▪ UNIVERSITY database
▪ For maintain information concerning students,
courses, and grades in a university environment.
▪ The UNIVERSITY database is organized as five files,
each of which stores data records of the same type
▪ STUDENT file: stores data on each student.
▪ COURSE file: stores data on each course.
▪ SECTION file: stores data on each section of a
course.
▪ GRADE_REPORT file: stores the grades that
students receive.
▪ PREREQUISITE file: stores the prerequisite of
each course.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Database System
Note: The database
and DBMS together
called a database
system.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
An Example (cont'd.)
1) Defining UNIVERSITY database:
▪ To define this database, we must specify structure of
records of each file by specifying data element for
each data type.
▪ Data element: e.g. each student record includes data to
represent the student’s name, student_number,
Class, and Major.
▪ Data type: for each data element within a record, for
example:
▪ Name of student is a string of alphabetic characters.
▪ Student_number of student is integer
▪ Etc.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
An Example (cont'd.)
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
An Example (cont'd.)
2) Constructing UNIVERSITY database
▪ Store data to represent each student, course, section,
grade report, and prerequisite as a record in
appropriate file
▪ Relationships among the records: records in the
various files may be related. E.g. the record for Smith in
the STUDENT file is related to two records in the
GRADE_REPORT file.
3) Manipulating UNIVERSITY database
▪ Involves querying and updating.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
An Example (cont'd.)
▪ Examples of queries:
▪ Retrieve the transcript
▪ List the names of students who took the
section of the ‘Database’ course offered in fall
2008 and their grades in that section
▪ List the prerequisites of the ‘Database’ course
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
An Example (cont'd.)
▪ Examples of updates:
▪ Change the class of ‘Smith’ to sophomore
▪ Create a new section for the ‘Database’ course
for this semester
▪ Enter a grade of ‘A’ for ‘Smith’ in the ‘Database’
section of last semester
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Database Systems Vs File Systems
▪ In early days, database application were built
directly on top of file systems.
▪ In traditional file processing each user defines
and implements the files needed for a specific
software application.
▪ Example
▪ One user, the grade reporting office, may
keep files on students and their grades.
▪ A second user, the accounting office, may
keep track of students’ fees and their
payments.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Database Systems Vs File Systems (cont'd.)
▪ Although Both users are interested in data about
students; each user maintains separate files and
programs to manipulate these files, because each
requires some data not available from the other
user’s file.
▪ This redundancy in defining and storing data
results in wasted storage space and in
redundant efforts to maintain common up-to-
date data.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
The disadvantages of using File Systems
1. Data redundancy and inconsistency
▪ Multiple file formats, duplication of information in different files.
2. Data isolation and Difficult in accessing data
▪ Data scattered in various files and files may be in different formats,
writing programs to retrieve the data is difficult.
3. Data integrity problem
▪ The data values stored in the database must satisfy certain type of
consistency constraints.
4. Concurrent access by multiple users problem
▪ Difficult to control the concurrent access in file system.
5. Security problems
▪ Hard to provide user access to some, but not all, data.
▪ Database Systems offer solutions to all the above
problems.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Summary
▪ Database
▪ Collection of related data (recorded facts)
▪ DBMS
▪ Generalized software package for
implementing and maintaining a computerized
database
▪ Database Systems Vs File Systems
▪ Database Systems offer solutions to all the file
system problems.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe