SQL language is divided into four types of primary language statements: DML, DDL, DCL and TCL. Using these statements, we can define the structure of a database by creating and altering database objects and we can manipulate data in a table through updates or deletions. We also can control which user can read/write data or manage transactions to create a single unit of work.
The four main categories of SQL statements are as follows −
DML statements affect records in a table. These are basic operations we perform on data such as selecting a few records from a table, inserting new records, deleting unnecessary records, and updating/modifying existing records.
DML statements include the following −
SELECT – select records from a table
DDL statements are used to alter/modify a database or table structure and schema. These statements handle the design and storage of database objects.
DCL statements control the level of access that users have on database objects.
TCL statements allow you to control and manage transactions to maintain the integrity of data within SQL statements.