Database
Database
• is a collection of related data.
• data: mean known facts that can be recorded
and that have implicit meaning.
For example, consider the names, telephone
numbers, and addresses of the people you know.
• This data can also be recorded in an indexed
address book or stored on a hard drive, using a
personal computer and software such as
Microsoft Access or Excel. This collection of
related data with an implicit meaning is a
database.
DB properties
• A database represents some aspect of the real
world, sometimes called the mini world.
Changes to the mini world are reflected in the
database.
• A database is a logically coherent collection of
data with some inherent meaning.
• A database is designed, built, and populated
with data for a specific purpose. It has an
intended group of users and some
preconceived applications in which these
users are interested.
Cont. DB properties
• A database can be of any size and complexity.
For example, the list of names and addresses
referred to earlier may consist of only a few
hundred records, each with a simple structure. On
the other hand, the computerized catalog of a large
library may contain half a million entries organized
under different categories—by primary author’s last
name, by subject, by book title—with each category
organized alphabetically. A database of even greater
size and complexity would be maintained by a social
media company such as Facebook, which has more
than a billion users.
An example of a large commercial database is
Amazon.com.
Some types of DB
• traditional database applications, in which most of the
information that is stored and accessed is either textual
or numeric.
• multimedia databases: store images, audio clips, and
video streams digitally.
• Geographic information systems (GISs) can store and
analyze maps, weather data, and satellite images.
• Data warehouses and online analytical processing
(OLAP) systems are used in many companies to extract
and analyze useful business information from very
large databases to support decision making.
• Real-time and active database technology is used to
control industrial and manufacturing processes.
Database Management System
(DBMS)
is a computerized system that enables users to
create and maintain a database.
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
• involves 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 the database is the process of
storing the data on some storage medium that
is controlled by the DBMS.
• Manipulating a database includes functions
such as querying the database to retrieve
specific data, updating the data- base to
reflect changes in the mini world, and
generating reports from the data.
• Sharing a database allows multiple users and
programs to access the database
simultaneously.
• Other important functions provided by the
DBMS include protecting the database and
maintaining it over a long period of time.
Protection includes system protection against
hardware or software malfunction (or crashes)
and security protection against unauthorized
or malicious access.
• An application program accesses the database
by sending queries or requests for data to the
DBMS.
• A query typically causes some data to be
retrieved.
• a transaction may cause some data to be
read and some data to be written into the
database.
Example
• a UNIVERSITY database for maintaining
information concerning students, courses, and
grades in a university environment.
Users/Programmers
• The database is organized as five files, each of
which stores data records of the same type.
The STUDENT file stores data on each student,
the COURSE file stores data on each course,
the SECTION file stores data on each section
of a course, the GRADE_REPORT file stores the
grades that students receive in the various
sections they have completed, and the
PREREQUISITE file stores the prerequisites of
each course.
• To define this database, we must specify the
structure of the records of each file by
specifying the different types of data
elements to be stored in each record.
For example, we can specify that Name of
STUDENT is a string of alphabetic characters,
Student_number of STUDENT is an integer, and
Grade of GRADE_REPORT is a single character
from the set {‘A’, ‘B’, ‘C’, ‘D’, ‘F’, ‘I’}.
Examples of queries are as follows:
• Retrieve the transcript—a list of all courses
and grades—of ‘Smith’
• 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
Examples of updates include the following:
• 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