SQL

Structured Query Language(SQL) is the standard language
designed to access relational databases.
SQL is pronounced either as the word
Sequel or as the letters SQL.SQL uses simple syntax that is easy to learn
and use there are five types of SQL statements given below.

Query Statements: Allow you to retrieve the rows stored in the database tables. You
write a query using the SQL SELECT statement.

Data Manipulation Language (DML) Statements: Allows you to modify the contents of the tables. There are three
DML statements.
 INSERT – Allows you to Insert row(s) into the Table.
 UPDATE – Allows you to change a Row.
 DELETE Allows you delete the rows from the Table.

Data Definition Language (DDL): Allows you to define the Data structures, such as tables that make
up a database. There are five basic types of DDL statements.
 CREATE – Allows you to Create Database structure.
Ex: Create Table – Used to create a Table in the Database.
Create User – Used to create the database user.
 ALTER – Allows you to modify a database structure.
 DROP – Allows you to remove a database structure.
 RENAME – Allows you to change the name of the table.
 TRUNCATE – Allows you to delete the entire contents of the table.

Transaction Control (TC) Statements: Allows you to permanently record the
changes made to rows stored in a table or undo the changes. There are three TC
Statements.
 COMMIT – Allows you to permanently record the changes made to the
rows.
 ROLLBACK – Allows you to undo the changes made to the rows.
 SAVEPOINT – Allows you to set a SAVEPOINT to which you can
rollback changes you made.

Data Control Language (DCL): Allows you to change the permissions on the database structures.
There are two DCL statements.
 GRANT – Allows you to give another user access to your database structures,
such as tables.
 REVOKE – Allows you to prevent another user from accessing to your
database structures, such as tables.

Powered by k2schools