DBMS Interview Questions - Set 3

DBMS Interview Questions

This page consists of DBMS interview questions and answers.

Q1: List the different types of language available in DBMS

Following are the languages available in DBMS.

  • DDL - Data Definition Language
  • DML - Data Manipulation Language
  • DCL - Data Control Language
  • TCL - Transaction Control Language

Q2: What is DDL in RDBMS?

DDL or Data Definition Language is a list of SQL queries that helps in defining database and schema structure and consists of queries like CREATE, ALTER, DROP, TRUNCATE and RENAME.

Q3: What is DML in RDBMS?

DML or Data Manipulation Language is a list of SQL queries that helps in manipulating data and consists of queries like INSERT, UPDATE, SELECT and DELETE.

Q4: What is DCL in RDBMS?

DCL or Data Control Language is used to control user access in the database and consists of SQL queries like GRANT and REVOKE.

Q5: What is TCL in RDBMS?

TCL or Transaction Control language is used to control the database transactions. They manage the changes made by the DML statements.

TCL consists of commands like COMMIT, ROLLBACK and SAVEPOINT.

Q6: What is the difference between DELETE and TRUNCATE query?

DELETE is a DML command whereas, TRUNCATE is a DDL command.

When we run the DELETE query it deletes rows from the table that satisfies the given condition.

When we run the TRUNCATE query it deletes all the rows from the table.

Note! If no condition is provided to the DELETE query then all the rows are deleted.

Q7: What is the difference between DROP and TRUNCATE query?

DROP and TRUNCATE are both DDL command but when we run the DROP query the entire schema is deleted along with its data (rows or tuples).

Whereas, when we run the TRUNCATE query the entire data is deleted but the schema remains and we can use it again to store new data.

Q8: What is the use of COMMIT command?

The COMMIT command is used to permanently save any transactions in the database.

Q9: What is the use of SAVEPOINT command?

The SAVEPOINT command is used to temporarily save database transactions at a given point. This help us to rollback to that point if need arises.

Q10: What is the use of ROLLBACK command?

The ROLLBACK command takes us back to the last committed transaction.

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT