SQL (Structured Query Language) is a standard programming language designed for managing relational databases. It’s used for querying, inserting, updating, and deleting data from databases, as well as for defining database schemas, creating and modifying tables, and managing database users and permissions.
SQL is used to insert, search, update, and delete database records (and a fancy term used for such operation is known as CRUD).
Here are some key aspects of SQL:
SELECT
statement is the primary SQL command used for querying data.INSERT
(for adding new rows of data), UPDATE
(for modifying existing data), and DELETE
(for removing data).COMMIT
(to save changes made by a transaction) and ROLLBACK
(to discard changes and restore the database to its previous state).SQL is a standardized language, but different database management systems (DBMS) may implement variations or extensions of the standard. Some popular relational database systems that use SQL include MySQL, PostgreSQL, Oracle Database, SQL Server, SQLite, and MariaDB. Despite some differences in syntax and features, the core SQL language remains consistent across these systems.
The following SQL statement selects all the records in the “Employees” table:
SELECT * FROM EMPLOYEES
SQL keywords are NOT case sensitive: select
is the same as SELECT