Introduction to SQL

Structure Query Language(SQL) is a programming language used for storing and managing data in RDBMS. SQL was the first commercial language introduced for E.F Codd’s Relational model. Almost all RDBMS(MySql, Oracle, Infomix, Sybase, MS Access) uses SQL as the standard database language. SQL is used to perform all type of data operations in RDBMS.

SQL Command

SQL defines following data languages to manipulate data of RDBMS.

SQL commands can be categorized under

  • DDL – Data Definition Language
  • DML- Data Manipulation Language
  • DCL- Data Control Language
  • TCL- Transaction Control Language
  • DQL- Data Query Language

DDL : Data Definition Language

All DDL commands are auto-committed. That means it saves all the changes permanently in the database.

Command Description
createto create new table or database
alterfor alteration
truncatedelete data from table
dropto drop a table
renameto rename a table

DML : Data Manipulation Language

DML commands are not auto-committed. It means changes are not permanent to database, they can be rolled back.

Command Description
insertto insert a new row
updateto update existing row
deleteto delete a row
mergemerging two rows or two tables

DCL : Data Control Language

Data control language provides command to grant and take back authority.

Command Description
grantgrant permission of right
revoketake back permission.

TCL : Transaction Control Language                                                    

These commands are to keep a check on other commands and their affect on the database. These commands can annul changes made by other commands by rolling back to original state. It can also make changes permanent.

Command Description
committo permanently save
rollbackto undo change
savepointto save temporarily

DQL : Data Query Language  

Commands used to fetch data from the database.                                                                  

Command Description
selectretrieve records from one or more table

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.