DBMS Interview Questions - Answers
DBMS Interview Questions - Answers
5. What are the different types of languages that are available in DBMS?
The different types of dbms languages are:
DDL: Data Definition language is used to define schemas, table, index, view
etc. (create, alter, drop, rename, truncate)
DML: Data Manipulation Language is used to manipulate data in dbms
tables. (select, insert, update, delete)
DCL: Data control language is used to grant and revoke user access in the
database. (grant, revoke)
TCL: Transaction Control language is used to either perform or rollback the
changes we make in a database using DML. (commit, rollback)
8. What are the main differences between Primary key and Unique key?
A relational database table can have only one primary key whereas there can
have multiple unique keys and a primary key cannot be null but a unique key
can be null.
10. What is the use of DROP commands and what are the differences
between DROP, TRUNCATE and DELETE commands?
The DROP command is used to delete a database, table, index or view from
the database.
TRUNCATE is used to remove all the rows from a table but the table
structure, constraints, index and so on remain whereas DROP is used to
delete table definition along with data.
DELETE is used to remove or delete a row from a database table.
11. What is the main difference between UNION and UNION ALL?
UNION and UNION ALL are SQL operators used to concatenate two more
data sets. This allows us to write multiple SELECT statements to retrieve
desired results and then combine them together into a final unified set.
The only difference is that UNION ALL keeps all the records from each of the
original sets where UNION removes any duplicate records.