Different types of SQL commands?

Answered by Kaushik Chandra

SQL commands are the set of commands utilized to communicate and oversee the information shown within the database. The distinctive sort of SQL commands are,

a. DDL – These commands are utilized to characterize or modify the structure of the database. The diverse DDL commands are,

CREATE – Utilized to form a table within the database

DROP – Drops the table from the DB

ALTER – Changes the structure of the DB

TRUNCATE – Erases all the records from the database but not its database structure

RENAME – Renames a database object

b. DML – These commands are utilized for overseeing information display within the database. A few of the DML commands are select, insert, update, erase, etc.

c. DCL – These commands are utilized to the creation of roles, granting the permission and controls get i.e. access to the database objects. The three DCL commands are,

GRANT – Grants authorization to the DB user

REVOKE – Removes the access for a user-provided with the GRANT command

Deny – It avoids a client from getting specific permission (e.g. avoiding a specific client having a place to a bunch to get the get to controls

d. TCL – Transactional Control Language (TCL) is utilized to oversee the changes made by DML articulations. These are also utilized to process a group of SQL statements comprising a logical unit. The three TCL commands are,

COMMIT – Commit type in the changes to the database

SAVEPOINT – Savepoints are the breakpoints, these isolate the exchange into smaller logical units which may well assist roll-back.

ROLLBACK – Rollbacks are utilized to re-establish the database since the final commit.



Your Answer

Interviews

Parent Categories