1. What are the advantages of DBMS over traditional file-based systems?
Database management systems were developed to handle the following difficulties of typical File-processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Difficulty in accessing data
3. Data isolation – multiple files and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security problems
2. What are super, primary, candidate, and foreign keys?
A super key is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is a minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more than one primary key in a table..
A Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table.
3. What is the difference between primary key and unique constraints?
The primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains.
4.What is database normalization?
It is a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the following desirable properties:
1. Minimizing Redundancy
2. Minimizing the Insertion, Deletion, And Update Anomalies Relation schemas that do not meet the properties are decomposed into smaller relation schemas that could meet desirable properties.
5. Why is the use of DBMS recommended? Explain by listing some of its major advantages?
Some of the major advantages of DBMS are as follows:
- Controlled Redundancy: DBMS supports a mechanism to control the redundancy of data inside the database by integrating all the data into a single database and as data is stored in only one place, the duplicity of data does not happen.
- Data Sharing: Sharing of data among multiple users simultaneously can also be done in DBMS as the same database will be shared among all the users and by different application programs.
- Backup and Recovery Facility: DBMS minimizes the pain of creating the backup of data again and again by providing a feature of ‘backup and recovery’ which automatically creates the data backup and restores the data whenever required.
- Enforcement of Integrity Constraints: Integrity Constraints are very important to be enforced on the data so that the refined data after putting some constraints are stored in the database and this is followed by DBMS.
- Independence of Data: It simply means that you can change the structure of the data without affecting the structure of any of the application programs.
6. What are the differences between DDL, DML, and DCL in SQL?
Following are some details of three :
DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP, TRUNCATE and RENAME come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT, DELETE and UPDATE come under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.
7. What is the difference between having and where clause?
HAVING is used to specify a condition for a group or an aggregate function used in a select statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping. Unlike the HAVING clause, the WHERE clause cannot contain aggregate functions. (See this for examples). See Having vs Where Clause? for more details
8.How to print duplicate rows in a table?
See https://www.geeksforgeeks.org/how-to-print-duplicate-rows-in-a-table/
9. What is Join?
An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.
Table – Student Table
| EnrollNo |
StudentName |
Address |
| 1000 |
geek1 |
geeksquiz1 |
| 1001 |
geek2 |
geeksquiz2 |
| 1002 |
geek3 |
geeksquiz3 |
Table – StudentCourse Table
| CourseID |
EnrollNo |
| 1 |
1000 |
| 2 |
1000 |
| 3 |
1000 |
| 1 |
1002 |
| 2 |
1003 |
Following is a join query that shows the names of students enrolled in different courseIDs.
SELECT StudentCourse.CourseID, Student.StudentName
FROM StudentCourse
INNER JOIN Student
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;
The above query would produce the following result.
| CourseID |
StudentName |
| 1 |
geek1 |
| 1 |
geek3 |
| 2 |
geek1 |
| 3 |
geek1 |
9. What is Identity?
Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the value of this cannot be controlled. Identity/GUID columns do not need to be indexed.
10.What is a view in SQL? How to create a view?
A view is a virtual table based on the result-set of an SQL statement. We can create it using create view syntax.
CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
11.What are the uses of view?
1. Views can represent a subset of the data contained in a table; consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.
2. Views can join and simplify multiple tables into a single virtual table.
3. Views can act as aggregated tables, where the database engine aggregates data (sum, average, etc.) and presents the calculated results as part of the data.
4. Views can hide the complexity of data.
5. Views take very little space to store; the database contains only the definition of a view, not a copy of all the data which it presents.
6. Depending on the SQL engine used, views can provide extra security.
12. What is a Trigger?
A Trigger is a code associated with insert, update or delete operations. The code is executed automatically whenever the associated query is executed on a table. Triggers can be useful to maintain integrity in the database.
13. What is a stored procedure?
A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.
14. What is the difference between Trigger and Stored Procedure?
Unlike Stored Procedures, Triggers cannot be called directly. They can only be associated with queries.
15. What is a transaction? What are ACID properties?
A Database Transaction is a set of database operations that must be treated as a whole, which means either all operations are executed or none of them. An example can be a bank transaction from one account to another account. Either both debit and credit operations must be executed or none of them. ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database transactions are processed reliably.
16. What are indexes?
A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and the use of more storage space to maintain the extra copy of data. Data can be stored only in one order on a disk. To support faster access according to different values, faster search like binary search for different values is desired, For this purpose, indexes are created on tables. These indexes need extra space on the disk, but they allow faster search according to different frequently searched values.
17. What are clustered and non-clustered Indexes?
Clustered indexes are the index according to which data is physically stored on a disk. Therefore, only one clustered index can be created on a given database table.
Non-clustered indexes don’t define the physical ordering of data, but logical ordering. Typically, a tree is created whose leaf point to disk records. B-Tree or B+ tree are used for this purpose.
18. What is Denormalization?
Denormalization is a database optimization technique in which we add redundant data to one or more tables.
19. What is CLAUSE in SQL?
A clause in SQL is a part of a query that lets you filter or customize how you want your data to be queried to you.
20. What is a Live Lock?
Livelock situation can be defined as when two or more processes continually repeat the same interaction in response to changes in the other processes without doing any useful work These processes are not in the waiting state, and they are running concurrently. This is different from a deadlock because in a deadlock all processes are in the waiting state.
21. What is QBE?
Query-by-example represents a visual/graphical approach for accessing information in a database through the use of query templates called skeleton tables. It is used by entering example values directly into a query template to represent what is to be achieved. QBE is used by many database systems for personal computers. QBE is a very powerful facility that gives the user the capability to access the information a user wants without the knowledge of any programming language. Queries in QBE are expressed by skeleton tables. QBE has two distinct features:
QBE has the two-dimensional syntax: Queries look like tables.
22. Why are cursors necessary in embedded SQL?
A cursor is an object used to store the output of a query for row-by-row processing by the application programs. SQL statements operate on a set of data and return a set of data. On other hand, host language programs operate on a row at a time. The cursors are used to navigate through a set of rows returned by an embedded SQL SELECT statement. A cursor can be compared to a pointer.
23. What is the purpose of normalization in DBMS?
Database normalization is the process of organizing the attributes of the database to reduce or eliminate data redundancy (having the same data but at different places).
Purpose of normalization:
It is used to remove duplicate data and database anomalies from the relational table.
Normalization helps to reduce redundancy and complexity by examining new data types used in the table.
It is helpful to divide the large database table into smaller tables and link them using relationships.
It avoids duplicate data or no repeating groups into a table.
It reduces the chances for anomalies to occur in a database.
24. What is the difference between a database schema and a database state?
The collection of information stored in a database at a particular moment in time is called database state while the overall design of the database is called the database schema.
25. What is the purpose of SQL?
SQL stands for Structured Query Language whose main purpose is to interact with the relational databases in the form of inserting, deleting and updating/modifying the data in the database.
26. Explain the concepts of a Primary key and Foreign Key.
Primary Key is used to uniquely identify the records in a database table while Foreign Key is mainly used to link two or more tables together, as this is a particular field(s) in one of the database tables which are the primary key of some other table.
Example: There are 2 tables – Employee and Department. Both have one common field/column as ‘ID’ where ID is the primary key of the Employee table while this is the foreign key for the Department table.
27.What are the main differences between Primary key and Unique Key?
Given below are few differences:
The main difference between the Primary key and the Unique key is that the Primary key can never have a null value while the Unique key may consist of a null value.
In each table, there can be only one primary key while there can be more than one unique key in a table.
28. What is the concept of sub-query in terms of SQL?
Sub-query is basically the query that is included inside some other query and can also be called an inner query which is found inside the outer query.
29. What is the use of the DROP command and what are the differences between DROP, TRUNCATE and DELETE commands?
DROP command is a DDL command which is used to drop/delete the existing table, database, index, or view from the database.
The major difference between DROP, TRUNCATE and DELETE commands are:
DROP and TRUNCATE commands are the DDL commands which are used to delete tables from the database.
And when we make use of a DROP command, the tables get deleted permanently all the privileges and indexes that are related to the table also get deleted. This operation cannot be rolled back and so should be used only when necessary.
However in case of TRUNCATE, only the data stored in a table is deleted and the structure of the table is preserved and you can re-insert data by the use of “INSERT INTO clause”. It can be rolled back until the commit has been made.
DELETE command, on the other hand, is a DML Command which is used to delete rows from the table and this can be rolled back, however its considered slower than truncate. Using the delete command, we can delete 1 or more specific rows from the table.
30. What is the main difference between UNION and UNION ALL?
UNION and UNION ALL are used to join the data from 2 or more tables but UNION removes duplicate rows and picks the rows which are distinct after combining the data from the tables whereas UNION ALL does not remove the duplicate rows, it just picks all the data from the tables.
31. What is Correlated Subquery in DBMS?
A Subquery is also known as a nested query i.e. a query written inside some query. When a Subquery is executed for each of the rows of the outer query then it is termed as a Correlated Subquery.
An example of Non-Correlated Subquery is:
| SELECT * from EMP WHERE ‘RIYA’ IN (SELECT Name from DEPT WHERE EMP.EMPID=DEPT.EMPID); |
Here, the inner query is not executed for each of the rows of the outer query.
32. Explain Entity, Entity Type, and Entity Set in DBMS?
The entity is an object, place, or thing which has its independent existence in the real world and about which data can be stored in a database. For Example, any person, book, etc.
Entity Type is a collection of entities that have the same attributes. For Example, the STUDENT table contains rows in which each row is an entity holding the attributes like name, age, and id of the students, hence STUDENT is an Entity Type that holds the entities having the same attributes.
Entity Set is a collection of entities of the same type. For Example, A collection of the employees of a firm.
33. What are the different levels of abstraction in the DBMS?
There are 3 levels of data abstraction in the DBMS.
They include:
Physical Level: This is the lowest level of the data abstraction which states how the data is stored in the database.
Logical Level: This is the next level of the data abstraction which states the type of the data and the relationship among the data that is stored in the database.
View Level: This is the highest level in the data abstraction which shows/states only a part of the database.
34 . What integrity rules exist in the DBMS?
There are two major integrity rules that exist in the DBMS.
Entity Integrity: This states a very important rule that the value of a Primary key can never have a NULL value.
Referential Integrity: This rule is related to the Foreign key which states that either the value of a Foreign key is a NULL value or it should be the primary key of any other relation.
35. What is E-R model in the DBMS?
E-R model is known as an Entity-Relationship model in the DBMS which is based on the concept of the Entities and the relationship that exists among these entities.
36. What is a functional dependency in the DBMS?
This is basically a constraint that is useful in describing the relationship among the different attributes in a relation.
Example: If there is some relation ‘R1’ which has 2 attributes as Y and Z then the functional dependency among these 2 attributes can be shown as Y->Z which states that Z is functionally dependent on Y.
37. What is 1NF in the DBMS?
1NF is known as the First Normal Form.
This is the easiest form of the normalization process which states that the domain of an attribute should have only atomic values. The objective of this is to remove the duplicate columns that are present in the table.
38. What is 2NF in the DBMS?
2NF is the Second Normal Form.
Any table is said to have in the 2NF if it satisfies the following 2 conditions:
A table is in the 1NF.
Each non-prime attribute of a table is said to be functionally dependent in totality on the primary key.
39. What is 3NF in the DBMS?
3NF is the Third Normal Form.
Any table is said to have in the 3NF if it satisfies the following 2 conditions:
A table is in the 2NF.
Each non-prime attribute of a table is said to be non-transitively dependent on every key of the table.
40. What is BCNF in the DBMS?
BCNF is the Boyce Codd Normal Form which is stricter than the 3NF.
Any table is said to have in the BCNF if it satisfies the following 2 conditions:
A table is in the 3NF.
For each of the functional dependencies X->Y that exists, X is the super key of a table.
41. What is a CLAUSE in terms of SQL?
This is used with the SQL queries to fetch specific data as per the requirements on the basis of the conditions that are put in the SQL. This is very helpful in picking the selective records from the complete set of records.
For Example, There is a query that has a WHERE condition or the query with the HAVING clause.
42.How can you get the alternate records from the table in the SQL?
If you want to fetch the odd numbers then the following query can be used:
| SELECT EmpId from (SELECT rowno,EmpId from Emp) WHERE mod(rowno,2)=1; |
If you want to fetch the even numbers, then the following query can be used:
| SELECT EmpId from (SELECT rowno,EmpId from Emp) WHERE mod(rowno,2)=0; |
43. How is the pattern matching done in the SQL?
Answer: With the help of the LIKE operator, pattern matching is possible in the SQL.’%’ is used with the LIKE operator when it matches with the 0 or more characters, and ‘_’ is used to match the one particular character.
Example:
| SELECT * from Emp WHERE name like ‘b%’; |
| SELECT * from Emp WHERE name like ‘hans_’; |
44. What is a join in the SQL?
A Join is one of the SQL statements which is used to join the data or the rows from 2 or more tables on the basis of a common field/column among them.
45. What are the different types of joins in SQL?
There are 4 types of SQL Joins:
Inner Join: This type of join is used to fetch the data among the tables which are common in both tables.
Left Join: This returns all the rows from the table which is on the left side of the join but only the matching rows from the table which is on the right side of the join.
Right Join: This returns all the rows from the table which is on the right side of the join but only the matching rows from the table which is on the left side of the join.
Full Join: This returns the rows from all the tables on which the join condition has been put and the rows which do not match hold null values.
46. Explain the Stored Procedure.
A Stored Procedure is a group of SQL statements in the form of a function that has some unique name and is stored in relational database management systems(RDBMS) and can be accessed whenever required.
47. What is RDBMS?
RDBMS is the Relational Database Management System which contains data in the form of the tables and data is accessed on the basis of the common fields among the tables.
48. What are the different types of relationships in the DBMS?
A Relationship in DBMS depicts an association between the tables.
Different types of relationships are:
One-to-One: This basically states that there should be a one-to-one relationship between the tables i.e. there should be one record in both the tables.
One-to-Many: This states that there can be many relationships for one i.e. a primary key table hold only one record which can have many, one, or none records in the related table.
Many-to-Many: This states that both the tables can be related to many other tables.
49. What do you mean by Entity type extension?
Compilation of similar entity types into one particular type which is grouped together as an entity set is known as entity type extension.
50. What is conceptual design in dbms?
Conceptual design is the first stage in the database design process. The goal at this stage is to design a database that is independent of database software and physical details. The output of this process is a conceptual data model that describes the main data entities, attributes, relationships, and constraints of a given problem domain.
51. Differentiate between logical database design and physical database design. Show how this separation leads to data independence.
| Parameters |
Logical Database Design |
Physical Database Design |
| Task |
Maps or transforms the conceptual schema (or an ER schema) from the high-level data model into a relational database schema.
|
The specifications for the stored database in terms of physical storage structures, record placement, and indexes are designed.
|
| Choice of criteria |
The mapping can proceed in two stages:
- System-independent mapping but data model-dependent
- Tailoring the schemas to a specific DBMS
|
The following criteria are often used to guide the choice of physical database design options:
- Response Time
- Space Utilization
- Transaction Throughput
|
| Result |
DDL statements in the language of the chosen DBMS that specify the conceptual and external level schemas of the database system. But if the DDL statements include some physical design parameters, a complete DDL specification must wait until after the physical database design phase is completed.
|
An initial determination of storage structures and the access paths for the database files. This corresponds to defining the internal schema in terms of Data Storage Definition Language.
|
The database design is divided into several phases. The logical database design and physical database design are two of them. This separation is generally based on the concept of the three-level architecture of DBMS, which provides data independence. Therefore, we can say that this separation leads to data independence because the output of the logical database design is the conceptual and external level schemas of the database system which is independent of the output of the physical database design that is an internal schema.
52. What are temporary tables? When are they useful?
Temporary tables exist solely for a particular session, or whose data persists for the duration of the transaction. The temporary tables are generally used to support specialized rollups or specific application processing requirements. Unlike a permanent table, space is not allocated to a temporary table when it is created. Space will be dynamically allocated for the table as rows are inserted. The CREATE GLOBAL TEMPORARY TABLE command is used to create a temporary table in Oracle.
53. Explain different types of failures that occur in the Oracle database.
Types of Failures – In the Oracle database following types of failures can occur:
- Statement Failure·
- Bad data type
- Insufficient Privileges (e.g., object privileges to a role)
- User Process Failure
- The user performed an abnormal disconnect
- The user’s session was abnormally terminated
- The user’s program raised an address exception
- User Error
- The user drops a table
- User damages data by modification
- Instance Failure
- Media Failure
- The user drops a table
- User damages data by modification
- Alert Logs
- Records informational and error messages
- All Instance startups and shutdowns are recorded in the log
54. What is the main goal of RAID technology?
RAID stands for Redundant Array of Inexpensive (or sometimes “Independent”)Disks.
RAID is a method of combining several hard disk drives into one logical unit (two or more disks grouped together to appear as a single device to the host system). RAID technology was developed to address the fault-tolerance and performance limitations of conventional disk storage. It can offer fault tolerance and higher throughput levels than a single hard drive or group of independent hard drives. While arrays were once considered complex and relatively specialized storage solutions, today they are easy to use and essential for a broad spectrum of client/server applications.
Our GATE 2026 Courses for CSE & DA offer live and recorded lectures from GATE experts, Quizzes, Subject-Wise Mock Tests, PYQs and practice questions, and Full-Length Mock Tests to ensure you’re well-prepared for the toughest questions.
Take the Three 90 Challenge! Complete 90% of the course in 90 days and earn a 90% refund. Stay motivated, track your progress, and make the most of your preparation time. Plus, enjoy exclusive features like:
--> All India Mock Test
--> Live GATE CSE & DA Mentorship Classes
--> Live Doubt Solving Sessions
Join now and stay ahead in your GATE 2026 journey!
Similar Reads
DBMS Tutorial – Learn Database Management System
Database Management System (DBMS) is a software used to manage data from a database. A database is a structured collection of data that is stored in an electronic device. The data can be text, video, image or any other format.A relational database stores data in the form of tables and a NoSQL databa
7 min read
Basic of DBMS
Introduction of DBMS (Database Management System)
A database is a collection of interrelated data that helps in the efficient retrieval, insertion, and deletion of data from the database and organizes the data in the form of tables, views, schemas, reports, etc. For Example, a university database organizes the data about students, faculty, admin st
9 min read
History of DBMS
The first database management systems (DBMS) were created to handle complex data for businesses in the 1960s. These systems included Charles Bachman's Integrated Data Store (IDS) and IBM's Information Management System (IMS). Databases were first organized into tree-like structures using hierarchica
7 min read
Advantages of Database Management System
Database Management System (DBMS) is a collection of interrelated data and a set of software tools/programs that access, process, and manipulate data. It allows access, retrieval, and use of that data by considering appropriate security measures. The Database Management system (DBMS) is really usefu
6 min read
Disadvantages of DBMS
You might have encountered bulks of files/registers either at some office/school/university. The traditional file management system has been followed for managing the information or data at many organizations and by many businesses. It used to be cost-effective and easily accessible. With evolving t
9 min read
Application of DBMS
The efficient and safe management, saving and retrieval of data is made possible by the Database Management Systems. They provide strong solutions for the data management demands and are the foundation of the numerous applications used in a variety of the sectors. Recognizing the uses of DBMSs aids
5 min read
Need for DBMS
In earlier days, the databases were created directly on top of file systems. File system has many disadvantages. Disadvantages of File SystemsMemory and PerformanceLarge datasets exceed RAM, requiring frequent data transfer between memory and storage, which reduces performance.Addressing limitations
4 min read
DBMS Architecture 1-level, 2-Level, 3-Level
A Database stores a lot of critical information to access data quickly and securely. Hence it is important to select the correct architecture for efficient data management. Database Management System (DBMS) architecture is crucial for efficient data management and system performance. It helps users
6 min read
Difference between File System and DBMS
A file system and a DBMS are two kinds of data management systems that are used in different capacities and possess different characteristics. A File System is a way of organizing files into groups and folders and then storing them in a storage device. It provides the media that stores data as well
6 min read
Entity Relationship Model
Introduction of ER Model
We typically follow the below steps for designing a database for an application. Gather the requirements (functional and data) by asking questions to the database users.Do a logical or conceptual design of the database. This is where ER model plays a role. It is the most used graphical representatio
10 min read
Structural Constraints of Relationships in ER Model
Structural constraints, within the context of Entity-Relationship (ER) modeling, specify and determine how the entities take part in the relationships and this gives an outline of how the interactions between the entities can be designed in a database. Two primary types of constraints are cardinalit
6 min read
Difference between entity, entity set and entity type
The Entity-Relationship (ER) Model is one of the primary components of Database Management Systems and is very important for designing the logical structure of databases. It helps define data, and the relationship between the data entities and it makes the system easier to visualize. This is the rea
7 min read
Difference between Strong and Weak Entity
An entity is a “thing” or “object” in the real world. An entity contains attributes, which describe that entity. So anything about which we store information is called an entity. Entities are recorded in the database and must be distinguishable, i.e., easily recognized from the group. In this articl
3 min read
Generalization, Specialization and Aggregation in ER Model
Using the ER model for bigger data creates a lot of complexity while designing a database model, So in order to minimize the complexity Generalization, Specialization, and Aggregation were introduced in the ER model. These were used for data abstraction. In which an abstraction mechanism is used to
4 min read
Recursive Relationships in ER diagrams
A relationship between two entities of a similar entity type is called a recursive relationship. Here the same entity type participates more than once in a relationship type with a different role for each instance. In other words, a relationship has always been between occurrences in two different e
4 min read
Relational Model
Introduction of Relational Model and Codd Rules in DBMS
The Relational Model is a fundamental concept in Database Management Systems (DBMS) that organizes data into tables, also known as relations. This model simplifies data storage, retrieval, and management by using rows and columns. Codd’s Rules, introduced by Dr. Edgar F. Codd, define the principles
14 min read
Types of Keys in Relational Model (Candidate, Super, Primary, Alternate and Foreign)
Keys are one of the basic requirements of a relational database model. It is widely used to identify the tuples(rows) uniquely in the table. We also use keys to set up relations amongst various columns and tables of a relational database. Why do we require Keys in a DBMS?We require keys in a DBMS to
7 min read
Anomalies in Relational Model
Anomalies in the relational model refer to inconsistencies or errors that can arise when working with relational databases, specifically in the context of data insertion, deletion, and modification. There are different types of anomalies that can occur in referencing and referenced relations which c
5 min read
Mapping from ER Model to Relational Model
Converting an Entity-Relationship (ER) diagram to a Relational Model is a crucial step in database design. The ER model represents the conceptual structure of a database, while the Relational Model is a physical representation that can be directly implemented using a Relational Database Management S
7 min read
Strategies for Schema design in DBMS
There are various strategies that are considered while designing a schema. Most of these strategies follow an incremental approach that is, they must start with some schema constructs derived from the requirements and then they incrementally modify, refine, or build on them. In this article, let's d
7 min read
Relational Algebra
Introduction of Relational Algebra in DBMS
Relational Algebra is a procedural query language. Relational algebra mainly provides a theoretical foundation for relational databases and SQL. The main purpose of using Relational Algebra is to define operators that transform one or more input relations into an output relation. Given that these op
8 min read
Basic Operators in Relational Algebra
The Relational Model is a way of structuring data using relations, which are a collection of tuples that have the same attributes. Relational Algebra is a procedural query language that takes relations as input and returns relations as output. It uses a set of operators to manipulate and retrieve da
4 min read
Extended Operators in Relational Algebra
Basic idea about relational model and basic operators in Relational Algebra: Relational Model Basic Operators in Relational Algebra Extended operators are those operators which can be derived from basic operators. There are mainly three types of extended operators in Relational Algebra: JoinIntersec
6 min read
SQL Joins (Inner, Left, Right and Full Join)
SQL joins are the foundation of database management systems, enabling the combination of data from multiple tables based on relationships between columns. Joins allow efficient data retrieval, which is essential for generating meaningful observations and solving complex business queries. Understandi
6 min read
Join operation Vs Nested query in DBMS
The growth of technology and automation coupled with exponential amounts of data has led to the importance and omnipresence of databases which, simply put, are organized collections of data. Considering a naive approach, one can theoretically keep all the data in one large table, however that increa
5 min read
Tuple Relational Calculus (TRC) in DBMS
Tuple Relational Calculus (TRC) is a non-procedural query language used in relational database management systems (RDBMS) to retrieve data from tables. TRC is based on the concept of tuples, which are ordered sets of attribute values that represent a single row or record in a database table. TRC is
4 min read
Domain Relational Calculus in DBMS
Domain Relational Calculus is a non-procedural query language equivalent in power to Tuple Relational Calculus. Domain Relational Calculus provides only the description of the query but it does not provide the methods to solve it. In Domain Relational Calculus, a query is expressed as, { < x1, x2
2 min read
Normalisation
Introduction of Database Normalization
Normalization is an important process in database design that helps improve the database's efficiency, consistency, and accuracy. It makes it easier to manage and maintain the data and ensures that the database is adaptable to changing business needs. What is Database Normalization?Database normaliz
7 min read
Normal Forms in DBMS
Normal forms are the essential principles used to organize data efficiently and eliminate redundancy. They help to ensure that the database structure is logical, consistent and optimized for performance. By breaking down data into smaller, related tables and defining clear relationships between them
11 min read
First Normal Form (1NF)
Normalization in database management is the process of organizing data to minimize redundancy and dependency, ensuring efficiency, consistency, and integrity. This involves structuring data into smaller, logically related tables and defining relationships between them to streamline data storage and
4 min read
Second Normal Form (2NF)
Normalization is a structural method whereby tables are broken down in a controlled manner with an aim of reducing data redundancy. It refers to the process of arranging the attributes and relations of a database in order to minimize data anomalies such as update, insert and delete anomalies. Normal
6 min read
Boyce-Codd Normal Form (BCNF)
While Third Normal Form (3NF) is generally sufficient for organizing relational databases, it may not completely eliminate redundancy. Redundancy can still occur if there’s a dependency X→X where X is not a candidate key. This issue is addressed by a stronger normal form known as Boyce-Codd Normal F
8 min read
Introduction of 4th and 5th Normal Form in DBMS
Two of the highest levels of database normalization are the fourth normal form (4NF) and the fifth normal form (5NF). Multivalued dependencies are handled by 4NF, whereas join dependencies are handled by 5NF. If two or more independent relations are kept in a single relation or we can say multivalue
5 min read
The Problem of Redundancy in Database
Redundancy means having multiple copies of the same data in the database. This problem arises when a database is not normalized. Suppose a table of student details attributes is: student ID, student name, college name, college rank, and course opted. Student_ID Name Contact College Course Rank 100Hi
6 min read
Database Management System | Dependency Preserving Decomposition
Dependency Preservation: A Decomposition D = { R1, R2, R3...Rn } of R is dependency preserving wrt a set F of Functional dependency if (F1 ? F2 ? … ? Fm)+ = F+. Consider a relation R R ---> F{...with some functional dependency(FD)....} R is decomposed or divided into R1 with FD { f1 } and R2 with
4 min read
Lossless Decomposition in DBMS
The original relation and relation reconstructed from joining decomposed relations must contain the same number of tuples if the number is increased or decreased then it is Lossy Join decomposition. Lossless join decomposition ensures that never get the situation where spurious tuples are generated
5 min read
Lossless Join and Dependency Preserving Decomposition
Decomposition of a relation is done when a relation in a relational model is not in appropriate normal form. Relation R is decomposed into two or more relations if decomposition is lossless join as well as dependency preserving. Lossless Join DecompositionIf we decompose a relation R into relations
4 min read
Denormalization in Databases
Denormalization is used to alter the structure of a database. Denormalization focuses on adding redundancy which means combining multiple tables so that execute queries quickly. In this article, we’ll explore Denormalization and how it impacts database design. What is Denormalization in Databases?De
5 min read
Transactions and Concurrency Control
Concurrency Control in DBMS
Concurrency control is a very important concept of DBMS which ensures the simultaneous execution or manipulation of data by several processes or user without resulting in data inconsistency. Concurrency Control deals with interleaved execution of more than one transaction. What is Transaction? A tra
13 min read
ACID Properties in DBMS
A transaction is a single logical unit of work that interacts with the database, potentially modifying its content through read and write operations. To maintain database consistency both before and after a transaction, specific properties, known as ACID properties must be followed. This article foc
7 min read
Implementation of Locking in DBMS
Locking protocols are used in database management systems as a means of concurrency control. Multiple transactions may request a lock on a data item simultaneously. Hence, we require a mechanism to manage the locking requests made by transactions. Such a mechanism is called a Lock Manager. It relies
5 min read
Lock Based Concurrency Control Protocol in DBMS
In a database management system (DBMS), lock-based concurrency control (BCC) is used to control the access of multiple transactions to the same data item. This protocol helps to maintain data consistency and integrity across multiple users. In the protocol, transactions gain locks on data items to c
6 min read
Graph Based Concurrency Control Protocol in DBMS
Graph-based concurrency control protocols are used in database management systems (DBMS) to ensure that concurrent transactions do not interfere with each other and maintain the consistency of the database. In graph-based concurrency control, transactions are represented as nodes in a graph, and the
4 min read
Two Phase Locking Protocol
The Two-Phase Locking (2PL) Protocol is an essential concept in database management systems used to maintain data consistency and ensure smooth operation when multiple transactions are happening simultaneously. It helps to prevent issues like data conflicts where two or more transactions try to acce
9 min read
Multiple Granularity Locking in DBMS
The various Concurrency Control schemes have used different methods and every individual Data item is the unit on which synchronization is performed. A certain drawback of this technique is if a transaction Ti needs to access the entire database, and a locking protocol is used, then Ti must lock eac
5 min read
Polygraph to check View Serializability in DBMS
Prerequisite - Concurrency Control -Introduction, Conflict Serializability, Transaction Isolation Levels in DBMS Serializability: If any transaction (non-serial) produces an outcome that is equal to the outcome of that schedule's transaction executed serially then we can call that transaction schedu
6 min read
Log based Recovery in DBMS
The atomicity property of DBMS states that either all the operations of transactions must be performed or none. The modifications done by an aborted transaction should not be visible to the database and the modifications done by the committed transaction should be visible. To achieve our goal of ato
7 min read
Timestamp based Concurrency Control
Timestamp-based concurrency control is a method used in database systems to ensure that transactions are executed safely and consistently without conflicts, even when multiple transactions are being processed simultaneously. This approach relies on timestamps to manage and coordinate the execution o
5 min read
Dirty Read in SQL
Pre-Requisite - Types of Schedules, Transaction Isolation Levels in DBMS A Dirty Read in SQL occurs when a transaction reads data that has been modified by another transaction, but not yet committed. In other words, a transaction reads uncommitted data from another transaction, which can lead to inc
6 min read
Types of Schedules in DBMS
Schedule, as the name suggests, is a process of lining the transactions and executing them one by one. When there are multiple transactions that are running in a concurrent manner and the order of operation is needed to be set so that the operations do not overlap each other, Scheduling is brought i
7 min read
Conflict Serializability in DBMS
In database systems, ensuring the consistency and integrity of data is a top priority, especially when multiple transactions are executed simultaneously. This is where conflict serializability comes into play. It is a concept in concurrency control that determines whether a non-serial schedule can b
5 min read
Condition of schedules to View-equivalent
In a database system, a schedule is a sequence of operations (such as read and write operations) performed by transactions in the system. Two schedules are view-equivalent if they produce the same set of results when executed against the same database state. A schedule S1 is said to be view-equivale
3 min read
Recoverability in DBMS
Recoverability is a property of database systems that ensures that, in the event of a failure or error, the system can recover the database to a consistent state. Recoverability guarantees that all committed transactions are durable and that their effects are permanently stored in the database, whil
6 min read
Precedence Graph for Testing Conflict Serializability in DBMS
A Precedence Graph or Serialization Graph is used commonly to test the Conflict Serializability of a schedule. It is a directed Graph (V, E) consisting of a set of nodes V = {T1, T2, T3..........Tn} and a set of directed edges E = {e1, e2, e3..................em}. The graph contains one node for eac
6 min read
Database Recovery Techniques in DBMS
Database Systems like any other computer system, are subject to failures but the data stored in them must be available as and when required. When a database fails it must possess the facilities for fast recovery. It must also have atomicity i.e. either transactions are completed successfully and com
11 min read
Starvation in DBMS
Starvation or Livelock is the situation when a transaction has to wait for an indefinite period of time to acquire a lock. Reasons for Starvation:If the waiting scheme for locked items is unfair. ( priority queue )Victim selection (the same transaction is selected as a victim repeatedly )Resource le
5 min read
Deadlock in DBMS
In database management systems (DBMS) a deadlock occurs when two or more transactions are unable to the proceed because each transaction is waiting for the other to the release locks on resources. This situation creates a cycle of the dependencies where no transaction can continue leading to the sta
10 min read
Types of Schedules based Recoverability in DBMS
In this article, we are going to deal with the types of Schedules based on the Recoverability in Database Management Systems (DBMS). Generally, there are three types of schedules given as follows: Schedules Based on RecoverabilityRecoverable Schedule: A schedule is recoverable if it allows for the r
5 min read
Why recovery is needed in DBMS
Basically, whenever a transaction is submitted to a DBMS for execution, the operating system is responsible for making sure or to be confirmed that all the operations which need to be performed in the transaction have been completed successfully and their effect is either recorded in the database or
6 min read
Indexing, B and B+ trees
Indexing in Databases - Set 1
Indexing improves database performance by minimizing the number of disc visits required to fulfill a query. It is a data structure technique used to locate and quickly access data in databases. Several database fields are used to generate indexes. The main key or candidate key of the table is duplic
9 min read
Introduction of B-Tree
The limitations of traditional binary search trees can be frustrating. Meet the B-Tree, the multi-talented data structure that can handle massive amounts of data with ease. When it comes to storing and searching large amounts of data, traditional binary search trees can become impractical due to the
15+ min read
Insert Operation in B-Tree
In the previous post, we introduced B-Tree. We also discussed search() and traverse() functions. In this post, insert() operation is discussed. A new key is always inserted at the leaf node. Let the key to be inserted be k. Like BST, we start from the root and traverse down till we reach a leaf node
15+ min read
Delete Operation in B-Tree
Pre-Requisite: B-Tree | Set 1 (Introduction), B-Tree | Set 2 (Insert) B Trees is a type of data structure commonly known as a Balanced Tree that stores multiple data items very easily. B Trees are one of the most useful data structures that provide ordered access to the data in the database. In this
15+ min read
Introduction of B+ Tree
B + Tree is a variation of the B-tree data structure. In a B + tree, data pointers are stored only at the leaf nodes of the tree. In a B+ tree structure of a leaf node differs from the structure of internal nodes. The leaf nodes have an entry for every value of the search field, along with a data po
8 min read
Bitmap Indexing in DBMS
Bitmap Indexing is a data indexing technique used in database management systems (DBMS) to improve the performance of read-only queries that involve large datasets. It involves creating a bitmap index, which is a data structure that represents the presence or absence of data values in a table or col
8 min read
Inverted Index
An Inverted Index is a data structure used in information retrieval systems to efficiently retrieve documents or web pages containing a specific term or set of terms. In an inverted index, the index is organized by terms (words), and each term points to a list of documents or web pages that contain
7 min read
Difference between Inverted Index and Forward Index
Inverted Index It is a data structure that stores mapping from words to documents or set of documents i.e. directs you from word to document.Steps to build Inverted index are:Fetch the document and gather all the words.Check for each word, if it is present then add reference of document to index els
2 min read
SQL Queries on Clustered and Non-Clustered Indexes
Indexes in SQL play a pivotal role in enhancing database performance by enabling efficient data retrieval without scanning the entire table. The two primary types of indexes Clustered Index and Non-Clustered Index serve distinct purposes in optimizing query performance. In this article, we will expl
7 min read
DBMS Interview questions and Last minute notes
DBMS GATE Previous Year Questions
Database Management System - GATE CSE Previous Year Questions
In this article, we are mainly focusing on the DBMS GATE Questions that are asked in Previous Years, with their solutions, and where an explanation is required, we have also provided the reason. Topic-Wise Quizzes to Practice Previous Year's QuestionsER and Relational ModelsDatabase Design (Normal F
2 min read
Database Management Systems | Set 2
Following Questions have been asked in GATE 2012 exam. 1) Which of the following statements are TRUE about an SQL query? P: An SQL query can contain a HAVING clause even if it does not a GROUP BY clause Q: An SQL query can contain a HAVING clause only if it has a GROUP BY clause R: All attributes us
4 min read
Database Management Systems | Set 3
Following Questions have been asked in GATE 2012 exam. 1) Consider the following transactions with data items P and Q initialized to zero: T1: read (P) ; read (Q) ; if P = 0 then Q : = Q + 1 ; write (Q) ; T2: read (Q) ; read (P) ; if Q = 0 then P : = P + 1 ; write (P) ; Any non-serial interleaving o
3 min read
Database Management Systems | Set 4
Following Questions have been asked in GATE 2011 exam. 1. Consider a relational table with a single record for each registered student with the following attributes. 1. Registration_Number:< Unique registration number for each registered student 2. UID: Unique Identity number, unique at the natio
4 min read
Database Management Systems | Set 5
Following Questions have been asked in GATE CS 2010 exam. 1) A relational schema for a train reservation database is given below. Passenger (pid, pname, age) Reservation (pid, class, tid) Table: Passenger pid pname age ----------------- 0 Sachin 65 1 Rahul 66 2 Sourav 67 3 Anil 69 Table : Reservatio
4 min read
Database Management Systems | Set 6
Following questions have been asked in GATE 2009 CS exam. 1) Consider two transactions T1 and T2, and four schedules S1, S2, S3, S4 of T1 and T2 as given below: T1 = R1[X] W1[X] W1[Y] T2 = R2[X] R2[Y] W2[Y] S1 = R1[X] R2[X] R2[Y] W1[X] W1[Y] W2[Y] S2 = R1[X] R2[X] R2[Y] W1[X] W2[Y] W1[Y] S3 = R1[X]
4 min read
Database Management Systems | Set 7
Following questions have been asked in GATE 2008 CS exam. 1) Let R and S be two relations with the following schema R (P,Q,R1,R2,R3) S (P,Q,S1,S2) Where {P, Q} is the key for both schemas. Which of the following queries are equivalent? (A) Only I and II (B) Only I and III (C) Only I, II and III (D)
3 min read
Database Management Systems | Set 8
Following questions have been asked in GATE 2005 CS exam. 1) Which one of the following statements about normal forms is FALSE? (a) BCNF is stricter than 3NF (b) Lossless, dependency-preserving decomposition into 3NF is always possible (c) Lossless, dependency-preserving decomposition into BCNF is a
3 min read