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.
The ADD command is used to add a column in an existing table
he ADD CONSTRAINT command is used to create a constraint after a table is already created.
The ALL command returns true if all of the subquery values meet the condition.
The ALTER COLUMN command is used to change the data type of a column in a table.
The ALTER TABLE command adds, deletes, or modifies columns in a table.
The AND command is used with WHERE to only include rows where both conditions is true.
The ANY command returns true if any of the subquery values meet the condition.
The AS command is used to rename a column or table with an alias.
The ASC command is used to sort the data returned in ascending order.
The BACKUP DATABASE command is used in SQL Server to create a full back up of an existing SQL database.
The BETWEEN command is used to select values within a given range. The values can be numbers, text, or dates.
The CASE command is used is to create different output based on conditions
The CHECK constraint limits the value that can be placed in a column.
The CREATE DATABASE command is used is to create a new SQL database.
The CREATE INDEX command is used to create indexes in tables (allows duplicate values).
CREATE OR REPLACE VIEW
The CREATE OR REPLACE VIEW command updates a view.
The CREATE PROCEDURE command is used to create a stored procedure.
The CREATE TABLE command creates a new table in the database.
CREATE UNIQUE INDEX
The CREATE UNIQUE INDEX command creates a unique index on a table (no duplicate values allowed)
The CREATE VIEW command creates a view.
The DEFAULT constraint provides a default value for a column.
The DELETE command is used to delete existing records in a table.
The DESC command is used to sort the data returned in descending order.
The DROP COLUMN command is used to delete a column in an existing table.
The DROP CONSTRAINT command is used to delete a UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint.
The DROP DATABASE command is used to delete an existing SQL database.
The DROP DEFAULT command is used to delete a DEFAULT constraint.
The DROP INDEX command is used to delete an index in a table.
The DROP TABLE command deletes a table in the database.
The DROP VIEW command deletes a view.
The EXEC command is used to execute a stored procedure.
The EXISTS command tests for the existence of any record in a subquery, and returns true if the subquery returns one or more records.
The FOREIGN KEY constraint is a key used to link two tables together.
The FROM command is used to specify which table to select or delete data from.
FULL OUTER JOIN
The FULL OUTER JOIN command returns all rows when there is a match in either left table or right table.
The GROUP BY command is used to group the result set (used with aggregate functions: COUNT, MAX, MIN, SUM, AVG).
The HAVING command is used instead of WHERE with aggregate functions.
The IN command allows you to specify multiple values in a WHERE clause.
The INNER JOIN command returns rows that have matching values in both tables.
The INSERT INTO command is used to insert new rows in a table.
INSERT INTO SELECT
The INSERT INTO SELECT command copies data from one table and inserts it into another table.
IS NOT NULL
The IS NOT NULL command is used to test for non-empty values (NOT NULL values).
The IS NULL command is used to test for empty values (NULL values).
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.
The LIKE command is used in a WHERE clause to search for a specified pattern in a column.
The LIMIT command is used to specify the number of records to return.
The NOT command is used with WHERE to only include rows where a condition is not true.
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.
The OR command is used with WHERE to include rows where either condition is true.
The ORDER BY command is used to sort the result set in ascending or descending order.
The PRIMARY KEY constraint uniquely identifies each record in a table.
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.
The SELECT command is used to select data from a database. The data returned is stored in a result table, called the result set.
The SELECT DISTINCT command returns only distinct (different) values in the result set.
The SELECT INTO command copies data from one table and inserts it into a new table.
The LIMIT, SELECT TOP used to specify the number of records to return.
The SET command is used with UPDATE to specify which columns and values that should be updated in a table.
The TRUNCATE TABLE command deletes the data inside a table, but not the table itself.
The UNION command combines the result set of two or more SELECT statements (only distinct values)
The UNION ALL command combines the result set of two or more SELECT statements (allows duplicate values).
The UNIQUE constraint ensures that all values in a column are unique.
The UPDATE command is used to update existing rows in a table.
The VALUES command specifies the values of an INSERT INTO statement.
The WHERE command filters a result set to include only records that fulfill a specified condition.