REQUEST COMPLIMENTARY SQLS*PLUS LICENCE
What is DDL, DML, DCL and TCL in the SQL language
In this material I will tell you about DDL, DML, DCL and TCL in SQL language. If you do not know what these incomprehensible letter sets mean and you work with SQL language, you should read this material.
What is DDL, DML, DCL and TCL in SQL
For starters, let’s remember what SQL is and what it is for.
SQL – Structured Query Language
Structured Query Language (SQL) – a language of structured queries, using it to write special queries (SQL instructions) to the database in order to obtain these data from the database and to manipulate these data.
SQL is a standard, it is implemented in all relational databases, but each DBMS has an extension of this standard, has its own language for working with data, it is usually called a dialect of SQL, which, of course, is based on SQL, but provides more opportunities for full programming, in addition, this internal language allows you to get system information and simplify SQL queries.
Here are some dialects of the SQL language:
- Transact-SQL (short for T-SQL) – used in Microsoft SQL Server;
- PL/SQL (Procedural Language / Structured Query Language) – used in Oracle Database;
- PL/pgSQL (Procedural Language/PostGres Structured Query Language) – used in PostgreSQL.
Thus, it depends on the DBMS on which extension you will write SQL instructions. If we talk about simple SQL queries, for example:
SELECT ProductId, ProductName
FROM Goods
then, of course, such queries will work in all DBMS, because SQL is a standard.
Note: This is a simple SQL query for selecting data from a single table, two columns are displayed.
However, if you are going to program, use all internal DBMS capabilities (develop procedures, use built-in functions, get system information, etc.), then you need to learn a specific SQL dialect and practice it accordingly in the DBMS that uses this dialect. This is important, because the syntax of many constructions differs in the same way as the features and much more. And if, say, you run an SQL instruction that uses the capabilities of a particular SQL extension to another DBMS, then such an instruction, of course, will not be executed.
In other words, the SQL language is needed to work with databases.
In terms of implementation, the SQL language is a set of operators that are divided into certain groups and each group has its own purpose. In short, these groups are called DDL, DML, DCL and TCL.
Thus, these incomprehensible letters represent an abbreviation for names of groups of operators of SQL language.
DDL – Data Definition Language
Data Definition Language (DDL) is a group of data definition operators. In other words, with the help of operators included in this group, we define the structure of the database and work with the objects of this database, ie create, modify and delete them.
This group includes the following operators:
- CREATE – used to create database objects;
- ALTER – used to modify database objects;
- DROP – used to delete database objects.
DML – Data Manipulation Language
Data Manipulation Language (DML) is a group of operators for data manipulation. With these operators we can add, modify, delete and unload data from the database, i.e. manipulate them.
This group includes the most common SQL language operators:
- SELECT – performs data sampling;
- INSERT – adds new data;
- UPDATE – changes the existing data;
- DELETE – deletes data.
DCL – Data Control Language
Data Control Language (DCL) – a group of operators defining access to data. In other words, these are operators for managing permissions, with their help we can allow or deny certain operations on database objects.
This includes:
- GRANT – gives the user or group permissions to perform certain operations on the object;
- REVOKE – revokes the granted permissions;
- DENY – sets a ban that has priority over the permission.
TCL – Transaction Control Language
Transaction Control Language (TCL) – a group of operators to manage transactions. A transaction is a command or block of commands (instructions) that are successfully completed as a whole, with all the changes made in the database being fixed permanently or cancelled, i.e. all the changes made by any command included in the transaction will be cancelled.
TCL operator group is designed just for the implementation and management of transactions. It can be referred to here:
- BEGIN TRANSACTION – serves to determine the beginning of the transaction;
- COMMIT TRANSACTION – applies the transaction;
- ROLLBACK TRANSACTION – rollback all changes made in the context of the current transaction;
- SAVE TRANSACTION – sets the intermediate saving point within the transaction.
DDL, DML, DCL & TCL statements in SQL (Database basics)
MORE NEWS
PreambleNoSql is not a replacement for SQL databases but is a valid alternative for many situations where standard SQL is not the best approach for...
PreambleMongoDB Conditional operators specify a condition to which the value of the document field shall correspond.Comparison Query Operators $eq...
5 Database management trends impacting database administrationIn the realm of database management systems, moreover half (52%) of your competitors feel...
The data type is defined as the type of data that any column or variable can store in MS SQL Server. What is the data type? When you create any table or...
PreambleMS SQL Server is a client-server architecture. MS SQL Server process starts with the client application sending a query.SQL Server accepts,...
First the basics: what is the master/slave?One database server (“master”) responds and can do anything. A lot of other database servers store copies of all...
PreambleAtom Hopper (based on Apache Abdera) for those who may not know is an open-source project sponsored by Rackspace. Today we will figure out how to...
PreambleMongoDB recently introduced its new aggregation structure. This structure provides a simpler solution for calculating aggregated values rather...
FlexibilityOne of the most advertised features of MongoDB is its flexibility. Flexibility, however, is a double-edged sword. More flexibility means more...
PreambleSQLShell is a cross-platform command-line tool for SQL, similar to psql for PostgreSQL or MySQL command-line tool for MySQL.Why use it?If you...
PreambleWriting an application on top of the framework on top of the driver on top of the database is a bit like a game on the phone: you say “insert...
PreambleOracle Coherence is a distributed cache that is functionally comparable with Memcached. In addition to the basic function of the API cache, it...
PreambleIBM pureXML, a proprietary XML database built on a relational mechanism (designed for puns) that offers both relational ( SQL / XML ) and...
What is PostgreSQL array? In PostgreSQL we can define a column as an array of valid data types. The data type can be built-in, custom or enumerated....
PreambleIf you are a Linux sysadmin or developer, there comes a time when you need to manage an Oracle database that can work in your environment.In this...
PreambleStarting with Microsoft SQL Server 2008, by default, the group of local administrators is no longer added to SQL Server administrators during the...