Introduction to SQL Queries
Introduction to SQL Queries
SQL Queries
Introduction to SQL Queries
• Structured Query Language(SQL) as we all know is the database language by the use of which we
can perform certain operations on the existing database and also we can use this language to create
a database.
• SQL uses certain commands like Create, Drop, Insert, etc. to carry out the required tasks.
• These SQL commands are mainly categorized into four categories as:
• Data Definition Language actually consists of the SQL commands that can be used to define the
database schema
• It simply deals with descriptions of the database schema and is used to create and modify the
structure of database objects
• CREATE : This command is used to create the database or its objects (like table, index, function,
views, store procedure, and triggers).
• TRUNCATE : This is used to remove all records from a table, including all spaces allocated for the
records are removed.
DQL (Data Query Language)
• DQL statements are used for performing queries on the data within schema objects.
• The purpose of the DQL Command is to get some schema relation based on the query passed to it
• We can define DQL as follows it is a component of SQL statement that allows getting data from the
database and imposing order upon it.
• List of DQL:
• The SQL commands that deals with the manipulation of data present in the database belong to DML
or Data Manipulation Language and this includes most of the SQL statements..
• It is the component of the SQL statement that controls access to data and to the database.
• DCL includes commands such as GRANT and REVOKE which mainly deal with the rights,
permissions, and other controls of the database system.
• It is the component of the SQL statement that controls access to data and to the database.
• REVOKE : This command withdraws the user’s access privileges given by using the GRANT
command..