SQL Statements: Types, Syntactic Components, and More

SQL statements, is a series of commands used by professionals in the programming area when they are going to develop a programming activity, in this article the user will be able to know their types.

Sql-1-statements

SQL statements

SQL statements refer to SQL commands that can be used in this domain language used for programming.

In SQL there are enough statements that can be used to carry out any number of tasks, everything will depend on the type of tasks, so these statements are classified into three main groups known as DML, DDL, DCL, however, it is It is good to highlight that there is another achievement of sentences that are not considered to belong to the SQL language, but rather correspond to PLSQL.

Get to know this interesting article by clicking on Mysql features.

It is important to mention that most of the SQL have the same structure, absolutely all of them start with a verb such as: select, create, update, insert, then request the information with which they will be managed such as: from, where , many of these are considered options, while others are mandatory, such as: from.

To create tables with SQL statements, you must enter certain important data, such as the name with which you want to identify the fields and their specifications, it is also required to indicate which of the fields will function as indexes and what their type will be.

From the next paragraph we will begin to show the types of statement that SQL has, we start with:

DML: Data manipulation

This statement is made up of the following commands: Update, insert, select, delete.

Its description: It is intended to retrieve the data found in the database, it also has the option of adding new rows of information to the database.

Allows you to delete rows of data that are within the database.

You still have the option of modifying or changing data that already exists in the database.

DDL: Data definition

In it are the following commands: Create table, drop table, alter table, create view, drop view, create index, drop index, create synoym, drop synoym.

Its description: This statement allows adding a new table to the database, as well as accepting to delete or delete a table from the database.

You agree to modify the structure of a table that already exists; add a new view to the database; remove a view from the database; as well as you have the option to build an index for a column; finally it allows to define and eliminate or suppress, an alias to assign a name in the table.

DCL: Access control

In this statement you can see the following commands: Grant, revoke, and transaction control such as commit, rollback.

Its description: Free access for users to enter; remove or remove privileges for users to access; has the option to end the current transaction, and abort the current transaction.

PLSQL: Programmatic SQL

Your description: You have the option of defining a cursor for when a query is made; agrees to open the cursor to retrieve information made in the query; in addition to retrieving a row of query results, and finally shows the option to close the cursor.