Skip to main content
CodeSpeedTest
Languages
Start TypingJump into a test — pick any languageAdaptive TrainingUnlock chars as you master them — home row to !@#$%Practice DrillsFocused sessions targeting weak spotsDaily ChallengesNew coding challenges every dayRace ModeCompete against others in real timeAI OpponentRace against an AI at your WPM level
LeaderboardGlobal rankings for every languageCertificatesEarn verifiable Bronze / Silver / Gold certsActivityDaily streaks & historical analyticsProfileYour stats, badges & achievements
Browse Languages500+ languages with real code examplesBlogTips, guides & deep divesFAQCommon questions answeredGetting StartedNew to CodeSpeedTest?AboutOur story & mission
Pricing
Start Typing
Tools/SQL Commands

SQL Commands & Syntax Reference

100+ SQL commands organized into DDL, DML, DCL, TCL, clauses, JOINs, and aggregate functions — each with a one-line description.

DDL — Data Definition Language

Define and modify database schema structure.

CommandDescription
CREATE TABLECreate a new table
CREATE DATABASECreate a new database
CREATE INDEXCreate an index on a column
CREATE VIEWCreate a virtual table from a query
ALTER TABLEModify an existing table structure
ALTER COLUMNChange column type or constraints
DROP TABLEDelete a table and all its data
DROP DATABASEDelete an entire database
DROP INDEXRemove an index
TRUNCATE TABLERemove all rows without logging individual deletes
RENAME TABLERename a table
ADD CONSTRAINTAdd a constraint to an existing column

DML — Data Manipulation Language

Read and modify the data inside tables.

CommandDescription
SELECTRetrieve rows from one or more tables
SELECT DISTINCTReturn unique values only
INSERT INTOAdd new rows to a table
INSERT INTO ... SELECTInsert rows from a query result
UPDATEModify existing rows
DELETE FROMRemove rows matching a condition
MERGEUpsert — insert or update based on a match
REPLACE INTODelete + re-insert (MySQL)
UPSERTInsert or update on conflict (PostgreSQL)

DCL — Data Control Language

Manage user permissions and access rights.

CommandDescription
GRANTGive user permission on a database object
REVOKERemove a previously granted permission
DENYExplicitly block a permission (SQL Server)

TCL — Transaction Control Language

Control the boundaries of database transactions.

CommandDescription
BEGINStart a transaction block
COMMITSave all changes in the current transaction
ROLLBACKUndo all changes since last commit
SAVEPOINTSet a named point to roll back to
RELEASE SAVEPOINTRemove a savepoint
SET TRANSACTIONConfigure isolation level

Clauses & Operators

Shape and filter query results.

CommandDescription
WHEREFilter rows by condition
AND / OR / NOTCombine boolean conditions
ORDER BYSort results ascending or descending
GROUP BYAggregate rows sharing a column value
HAVINGFilter groups after GROUP BY
LIMIT / TOPRestrict the number of returned rows
OFFSETSkip N rows (pagination)
LIKEPattern match with wildcards (% and _)
INMatch against a list of values
BETWEENMatch a range of values
IS NULL / IS NOT NULLCheck for null values
EXISTSTrue if subquery returns any row
CASE WHENConditional expression
COALESCEReturn first non-null value in list
NULLIFReturn null if two values are equal

JOINs

Combine rows from multiple tables.

CommandDescription
INNER JOINReturn rows with matching keys in both tables
LEFT JOINAll left rows + matched right rows
RIGHT JOINAll right rows + matched left rows
FULL OUTER JOINAll rows from both tables
CROSS JOINCartesian product of both tables
SELF JOINJoin a table with itself

Aggregate Functions

Compute summary values over groups of rows.

CommandDescription
COUNT()Number of matching rows
SUM()Total of a numeric column
AVG()Average of a numeric column
MIN()Smallest value in a column
MAX()Largest value in a column
GROUP_CONCAT()Concatenate values in a group

Practice typing these in CodeSpeedTest →

SQL fluency comes from typing real queries until your fingers know the patterns. Start with SELECT and work your way through JOINs and window functions.

Start typing SQL →Browse all languages
CodeSpeedTest

Improve your coding speed, code accuracy, and programming syntax WPM with practice sessions across 500+ programming languages.

Quick Links

HomeAboutFeaturesGetting StartedLanguages

Resources

Pro ⚡ PricingCertifyFAQBlogContactLeaderboardRaceChallengesFree ToolsWPM CalculatorPrivacy PolicyTerms of Service

Connect

CodeSpeedTest on GitHubCodeSpeedTest on TwitterEmail CodeSpeedTest

© 2026 CodeSpeedTest. All rights reserved.