Unit 1
Unit 1
(CSPC250T)
4th Semester
Syllabus
Unit Topics
Relational Data Model: Concept of relations, Schema-instance distinction, Keys, referential integrity and
foreign keys, Relational algebra operators, Tuple relation calculus, Domain relational calculus.
2
Physical and logical hierarchy: Concept of index, B-trees, hash index, function index, bitmap index.
Concepts of Functional dependency, Normalization (1NF, 2NF, 3NF, BCNF, etc)
Query Processing and Optimization: Query Processing and Optimization process, measures of query
3
cost estimation in query optimization, pipelining and Materialization, Structure of query evaluation plans.
Transaction Processing: Concurrency Control and Recovery: Recovery System and advanced databases:
failure classification, recovery and atomicity, log based recovery, checkpoints, buffer management,
5
advanced recovery techniques. Introduction to Web databases, distributed databases, data warehousing
and data mining, Data Security, NOSQL databases
Course Objectives
❖ To Understand the General Idea Of Database Management Systems.
❖ To develop skills to design databases using data modeling and design technique
Text Books
1. Database management system by W.Stallings, PHI publication, 2001
2. Database management system Elsevier 2008
3. Data base System Concepts, Silberschatz, Korth, 4. Data base Management Systems, Raghurama
McGraw hill, Sixth Edition. Krishnan, Johannes Gehrke, TATA McGrawHill 3rd
Edition.
Reference Books
For example, within a company there are different departments, as well as customers, who each need to see different kinds of
data. Each employee in the company will have different levels of access to the database with their own customized front-end
application. In a database, data is organized strictly in row and column format. The rows are called Tuple or Record. The data
items within one row may belong to different data types. On the other hand, the columns are often called Domain or Attribute. All
the data items within a single attribute are of the same data type.
1.2 What is Management System?
● A database-management system (DBMS) is a collection of interrelated data and a set of
programs to access those data.
● This is a collection of related data with an implicit meaning and hence is a database.
● The collection of data, usually referred to as the database, contains information relevant
to an enterprise.
● The primary goal of a DBMS is to provide a way to store and retrieve database
information that is both convenient and efficient.
● The management system is important because without the existence of some kind of
rules and regulations it is not possible to maintain the database.
● We have to select the particular attributes which should be included in a particular table;
the common attributes to create relationship between two tables; if a new record has to
be inserted or deleted then which tables should have to be handled etc.
● These issues must be resolved by having some kind of rules to follow in order to
maintain the integrity of the database.
1.3 Database Management System (DBMS) and Its Applications
A Database management system is a computerized record-keeping system. It is a repository or a
container for collection of computerized data files. The overall purpose of DBMS is to allow he
users to define, store, retrieve and update the information contained in the database on demand.
Information can be anything that is of significance to an individual or organization.
Databases touch all aspects of our lives. Some of the major areas of application are as follows:
1. Banking
2. Airlines
3. Universities
4. Manufacturing and selling
5. Human resources
1.4 Data Abstraction
Data abstraction is a logical function in a
database management system (DBMS) that
separates the raw data from the front end.
It hides the complexities of how data is
stored and managed, and provides a
simplified view of the data to users and
applications.
● Storage space: The physical layout of the library, including stacks, reading rooms,
and storage areas.
● Barcode system: How books are tagged and tracked using barcodes.
A librarian organizing new books by subject and placing them on specific shelves.
1.4 Data Abstraction
1.4.2 Logical level (or Conceptual View / Schema):
● The next-higher level of abstraction describes what data are stored in the database,
and what relationships exist among those data.
Example:
● Cataloging rules: How books are classified, indexed, and described in the library
catalog.
● Database structure: The fields and relationships in the library's database (e.g., title,
author, ISBN, availability status).
● Search functionality: How users can search the catalog using keywords, subject
headings, or author names.
A librarian creating a new catalog entry for a book, including its title, author, subject
headings, and call number.
1.4 Data Abstraction
1.4.3 View level (or External View / Schema):
● The highest level of abstraction describes only part of the entire database.
Example
● User interfaces: Online library catalogs, mobile apps, and search engines.
● Access control: Limiting access to certain parts of the catalog or specific functions
based on user permissions (e.g., student, faculty, staff).
● Personalized recommendations: Suggesting books based on user history and
preferences.
A student searching the online library catalog for books on a specific topic, while a
librarian accessing detailed inventory information.
1.5 Instances and Schemas
Databases change over time as information is inserted and deleted. The collection of
information stored in the database at a particular moment is called an instance of the
database.
The overall design of the database is called the database schema. Schemas are changed
infrequently, if at all. The concept of database schemas and instances can be understood by
analogy to a program written in a programming language. A database schema corresponds to
the variable declarations (along with associated type definitions) in a program.
Example:
In a Database Management System (DBMS), an instance refers to the actual data stored in the
database at a specific point in time. It's like a snapshot of the database's contents.
Here's an example:
Imagine you have a table named Students with the following schema (structure):
1.5 Instances and Schemas
The schema defines the structure of the table, but it doesn't contain any actual data.
Now, let's say the table has the following data:This set of data within the Students table at a particular moment is
an instance of the database.
1.6 Difference between Relation and Schema in DBMS
Relation:
● Definition: A relation, often visualized as a table, is a fundamental unit of data storage. It consists of rows
and columns, where each row represents a specific record or instance, and each column represents a
specific attribute or property of that record.
● Example: In a "Students" relation, each row would represent a single student, and the columns might
include attributes like "StudentID," "Name," "Major," and "GPA."
Schema:
● Definition: A schema defines the structure or blueprint of a relation or a collection of relations within a
database. It specifies the attributes (columns) of a relation, their data types, and any constraints or rules
that apply to the data.
● Example: The schema for the "Students" relation would define that it has attributes like "StudentID"
(integer), "Name" (text), "Major" (text), and "GPA" (decimal), and it might also specify constraints such as
"StudentID" must be unique or "GPA" must be between 0 and 4.0.
1.7 Data Models
● A Data Model in Database Management System (DBMS) is the concept of tools that are
developed to summarize the description of the database.
● Data Models provide us with a transparent picture of data which helps us in creating an
actual database. It shows us from the design of the data to its proper implementation of
data.
Database Languages
A database system provides a data-definition language (DDL) to specify the database
schema and a data-manipulation language (DML) to express database queries and
updates. In practice, the data-definition and data-manipulation languages are not two
separate languages; instead they simply form parts of a single database language, such
as the widely used SQL language.
1.8 Database Languages
1.9 Database
System
Architecture
work
https://docs.google.com
/document/d/16L3ThUG
CKWBzxLE_LxfGPqU4yG
N9QSZZw3lUIIt5yGM/ed
it?tab=t.0
1.10 Three Tier Architecture
There are several types of DBMS Architecture that we use according to the usage requirements. Types of DBMS
Architecture are discussed here.
● 1-Tier Architecture
● 2-Tier Architecture
● 3-Tier Architecture
1-Tier Architecture
In 1-Tier Architecture the database is directly available to the user, the user can directly sit on the DBMS and use it
that is, the client, server, and Database are all present on the same machine. For Example: to learn SQL we set up
an SQL server and the database on the local system.
1.10 Three Tier Architecture
2-Tier Architecture
○ The 2-Tier architecture is same as basic
client-server. In the two-tier architecture,
applications on the client end can directly
communicate with the database at the server
side. For this interaction, API's like: ODBC,
JDBC are used.
2. Software : Software is defined as the collection of programs that are used to instruct the
computer about its work. The software consists of a set of procedures, programs, and routines
associated with the computer system's operation and performance. Also, we can say that computer
software is a set of instructions that is used to instruct the computer hardware for the operation of
the computers. The software includes so many software like network software and operating
software. The database software is used to access the database, and the database application
performs the task.
3. Data: The term data means the collection of any raw fact stored in the database. Here the data are
any type of raw material from which meaningful information is generated.
1.11 Various components of a DBMS
4. Procedures: The procedure is a type of general instruction or guidelines for the use of
DBMS. This instruction includes how to set up the database, how to install the database, how to
log in and log out of the database, how to manage the database, how to take a backup of the
database, and how to generate the report of the database.
6. People: The people who control and manage the databases and perform different types of
operations on the database in the DBMS. The people include database administrator, software
developer, and End-user.
1.12 Types of Data models
A Data Model in Database Management System (DBMS) is the concept of tools that are developed to
summarize the description of the database. Data Models provide us with a transparent picture of data
which helps us in creating an actual database. It shows us from the design of the data to its proper
implementation of data.
1.12 Types of Data models
on1)ofRelational
data. Data Model:
This type of model designs the data in the form of rows and columns within a table. Thus, a
relational model uses tables for representing data and in-between relationships. Tables are also
called relations. This model was initially described by Edgar F. Codd, in 1969. The relational data
model is the widely used model which is primarily used by commercial data processing
applications.
1.12 Types of Data models
on2)ofEntity-Relationship
data. Data Model: An ER model is the logical representation of data as objects
and relationships among them. These objects are known as entities, and relationship is an
association among these entities. This model was designed by Peter Chen and published in 1976
papers. It was widely used in database designing. A set of attributes describe the entities. For
example, student_name, student_id describes the 'student' entity. A set of the same type of
entities is known as an 'Entity set', and the set of the same type of relationships is known as
'relationship set'.
1.12 Types of Data models
on3)of Object-based
data. Data Model: An extension of the ER model with notions of functions,
encapsulation, and object identity, as well. This model supports a rich type system that
includes structured and collection types. Thus, in 1980s, various database systems following
the object-oriented approach were developed. Here, the objects are nothing but the data
carrying its properties.
1.12 Types of Data models
on4)
of Semistructured
data. Data Model: This type of data model is different from the other three
data models (explained above). The semistructured data model allows the data
specifications at places where the individual data items of the same type may have different
attributes sets. The Extensible Markup Language, also known as XML, is widely used for
representing the semistructured data. Although XML was initially designed for including
the markup information to the text document, it gains importance because of its
application in the exchange of data.
Example
A common example of this type of data model is web-based data sources in which the data
and the schema of the website are visible. Some entities may be missing attributes, while
another one may have an extra attribute in this model. This approach allows for data
storage flexibility. It also allows the qualities to be more flexible. Any value that we store in
any attribute can be either an atomic value or a collection of data.
Emails, HTML, web pages, etc., are a few more examples of this type of data model.
ER (Entity Relationship) Diagram in DBMS
○ ER model stands for an Entity-Relationship model. It is a high-level data
model. This model is used to define the data elements and relationship for a
specified system.
a. Strong entity set: The entity types which consist of key attributes or if
there are enough attributes for forming a primary key attribute are called a
strong entity set. It is represented by a single rectangle.
ER Diagram in DBMS - Entity Set
ER Diagram in DBMS - Attributes
ER Diagram in DBMS - Attributes types
ER Diagram in DBMS - Attributes types
ER Diagram in DBMS - Attributes types
ER Diagram in DBMS - Attributes types
ER Diagram in DBMS - Relationships
ER Diagram in DBMS - Relationships
ER Diagram in DBMS - Relationships
a. One-to-One Relationship
When only one instance of an entity is associated with the relationship, then it is known as one to
one relationship.
For example, A female can marry to one male, and a male can marry to one female.
ER Diagram in DBMS - Relationships
b. One-to-many relationship
When only one instance of the entity on the left, and more than one instance of an entity on
the right associates with the relationship then this is known as a one-to-many relationship.
For example, Scientist can invent many inventions, but the invention is done by the only
specific scientist.
ER Diagram in DBMS - Relationships
c. Many-to-one relationship
When more than one instance of the entity on the left, and only one instance of an entity on the
right associates with the relationship then it is known as a many-to-one relationship.
For example, Student enrolls for only one course, but a course can have many students
ER Diagram in DBMS - Relationships
d. Many-to-many relationship
When more than one instance of the entity on the left, and more than one instance of an
entity on the right associates with the relationship then it is known as a many-to-many
relationship.
For example, Employee can assign by many projects and project can have many employees.
ER Diagram in DBMS - Notation
Database can be represented
using the notations. In ER
diagram, many notations are
used to express the
cardinality. These notations
are as follows: