{"id":155,"date":"2018-12-06T09:42:40","date_gmt":"2018-12-06T09:42:40","guid":{"rendered":"https:\/\/barkhane.com\/sql\/2018\/12\/06\/sql-keywords\/"},"modified":"2024-03-03T18:01:53","modified_gmt":"2024-03-03T18:01:53","slug":"sql-keywords","status":"publish","type":"post","link":"https:\/\/barkhane.com\/sql\/sql-keywords\/","title":{"rendered":"SQL Keywords"},"content":{"rendered":"<p>This SQL keywords reference contains the reserved words in SQL.<\/p>\n<table>\n<tbody>\n<tr>\n<th><strong>Keyword<\/strong><\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td><strong>ADD<\/strong><\/td>\n<td>Adds a column in an existing table<\/td>\n<\/tr>\n<tr>\n<td><strong>ADD CONSTRAINT<\/strong><\/td>\n<td>Adds a constraint after a table is already created<\/td>\n<\/tr>\n<tr>\n<td><strong>ALTER<\/strong><\/td>\n<td>Adds, deletes, or modifies columns in a table, or changes the data type of a column in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>ALTER COLUMN<\/strong><\/td>\n<td>Changes the data type of a column in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>ALTER TABLE<\/strong><\/td>\n<td>Adds, deletes, or modifies columns in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>ALL<\/strong><\/td>\n<td>Returns true if all of the subquery values meet the condition<\/td>\n<\/tr>\n<tr>\n<td><strong>AND<\/strong><\/td>\n<td>Only includes rows where both conditions is true<\/td>\n<\/tr>\n<tr>\n<td><strong>ANY<\/strong><\/td>\n<td>Returns true if any of the subquery values meet the condition<\/td>\n<\/tr>\n<tr>\n<td><strong>AS<\/strong><\/td>\n<td>Renames a column or table with an alias<\/td>\n<\/tr>\n<tr>\n<td><strong>ASC<\/strong><\/td>\n<td>Sorts the result set in ascending order<\/td>\n<\/tr>\n<tr>\n<td><strong>BACKUP DATABASE<\/strong><\/td>\n<td>Creates a back up of an existing database<\/td>\n<\/tr>\n<tr>\n<td><strong>BETWEEN<\/strong><\/td>\n<td>Selects values within a given range<\/td>\n<\/tr>\n<tr>\n<td><strong>CASE<\/strong><\/td>\n<td>Creates different outputs based on conditions<\/td>\n<\/tr>\n<tr>\n<td><strong>CHECK<\/strong><\/td>\n<td>A constraint that limits the value that can be placed in a column<\/td>\n<\/tr>\n<tr>\n<td><strong>COLUMN<\/strong><\/td>\n<td>Changes the data type of a column or deletes a column in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>CONSTRAINT<\/strong><\/td>\n<td>Adds or deletes a constraint<\/td>\n<\/tr>\n<tr>\n<td><strong>CREATE<\/strong><\/td>\n<td>Creates a database, index, view, table, or procedure<\/td>\n<\/tr>\n<tr>\n<td><strong>CREATE DATABASE<\/strong><\/td>\n<td>Creates a new SQL database<\/td>\n<\/tr>\n<tr>\n<td><strong>CREATE INDEX<\/strong><\/td>\n<td>Creates an index on a table (allows duplicate values)<\/td>\n<\/tr>\n<tr>\n<td><strong>CREATE OR REPLACE VIEW<\/strong><\/td>\n<td>Updates a view<\/td>\n<\/tr>\n<tr>\n<td><strong>CREATE TABLE<\/strong><\/td>\n<td>Creates a new table in the database<\/td>\n<\/tr>\n<tr>\n<td><strong>CREATE PROCEDURE<\/strong><\/td>\n<td>Creates a stored procedure<\/td>\n<\/tr>\n<tr>\n<td><strong>CREATE UNIQUE INDEX<\/strong><\/td>\n<td>Creates a unique index on a table (no duplicate values)<\/td>\n<\/tr>\n<tr>\n<td><strong>CREATE VIEW<\/strong><\/td>\n<td>Creates a view based on the result set of a SELECT statement<\/td>\n<\/tr>\n<tr>\n<td><strong>DATABASE<\/strong><\/td>\n<td>Creates or deletes an SQL database<\/td>\n<\/tr>\n<tr>\n<td><strong>DEFAULT<\/strong><\/td>\n<td>A constraint that provides a default value for a column<\/td>\n<\/tr>\n<tr>\n<td><strong>DELETE<\/strong><\/td>\n<td>Deletes rows from a table<\/td>\n<\/tr>\n<tr>\n<td><strong>DESC<\/strong><\/td>\n<td>Sorts the result set in descending order<\/td>\n<\/tr>\n<tr>\n<td><strong>DISTINCT<\/strong><\/td>\n<td>Selects only distinct (different) values<\/td>\n<\/tr>\n<tr>\n<td><strong>DROP<\/strong><\/td>\n<td>Deletes a column, constraint, database, index, table, or view<\/td>\n<\/tr>\n<tr>\n<td><strong>DROP COLUMN<\/strong><\/td>\n<td>Deletes a column in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>DROP CONSTRAINT<\/strong><\/td>\n<td>Deletes a UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint<\/td>\n<\/tr>\n<tr>\n<td><strong>DROP DATABASE<\/strong><\/td>\n<td>Deletes an existing SQL database<\/td>\n<\/tr>\n<tr>\n<td><strong>DROP DEFAULT<\/strong><\/td>\n<td>Deletes a DEFAULT constraint<\/td>\n<\/tr>\n<tr>\n<td><strong>DROP INDEX<\/strong><\/td>\n<td>Deletes an index in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>DROP TABLE<\/strong><\/td>\n<td>Deletes an existing table in the database<\/td>\n<\/tr>\n<tr>\n<td><strong>DROP VIEW<\/strong><\/td>\n<td>Deletes a view<\/td>\n<\/tr>\n<tr>\n<td><strong>EXEC<\/strong><\/td>\n<td>Executes a stored procedure<\/td>\n<\/tr>\n<tr>\n<td><strong>EXISTS<\/strong><\/td>\n<td>Tests for the existence of any record in a subquery<\/td>\n<\/tr>\n<tr>\n<td><strong>FOREIGN KEY<\/strong><\/td>\n<td>A constraint that is a key used to link two tables together<\/td>\n<\/tr>\n<tr>\n<td><strong>FROM<\/strong><\/td>\n<td>Specifies which table to select or delete data from<\/td>\n<\/tr>\n<tr>\n<td><strong>FULL OUTER JOIN<\/strong><\/td>\n<td>Returns all rows when there is a match in either left table or right table<\/td>\n<\/tr>\n<tr>\n<td><strong>GROUP BY<\/strong><\/td>\n<td>Groups the result set (used with aggregate functions: COUNT, MAX, MIN, SUM, AVG)<\/td>\n<\/tr>\n<tr>\n<td><strong>HAVING<\/strong><\/td>\n<td>Used instead of WHERE with aggregate functions<\/td>\n<\/tr>\n<tr>\n<td><strong>IN<\/strong><\/td>\n<td>Allows you to specify multiple values in a WHERE clause<\/td>\n<\/tr>\n<tr>\n<td><strong>INDEX<\/strong><\/td>\n<td>Creates or deletes an index in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>INNER JOIN<\/strong><\/td>\n<td>Returns rows that have matching values in both tables<\/td>\n<\/tr>\n<tr>\n<td><strong>INSERT INTO<\/strong><\/td>\n<td>Inserts new rows in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>INSERT INTO SELECT<\/strong><\/td>\n<td>Copies data from one table into another table<\/td>\n<\/tr>\n<tr>\n<td><strong>IS NULL<\/strong><\/td>\n<td>Tests for empty values<\/td>\n<\/tr>\n<tr>\n<td><strong>IS NOT NULL<\/strong><\/td>\n<td>Tests for non-empty values<\/td>\n<\/tr>\n<tr>\n<td><strong>JOIN<\/strong><\/td>\n<td>Joins tables<\/td>\n<\/tr>\n<tr>\n<td><strong>LEFT JOIN<\/strong><\/td>\n<td>Returns all rows from the left table, and the matching rows from the right table<\/td>\n<\/tr>\n<tr>\n<td><strong>LIKE<\/strong><\/td>\n<td>Searches for a specified pattern in a column<\/td>\n<\/tr>\n<tr>\n<td><strong>LIMIT<\/strong><\/td>\n<td>Specifies the number of records to return in the result set<\/td>\n<\/tr>\n<tr>\n<td><strong>NOT<\/strong><\/td>\n<td>Only includes rows where a condition is not true<\/td>\n<\/tr>\n<tr>\n<td><strong>NOT NULL<\/strong><\/td>\n<td>A constraint that enforces a column to not accept NULL values<\/td>\n<\/tr>\n<tr>\n<td><strong>OR<\/strong><\/td>\n<td>Includes rows where either condition is true<\/td>\n<\/tr>\n<tr>\n<td><strong>ORDER BY<\/strong><\/td>\n<td>Sorts the result set in ascending or descending order<\/td>\n<\/tr>\n<tr>\n<td><strong>OUTER JOIN<\/strong><\/td>\n<td>Returns all rows when there is a match in either left table or right table<\/td>\n<\/tr>\n<tr>\n<td><strong>PRIMARY KEY<\/strong><\/td>\n<td>A constraint that uniquely identifies each record in a database table<\/td>\n<\/tr>\n<tr>\n<td><strong>PROCEDURE<\/strong><\/td>\n<td>A stored procedure<\/td>\n<\/tr>\n<tr>\n<td><strong>RIGHT JOIN<\/strong><\/td>\n<td>Returns all rows from the right table, and the matching rows from the left table<\/td>\n<\/tr>\n<tr>\n<td><strong>ROWNUM<\/strong><\/td>\n<td>Specifies the number of records to return in the result set<\/td>\n<\/tr>\n<tr>\n<td><strong>SELECT<\/strong><\/td>\n<td>Selects data from a database<\/td>\n<\/tr>\n<tr>\n<td><strong>SELECT DISTINCT<\/strong><\/td>\n<td>Selects only distinct (different) values<\/td>\n<\/tr>\n<tr>\n<td><strong>SELECT INTO<\/strong><\/td>\n<td>Copies data from one table into a new table<\/td>\n<\/tr>\n<tr>\n<td><strong>SELECT TOP<\/strong><\/td>\n<td>Specifies the number of records to return in the result set<\/td>\n<\/tr>\n<tr>\n<td><strong>SET<\/strong><\/td>\n<td>Specifies which columns and values that should be updated in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>TABLE<\/strong><\/td>\n<td>Creates a table, or adds, deletes, or modifies columns in a table, or deletes a table or data inside a table<\/td>\n<\/tr>\n<tr>\n<td><strong>TOP<\/strong><\/td>\n<td>Specifies the number of records to return in the result set<\/td>\n<\/tr>\n<tr>\n<td><strong>TRUNCATE TABLE<\/strong><\/td>\n<td>Deletes the data inside a table, but not the table itself<\/td>\n<\/tr>\n<tr>\n<td><strong>UNION<\/strong><\/td>\n<td>Combines the result set of two or more SELECT statements (only distinct values)<\/td>\n<\/tr>\n<tr>\n<td><strong>UNION ALL<\/strong><\/td>\n<td>Combines the result set of two or more SELECT statements (allows duplicate values)<\/td>\n<\/tr>\n<tr>\n<td><strong>UNIQUE<\/strong><\/td>\n<td>A constraint that ensures that all values in a column are unique<\/td>\n<\/tr>\n<tr>\n<td><strong>UPDATE<\/strong><\/td>\n<td>Updates existing rows in a table<\/td>\n<\/tr>\n<tr>\n<td><strong>VALUES<\/strong><\/td>\n<td>Specifies the values of an INSERT INTO statement<\/td>\n<\/tr>\n<tr>\n<td><strong>VIEW<\/strong><\/td>\n<td>Creates, updates, or deletes a view<\/td>\n<\/tr>\n<tr>\n<td><strong>WHERE<\/strong><\/td>\n<td>Filters a result set to include only records that fulfill a specified condition<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>This SQL keywords reference contains the reserved words in SQL. Keyword Description ADD Adds a column in an existing table [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-sql"],"_links":{"self":[{"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":0,"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"wp:attachment":[{"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/barkhane.com\/sql\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}