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

SQL Commands Chart

The document is a chart detailing various SQL commands categorized into DDL, DML, DCL, TCL, and DQL. Each command includes its full form, purpose, and an example of usage. This serves as a quick reference for understanding SQL commands and their functionalities.

Uploaded by

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

SQL Commands Chart

The document is a chart detailing various SQL commands categorized into DDL, DML, DCL, TCL, and DQL. Each command includes its full form, purpose, and an example of usage. This serves as a quick reference for understanding SQL commands and their functionalities.

Uploaded by

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

SQL Commands Chart

Category Command Full Form Purpose / Description Example

DDL (Data Definition Language)


CREATE Create Creates a new table, database, view, or object.
CREATE TABLE Students (ID INT, Name V

ALTER Alter Modifies an existing database object. ALTER TABLE Students ADD Age INT;

DROP Drop Deletes an entire table, view, or database. DROP TABLE Students;

TRUNCATE Truncate Removes all records but keeps the structure. TRUNCATE TABLE Students;

RENAME Rename Renames a table or column. RENAME TABLE Students TO Learners;

COMMENT Comment Adds comments to the data dictionary. COMMENT ON TABLE Students IS 'Stores

DML (Data Manipulation


INSERT
Language) Insert Adds new records into a table. INSERT INTO Students VALUES (1, 'Amit',

UPDATE Update Modifies existing records. UPDATE Students SET Age = 21 WHERE

DELETE Delete Removes specific records. DELETE FROM Students WHERE ID = 1;

MERGE Merge Combines insert and update operations. MERGE INTO Target USING Source ON ...

DCL (Data Control Language)


GRANT Grant Gives user access privileges. GRANT SELECT ON Students TO user1;

REVOKE Revoke Removes access privileges. REVOKE SELECT ON Students FROM use

TCL (Transaction Control


COMMIT
Language) Commit Saves all changes made during the transaction.
COMMIT;

ROLLBACK Rollback Reverts changes if an error occurs. ROLLBACK;

SAVEPOINT Savepoint Sets a point within a transaction. SAVEPOINT sp1;

SET TRANSACTION
Set Transaction Defines characteristics of a transaction. SET TRANSACTION READ ONLY;

DQL (Data Query Language)


SELECT Select Retrieves data from one or more tables. SELECT Name, Age FROM Students;

You might also like