Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. SQL Dictionary

SQL Dictionary

Beginners Guide: Overview, Features, and Learning PathAn overview of SQL, features and trade-offs, key feature explanations, and a recommended learning order for this dictionary.
[Setup] SQL Execution EnvironmentSteps for setting up an environment to execute SQL.
Creating and Running .sql FilesHow to write .sql files and execute them in each database.
SELECTBasic syntax for retrieving rows and columns.
WHEREFiltering rows by condition.
AND / OR / NOTLogical operators for combining multiple conditions.
LIKEPattern-matching search.
IS NULL / IS NOT NULLChecking for NULL values.
ORDER BYSorting query results.
LIMIT / OFFSETSpecifying the number of rows to retrieve and the starting position.
INSERTInserting rows into a table.
UPDATEUpdating existing rows.
DELETEDeleting rows from a table.
TRUNCATEQuickly deleting all rows from a table.
COUNTCounting the number of rows or records.
SUM / AVGCalculating sums and averages.
MAX / MINFinding maximum and minimum values.
GROUP BY / HAVINGGrouping data and filtering aggregated results.
INNER JOINJoining rows that match in both tables.
LEFT JOIN / RIGHT JOINJoining while keeping all rows from one table.
FULL OUTER JOINJoining while keeping all rows from both tables.
CROSS JOINA Cartesian product join that generates all combinations.
SELF JOINJoining a table with itself.
Subqueries (Scalar and Row)Subqueries that return a single value or row.
IN / EXISTSChecking for matches against subquery results.
ALL / ANYComparing against all or any values returned by a subquery.
Correlated SubqueriesSubqueries that reference the outer query.
UNION / UNION ALLVertically combining results from multiple SELECT statements.
INTERSECT / EXCEPTExtracting common rows or the difference between result sets.
OVER / PARTITION BYBasic syntax for window functions.
ROW_NUMBER / RANK / DENSE_RANKAssigning ranks and sequential numbers to rows.
LAG / LEADReferencing values from preceding or following rows.
SUM / AVG (Window)Calculating running totals and moving averages.
CONCAT / LENGTHConcatenating strings and getting their length.
SUBSTRING / TRIMExtracting substrings and trimming leading/trailing whitespace.
UPPER / LOWER / REPLACEConverting case and replacing strings.
LIKE (Function) / POSITIONSearching for character positions and checking pattern matches.
ROUND / CEIL / FLOORRounding numeric values.
ABS / MOD / POWERAbsolute values, modulo, and exponentiation.
CURRENT_DATE / NOWGetting the current date and time.
DATE_ADD / DATEDIFFAdding/subtracting dates and calculating date differences.
EXTRACT / FORMATExtracting year, month, day, etc. from a date and formatting it.
CASESwitching values based on conditional logic.
COALESCE / NULLIFReplacing NULL with another value.
CAST / CONVERTConverting data types.
CREATE TABLECreating a table.
Constraints (NOT NULL / UNIQUE / DEFAULT)Basic column-level constraints.
PRIMARY KEY / FOREIGN KEYPrimary key and foreign key constraints.
ALTER TABLEModifies the definition of an existing table.
CREATE INDEXCreates or drops an index on a table.
VIEWCreates, updates, or drops a view.
WITH (CTE)Improves query readability using Common Table Expressions.
TRANSACTION / COMMIT / ROLLBACKBegins, commits, or rolls back a transaction.
GRANT / REVOKEGrants or revokes privileges for a user.
EXPLAINDisplays the execution plan of a query.
AUTO_INCREMENT / SERIAL / IDENTITYA feature that automatically assigns sequential numbers to a primary key column; MySQL uses AUTO_INCREMENT, PostgreSQL uses SERIAL, SQL Server uses IDENTITY.
BETWEEN ... AND ...An operator that specifies an inclusive range condition; usable with numbers, dates, and strings.
Comments -- / # / /* */Three comment types: single-line (--), MySQL-only single-line (#), and block comments (/* */).
Data TypesAn overview of major SQL data types including numeric, string, date, and boolean types, with notes on differences across DBMSes.
GROUP_CONCAT / STRING_AGGAggregate functions that concatenate multiple row values within a group into a single string; MySQL uses GROUP_CONCAT, PostgreSQL and SQL Server use STRING_AGG.
IF() / IIF() FunctionsShortcut functions that return different values based on a condition; MySQL uses IF(), SQL Server uses IIF().
INSERT INTO ... SELECTSyntax for bulk-inserting the results of a SELECT statement into another table, used for copying data between tables or filtered extraction.