Structured Query Language, or SQL (pronounced see-quel), is the language that is used for querying and manipulating data and defining structures in databases. Initially developed at IBM in the early 1970s, SQL became an ANSI and ISO standard in 1986.
SQL is a powerful, yet simple language, and can do many things, such as execute queries, retrieve, insert, update, and delete data, create databases and tables, and much more.
These types of activities can be grouped into different subdivisions of SQL: Data Definition Language (DDL), Data Manipulation Language (DML), and Data Control Language (DCL):
- Use DDL commands to specify database schema:
- CREATE: This is used to create a new database or objects in a database.
- ALTER: This is used to alter a database or objects in a database.
- DROP: This is used to delete a database or objects in a database.
- TRUNCATE: This is used to remove all data from a table instantaneously.
- Use DML commands to query and modify data:
- SELECT: This is used to retrieve data from a database.
- INSERT: This is used to insert data into a database.
- UPDATE: This is used to update data in a database.
- DELETE: This is used to remove data from a database.
- Use DCL commands to control permissions and translations:
- GRANT: This is used to give access to a user.
- REVOKE: This is used to take access away from a user.
- COMMIT: This is used to save changes in a transaction.
- ROLLBACK: This is used to remove the saved changes in a transaction.
