DBMS
DBMS
• This course aims to introduce the concepts of database management systems, focusing on
SQL-based relational databases and NoSQL databases.
Textbook:
• Raghu Ramakrishnan and Johannes Gehrke, Database Management Systems, McGraw-
Hill.
• Shamkant B. Navathe, RamezElmasri, Database Systems, Pearson Higher Education.
Reference book:
• Abraham Silberschatz, Henry F. Korth, S. Sudarshan, DATABASE SYSTEM
CONCEPTS, Sixth Edition,
McGraw Hill.
• Garcia-Molina, Ullman, Widom: Database System Implementation, Pearson
education.
• S. K. Singh: Database Systems, Concepts, Design and Applications, Pearson
Education.
• G.K. Gupta: Database Management Systems, McGraw Hill.
• Toledo and Cushman: Database Management Systems, (Schaum‘s Outlines)
Module 1
Introduction to Database System and Data Modelling
• Database-System Applications
• Purpose of Database Systems
• View of Data
• Database Languages
• Relational Databases
• Database Design
• Structure of Relational Databases
• Database Schema
• Keys
• Schema Diagrams
• Relational Query Languages
• Relational Operation
Module 1
Introduction to Database System and Data Modelling
Q.1 Explain the application and Uses of Database Management System (DBMS)
1. Railway Reservation System
The database is required to record ticket
bookings, train departures, and arrival
statuses. Also, if trains are late, people are
informed through database updates.
2. Library Management System
6. Military
In military areas, the DBMS is playing a vital
role. The military keeps records of soldiers, and
it has so many files that should be kept secure
and safe. DBMS provides high security to
military information.
7. Online Shopping
Nowadays, we all do Online shopping without
wasting time, thanks to DBMS. Products are
added and sold only with the help of DBMS,
such as Purchase information, invoice bills, and
payment.
8. Human Resource Management
The management keeps records of each
employee’s salary, tax, and work through
DBMS.
9. Manufacturing
Manufacturing companies make and sell
products daily. A DBMS keeps records of all
those details.
10. Airline Reservation system
Like the railway reservation system, airlines
need DBMS to keep records of flight arrival,
departure, and delay status.
Q.2 What is the purpose of a Database Management System?
The Database Management System (DBMS) is a software system that allows the user
to define, create, and maintain the database and provide control access to the data.
Types of DBMS
For example, a student table stores the records of various students. A row of this table
represents the record of a single student, and the column represents the attributes of the
record, such as student ID, name, age, address, etc.
Data is stored as objects, attributes, and methods. It typically stores and manages objects
directly on the database server’s disk. There are no tables, rows, columns, or foreign keys—
only objects.
For example: A house is an object. An object
has two characteristics: states and behavior.
1. Single-tier architecture
2. Two-tier architecture
3. Three-tier architecture
1. Single tier architecture
In this type of architecture, the database is readily available on the client machine; any
request the client makes doesn’t require a network connection to act on the database.
For example, let's say you want to fetch an employee's records from the database. The
database is available on your computer system, so your computer will request the details and
records from the database as well. This type of system is generally referred to as a local
database system.
2. Two-tier architecture
In a two-tier architecture, the Database
system is on the server machine, and the
DBMS application is on the client machine.
These two machines are connected through Two-tier architecture
a reliable network, as shown in the diagram.
The user doesn’t need to know the database schema details, such as data structure, table
definition, etc. The user is only concerned about data, which returns to the view level after it
has been fetched from the database (present at the internal level).
The external level is the “top-level” of the Three Level DBMS Architecture.
2. Conceptual level
It is also called the logical level. This level describes the whole design of the database, such
as the relationships among data, the schema of data, etc.
This level of architecture also implements database constraints and security. The DBA
(database administrator) maintains this level.
3. Internal level
This level is also known as the physical level. It describes how the data is actually stored
in the storage devices and is responsible for allocating space to the data. This is the
lowest level of the architecture.
View of data in DBMS
Abstraction is one of the main features of database systems. Hiding irrelevant
details from users and providing abstract views of data to users helps in easy and
efficient user-database interaction. In DBMS architecture, the top level of that
architecture is the “view level.” The view level provides the “view of data” to the
users and hides irrelevant details, such as data relationship, database schema,
constraints, security, etc, from the user.
What is Database design?
Database Design can be defined as a set of procedures or collection of tasks involving
various steps taken to implement a database. A good database design is important. It helps
you get the correct information when you need it. Following are some critical points to keep
in mind to achieve a good database design:
Following are some critical points to keep in mind to achieve a good database
design:
Data consistency and integrity must be maintained.
Low Redundancy
Faster searching through indices
Security measures should be taken by enforcing various integrity constraints.
Data should be stored in fragmented information in the most atomic format
possible.
What are the Following Steps that a Database Designer can take to Ensure
Good Database Design?
Step 1: Determine the goal of your database and ensure clear communication with the
stakeholders (if any). Understanding the purpose of a database will help you consider various
use cases, where problems may arise, and how you can prevent them.
Step 2: List all the entities that will be present in the database and what relationships exist
among them.
Step 3: Organize the information into different tables so there is little or no redundancy.
Step 4: Ensure uniqueness in every table. The uniqueness of records present in any relation is a
crucial part of database design that helps us avoid redundancy. Identify the key attributes to
uniquely identify every row from columns. You can use various key constraints to ensure the
uniqueness of your table. Also, keep in mind that the uniquely identifying records must
consume as little space as possible and shall not contain any NULL values.
Step 5: After all the tables are structured and information is organized, normalization forms
are applied to identify anomalies that may arise and redundancies that can cause
inconsistency in the database.
Primary Terminologies Used in Database Design
Following are the terminologies that a person should be familiar with before designing a
database:
1. Redundancy:
Redundancy refers to data duplication. There can be specific use cases when we need or don't
need redundancy in our Database. For example, if we have a banking system application, we
may need to prevent redundancy in our Database strictly.
2. Schema:
A schema is a logical container that defines the structure and manages the organization of the
stored data. It consists of rows and columns, with data types for each column.
3. Records/Tuples:
A Record or a tuple is the same. It’s where our data is stored inside a table
4. Indexing:
Indexing is a data structure technique that promotes efficient retrieval of the data stored in our
database.
5. Data Integrity & Consistency:
Data integrity refers to the quality of the information stored in our database, and consistency
refers to the correctness of the data stored.
6. Data Models:
Data models provide us with visual modeling techniques to visualize the data and the
relationships among those data. Examples include a network Model, an object-oriented
model, a Hierarchical model, etc.
7. Normalization:
Organizes data to reduce redundancy and dependency by dividing larger tables into smaller
ones and defining relationships. It ensures data storage and consistency.
8. Functional Dependency:
Functional Dependency is a relationship between two attributes of the table that represents that
another can determine the value of one attribute. Ex: {A -> B}, A & B are two attributes, and
attribute A can uniquely determine the value of B.
9. Transaction:
Transaction is a single logical unit of work. It signifies that some changes have been made to
the database. A transaction must satisfy the ACID or BASE properties (depending on the type
of Database).
10. Schedule:
The schedule defines the sequence of transactions in which they're executed by one or
multiple users.
11. Concurrency:
Concurrency refers to allowing multiple transactions to operate simultaneously without
interfering with one another.
12. Constraints:
Constraints are the rules applied to fields in a table to enforce data integrity, such as NOT
NULL, UNIQUE, CHECK, etc. They ensure data quality and accuracy.
Database Design Lifecycle
The database design lifecycle goes something like this:
1. Requirement Analysis
It's crucial to understand the requirements of our application so that you can think productively
and imply appropriate integrity constraints to maintain data integrity and consistency.