What is SQL
SQL stands for Structured Query Language, and is used to communicate with a relational database.
It's the standard language for relational database management systems.
SQL statements are used to perform task such as update data in a database, or retrieve data from a database. Some common relational database management system that usd Sql include microsoft Sql Server, MySQL, postgreSQL,
MariaDb,and Oracle
History Of SQL
SQL was originally standardized by the American National Standards Institute (ANSI) in 1986, and by the International Organization for Standardization (ISO) in 1987. Since then, the standard has been extended several times as relational database vendors have added new features to their systems. Additionally, most database vendors include their own proprietary extensions that are not part of the standard, which has resulted in a variety of dialects of SQL
You can use SQL statements such as SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP to accomplish almost everything that you need to do with a database.
PostgreSQL and MySQL also have their own versions of these features.
Some popular dialects of SQL include:
Transact-SQL (T-SQL). This version of SQL is used by Microsoft SQL Server and Azure SQL services.
pgSQL. This is the dialect, with extensions implemented in PostgreSQL.
PL/SQL. This is the dialect used by Oracle. PL/SQL stands for Procedural Language/SQL.
SQL statement types
SQL statements are grouped into three main logical groups:
- Data Definition Language (DDL)
- Data Control Language (DCL)
- Data Manipulation Language (DML)
- Data Query Language (DQL)
- Transaction Control Language (TCL)
DDL Command
You use DDL statements to create, modify, and remove tables and other objects in a database (table, stored procedures, views, and so on).
The most common DDL Command are;
Commands
CREATE : ( Create a new object in the database. such as a table or a View. )
ALTER : ( Modify the structure of an object. for instance altering a table to add a new column )
DROP : ( Remove an Object from the database)
RENAME : (This is used to rename an object existing in the database)
DCL Command
DCL includes commands such as GRANT and REVOKE which mainly deal with the rights, permissions, and other controls of the database system.
The most common DCL Command are;
Commands
GRANT : ( Grant Permission to perfome specific actions )
DENY : ( Deny permission to perfome specific actions )
REVOKE : ( Remove a Previously granted permission )
SQL
GRANT SELECT, INSERT, UPDATE
ON Product
TO user1;
DML Commands
UPDATE : ( Modify Data In Existing Rows )
DELETE : ( Delete Existing rows )
DQL Commands
List of DQL:
- SELECT: It is used to retrieve data from the database
TCL Commands
- A single unit of work in a database is formed after the consecutive execution of commands is known as a transaction.
- There are certain commands present in SQL known as TCL commands that help the user manage the transactions that take place in a database.
.png)
No comments:
Post a Comment