0% found this document useful (0 votes)
3 views1 page

SQL Commands Details

The document outlines various SQL command categories including DQL, DDL, DML, TCL, and DCL, along with their descriptions and examples. Each category serves a specific purpose, such as data retrieval, table management, data manipulation, transaction control, and permission management. Examples provided illustrate the syntax and usage of each command.

Uploaded by

t24026463
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

SQL Commands Details

The document outlines various SQL command categories including DQL, DDL, DML, TCL, and DCL, along with their descriptions and examples. Each category serves a specific purpose, such as data retrieval, table management, data manipulation, transaction control, and permission management. Examples provided illustrate the syntax and usage of each command.

Uploaded by

t24026463
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Category CommandDescription Example

DQL SELECT Retrieves dSELECT * FROM employees;


DDL CREATE Creates a nCREATE TABLE employees (id INT, name VARCHAR(50));
DDL ALTER Modifies anALTER TABLE employees ADD salary DECIMAL(10,2);
DDL DROP Deletes a tDROP TABLE employees;
DDL TRUNCATEDeletes all TRUNCATE TABLE employees;
DDL RENAME Renames aRENAME TABLE employees TO staff;
DML INSERT Adds new dINSERT INTO employees (id, name) VALUES (1, 'Alice');
DML UPDATE Modifies exUPDATE employees SET name = 'Bob' WHERE id = 1;
DML DELETE Removes reDELETE FROM employees WHERE id = 1;
TCL COMMIT Saves the COMMIT;
TCL ROLLBACK Undoes chaROLLBACK;
TCL SAVEPOINTSets a pointSAVEPOINT sp1;
TCL SET TRANSSets characSET TRANSACTION READ ONLY;
DCL GRANT Gives privi GRANT SELECT ON employees TO user1;
DCL REVOKE Takes backREVOKE SELECT ON employees FROM user1;

You might also like