DBMS TCS
DBMS TCS
Answer: DBMS stands for Database Management System. It is software that allows
users to interact with a database. It facilitates the creation, maintenance, and
manipulation of databases.
3. What are the different types of DBMS?
Answer: The different types of DBMS include relational DBMS (RDBMS), object-
oriented DBMS (OODBMS), hierarchical DBMS, network DBMS, and NoSQL databases.
4. Explain the difference between DBMS and RDBMS.
Answer: DBMS is a broader term that refers to the entire system used for managing
databases, whereas RDBMS (Relational Database Management System) is a specific type
of DBMS that organizes data into tables with rows and columns, and establishes
relationships between these tables.
5. What is a primary key?
Answer: A primary key is a unique identifier for each record in a table. It ensures
that each row in the table can be uniquely identified and retrieved.
6. What is a foreign key?
Answer: A foreign key is a column or a set of columns in a table that refers to the
primary key of another table. It establishes a relationship between two tables.
7. What is normalization?
Answer: DELETE command is used to remove rows from a table based on a condition,
while TRUNCATE command is used to remove all the rows from a table, but it does not
maintain any rollback information.
11. What is a stored procedure?
Answer: A stored procedure is a set of SQL statements that are stored and executed
on the database server. It can accept input parameters, perform operations, and
return results.
12. What is a trigger?
Answer: A trigger is a set of SQL statements that are automatically executed in
response to certain events, such as insert, update, or delete operations on a
table.
13. Explain the difference between a clustered and non-clustered index.
Answer: A clustered index determines the physical order of data in a table, while a
non-clustered index does not affect the physical order of data and stores a
separate copy of the indexed columns.
14. What is a join in SQL?
Answer: A join is used to combine rows from two or more tables based on a related
column between them.
15. What are the different types of joins in SQL?
Answer: The different types of joins in SQL include INNER JOIN, LEFT JOIN (or LEFT
OUTER JOIN), RIGHT JOIN (or RIGHT OUTER JOIN), and FULL JOIN (or FULL OUTER JOIN).
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------
Certainly! Here's a set of interview questions and answers in DBMS from basic to
advanced for a fresher interviewing with Tata Consultancy Services (TCS):
Basic Level:
Answer: A Database Management System (DBMS) is a software system that enables users
to define, create, maintain, and control access to databases.
What is a Database?
Answer: Main advantages of using a DBMS include data consistency, data integrity,
data security, efficient data retrieval, and reduced data redundancy.
Name some popular DBMS products.
Answer: Some popular DBMS products include Oracle Database, MySQL, Microsoft SQL
Server, PostgreSQL, and MongoDB.
What is SQL?
What is Normalization?
Answer: A Primary Key is a unique identifier for each record (row) in a table. It
ensures that each row can be uniquely identified within the table.
What is a Foreign Key?
Answer: A Foreign Key is a column or a set of columns in a table that establishes a
relationship with the Primary Key of another table. It is used to maintain
referential integrity between related tables.
Explain the ACID properties of a DBMS.
Answer: ACID stands for Atomicity, Consistency, Isolation, and Durability. These
properties ensure that database transactions are processed reliably:
Atomicity ensures that a transaction is either completed in its entirety or not at
all.
Consistency ensures that the database remains in a valid state before and after a
transaction.
Isolation ensures that transactions are executed independently of each other.
Durability ensures that the changes made by a committed transaction are permanent
and survive system failures.
What is a View in a database?
Answer: A View is a virtual table that is based on the result of a SELECT query. It
does not store data itself but presents data from one or more tables in a
structured format.
Advanced Level:
Answer:
A Clustered Index determines the physical order of rows in a table. Each table can
have only one clustered index.
A Non-clustered Index does not affect the physical order of rows in a table. It
creates a separate structure that points to the rows in the table.
What is a Stored Procedure?
Answer: A Stored Procedure is a set of SQL statements that are stored in the
database and can be executed on demand. Stored procedures can accept parameters,
perform operations, and return results.
Explain the difference between DELETE and TRUNCATE commands.
Answer:
DELETE command is used to remove one or more rows from a table based on a specified
condition.
TRUNCATE command is used to remove all rows from a table, effectively deleting all
data from the table. TRUNCATE is faster than DELETE but cannot be rolled back.
What is Database Normalization and its different forms?
Answer:
Database Normalization is the process of organizing data in a database to reduce
redundancy and dependency, thereby improving data integrity and minimizing data
anomalies.
Different normal forms include First Normal Form (1NF), Second Normal Form (2NF),
Third Normal Form (3NF), Boyce-Codd Normal Form (BCNF), and Fourth Normal Form
(4NF). Each normal form represents a higher level of data normalization and has
specific criteria for achieving it.