Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
SQL
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Syntax== {{Main|SQL syntax}} {{Image frame|content= <math> \underbrace{\left. \begin{array}{rl} \textstyle\mathtt{UPDATE~clause\mathtt{:}} & \{ \mathtt{UPDATE\ \overbrace{\mathtt{countries}}^\mathtt{table}} \} \\ \textstyle\mathtt{SET~clause:} & \{ {\mathtt{SET\ \overbrace{\mathtt{population}}^\mathtt{column} =~} \overbrace{\mathtt{{population} + \underbrace{\mathtt{1}}_\mathtt{literal}}}^\mathtt{expression}} \} \\ \textstyle\mathtt{WHERE~clause:} & \{ {\mathtt{WHERE\ \underbrace{\overbrace{\mathtt{name}}^\mathtt{column} \mathtt{=} \overbrace{{\overbrace{\mathtt{'USA'}}^\mathtt{literal}}}^\mathtt{expression}}_\mathtt{predicate}}\}{\texttt{;}}} \end{array} \right \}{\textstyle\texttt{statement}}}_{\textstyle\mathtt{SQL~query}} </math> |width=500|caption=A chart showing several of the SQL language elements comprising a single statement}} The SQL language is subdivided into several language elements, including: * ''Clauses'', which are constituent components of statements and queries. (In some cases, these are optional.)<ref name="ANSI/ISO/IEC" /> * ''Expressions'', which can produce either [[scalar (computing)|scalar]] values, or [[table (database)|tables]] consisting of [[column (database)|columns]] and [[row (database)|rows]] of data * ''Predicates'', which specify conditions that can be evaluated to SQL [[Three-valued logic|three-valued logic (3VL)]] (true/false/unknown) or [[Boolean logic|Boolean]] [[truth value]]s and are used to limit the effects of statements and queries, or to change program flow. * ''Queries'', which retrieve the data based on specific criteria. This is an important element of ''SQL''. * ''Statements'', which may have a persistent effect on schemata and data, or may control [[Database transaction|transactions]], program flow, connections, sessions, or diagnostics. ** SQL statements also include the [[semicolon]] (";") statement terminator. Though not required on every platform, it is defined as a standard part of the SQL grammar. * ''[[Whitespace (computer science)|Insignificant whitespace]]'' is generally ignored in SQL statements and queries, making it easier to format SQL code for readability.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)