Database Systems Fundamentals
Introduction to Databases and Database Management Systems
What Is a Database?
A database is a collection of related pieces of data that records information about some real-world organization, activity, or domain. The data must be related to a shared purpose: a university database, for example, would normally contain information about the university rather than unrelated weather records.
A database is created to meet specific information-management needs. It reflects the state of the organization or activity it represents, and it changes as that real-world situation changes. For example, when a student enrolls in a course or a new course is offered, the relevant information can be recorded in the university’s database.
An organization’s information may be too extensive to fit into a single database. Multiple databases may be needed to capture different parts of a large enterprise.
Example: An Academic University Database
A database focused on the academic activities of a university might track:
Students and their identifying information
Faculty members who teach students
Courses offered for study
Research laboratories
Student enrollment or registration in courses
This database is intended to represent the university’s academic affairs. It does not necessarily include every aspect of the university, such as finance or health services. Its contents and structure depend on the purpose for which it was designed.
Databases and Database Management Systems
A database and a database management system (DBMS) are related but distinct:
Database: The collection of related data.
DBMS: The software system used to create, store, retrieve, and manage databases.
Related information can be recorded in physical ledgers or books, but a DBMS provides software-based facilities for maintaining and working with large databases.
Persistent Storage
Databases generally need to preserve information over long periods. Main memory is volatile: its contents may disappear when a program or system stops running. Database information therefore needs to be stored on persistent secondary storage, such as disks.
A DBMS supports the creation and management of large databases stored on secondary storage. Because storage devices can fail, a practical DBMS must also address the protection and availability of stored data.
Retrieving Information
A database is useful not only because it stores information, but also because users can ask questions about that information. A request for information is expressed as a query.
For example, a university database could be queried to determine whether a student in a particular semester has completed a specified course. The DBMS processes the query and returns the requested information.
SQL is a widely recognized standard for expressing database queries. It provides a common way to state what information is needed, while the DBMS works to retrieve the answer efficiently. The time required can depend on the amount of data stored and the work needed to locate the requested information.
Important Responsibilities of a DBMS
A DBMS supports more than storing records and answering queries. It must also manage shared use of data, preserve application-specific rules, and handle failures.
Efficient Query Processing
The DBMS aims to return query results efficiently. A query that searches a large database may take substantial time, so the system must manage how the data is accessed and processed.
Concurrent Use
Database systems are often used simultaneously by many people. The DBMS must handle requests from multiple users without treating each request as if no others were occurring.
This concurrent use should be coordinated so that users can work with the system while the database remains in a valid state. A DBMS therefore has to manage both the processing of simultaneous requests and the consistency of the resulting data.
Consistency Requirements
A database is consistent when its information obeys the rules required by its application. These rules depend on the particular domain.
For example, in a railway reservation system, a seat on a train between two specified points must not be allocated to two different people. If many users request seats at the same time, the system must ensure that a particular seat is assigned to no more than one passenger.
Thus, consistency is not a single universal rule. A database’s consistency requirements are determined by the real-world rules it represents, and the DBMS must preserve those requirements when handling concurrent operations.
Data Availability and Failure Handling
A database may be expected to remain available even when parts of the system fail. Availability means that users can continue to obtain the data they need despite failures that the system is designed to handle.
Storage-Medium Failure
Disks and other storage devices can fail. An organization cannot simply accept the permanent loss of important data when a storage device stops working. A DBMS and its surrounding infrastructure therefore need measures to protect data against storage failures.
One possible measure is to keep a copy of the database at a geographically separate location. If a catastrophic event, such as a fire or storm, destroys the primary database server, the separate copy can help keep the data available.
Program Failure and Incomplete Changes
Programs that interact with a database can also encounter errors or crash. A program may have made some changes before failing, without completing the full task. If those partial changes remain in the database, they may violate the database’s consistency requirements.
The system must therefore handle incomplete work so that a failed operation does not leave the database in an invalid state. The management of such failures is closely connected to transaction processing and recovery.
Why Use a DBMS Instead of Writing Custom File Programs?
It is possible to store records in files and write programs to read and modify them. However, creating a complete database system in this way creates significant difficulties. A DBMS provides general-purpose facilities for problems that would otherwise have to be handled separately by application programmers.
Redundancy and Inconsistency
Different applications may need to store overlapping information. For example:
An academic application might record students, courses, and grades.
A university hospital application might record students’ health information.
Both applications might need a student’s name, address, and contact number.
If each application stores its own copy of these details, the data becomes redundant. Redundancy is not necessarily a problem merely because it uses extra storage. The greater difficulty is that every copy must be updated whenever the information changes.
If a student’s phone number is changed in one file but not another, the database system contains conflicting values. It may then be unclear which value is correct. Keeping redundant copies synchronized across independent programs is difficult and can lead to inconsistency.
Dependence on Record Structures
In a custom file-based approach, programs often depend directly on the structure of the records they read and write. The structure must be declared in the program before the program can work with records of that type.
If the record structure changes, affected programs may also need to be modified, recompiled, and rebuilt. This makes changes to the organization of the data costly and difficult to manage.
Difficulty Handling Queries
A custom program can answer a specific question by searching through records and producing a result. However, each new kind of question may require another program.
It is difficult to predict every query that users might ask in advance and create a separate program for each one. An approach based on many special-purpose programs is therefore poorly suited to flexible, unanticipated information requests.
A standard query language such as SQL allows users to express many different information needs through a common interface, rather than requiring a newly written program for every question.
Concurrency and Recovery Burden
If applications manage files independently, the programmers must also solve the problems of simultaneous access and failure recovery. Coordinating concurrent changes while maintaining consistency is difficult. Recovering safely from program or system failures is another responsibility that would otherwise fall to application developers.
A DBMS is valuable because it provides shared facilities for these requirements rather than forcing every application to recreate them.
Program–Data Independence and General-Purpose DBMSs
A central DBMS idea is the separation of data from metadata.
Data is the actual stored information, such as student names or course registrations.
Metadata is information that describes the data, such as record types and the organization of stored information.
The DBMS maintains metadata separately, in a system catalog. Programs can consult the catalog to learn how information is organized rather than relying entirely on fixed structural assumptions embedded in their code.
How the Separation Helps
When a program needs to work with stored information, the DBMS can use the relevant catalog description to interpret the data. If the structure changes, the metadata can be updated, and programs can use the revised description.
This supports program–data independence: programs that operate on data are less tightly coupled to the precise way that data is organized. Structural changes can be managed through metadata rather than requiring every program to be rewritten for every change.
General-Purpose Operation
Because a DBMS uses descriptions of individual databases, one DBMS can manage many different databases. For example, the same system could be used for:
Hospital records
Staff accounts and salaries
Students’ academic records
Each database has its own data and catalog information, while the DBMS provides the general mechanisms for managing them.
SQL and Relational Query Foundations
The relational approach to databases provides a foundation for standard query formulation. SQL is an internationally recognized standard for expressing queries and other database operations. A DBMS that implements the relevant SQL features can interpret queries expressed using that standard.
The DBMS’s work includes both understanding the query and retrieving the answer efficiently. The database theory underlying the relational approach includes formal ways of describing queries, including:
Tuple relational calculus, which describes queries in terms of conditions that database tuples must satisfy.
Relational algebra, which expresses queries through operations on relations.
These ideas provide theoretical foundations for reasoning about database queries. When query needs can be expressed in a standard language, users can formulate many different requests without requiring a separate custom program for each one.
Database Design and the Role of a DBMS
Designing a database begins with understanding the organization whose information it will represent. For an academic university database, designers would consult the people responsible for academic activities to determine:
What information must be tracked
How the important pieces of information relate to one another
What queries or reports are needed regularly
This requirements work leads to a logical design: a description of what information the database represents and how that information is organized conceptually.
The DBMS provides many of the mechanisms needed to store data, process queries, and coordinate users. As a result, designers can focus more directly on the logical structure of the database and the information needs it must satisfy, instead of implementing all of those mechanisms from scratch.
Data Models and Levels of Abstraction
A data model is a collection of conceptual tools used to describe a database at a particular level of abstraction. Different levels emphasize different concerns. Some help designers discuss requirements with users; others describe the logical organization of data or its detailed physical implementation.
Conceptual Data Model
A conceptual data model gives a high-level description of the information that a database needs to represent. It is particularly useful during requirements gathering, when designers are discussing the organization’s needs with people who may not have technical backgrounds.
Conceptual models use ideas that can be explained without requiring detailed knowledge of files or database software. They help designers and users agree on what the database is about before deciding how it will be implemented.
Representational Data Model
A representational data model describes a database’s logical organization without specifying all of its physical storage details. It lets designers concentrate on what data is represented and how the parts of that data relate.
This level is useful for evaluating and refining a design without being distracted by the specific files, records, or storage structures that will eventually implement it.
Physical Data Model
A physical data model describes implementation details, including:
Record formats
File organization
External data structures used to organize or access data
Relationships among the physical structures
At this level, attention shifts from the logical meaning of the data to the details of how it is physically represented and managed.
The Entity–Relationship Model
The entity–relationship model is a conceptual data model. It uses three main concepts to describe information in a domain: entities, relationships, and attributes. These concepts help database designers discuss requirements with users in an accessible way.
Entities
An entity is a significant kind of object or thing that the database needs to represent. In a university setting, examples include:
Students
Faculty members
Courses
Departments
Entities identify the main categories of information that must be tracked.
Relationships
A relationship describes an association between entities. In the university example:
A student is enrolled in a course.
A faculty member is employed by a department.
Relationships show how the different kinds of information connect to one another.
Attributes
An attribute is a piece of information that describes an entity. For a student, attributes might include:
Name
Student identification or roll number
Address
An identifying attribute, such as a student number, helps distinguish one student from another.
Using the Model to Gather Requirements
Designers can use entities, relationships, and attributes as shared concepts when discussing a database with the people who understand the organization’s work. This helps them determine what the database should represent before choosing detailed logical or physical implementation structures.
The resulting description is not a storage specification. It is a high-level account of the important things in the domain, the information about them, and the associations among them.

Ask anything
We've read this whole study set, so questions about it get the best answers.