SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Microsoft Access, Ingres, etc.
Keyword | |
---|---|
1 |
ADD The ADD command is used to add a column in an existing table |
2 |
ADD CONSTRAINT he ADD CONSTRAINT command is used to create a constraint after a table is already created. |
3 |
ALL The ALL command returns true if all of the subquery values meet the condition. |
4 |
ALTER COLUMN The ALTER COLUMN command is used to change the data type of a column in a table. |
5 |
ALTER TABLE The ALTER TABLE command adds, deletes, or modifies columns in a table. |
6 |
AND The AND command is used with WHERE to only include rows where both conditions is true. |
7 |
ANY The ANY command returns true if any of the subquery values meet the condition. |
8 |
AS The AS command is used to rename a column or table with an alias. |
9 |
ASC The ASC command is used to sort the data returned in ascending order. |
10 |
BACKUP DATABASE The BACKUP DATABASE command is used in SQL Server to create a full back up of an existing SQL database. |
11 |
BETWEEN The BETWEEN command is used to select values within a given range. The values can be numbers, text, or dates. |
12 |
CASE The CASE command is used is to create different output based on conditions |
13 |
CHECK The CHECK constraint limits the value that can be placed in a column. |
14 |
CREATE DATABASE The CREATE DATABASE command is used is to create a new SQL database. |
15 |
CREATE INDEX The CREATE INDEX command is used to create indexes in tables (allows duplicate values). |
16 |
CREATE OR REPLACE VIEW The CREATE OR REPLACE VIEW command updates a view. |
17 |
CREATE PROCEDURE The CREATE PROCEDURE command is used to create a stored procedure. |
18 |
CREATE TABLE The CREATE TABLE command creates a new table in the database. |
19 |
CREATE UNIQUE INDEX The CREATE UNIQUE INDEX command creates a unique index on a table (no duplicate values allowed) |
20 |
CREATE VIEW The CREATE VIEW command creates a view. |
21 |
DEFAULT The DEFAULT constraint provides a default value for a column. |
22 |
DELETE The DELETE command is used to delete existing records in a table. |
23 |
DESC The DESC command is used to sort the data returned in descending order. |
24 |
DROP COLUMN The DROP COLUMN command is used to delete a column in an existing table. |
25 |
DROP CONSTRAINT The DROP CONSTRAINT command is used to delete a UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint. |
26 |
DROP DATABASE The DROP DATABASE command is used to delete an existing SQL database. |
27 |
DROP DEFAULT The DROP DEFAULT command is used to delete a DEFAULT constraint. |
28 |
DROP INDEX The DROP INDEX command is used to delete an index in a table. |
29 |
DROP TABLE The DROP TABLE command deletes a table in the database. |
30 |
DROP VIEW The DROP VIEW command deletes a view. |
31 |
EXEC The EXEC command is used to execute a stored procedure. |
32 |
EXISTS The EXISTS command tests for the existence of any record in a subquery, and returns true if the subquery returns one or more records. |
33 |
FOREIGN KEY The FOREIGN KEY constraint is a key used to link two tables together. |
34 |
FROM The FROM command is used to specify which table to select or delete data from. |
35 |
FULL OUTER JOIN The FULL OUTER JOIN command returns all rows when there is a match in either left table or right table. |
36 |
GROUP BY The GROUP BY command is used to group the result set (used with aggregate functions: COUNT, MAX, MIN, SUM, AVG). |
37 |
HAVING The HAVING command is used instead of WHERE with aggregate functions. |
38 |
IN The IN command allows you to specify multiple values in a WHERE clause. |
39 |
INNER JOIN The INNER JOIN command returns rows that have matching values in both tables. |
40 |
INSERT INTO The INSERT INTO command is used to insert new rows in a table. |
41 |
INSERT INTO SELECT The INSERT INTO SELECT command copies data from one table and inserts it into another table. |
42 |
IS NOT NULL The IS NOT NULL command is used to test for non-empty values (NOT NULL values). |
43 |
IS NULL The IS NULL command is used to test for empty values (NULL values). |
44 |
LEFT JOIN The LEFT JOIN command returns all rows from the left table, and the matching rows from the right table. The result is NULL from the right side, if there is no match. |
45 |
LIKE The LIKE command is used in a WHERE clause to search for a specified pattern in a column. |
46 |
LIMIT The LIMIT command is used to specify the number of records to return. |
47 |
NOT The NOT command is used with WHERE to only include rows where a condition is not true. |
48 |
NOT NULL The NOT NULL constraint enforces a column to not accept NULL values, which means that you cannot insert or update a record without adding a value to this field. |
49 |
OR The OR command is used with WHERE to include rows where either condition is true. |
50 |
ORDER BY The ORDER BY command is used to sort the result set in ascending or descending order. |
51 |
PRIMARY KEY The PRIMARY KEY constraint uniquely identifies each record in a table. |
52 |
RIGHT JOIN The RIGHT JOIN command returns all rows from the right table, and the matching records from the left table. The result is NULL from the left side, when there is no match. |
53 |
SELECT The SELECT command is used to select data from a database. The data returned is stored in a result table, called the result set. |
54 |
SELECT DISTINCT The SELECT DISTINCT command returns only distinct (different) values in the result set. |
55 |
SELECT INTO The SELECT INTO command copies data from one table and inserts it into a new table. |
56 |
SELECT TOP The LIMIT, SELECT TOP used to specify the number of records to return. |
57 |
SET The SET command is used with UPDATE to specify which columns and values that should be updated in a table. |
58 |
TRUNCATE TABLE The TRUNCATE TABLE command deletes the data inside a table, but not the table itself. |
59 |
UNION The UNION command combines the result set of two or more SELECT statements (only distinct values) |
60 |
UNION ALL The UNION ALL command combines the result set of two or more SELECT statements (allows duplicate values). |
61 |
UNIQUE The UNIQUE constraint ensures that all values in a column are unique. |
62 |
UPDATE The UPDATE command is used to update existing rows in a table. |
63 |
VALUES The VALUES command specifies the values of an INSERT INTO statement. |
64 |
WHERE The WHERE command filters a result set to include only records that fulfill a specified condition. |