DBMS Interview Questions
This page consists of DBMS interview questions and answers.
Following are the languages available in DBMS.
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.
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.
DCL or Data Control Language is used to control user access in the database and consists of SQL queries like GRANT and REVOKE.
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.
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.
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.
The COMMIT command is used to permanently save any transactions in the database.
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.
The ROLLBACK command takes us back to the last committed transaction.
ADVERTISEMENT