DBMS FAQs
DBMS FAQs
efficiently. A DBMS ensures data integrity, security, and consistency. It allows multiple
users to interact with the database simultaneously and offers a centralized data
management system.
3. What is SQL?
used for managing and querying data in a relational database. It allows users to interact
with the database by operating such as SELECT, INSERT, DELETE, and UPDATE.
SQL is used for various purposes, including defining a database's structure (DDL),
In DBMS, relationships between tables are defined by how they are connected. There
Example: In a system involving students and courses, each student can enroll in various
5. What is a database?
provides a systematic way to manage, store, and retrieve data for different applications.
6. What is normalization?
A normalization process involves dividing large tables into smaller ones to reduce
stored in the right place, eliminating anomalies like update, insertion, and deletion
anomalies. The goal is to ensure that each table contains only related data, thus
and dependency:
● 1NF (First Normal Form): Ensures that each column contains atomic
(indivisible) values and that there are no repeating groups or arrays.
● 2NF (Second Normal Form): Builds on 1NF and removes partial dependencies,
ensuring that every non-key attribute is fully dependent on the primary key.
● 3NF (Third Normal Form): Removes transitive dependencies, ensuring that
non-key attributes are only dependent on the primary key.
● BCNF (Boyce-Codd Normal Form): A stricter version of 3NF that ensures every
determinant is a candidate key.
● 4NF (Fourth Normal Form): Deals with multi-valued dependencies, ensuring
that no table contains more than one independent multi-valued dependency.
A primary key serves as a unique identifier for each entry in a database table. It ensures
that no two rows in the table can have the same value in the primary key column(s). A
primary key is crucial for maintaining data integrity and is used to establish relationships
with other tables through foreign keys. A primary key cannot have NULL values.
A foreign key is a column in a table that uniquely identifies a row in another table, or in
the same table when referencing itself. It is used to create and maintain a relationship
between the data in two tables, ensuring that the connection between them remains
consistent and valid. The foreign key column in one table points to the primary key in
An index is a database object that improves the speed of data retrieval operations on a
table. It works similarly to an index in a book, allowing the database to quickly locate the
rows without having to search the entire table. Indexes can be created on one or more
columns, and although they speed up query performance, they can slow down data
JOIN is used to combine rows from two or more tables based on a related column
between them. Joins allow you to retrieve data that is spread across multiple tables in a
relational database. The most commonly used joins are INNER JOIN, LEFT JOIN,
RIGHT JOIN, and FULL OUTER JOIN. These types of join determine how unmatched
Here are the differences between INNER JOIN and OUTER JOIN:
Used when you need data that Used when you need all data from one or
exists in both tables, e.g., matching both tables, even if no matching data
It does not have any JOINS. It consists of three types: LEFT OUTER
OUTER JOIN.
database are:
single unit of work. These operations typically include INSERT, UPDATE, or DELETE
database effectively and are used in scenarios where multiple operations need to be
executed in sequence.
A deadlock is a situation that occurs when two or more transactions are blocked forever,
each waiting for the other to release resources. In a deadlock, no transaction can
proceed because each one holds a resource that the other needs. The DBMS must
detect and resolve deadlocks by aborting one of the transactions, allowing others to
A view in DBMS is a virtual table created by a query that combines data from one or
more tables. Unlike a physical table, a view does not store data itself; it only provides a
way to view data based on the underlying tables. Views can simplify complex queries,
certain events on a particular table or view. These events include INSERT, UPDATE, or
DELETE operations. Triggers are commonly used to enforce business rules, ensure
data integrity, or automatically generate values such as timestamps. They can be set to
updating data. Redundant data can cause errors such as update, insert, or delete
Data independence refers to the ability of a database system to change its schema
● Logical Data Independence: The ability to change the logical schema (e.g.,
adding new fields) without affecting the application programs.
● Physical Data Independence: The ability to change the physical schema (e.g.,
how data is stored) without affecting the logical schema or application programs.
Data independence is a key advantage of using a DBMS over traditional file
systems.
specified columns into summary rows. It is commonly used with aggregate functions like
COUNT, SUM, AVG, MIN, and MAX to perform calculations on each group of rows. For
example, you can use the GROUP BY clause to calculate the total sales by each region
or count the number of employees in each department. It helps organize data and
generate reports.
views, and constraints. It serves as a blueprint, outlining how data is organized and
accessed.
A relational database is a type of database that organizes data into tables consisting of
rows and columns, using a relational model to structure the data. The tables in a
A composite key consists of two or more columns in a table that, when combined,
uniquely identify a record. Each column in the composite key may not uniquely identify a
row, but when combined, they provide uniqueness. Composite keys are useful when no
single column can serve as a primary key.
● INNER JOIN: Fetches rows that have corresponding matches in both tables.
● LEFT JOIN (LEFT OUTER JOIN): Fetches all rows from the left table and the
matched rows from the right table. When no match is found, the columns from
the right table are filled with NULL values.
● RIGHT JOIN (RIGHT OUTER JOIN): Fetches all rows from the right table and
the matched rows from the left table. NULL values are returned for the left table
columns if there’s no match.
● FULL JOIN (FULL OUTER JOIN): Retrieves all rows when there is a match in
either of the tables, with NULL values where there is no match.
● CROSS JOIN: Merges each row from the first table with every row from the
second table, creating a Cartesian product.
● SELF JOIN: Joins a table to itself, which is useful for comparing rows within the
same table.