Databases and Database Users
Databases and Database Users
• A database management system (DBMS) is a collection of programs that enables users to create
and maintain a database.
○ 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.
○ 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 database to reflect changes in the miniworld, and generating
reports from the data.
○ Sharing a database allows multiple users and programs to access the database
simultaneously.
• 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.
• Functions provided by the DBMS
○ Protection includes system protection against hardware or software malfunction (or
crashes) and security protection against unauthorized or malicious access.
○ A typical large database may have a life cycle of many years, so the DBMS must be able to
maintain the database system by allowing the system to evolve as requirements change
over time.
• The database is organized as five files, each of which stores data records of the
same type.
• Define the structure of the records of each file
○ Data element
○ Data type
• To construct the UNIVERSITY database, we store data to represent each student,
course, section, grade report, and prerequisite as a record in the appropriate file.
• Database manipulation involves querying and updating. 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
• Design of a new application for an existing database
○ Requirements specification and analysis
○ Conceptual design --> represented and manipulated using some
computerized tools so that it can be easily maintained, modified, and
transformed into a database implementation. (ER)
○ Logical design --> A data model implemented in a commercial DBMS.
(RDBMS)
Physical design --> Further specifications are provided for storing and
The structure of data files is embedded in the application programs, so any Program-data independence - DBMS access programs do not require such
changes to the structure of a file may require changing all programs that changes in most cases. The structure of data files is stored in the DBMS
access that file. catalog separately from the access programs.
Ex. Adding Birth_date of student whole program need to change For adding Birth_date only catalog need to change
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.
The atomicity property ensures that either all the database operations in a
transaction are executed or none are
• Controlling Redundancy
○ Duplication of effort
○ Storage space is wasted
○ Data inconsistency
▪ Ex. ‘JAN-19-1988’ and ‘JAN-29-1988’.
○ Data normalization ---> storing data in only one place
▪ it ensures consistency and saves storage space
• Restricting Unauthorized Access
○ Ex. financial data is often considered confidential, and only authorized persons are allowed
to access such data.
• Providing Persistent Storage for Program Objects
○ A complex object in C++ can be stored permanently in an object-oriented DBMS.
○ Object-oriented database systems typically offer data structure compatibility with one or
more object-oriented programming languages ---> handles the problem of impedance
mismatch problem
• Providing Storage Structures and Search Techniques for Efficient Query Processing
○ Auxiliary files called indexes are used for speed up the searching purpose.
• Providing Backup and Recovery
○ If the computer system fails in the middle of a complex update transaction, the recovery
subsystem is responsible for making sure that the database is restored to the state it was in
before the transaction started executing.
○ Alternatively, the recovery subsystem could ensure that the transaction is resumed from the
point at which it was interrupted so that its full effect is recorded in the database
• Providing Multiple User Interfaces
○ These include query languages for casual users, programming language interfaces for
application programmers, forms and command codes for parametric users, and menu-
driven interfaces and natural language interfaces for standalone users.
• Representing Complex Relationships among Data
• Enforcing Integrity Constraints
○ The simplest type of integrity constraint involves specifying a data type for each data item.
• Permitting Inferencing and Actions Using Rules
○ A trigger is a form of a rule activated by updates to the table, which results in performing
some additional operations to some other tables, sending messages, and so on.
○ Stored procedures; they become a part of the overall database definition and are invoked
appropriately when certain conditions are met.