SQL Tutorial

SQL tutorial provides basic and advanced concepts of SQL. Our SQL tutorial is designed for beginners and professionals.

SQL (Structured Query Language) is used to perform operations on the records stored in database such as updating records, deleting records, creating and modifying tables, views etc.

SQL is just a query language not a database. To perform SQL queries, you need to install database such as Oracle, MySQL, PostGre, SQL Server, DB2 etc.

What Can SQL do

SQL execute queries against a database
SQL retrieve data from a database
SQL insert records in a database
SQL update records in a database
SQL delete records from a database
SQL create new databases
SQL create new tables in a database
SQL create stored procedures in a database
SQL create views in a database
SQL set permissions on tables, procedures, and views

Why SQL?

  • Allow users to access data in relational database management systems.

  • Allow users to describe the data.

  • Allow users to define the data in database and manipulate that data.

  • Allow to embed within other languages using SQL modules, libraries & pre-compilers.

  • Allow users to create and drop databases and tables.

  • Allow users to create view, stored procedure, functions in a database.

  • Allow users to set permissions on tables, procedures, and views

SQL Commands:

The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE, and DROP. These commands can be classified into groups based on their nature:

DDL - Data Definition Language:

Command Description
CREATE Creates a new table, a view of a table, or other object in database
ALTER Modifies an existing database object, such as a table.
DROP Deletes an entire table, a view of a table or other object in the database.

DML - Data Manipulation Language:

Command Description
INSERT Creates a record
UPDATE Modifies records
DELETE Deletes records

DCL - Data Control Language:

Command Description
GRANT Gives a privilege to user
REVOKE Takes back privileges granted from user

DQL - Data Query Language:

Command Description
SELECT Retrieves certain records from one or more tables