Bridge International College
Course Name: Fundamentals of Database Systems
Course code: CoSc2041
Credit Hours: 3 ECTS: 5
Text book:
• Raghu Ramakrishnan, Johannes Gehrke. Database Management Systems, McGraw-Hill; 3rd
edition, 2002
• Elmasri, R., & Navathe, S. (2017). Fundamentals of database systems (7 th Edition). Pearson.
• References
• Osama Mustafa, Robert P. Lockard. (2019). Oracle Database Application Security, Apress,
Berkeley, CA.
• C. J. Date. (2019). Database Design and Relational Theory. 2 nd Edition. Apress, Berkeley, CA.
• Anthony Hack. (2019). SQL Computer Programming for Beginners. Independently published
• Software required (Microsoft SQL Server or Oracle DB)
Assessment:
Mid exam:30%
Individual Assignment:10%
Lab exam :10%
Attendance :5%
Quiz:5%
Final exam:40%
Course objectives
This course introduces the students to the overview, design and implementation of
database systems.
At the end of this course, students will be able to:
Understand what database is, database system and DBMS .
Differentiate database system from file system .
Identify the pros and cons of manual approach, file based approach and database
approach
Understand the basic principles of database design systems using different database
models
Appreciate the use of database system in the real world.
Design different types of databases
Understand database normalization & functional dependency
Understand the principles of relational database management systems and their
languages.
Understand file organizations and storage management, and index structure for files.
Demonstrate queries in the relational algebra.
Demonstrate queries in the tuple relational calculus.
Create a relational database schema in SQL that incorporates key, entity integrity, and
referential integrity constraints.
UNIT -0NE
Introduction to Database Systems
1.1.Overview of Database system.
Databases and database systems are an essential component of life
in modern society.
Most of us encounter several activities every day that involve some
interaction with a database. For example, if we go to the bank to
deposit or withdraw funds, if we make a hotel or airline reservation,
if we access a computerized library catalog to search for a
bibliographic item, or if we purchase something online—such as a
book, toy, or computer—chances are that our activities will involve
someone or some computer program accessing a database.
1.1.Overview of Database system.
These interactions are examples of what we may call traditional database
applications, in which most of the information that is stored and accessed is
either textual or numeric.
In the past few years, advances in technology have led to exciting new
applications of database systems.
The proliferation of social media Web sites, such as Facebook, Twitter, and
Flickr, among many others, has required the creation of huge databases that
store non-traditional data, such as posts, tweets, images, and video clips.
New types of database systems, often referred to as big data storage
systems, or NOSQL systems, have been created to manage data for social
media applications
1.1.Overview of Database system.
These types of systems are also used by companies such as
Google, Amazon, and Yahoo, to manage the data required
in their Web search engines, as well as to provide cloud
storage, whereby users are provided with storage
capabilities on the Web for managing all types of data
including documents, programs, images, videos and emails.
Databases and database technology have had a major
impact on the growing use of computers.
Con’t
A database is a collection of related data. By data, we 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. Nowadays, this data is typically
stored in mobile phones, which have their own simple database
software. 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.
Con’t
A database has the following implicit properties:
A database represents some aspect of the real world, sometimes
called the miniworld or the universe of discourse (UoD). Changes to
the miniworld are reflected in the database.
A database is a logically coherent collection of data with some
inherent meaning. A random assortment of data cannot correctly be
referred to as a database.
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.
1.2. Basics of Database
– A database is an organized collection of structured information, typically stored
electronically in a computer system.
Database Management System (DBMS):
– Software that interacts with end users, applications, and the database itself to capture
and analyse data. Examples include MySQL, Oracle, and Microsoft SQL Server.
Data Models:
– Structures that dictate how data is stored, organized, and manipulated. Common types
include:
• Relational Model: Data is organized in tables (relations).
• NoSQL Models: Includes document, key-value, graph, and column-family
databases.
Key Components:
– Tables: The fundamental structure of a relational database, consisting of rows and
columns.
Basics of data base
Primary Key:
– A unique identifier for a record in a table, ensuring that each entry can be uniquely
retrieved.
Foreign Key:
– A field in one table that links to the primary key in another table, establishing
relationships between tables.
Queries:
– Requests for data retrieval or manipulation, typically made using Structured Query
Language (SQL).
Normalization:
– The process of organizing data to reduce redundancy and improve data integrity.
Transactions:
– A sequence of operations performed as a single logical unit of work, ensuring data
consistency and integrity (ACID properties: Atomicity, Consistency, Isolation,
Durability).
Backup and Recovery:
– Strategies to protect data from loss and ensure it can be restored in case of failure .
1.3. File organization verses Database approach
ASPECT TRADITIONAL FILE ORGANIZATION DATABASE APPROACH
Data is organized in tables with defined
Data Structure Data is stored in flat files or hierarchical structures.
relationships.
Accessing data often requires reading entire files, leading Allows for efficient querying using SQL,
Data Access
to inefficiencies. enabling quick data retrieval.
High potential for redundancy as data may be duplicated Minimizes redundancy through
Data Redundancy
across multiple files. normalization techniques.
Difficult to enforce data integrity constraints, leading to Enforces integrity constraints (e.g.,
Data Integrity
potential inconsistencies. primary and foreign keys).
Limited capabilities for manipulating data; often requires Provides robust tools for data
Data Manipulation
custom programming. manipulation, including transactions.
Scaling is challenging; managing large files can be Designed to scale easily, accommodating
Scalability
cumbersome. large volumes of data.
Limited user access control; often requires file-level Supports fine-grained access control,
User Access
permissions. allowing different user roles.
Typically does not support concurrent access, risking Manages concurrent transactions
Concurrency
data conflicts. effectively, ensuring data consistency.
Backup and Built-in backup and recovery
Backup processes are manual and may be error-prone.
Recovery mechanisms enhance data safety.
Ideal for complex applications requiring
Use Cases Suitable for simple, small-scale applications.
multi-user access and data integrity.
1.5 Characteristics of the Database Approach
Traditional File Processing: Requires users to create and manage separate files
tailored to specific applications, leading to inefficiencies.
Customization in File Processing
• User-Defined Files: Each user defines and implements their own files for specific
applications.
– Example 1: The grade reporting office maintains files on students and their
grades, with separate programs to handle tasks like printing transcripts and
entering grades.
– Example 2: The accounting office keeps separate records for students’ fees
and payments.
• Redundancy Issues
Separate Data Storage: Each user maintains independent files even when they are
interested in similar data (e.g., student information).
Consequences of Redundancy:
– Wasted Storage Space: Duplicate data storage leads to inefficient use of
resources.
– Maintenance Challenges: Keeping data consistent across multiple files
requires extra effort, increasing the risk of errors and out dated information.
1.5 Characteristics of the Database Approach
Shift to Database Approach.
Database Approach: Utilizes a centralized system to manage data,
allowing multiple users to access and manipulate shared data efficiently.
• Centralized Data Management: A single repository for data that can
be accessed by various users through queries and application
programs.
• Benefits of the Database Approach:
– Reduces redundancy and resource waste.
– Simplifies data maintenance and ensures consistency across applications.
– Enhances collaboration and data sharing among users.
The main characteristics of the database approach versus the file-processing approach are
the following:
Self-describing nature of a database system.
Insulation between programs and data, and data abstraction
Support of multiple views of the data.
Sharing of data and multiuser transaction processing
1.5.1. Self-describing nature of a database system.
A database system contains both the data and a complete description of its
structure and constraints.
DBMS Catalog: This catalog holds the metadata, which describes the database
structure, types, storage formats, and constraints for each data item.
Metadata: This is the data about the data. It provides essential information
for understanding the structure of the primary database.
Examples of Metadata:
Structure of Each File: Defines how data is organized within the database.
Data Types: Specifies whether data is integer, string, date, etc.
Storage Format: Indicates how data is stored (e.g., text, binary).
Constraints: Rules that ensure data integrity (e.g., primary keys, foreign
keys).
• Traditional File Processing: Data definitions are embedded within application
programs.
• Each program is designed to work with a specific database structure, limiting its
flexibility.
• Example: A C++ application might include struct or class definitions that specify how
1.5.2. Insulation between programs and data, and data abstraction
Insulation Between Programs and Data
• Traditional File Processing:
– Data file structures are embedded directly within application
programs.
– Changes to the structure (e.g., adding a new field) necessitate
modifications to all programs accessing that file.
– Example: If a STUDENT record needs to include a Birth_date,
every program that interacts with the STUDENT data must be
updated to accommodate this change.
• Database Management System (DBMS):
– In a DBMS, the structure of data files is stored separately in a
catalog.
– This leads to program-data independence, meaning programs do
not need to change when the data structure is updated.
– Example: The catalog can be updated to include the Birth_date for
STUDENT records without altering existing application programs.
1.5.2. Insulation between programs and data, and data abstraction
• Data Abstraction.
• A characteristic of a DBMS that provides a conceptual
representation of data, abstracting away the complexities of how
data is stored or operations are implemented.
• Data Models:
– Serve as frameworks for data abstraction, using logical concepts
(e.g., objects, properties, relationships) that are easier for users to
understand than technical storage details.
– Example: A user querying for a STUDENT's Name should
receive the correct value without needing to know the byte
location of the data in the record.
1.5.3. Support of multiple views of the data.
A database serves various users, each with unique needs and perspectives.
– Examples: End users (students), administrators, developers.
• View: A representation of a subset of data or derived data from the database.
– Can be:
• Subset View: Contains specific data relevant to a user.
• Derived View: Includes virtual data that is calculated from existing data
but not stored explicitly.
• User Transparency
• Users may not need to know if the data they access is stored or derived.
– Simplifies interaction with the database.
1.5.3. Support of multiple views of the data.
Multiuser DBMS Requirements
Facilities for Multiple Views: A multiuser Database Management System
(DBMS) must support defining and managing various views to cater to distinct
applications.
Essential for accommodating different user needs effectively.
Benefits of Multiple Views
Security: Restricts access to sensitive data by providing tailored views.
Usability: Simplifies data interaction by presenting only relevant information.
Customization: Allows users to have views that suit their specific tasks and
preferences.
Supporting multiple views in a database enhanes flexibility, security, and user
satisfaction, enabling a tailored data interaction experience for diverse user needs.
1.5.4. Sharing of data and multiuser transaction processing.
Multiuser DBMS Functionality
Simultaneous Access: A multiuser Database Management System
(DBMS) allows multiple users to access the database concurrently,
essential for integrating data from various applications.
Concurrency Control:-Ensures that multiple users can update the
same data in a controlled manner.
Example: In airline reservations, only one agent can assign a specific
seat at a time to prevent conflicts.
Online Transaction Processing (OLTP):- Applications that require
real-time data processing and support multiple transactions
simultaneously.
1.5.4. Sharing of data and multiuser transaction processing.
Role of DBMS: Ensure that concurrent transactions function correctly
and efficiently.
Concept of Transactions
A transaction is a process that includes one or more database
operations, such as reading or updating records.
Distinction from File Processing
DBMS vs. Traditional File Processing: The ability to handle
concurrent transactions and enforce transaction properties distinguishes
a DBMS from traditional file-processing systems.
1.6 Actors on the Scene
Actors on the Scene:
• Individuals actively using the database on a day-to-
day basis.
• Involved in data access and manipulation.
Workers Behind the Scene:
• Maintain the database system environment.
• Not directly interested in the contents of the
database as part of their daily job .
16.1.Database Administrators (DBA)
• Role of the DBA
Chief Administrator: Oversees and manages database resources in an organization.
Primary Responsibilities
o Database Access: Authorizes user access to the database.
o Coordination: Monitors and coordinates database usage.
o Resource Acquisition: Acquires necessary software and hardware.
o Accountability
o Security: Responsible for preventing security breaches.
o Performance: Ensures optimal system response time.
o Support Structure
o Staff Assistance: In large organizations, DBAs are supported by a team to
manage these responsibilities effectively.
Importance of the DBA
o Resource Management: Ensures efficient use of database resources.
o User Support: Facilitates a smooth experience for users accessing the database.
o System Integrity: Maintains data accuracy and security.
1.6.2. Database Designers
Responsibility: Identify data to be stored and choose appropriate structures for
representation.
Timing: Tasks are primarily conducted before the database implementation.
Understanding User Requirements
Communication: Engage with prospective database users to grasp their needs.
Design Creation: Develop a database design that meets user requirements.
Collaboration with DBA
Staff Role: Often part of the DBA's team, may take on additional responsibilities
post-design.
Interaction with User Groups
User Engagement: Interact with various user groups to develop tailored views of
the database.
Integration: Analyze and integrate views from different groups to ensure
comprehensive support.
Final Database Design
Support Requirements: The final design must accommodate the needs of all user
groups effectively.
1.6.3. end user
End users are individuals whose jobs require access to the database for
querying, updating, and generating reports.
The database primarily exists for the benefit of end users.
Categories of End Users:
• Casual End Users
– Occasionally access the database.
– Use sophisticated query interfaces.
– Typically middle- or high-level managers.
• Naive or Parametric End Users
– Regularly query and update the database.
– Utilize standard, pre-programmed queries (canned transactions).
– Examples:
• Bank customers checking balances.
• Reservation agents for airlines, hotels, etc.
1.6.3. end user
Types of End Users (Continued)
• Sophisticated End Users
– Engineers, scientists, and business analysts.
– Familiar with DBMS features to implement their own applications.
• Standalone Users
– Maintain personal databases using ready-made software.
– Example: Users of financial software packages.
User Interaction with DBMS:
• Naive Users: Minimal learning; focus on mobile apps or standard
transactions.
• Casual Users: Learn a few frequently used facilities.
• Sophisticated Users: Strive to learn most DBMS features.
• Standalone Users: Gain proficiency in specific software packages.
1.6.4. System Analysts and Application Programmers
• Role of System Analysts:
– Determine requirements of end users, especially naive and
parametric users.
– Develop specifications for standard canned transactions.
• Role of Application Programmers:
– Implement specifications as programs.
– Test, debug, document, and maintain these canned transactions.
• Commonly Referred To As:
– Software Developers or Software Engineers.
• Knowledge Requirement:
– Familiarity with the full range of capabilities provided by the
DBMS is essential for effective task completion.
Workers Behind the Scene
• These workers are essential for database functionality but
do not engage with the database content directly.
• Roles Focused on DBMS Development and Operation
– Not directly involved with database content.
Key Categories
• DBMS System Designers and Implementers
– Design and implement DBMS modules and interfaces.
– Handle complex components like:
Catalog management
Query processing
Data access and buffering
Concurrency control
Data recovery and security
– Interface with other system software (e.g., operating systems).
Workers Behind the Scene
• Tool Developers:-
– Create tools for:
• Database modeling and design
• System design and performance improvement
• Operators and Maintenance Personnel
– Manage the hardware and software environment.
– Ensure smooth operation of the database system.
1.6 Advantages of Using the DBMS Approach
Controlling Redundancy:-
Restricting Unauthorized Access
Providing Persistent Storage for Program Objects
Providing Storage Structures and Search Techniques for Efficient Query
Processing
Providing Backup and Recovery
Providing Multiple User Interfaces
Representing Complex Relationships among Data.
Enforcing Integrity Constraints.
Permitting Inference and Actions Using Rules and Triggers
Additional Implications of Using the Database Approach.