Download as pdf
Download as pdf
You are on page 1of 4
16/2020 SOL | DOL, DAL, DML, DCL and TCL Commands - GeekstorGeeks reeksforGeeks A computer science portal for geeks es SQL | DDL, DAL, DMiewexfandGrorlcommands Structured Query Language(’ Ca” by the use of which we can perform certain operations on tne existing aatapase ana aso in use this language to create a database. SQL uses certain command= "> >>> I>sert etc. to carry out the required tasks. These SQL commands are mainly cate agories as: 1, DDL - Data Definition Language 2. DQI - Data Query Language 3. DML - Data Manipulation Language 4, DCL - Data Control Language Though many resources claim there to be another category of SQL clauses TCL - Transaction Control Language. So we will see in detail about TCL as well. ‘Types of SQL Commands (so ‘Commands ad pad a a on ea ee Language Language: Language | eae seeer ‘went >) ous) “rows >) REVOKE en) nro) 7 >) coc) OG acknotsledge that you have read and understood our Cookie Policy & Privacy Policy ntpsiwu-geekstorgecks.org/sal-dd-dal-dm-dct-tct-commards! 14 18/2020 SQL | DDL, DOL, DML, DCL and TCL Commands - GeekstorGeeks 1. DDL (Data Definition Language) : DDL or Data Definition Language actually consists of the SQL ‘commands that can be used to define the database schema. It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in the database. Examples of DDL commands: + CREATE ~ is used to create the database or its objects (like table, index, function, views, store procedure and triggers). + DROP ~ is used to delete objects from the database. + ALTER-is used to alter the structure of the database. + TRUNCATE-is used to remove all records from a table, including all spaces allocated for the records are removed. + COMMENT ~ + RENAME —is used to rename an object existing in the database. 2, DQL (Data Query Language) : used to add comments to the data dictionary. DML statements are used for performing queries on the data within schema objects. The purpose of DQL Commands to get some schema relation based on the query passed to it Example of DQL: + SELECT - is used to retrieve data from the a database. 3, DML(Data Manipulation Language) : The SQL commands that deals with the manipulation of data present in the database belong to DML or Data Manipulation Language and this includes most of the SL statements. Examples of DML: + INSERT ~ is used to insert data into a table. + UPDATE - is used to update existing data within a table. + DELETE ~ is used to delete records from a database table. 4, DCL(Data Control Language) : DCL includes commands such as GRANT and REVOKE which mainly deals with the rights, permissions and other controls of the database system. Examples of DCL commands: + GRANT-gives user's access privileges to database. + REVOKE-withdraw user's access privileges given by using the GRANT command, 5, TCL (transaction Control Language) : TCL commands deals with the transaction within the database Examples of TCL commands: * COMMIT- commits a Transaction. + ROLLBACK- rollbacks a transaction in case of any error occurs. + SAVEPOINT-sets a savepoint within a transaction. + SET TRANSACTION-specify characteristics for the transaction, This article is contributed by Dimpy Varshni. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to n our website, Sy using our sit, you Got It! J our Cookie Polley & Privacy Polly o cookies fo ensure you have the best browsing axperion acknowladge that you have read and undors hitps:lmwu-geeksforgeeks orgisal-d-dql-dmidl-telcommands! 26 216:2020 SQL |DOL, DOL, DML, DCL and TOL Commands -GeekstorGeeks Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above. Recommended Posts: Unique Constraint in MS SQL Server Union and Union Allin MS SQL Server SQL query to find unique column values from table SQL MINQ and MAX() Differences between SQL and SQLite SQL COUNT(), AVG) and SUM() Window functions in SQL Difference between MySQL and mSQL Joins in MS SQL Server Self Join and Cross Join in MS SQL Server Delete statement in MS SQL Server SQL Error Messages Foreign key in MS SQL Server MINUTEQ, MICROSECOND() and HOUR( functions in MySQL Article Tags: SQL_SQL-Clauses-Operators Practice Tags: SQL © 39 2.2 To-dol] Done Based on 18 vote(s) Feedback/ Suggest Improvement ) ( Improve Article Please write to us at contribute@geeksforgeeks.org to report any issue with the above content, Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here. We use, okies to ensure you have the bast browsing experience on our website. Sy using our sit, you Got It! acknotsledge that you have read and understood our Cookie Policy & Privacy Policy ntpsiwu-geekstorgecks.org/sal-dd-dal-dm-dct-tct-commards! 34 ‘1612020 SQL | DOL, DAL, DML, DCL and TCL Commands - GeekstorGeeks A computer science portal for geeks 5th Floor, A-118, Sector-136, Noida, Uttar Pradesh - 201305 feedback @geeksforgeeks.org COMPANY LEARN ‘About Us Algorithms Careers Data Structures Privacy Policy Languages Contact Us CS Subjects Video Tutorials PRACTICE CONTRIBUTE Courses Write an Article Company-wise Write Interview Experience Topic-wise Internships: How to begin? Videos jeeksforgeeks, Some rights reserved We use cookies fo ensure you have the best browsing experience on our website. By using our sit, you Got It! acknotsledge that you have read and understood our Cookie Policy & Privacy Policy ntpsiwu-geekstorgecks.org/sal-dd-dal-dm-dct-tct-commards! 4

You might also like