Our SQL language reference gives you SQL answers quickly.
We cover important SQL concepts and features -- with examples.
Try the SQL examples live in our online SQL Editor.
SQL stands for Structure Query Language.
SQL is a programming language that is used to manage relational databases.
SQL commands retrieve, create, update, and delete data from a database.
Other commands can be used to control and manage the database.
SQL commands fall into into 5 categories:
Data Query Language commands are used to retrieve data from the database. This category has only one command, but it is, by far, the most commonly used query.
Data Manipulation Language commands are used to create, modify or delete data in the database. These commands include:
Transaction Control Language commands are used to control database transactions. These commands include:
Data Definition Language commands are used to define and modify database structures. These commands include:
Data Control Language commands are used to grant or revoke user rights and permissions. These commands include:
GRANT - gives priveleges to a database user
REVOKE - removes priveleges from a database user
When SQL Server executes a command, it uses a number of components to interpret the request and determine the optimal way to perform the task. This process includes the following steps:
SQL Server Agent is a service that executes scheduled administrative operations, called jobs, in SQL Server. It is a separate process from the database that can be started and stopped independently.
SQL Server Agent can run a job 1) at a scheduled time, or 2) in response
to a certain event, or 3) on demand (i.e. manually).
An example would be backup job that runs every day at 2:00 AM. Before the actual backup operation, perhaps a stored procedure needs to run to ensure that all aggregate data is up-to-date. This can all be part of a single job that consists of one or more tasks.