What is SQL
SQL stands for Structured Query Language.
It is designed for managing data in a relational database management system (RDBMS).
It is pronounced as S-Q-L or sometime See-Qwell.
SQL is a database language, it is used for database creation, deletion, fetching rows and modifying rows etc.
SQL depends on relational algebra and tuple relational calculus.
All DBMS like MySQL, Oracle, MS Access, Sybase, Informix, Postgres and SQL Server use SQL as standard database language.
Why SQL is required
SQL is required:
To create new databases, tables and views
To insert records in a database
To update records in a database
To delete records from a database
To retrieve data from a database
What SQL does
With SQL, we can query our database in a numbers of ways, using English-like statements.
With SQL, user can access data from relational database management system.
It allows user to describe the data.
It allows user to define the data in database and manipulate it when needed.
It allows user to create and drop database and table.
It allows user to create view, stored procedure, function in a database.
It allows user to set permission on tables, procedure and view.
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 |
---|---|
SELECT | Retrieves certain records from one or more tables |
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 |
No comments:
Post a Comment