ISO/IEC 9075-1:2023
(Main)Information technology — Database languages SQL — Part 1: Framework (SQL/Framework)
Information technology — Database languages SQL — Part 1: Framework (SQL/Framework)
Technologies de l'information — Langages de base de données SQL — Partie 1: Charpente (SQL/Charpente)
General Information
Relations
Standards Content (Sample)
INTERNATIONAL ISO/IEC
STANDARD 9075-1
Sixth edition
2023-06
Information technology — Database
languages — SQL —
Part 1:
Framework (SQL/Framework)
Technologies de l'information — Langages de base de données —
SQL —
Partie 1: Charpente (SQL/Charpente)
Reference number
© ISO/IEC 2023
© ISO/IEC 2023
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii
© ISO/IEC 2023 – All rights reserved
ISO/IEC9075-1:2023(E)
Contents Page
Foreword.x
Introduction.xii
1 Scope.1
2 Normativereferences.2
3 Termsanddefinitions.3
3.1 DefinitionstakenfromISO/IEC10646:2020.3
3.2 Definitionsprovidedinthisdocument.3
4 Concepts.6
4.1 WhatisSQL?.6
4.2 Useofterms.6
4.3 Caveat.7
4.4 SQL-environmentsandtheircomponents.7
4.4.1 SQL-environments.7
4.4.2 SQL-agents.7
4.4.3 SQL-implementations.7
4.4.3.1 IntroductiontoSQL-implementations.7
4.4.3.2 SQL-clients.7
4.4.3.3 SQL-servers.8
4.4.4 SQL-clientmodules.8
4.4.5 User identifiers.8
4.4.6 Roles.8
4.4.7 Usermappingconcepts.8
4.4.8 Routinemappingconcepts.8
4.4.9 Catalogsandschemas.9
4.4.9.1 Catalogs.9
4.4.9.2 SQL-schemas.9
4.4.9.3 InformationSchema.9
4.4.9.4 DefinitionSchema.9
4.4.10 Foreignserversanddescriptors.9
4.4.11 Foreign-datawrappersanddescriptors.9
4.4.12 SQL-data.10
4.5 Tables.10
4.6 SQLdatatypes.11
4.6.1 Generaldatatypeinformation.11
4.6.2 Nullvalue.11
4.6.3 Predefinedtypes.11
4.6.3.1 Numerictypes.11
4.6.3.2 Characterstringtypes.12
©ISO/IEC2023–Allrightsreserved iii
ISO/IEC9075-1:2023(E)
4.6.3.3 Binarystringtypes.12
4.6.3.4 Booleantype.12
4.6.3.5 Datetime types.12
4.6.3.6 Interval types.12
4.6.3.7 XMLtype.12
4.6.3.8 JSONtype.13
4.6.4 Constructedatomictypes:referencetypes.13
4.6.5 Constructedcompositetypes.13
4.6.5.1 Collection types.13
4.6.5.2 Row types.13
4.7 Sitesandoperationsonsites.13
4.7.1 Sites.13
4.7.2 Assignment.13
4.7.3 Nullability.14
4.8 SQL-schema objects.14
4.8.1 GeneralSQL-schemaobjectinformation.14
4.8.2 Descriptorsrelatingtocharactersets.14
4.8.2.1 Charactersets.14
4.8.2.2 Collations.15
4.8.2.3 Transliterations.15
4.8.3 Domainsandtheircomponents.15
4.8.3.1 Domains.15
4.8.3.2 Domain constraints.15
4.8.4 User-defined types.15
4.8.4.1 Introductiontouser-definedtypes.15
4.8.4.2 Distinct types.15
4.8.4.3 Structuredtypes.16
4.8.5 Basetablesandtheircomponents.16
4.8.5.1 Base tables.16
4.8.5.2 Columns.16
4.8.5.3 Periods.16
4.8.5.4 Table constraints.16
4.8.5.5 Triggers.17
4.8.6 View definitions.17
4.8.7 Assertions.17
4.8.8 SQL-servermodules(definedinISO/IEC9075-4).17
4.8.9 Schema routines.17
4.8.10 Sequence generators.17
4.8.11 Privileges.17
4.9 Integrityconstraintsandconstraintchecking.18
4.9.1 Constraint checking.18
4.9.2 Determinismandconstraints.18
4.9.3 Consistencywhendeletingandupdatingmultiplerows.19
4.10 CommunicationbetweenanSQL-agentandanSQL-server.19
4.10.1 Host languages.19
4.10.2 Sourcelanguagecharacterset.20
4.10.3 Parameterpassinganddatatypecorrespondences.20
iv ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-1:2023(E)
4.10.3.1 Generalparameterpassinganddatatypecorrespondenceinformation.20
4.10.3.2 Datatypecorrespondences.20
4.10.3.3 Locators.21
4.10.3.4 Statusparameters.21
4.10.3.5 Indicatorparameters.21
4.10.4 Descriptor areas.21
4.10.5 Diagnosticinformation.21
4.10.6 SQL-transactions.21
4.11 Modules.22
4.12 Routines.22
4.12.1 Generalroutineinformation.22
4.12.2 Typepreservingfunctions.23
4.13 SQL-statements.23
4.13.1 ClassesofSQL-statements.23
4.13.2 SQL-statementsclassifiedbyfunction.24
5 PartsoftheISO/IEC9075series.25
5.1 Overview.25
5.2 ISO/IEC9075-1:Framework(SQL/Framework).25
5.3 ISO/IEC9075-2Foundation(SQL/Foundation).26
5.3.1 IntroductiontoISO/IEC9075-2Foundation(SQL/Foundation).26
5.3.2 Bindingsmethods.26
5.3.2.1 Introductiontobindingsmethods.26
5.3.2.2 Embedded SQL.26
5.3.2.3 DynamicSQL.26
5.3.2.4 DirectinvocationofSQL.26
5.3.3 SQL-statementsspecifiedinISO/IEC9075-2.26
5.4 ISO/IEC9075-3:Call-LevelInterface(SQL/CLI).27
5.5 ISO/IEC9075-4:PersistentStoredModules(SQL/PSM).28
5.5.1 IntroductiontoSQL/PSM.28
5.5.2 SQL-statementsspecifiedinISO/IEC9075-4.28
5.6 ISO/IEC9075-9:ManagementofExternalData(SQL/MED).28
5.7 ISO/IEC9075-10:ObjectLanguageBindings(SQL/OLB).28
5.8 ISO/IEC9075-11:InformationandDefinitionSchemas(SQL/Schemata).28
5.9 ISO/IEC9075-13:SQLRoutinesandTypesUsingtheJava™ProgrammingLanguage(SQL/JRT).29
5.10 ISO/IEC9075-14:XML-RelatedSpecifications(SQL/XML).29
5.11 ISO/IEC9075-15:MultidimensionalArrays(SQL/MDA).29
5.12 ISO/IEC9075-16:PropertyGraphQueries(SQL/PGQ).29
6 NotationandconventionsusedinotherpartsoftheISO/IEC9075series.31
6.1 NotationtakenfromISO/IEC10646:2020.31
6.2 NotationprovidedintheISO/IEC9075series.31
6.3 Conventions.32
6.3.1 Specificationofsyntacticelements.32
6.3.2 SpecificationoftheInformationandDefinitionSchemata.33
6.3.3 Useofterms.33
6.3.3.1 Syntactic containment.33
6.3.3.2 Termsdenotingrulerequirements.34
6.3.3.3 Ruleevaluationorder.35
©ISO/IEC2023–Allrightsreserved v
ISO/IEC9075-1:2023(E)
6.3.3.4 Conditional rules.36
6.3.3.5 Syntacticsubstitution.36
6.3.3.6 Otherterms.37
6.3.3.7 Exceptions.37
6.3.4 Descriptors.38
6.3.5 Applicationoftechnicalcorrigenda.39
6.3.6 RelationshipsofpartswithintheISO/IEC9075series.39
6.3.6.1 Introductiontorelationshipsamongparts.39
6.3.6.2 Clauses1,2,and3.40
6.3.6.3 NewandmodifiedClausesandSubclauses.40
6.3.6.4 NewandmodifiedTables,Figures,Examples,andEquations.41
6.3.6.5 Functions.41
6.3.6.6 NewandmodifiedFormatItems.41
6.3.6.7 Newandmodifiedparagraphsandrules.42
6.3.6.8 ModifiedSubclauseSignatures.44
6.3.6.9 NewandmodifiedAnnexes.44
6.3.6.10 Orderofmerginganincrementalpart.45
6.3.7 Subclausesusedassubroutines.45
6.3.8 Document typography.46
6.3.9 Index typography.46
6.3.10 FeatureIDandFeatureName.46
6.3.11 Implementation-definedandimplementation-dependent.47
6.4 Digital artifacts.48
6.4.1 Introductiontodigitalartifacts.48
6.4.2 Languagesyntax.48
6.4.3 Conditioncodes.48
6.4.4 Feature codes.49
6.4.5 Implementation-defined items.50
6.4.6 Implementation-dependentitems.50
6.4.7 Header files.51
6.4.8 Adainterface.51
6.4.9 Schemadefinition.51
6.4.10 XMLSchemata.52
7 AnnexestothepartsoftheISO/IEC9075series.53
7.1 Annexesareinformative.53
7.2 SQLconformancesummary.53
7.3 Implementation-defined elements.53
7.4 Implementation-dependent elements.53
7.5 Deprecated features.53
7.6 Incompatibilitieswithpreviousversions.53
7.7 SQLfeaturetaxonomy.53
7.8 DefectReports.53
8 Statuscodes.54
8.1 SQLSTATE.54
9 Conformance.55
9.1 Kindsofconformanceclaims.55
vi ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-1:2023(E)
9.2 Minimum conformance.55
9.3 Conformancetoparts.55
9.4 Conformancetofeatures.55
9.5 Extensionsandoptions.56
9.6 SQLflagger.56
9.7 Claimsofconformance.57
9.7.1 Howconformanceisclaimed.57
9.7.2 RequirementsforSQLapplications.58
9.7.3 RequirementsforSQL-implementations.58
AnnexA(informative) SQLconformancesummary.59
AnnexB(informative) Implementation-definedelements.60
AnnexC(informative) Implementation-dependent elements.63
AnnexD(informative) SQLoptionalfeaturetaxonomy.65
AnnexE(informative) Deprecatedfeatures.66
AnnexF(informative) IncompatibilitieswithISO/IEC9075:2016.67
AnnexG(informative) DefectReportsnotaddressedinthiseditionofthisdocument.68
AnnexH(informative) MaintenanceandinterpretationofSQL.69
AnnexI(informative) Supportfortheuseofinter-documentlinksintheISO/IEC9075series.70
Bibliography.71
Index.72
©ISO/IEC2023–Allrightsreserved vii
ISO/IEC9075-1:2023(E)
Tables
Table Page
1 Relationshipsbetweenexternally-invokedandSQL-invokedroutines.22
2 SymbolsusedinBNF.31
3 Examplesandexplanationsofparagraphandrulemergers.43
4 SQLSTATEclassandsubclasscodes.54
A.1 FeaturedefinitionsoutsideofConformanceRules.59
D.1 Featuretaxonomyforoptionalfeatures.65
I.1 Filename conventions.70
viii ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-1:2023(E)
Figures
Figure Page
1 RelationshipsbetweenthepartsoftheISO/IEC9075series.40
©ISO/IEC2023–Allrightsreserved ix
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are
members of ISO or IEC participate in the development of International Standards through technical
committees established by the respective organization to deal with particular fields of technical activity.
ISO and IEC technical committees collaborate in fields of mutual interest. Other international
organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the
work.
The procedures used to develop this document and those intended for its further maintenance are
described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the
different types of document should be noted. This document was drafted in accordance with the editorial
rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives or
www.iec.ch/members_experts/refdocs).
ISO and IEC draw attention to the possibility that the implementation of this document may involve the
use of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any
claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC have
not received notice of (a) patent(s) which may be required to implement this document. However,
implementers are cautioned that this may not represent the latest information, which may be obtained
from the patent database available at www.iso.org/patents and https://patents.iec.ch. ISO and IEC shall
not be held responsible for identifying any or all such patent rights.
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and
expressions related to conformity assessment, as well as information about ISO's adherence to the World
Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT) see
www.iso.org/iso/foreword.html. In the IEC, see www.iec.ch/understanding-standards.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 32, Data management and interchange.
This sixth edition cancels and replaces the fifth edition (ISO/IEC 9075-1:2016), which has been
technically revised. It also incorporates the Technical Corrigendum ISO/IEC 9075-1:2016/Cor.1:2022.
The main changes are as follows:
— addition and refinement of the terms and concepts to support new data types required by
incremental parts;
— clarification and correction of the merge instructions for Technical Corrigenda and incremental
parts;
— improve the presentation and accuracy of the summaries of implementation-defined and
implementation-dependent aspects of this document;
— introduction of several digital artifacts;
— alignment with updated ISO house style and other guidelines for creating standards.
x © ISO/IEC 2023 – All rights reserved
This sixth edition of ISO/IEC 9075-1 is designed to be used in conjunction with the following editions of
other parts of the ISO/IEC 9075 series, all published 2023:
— ISO/IEC 9075-2, sixth edition;
— ISO/IEC 9075-3, sixth edition;
— ISO/IEC 9075-4, seventh edition;
— ISO/IEC 9075-9, fifth edition;
— ISO/IEC 9075-10, fifth edition;
— ISO/IEC 9075-11, fifth edition;
— ISO/IEC 9075-13, fifth edition;
— ISO/IEC 9075-14, sixth edition;
— ISO/IEC 9075-15, second edition;
— ISO/IEC 9075-16, first edition.
A list of all parts in the ISO/IEC 9075 series can be found on the ISO and IEC websites.
Any feedback or questions on this document should be directed to the user’s national standards body. A
complete listing of these bodies can be found at www.iso.org/members.html and www.iec.ch/national-
committees.
© ISO/IEC 2023 – All rights reserved xi
ISO/IEC9075-1:2023(E)
Introduction
Theorganizationofthisdocumentisasfollows:
1) Clause1,“Scope”,specifiesthescopeofthisdocument.
2) Clause2,“Normativereferences”,identifiesadditionalstandardsthat,throughreferenceinthis
document,constituteprovisionsoftheISO/IEC9075series.
3) Clause3,“Termsanddefinitions”,definestermsanddefinitionsusedinthisdocumentandinother
partsoftheISO/IEC9075series.
4) Clause4,“Concepts”,describestheconceptsusedintheISO/IEC9075series.
5) Clause5,“PartsoftheISO/IEC9075series”,summarizesthecontentofeachofthepartsofthe
ISO/IEC9075series,intermsoftheconceptsdescribedinClause4,“Concepts”.
6) Clause6,“NotationandconventionsusedinotherpartsoftheISO/IEC9075series”,definesnotation
andconventionsusedinotherpartsoftheISO/IEC9075series.
7) Clause7,“AnnexestothepartsoftheISO/IEC9075series”,describesthecontentofannexesof
otherpartsoftheISO/IEC9075series.
8) Clause8,“Statuscodes”,definesvaluesthatidentifythestatusoftheexecutionofSQL-statements
andthemechanismsbywhichthosevaluesarereturned.
9) Clause9,“Conformance”,specifiesrequirementsthatapplytoclaimsofconformancetoallorsome
ofthepartsoftheISO/IEC9075series.
10) AnnexA,“SQLconformancesummary”,isaninformativeAnnex.Itsummarizestheconformance
requirementsoftheSQLlanguage.
11) AnnexB,“Implementation-definedelements”,isaninformativeAnnex.Itliststhosefeaturesfor
whichthebodyofthisdocumentstatesthatthesyntax,themeaning,thereturnedresults,theeffect
onSQL-dataand/orschemas,orotheraspectispartlyorwhollyimplementation-defined.
12) AnnexC,“Implementation-dependentelements”,isaninformativeAnnex.Itliststhosefeaturesfor
whichthebodyofthisdocumentstatesthatthesyntax,themeaning,thereturnedresults,theeffect
onSQL-dataand/orschemas,orotheraspectispartlyorwhollyimplementation-dependent.
13) AnnexD,“SQLoptionalfeaturetaxonomy”,isaninformativeAnnex.ItidentifiesfeaturesoftheSQL
languagespecifiedinthisdocumentbyanidentifierandashortdescriptivename.Thistaxonomy
isusedtospecifyconformance.
14) AnnexE,“Deprecatedfeatures”,isaninformativeAnnex.Itlistsfeaturesthattheresponsible
TechnicalCommitteeintendsnottoincludeinafutureeditionofthisdocument.
15) AnnexF,“IncompatibilitieswithISO/IEC9075:2016”,isaninformativeAnnex.Itlistsincompatibil-
itieswiththepreviouseditionofthisdocument.
16) AnnexG,“DefectReportsnotaddressedinthiseditionofthisdocument”,isaninformativeAnnex.
ItdescribestheDefectReportsthatwereknownatthetimeofpublicationofthisdocument.Each
oftheseproblemsisaproblemcarriedforwardfromthepreviouseditionofthisdocument.Nonew
problemshavebeencreatedinthedraftingofthiseditionofthisdocument.
17) AnnexH,“MaintenanceandinterpretationofSQL”,isaninformativeAnnex.Itdescribestheformal
proceduresformaintenanceandinterpretationoftheISO/IEC9075series.
xii ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-1:2023(E)
18) AnnexI,“Supportfortheuseofinter-documentlinksintheISO/IEC9075series”,isaninformative
Annex.ItdescribesconventionsthatusersoftheISO/IEC9075seriesuseinordertomaximizethe
facilitiesprovidedinthepartsoftheISO/IEC9075series.
©ISO/IEC2023–Allrightsreserved xiii
INTERNATIONAL STANDARD ISO/IEC 9075-1:2023(E)
Informationtechnology—DatabaselanguageSQL—
Part1:
Framework(SQL/Framework)
1 Scope
ThisdocumentdescribestheconceptualframeworkusedinotherpartsoftheISO/IEC9075seriesto
specifythegrammarofSQLandtheresultofprocessingstatementsinthatlanguagebyanSQL-imple-
mentation.
ThisdocumentalsodefinestermsandnotationusedintheotherpartsoftheISO/IEC9075series.
©ISO/IEC2023–Allrightsreserved 1
ISO/IEC9075-1:2023(E)
2 Normativereferences
Thefollowingdocumentsarereferredtointhetextinsuchawaythatsomeoralloftheircontentconsti-
tutesrequirementsofthisdocument.Fordatedreferences,onlytheeditioncitedapplies.Forundated
references,thelatesteditionofthereferenceddocument(includinganyamendments)applies.
ISO/IEC646,Informationtechnology—ISO7-bitcodedcharactersetforinformationinterchange
ISO/IEC9075-2,Informationtechnology—Databaselanguages—SQL—Part2:Foundation
(SQL/Foundation)
ISO/IEC9075-3,Informationtechnology—Databaselanguages—SQL—Part3:Call-LevelInterface
(SQL/CLI)
ISO/IEC9075-4,Informationtechnology—Databaselanguages—SQL—Part4:PersistentStored
Modules(SQL/PSM)
ISO/IEC9075-9,Informationtechnology—Databaselanguages—SQL—Part9:Managementof
ExternalData(SQL/MED)
ISO/IEC9075-10,Informationtechnology—Databaselanguages—SQL—Part10:ObjectLanguage
Bindings(SQL/OLB)
ISO/IEC9075-11,Informationtechnology—Databaselanguages—SQL—Part11:Informationand
DefinitionSchemas(SQL/Schemata)
ISO/IEC9075-13,Informationtechnology—Databaselanguages—SQL—Part13:SQLRoutinesand
TypesUsingtheJava™ProgrammingLanguage(SQL/JRT)
ISO/IEC9075-14,Informationtechnology—Databaselanguages—SQL—Part14:XML-Related
Specifications(SQL/XML)
ISO/IEC9075-15,Informationtechnology—Databaselanguages—SQL—Part15:Multidimensional
Arrays(SQL/MDA)
ISO/IEC9075-16,Informationtechnology—Databaselanguages—SQL—Part16:PropertyGraph
Queries(SQL/PGQ)
ISO/IEC10646:2020,Informationtechnology—UniversalMulti-OctetCodedCharacterSet(UCS)
ISO/IEC14651,Informationtechnology—Internationalstringorderingandcomparison—Methodfor
comparingcharacterstringsanddescriptionofthecommontemplatetailorableordering
2 ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-1:2023(E)
3 Termsanddefinitions
Forthepurposesofthisdocument,thefollowingtermsanddefinitionsapply.
ISOandIECmaintainterminologicaldatabasesforuseinstandardizationatthefollowingaddresses:
— ISOOnlinebrowsingplatform:availableathttps://www.iso.org/obp
— IECElectropedia:availableathttps://www.electropedia.org/
3.1 DefinitionstakenfromISO/IEC10646:2020
3.1.1
character
memberofasetofelementsusedfortheorganization,control,orrepresentationoftextualdata
Note1toentry:ThisisidenticaltoabstractcharacterasdefinedbyTheUnicode®Standard.Inthis
document,whentherelevantcharacterrepertoireisUCS,acharactercanbethoughtofasthatwhichis
representedbyonecodepoint.
[SOURCE:ISO/IEC10646:2020,3.5]
3.2 Definitionsprovidedinthisdocument
3.2.1
atomic,adj.
incapableofbeingsubdivided
3.2.2
column
fieldoftherowtypeofatable
3.2.3
compilationunit
segmentofexecutablecode,possiblyconsistingofoneormoresubprograms
3.2.4
datatype
setofrepresentablevalues
3.2.5
descriptor
codeddescriptionofthemetadataofanSQLobject
3.2.6
field
(fieldname,datatype)pair
Note1toentry:Avalueofafieldisavalueofitsdatatype.
3.2.7
identifier
objectbywhichsomethingisidentified
©ISO/IEC2023–Allrightsreserved 3
ISO/IEC9075-1:2023(E)
3.2 Definitionsprovidedinthisdocument
3.2.8
identify,verb
toreferencesomethingwithoutambiguity
3.2.9
implementation-defined,adj.
possiblydifferingbetweenSQL-implementations,butspecifiedbytheimplementorforeachparticular
SQL-implementation
3.2.10
implementation-dependent,adj.
possiblydifferingbetweenSQL-implementations,butnotspecifiedbytheISO/IEC9075series,andnot
requiredtobespecifiedbytheimplementorforaparticularSQL-implementation
3.2.11
instance
physicalrepresentationofavalue
Note1toentry:Eachinstanceisatexactlyonesite.Aninstancehasadatatypethatisthedatatypeof
itsvalue.
3.2.12
nullvalue
specialvaluethatisusedtoindicatetheabsenceofanydatavalue
3.2.13
object
thingthatisacomponentof,orisotherwiseassociatedwith,somexandcannotexist
independentlyofthatx
Note1toentry:Forexample,anSQLobjectisanobjectthatexistsonlyinthecontextofSQL;anSQL-
schemaobjectisanobjectthatexistsinsomeSQL-schema.
3.2.14
persistent,adj.
continuingtoexistindefinitely,untildestroyeddeliberately
Note1toentry:Referentialandcascadedactionsareregardedasdeliberate.Actionsincidentaltothe
terminationofanSQL-transactionoranSQL-sessionarenotregardedasdeliberate.
3.2.15
property
attribute,quality,orcharacteristicoftheobject
3.2.16
row
valueofarowtype,i.e.,asequenceoffieldvalues;forrowsinatable,asequenceofcolumnvalues
3.2.17
scope
clauseinthestandardthatdefinesthesubjectofthestandardandtheaspectscovered,
therebyindicatingthelimitsofapplicabilityofthestandardorofparticularpartsofit
3.2.18
scope
oneormoreBNFnon-terminalsymbolswithinwhichthenameordeclaration
iseffective
4 ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-1:2023(E)
3.2 Definitionsprovidedinthisdocument
3.2.19
scope
tablethatavalueofthatreferencetypereferences
3.2.20
sequence
orderedcollectionofobjectsthatarenotnecessarilydistinct
3.2.21
site
placeoccupiedbyaninstanceofavalueofsomespecifieddatatype(orsubtypeofthatdatatype)
3.2.22
SQL-connection
associationbetweenanSQL-clientandanSQL-server
3.2.23
SQL-environment
contextinwhichSQL-dataexistsandSQL-statementsareexecuted
3.2.24
SQL-implementation
processorthatprocessesSQL-statements
Note1toentry:AconformingSQL-implementationisanSQL-implementationthatsatisfiestherequire-
mentsforSQL-implementationsasdefinedinClause9,“Conformance”.
3.2.25
SQL-session
contextwithinwhichasingleuser,fromasingleSQL-agent,executesasequenceofconsecutiveSQL-
statementsoverasingleSQL-connection
3.2.26
SQL-statement
stringofcharactersthatconformstotheFormatandSyntaxRulesspecifiedinthepartsoftheISO/IEC
9075series
3.2.27
table
collectionofzeroormorerows
3.2.28
whitespace
sequenceofoneormorecharactersthathavetheUnicodepropertyWhite_Space
©ISO/IEC2023–Allrightsreserved 5
ISO/IEC9075-1:2023(E)
4 Concepts
4.1 WhatisSQL?
Thename“SQL”iscorrectlypronounced“esscueell,”insteadofthesomewhatcommon“sequel”.SQL,
specifiedinthepartsoftheISO/IEC9075series,isadatabaselanguage(moreprecisely,adatasublan-
guage)usedforaccesstopseudo-relationaldatabasesthataremanagedbypseudo-relationaldatabase
managementsystems(RDBMS).
NOTE1—Manybooksandarticles“define”SQLbyparentheticallyclaimingthatthelettersstandfor“StructuredQuery
Language”.Whilethiswasundoubtedlytruefortheoriginalprototypes,itisnottrueofthestandard.Whentheletters
appearinproductnames,theyhaveoftenbeenassignedthismeaningbytheproductimplementors,butusersareill-served
byclaimsthattheword“structured”accuratelydescribesthelanguage.IntheSQLstandard,thelettersdonotstandfor
anythingatall.Thereareafficionadoswhoassertthatthelettersstandfor“SQLQueryLanguage”,arecursiveacronymin
thetraditionofGNU(GNU’sNotUnix)andSPARQL(SPARQLProtocolAndRDFQueryLanguage).
SQLisbasedon,butisnotastrictimplementationof,therelationalmodelofdataRelationalModel,
makingSQL“pseudo-relational”insteadoftrulyrelational.TherearetwoprincipalwaysinwhichSQL
breaksfromtherelationalmodel.
— Therelationalmodelrequiresthateveryrelation havenoduplicaterows(thatis,rowsforwhich
allcorrespondingattributeshaveequalvalues).Aconsequenceofthisrequirementisthatevery
relationhasaprimarykey.SQLdoesnotenforcethisrequirement,butprovidessyntaxthatpermits
applicationdeveloperstoenforcetherequirementasneeded.
— Therelationalmodeldoesnotspecifyorrecognizeanysortofflagorothermarkerthatrepresents
unspecified,unknown,orotherwisemissingdatavalues.Consequently,therelationalmodeldepends
onlyontwo-valued(true/false)logic.SQLprovidesa“nullvalue”thatservesthispurpose.Insupport
ofnullvalues,SQLalsodependsonthree-valued(true/false/unknown)logic.
TheSQLstandarddefinestwodistinctaspectsofthelanguage:adatadefinitionlanguage(knowninthe
standardasa“schemamanipulationlanguage”thatsupportsthecreationanddestructionofdatabase
objects,suchastables,columns,andintegrityconstraints;andadatamanipulationlanguagethatallows
theretrieval,creation,modification,anddeletionofdata.
AnespeciallyimportantcharacteristicofSQListhatitisdeclarative(asopposedtoprocedural)innature.
Thatis,SQL’ssyntaxandsemanticsallowapplicationwriterstospecifytherulesbywhichresultsmay
becomputedbyanSQLsystem,ratherthanspecifyingthealgorithmsbywhichthoseresultsmustbe
computed.Thiscontrastswithearlierdatabaselanguagesthatrequiredthedetailsspecificationofstep-
by-stepalgorithmstoretrieve,filter,andformatthedatarequiredbyapplications.
4.2 Useofterms
TheconceptsonwhichtheISO/IEC9075seriesisbasedaredescribedintermsofobjects,intheusual
senseoftheword.
Someobjectsareacomponentofanobjectonwhichtheydepend.Ifanobjectceasestoexist,thenevery
objectdependentonthatobjectsalsoceasestoexist.Themetadatarepresentationofanobjectisknown
asadescriptor.SeealsoSubclause6.3.4,“Descriptors”.
1 TermsdefinedbytherelationalmodelareusedcorrectlyinthisSubclause,butarenotdefinedorexplainedinthisdocument;
readersarereferredtotheformalspecificationoftherelationalmodel.
2 ISO/IEC9075-4,specifiesanumberofSQLstatementsthatprovideaproceduralcapabilitythroughwhichprocedures
andfunctionscanbewrittenentirelyinSQL.Proceduralprogramscanalsobewritteninordinary“host”programming
languageswithembeddedSQLstatements.
6 ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-1:2023(E)
4.3 Caveat
4.3 Caveat
ThisClausedescribesconceptsthatare,forthemostpart,specifiedpreciselyinotherpartsoftheISO/IEC
9075series.Inanycaseofdiscrepancy,thespecificationintheotherpartistobepresumedcorrect.
4.4 SQL-environmentsandtheircomponents
4.4.1 SQL-environments
AnSQL-environmentcomprises:
— oneSQL-agent;
— oneSQL-implementation;
— zeroormoreSQL-clientmodules,containingexternally-invokedproceduresavailabletotheSQL-
agent;
— zeroormoreauthorizationidentifiers;
— zeroormoreusermappings;
— zeroormoreroutinemappings;
— zeroormorecatalogs,eachofwhichcontainsoneormoreSQL-schemas,zeroormoreforeign
serverdescriptors,andzeroormoreforeign-datawrapperdescriptors;
— thesites,principallybasetables,thatcontainSQL-data,asdescribedbythecontentsoftheschemas;
thisdatamaybethoughtofas“thedatabase”,butthetermisnotusedintheISO/IEC9075series,
becauseithasdifferentmeaningsinthemoregeneralcontext.
4.4.2 SQL-agents
AnSQL-agentisthatwhichcausestheexecutionofSQL-statements.Inthecaseofthedirectinvocation
ofSQL(seeSubclause5.3.2.4,“DirectinvocationofSQL”),itisimplementation-defined(IW002).Alter-
natively,itmayconsistofoneormorecompilationunitsthat,whenexecuted,invokeexternally-invoked
proceduresinanSQL-clientmodule.
4.4.3 SQL-implementations
4.4.3.1 IntroductiontoSQL-implementations
AnSQL-implementationisaprocessorthatexecutesSQL-statements,asrequiredbytheSQL-agent.An
SQL-implementation,asperceivedbytheSQL-agent,includesoneSQL-client,towhichthatSQL-agentis
bound,andoneormoreSQL-servers.AnSQL-implementationisabletoconformtoISO/IEC9075without
allowingmorethanoneSQL-servertoexistinanSQL-environment.
BecauseanSQL-implementationcanbespecifiedonlyintermsofhowitexecutesSQL-statements,the
conceptdenotesaninstalledinstanceofsomesoftware(databasemanagementsystem).ISO/IEC9075
doesnotdistinguishbetweenfeaturesoftheSQL-implementationthataredeterminedbythesoftware
implementorandthosedeterminedbytheinstaller.
ISO/IEC9075recognizesthatSQL-clientandSQL-serversoftwaremayhavebeenobtainedfromdifferent
implementors;itdoesnotspecifythemethodofcommunicationbetweenSQL-clientandSQL-server.
4.4.3.2 SQL-clients
AnSQL-clientisaprocessor,perceivedbytheSQL-agenttobepartoftheSQL-implementation,that
establishesSQL-connectionsbetweenitselfandSQL-serversandmaintainsadiagnosticsareaandother
statedatarelatingtointeractionsbetweenitself,theSQL-agent,andtheSQL-servers.
©ISO/IEC2023–Allrightsreserved 7
ISO/IEC9075-1:2023(E)
4.4 SQL-environmentsandtheircomponents
WhenoneormoreSQL-connectionshavebeenestablishedforanSQL-client,thediagnosticsareamain-
tainedbythatSQL-clientisacopyofthefirstdiagnosticsareainthediagnosticsareastack(see
Subclause4.10.5,“Diagnosticinformation”)maintainedbytheSQL-serverofthecurrentSQL-connection.
WhennoSQL-connectionexists,thediagnosticsareaiseitheremptyorcontainsdiagnosticsinformation
pertainingtosomefailedSQL-connection.
4.4.3.3 SQL-servers
EachSQL-serverisaprocessor,perceivedbytheSQL-agenttobepartoftheSQL-implementation,that
managesSQL-data.
EachSQL-server:
— managestheSQL-sessiontakingplaceovertheSQL-connectionbetweenitselfandtheSQL-client;
— executesSQL-statementsreceivedfromtheSQL-client,receivingandsendingdataasrequired;
— maintainsthestateoftheSQL-session,includingtheauthorizationidentifierandcertainsession
defaults.
4.4.4 SQL-clientmodules
AnSQL-clientmoduleisamodulethatisexplicitlycreatedanddroppedbyimplementation-defined
(IW003)mechanisms.
AnSQL-clientmoduledoesnotnecessarilyhaveaname;ifitdoes,thepermittednamesareimplemen-
tation-defined(IA094).
AnSQL-clientmodulecontainszeroormoreexternally-invokedprocedures.Anexternally-invokedpro-
cedureconsistsofasingleSQL-statement.Anexternally-invokedprocedureisinvokedfromacompilation
unitofahostlanguage.
ExactlyoneSQL-clientmoduleisassociatedwithanSQL-agentatanygiventime.However,inthecase
ofeitherdirectbindingstyleorSQL/CLI,thismaybeadefaultSQL-clientmodulewhoseexistenceisnot
apparenttotheuser.
4.4.5 Useridentifiers
Auseridentifierrepresentsauser.Themeansofcreatinganddestroyinguseridentifiers,andtheir
mappingtorealusers,isnotspecifiedbytheISO/IEC9075series.
4.4.6 Roles
Aroleisapotentialgranteeandgrantorofprivilegesandofotherroles.Arolecanalsoownschemasand
otherobjects.
Aroleauthorizationpermitsagrantee(seeSubclause4.8.11,“Privileges”)touseeveryprivilegegranted
totherole.Italsoindicateswhethertheroleauthorizationisgrantable,inwhichcasethegranteeis
authorizedtogranttherole,torevokeagrantoftherole,andtodestroytherole.
4.4.7 Usermappingconcepts
Ausermappingpairsanauthorizationidentifierwithaforeignserverdescriptor.
4.4.8 Routinemappingconcepts
AroutinemappingpairsanSQL-invokedroutinewithaforeignserverdescriptor.
NOTE2—InthisrevisionoftheISO/IEC9075series,theSQL-invokedroutinethatispairedwithaforeignserverdescriptor
isrestrictedtobeanSQL-invokedregularfunction.Itispossiblethatthisrestrictionwillnotappearinfutureeditions.
8 ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-1:2023(E)
4.4 SQL-environmentsandtheircomponents
4.4.9 Catalogsandschemas
4.4.9.1 Catalogs
AcatalogisanamedcollectionofSQL-schemas,foreignserverdescriptors,andforeigndatawrapper
descriptorsinanSQL-environment.Themechanismsforcreatinganddestroyingcatalogsareimplemen-
tation-defined(IW005).
ThedefaultcatalognameforsthataredynamicallypreparedinthecurrentSQL-
sessionthroughtheexecutionofsandsisinitially
implementation-defined(ID006)butmaybechangedbytheuseofs.
4.4.9.2 SQL-schemas
AnSQL-schema,oftenreferredtosimplyasaschema,isapersistent,namedcollectionofdescriptors.An
objectwhosedescriptorisinsomeSQL-schemaisknownasanSQL-schemaobject.
Aschema,theschemaobjectsinit,andtheSQL-datadescribedbythemaresaidtobeownedbythe
authorizationidentifierassociatedwiththeschema.
SQL-schemasarecreatedanddestroyedbyexecutionofSQL-schemastatements(orbyimplementation-
defined(IW006)mechanisms).
4.4.9.3 InformationSchema
EverycatalogcontainsanSQL-schemawiththenameINFORMATION_SCHEMAthatincludesthedescriptors
ofanumberofschemaobjects,mostlyviewdefinitions,thattogetheralloweverydescriptorinthat
catalogtobeaccessed,butnotchanged,asthoughitwasSQL-data.
ThedataavailablethroughtheviewsinanInformationSchemaincludesthedescriptorsoftheInformation
Schemaitself.ItdoesnotincludetheschemaobjectsorbasetablesoftheDefinitionSchema(see
Subclause4.4.9.4,“DefinitionSchema”).
EachInformationSchemaviewissospecifiedthatagivenusercanaccessonlythoserowsoftheview
thatrepresentdescriptorsonwhichthatuserhasprivileges.
4.4.9.4 Def
...








Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.
Loading comments...