SQL

4 Types of SQL in Relational Database

Types of SQL Statements

SQL statements in relational database management system (RDBMS) could sometimes be too complicated to be analyzed for. As SQL developers, we should at least be able to distinguish what types of the statements that are using.

According to conventional SQL classification, there are 4 basic types of SQL statements.

  1. Data Query Language (DQL)
  2. It’s also called “Query”. Which means, it can only read data, not even try to write or control data. In other words, queries will not lock any data, they just consume resources. Such query statements, for example, SELECT is the top used statement in RDBMS.

  3. Data Definition Language (DDL)
  4. A data definition or called data description language is a type of statements for creating and defining database objects, structures, especially database schemas. The very first statement in DDL is CREATE which defines database objects when creating them.

  5. Data Control Language (DCL)
  6. It’s a type of statement mostly used to control how data can be used under various situations. For applying new changes, you can issue COMMIT to make it true. In contrary, for discarding new changes, you can issue ROLLBACK to revert it.

  7. Data Manipulation Language (DML)
  8. This type of statements aims at how to change data selectively and effectively for various intentions. Which means, DML can make data have different versions in different time frames. INSERT, UPDATE and DELETE are very typical statements in DML.

As we know, the most famous RDBMS is Oracle database. But somehow, the classification we talked above does not fully apply to it. Oracle has its own classification on types of SQL statements.

Leave a Reply

Your email address will not be published. Required fields are marked *