SQL is Structured Query Language, for storing, manipulating and retrieving data stored in relational database.Its a standard language for Relation Database System. All relational database management systems like MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server use SQL as standard database language.SQL is just a query language, it is not a database. To perform SQL queries, you need to install any database.
Uses of SQL
- Allows users to access data in relational database management systems.
- Allows users to describe the data.
- Allows users to define the data in database and manipulate that data.
- Allows to embed within other languages using SQL modules, libraries & pre-compilers.
- Allows users to create and drop databases and tables.
- Allows users to create view, stored procedure, functions in a database.
- Allows users to set permissions on tables, procedures, and views
Following is a simple diagram showing SQL Architecture
Important SQL Commands
The standard SQL commands to interact with relational databases.The SQL Commands can be divided into three. ther are:
- DDL – Data Definition Language
- DML – Data Manipulation Language
- DCL – Data Control Language
DDL – Data Definition Language
- CREATE : For Creates a new table
- ALTER :To Modifies an existing database object, such as a table.
- DROP : To Deletes an entire table
DML – Data Manipulation Language
- SELECT : Extract certain records from one or more tables
- INSERT : Creates a record or insert the data into database.
- UPDATE : Modifies records or update the data in a database
- DELETE : Deletes records or delete the data from database.
DCL – Data Control Language
- GRANT :Gives a privilege to user
- REVOKE :Takes back privileges granted from user