Database Language SQL
(Proposed revised text of DIS 9075) July 1992
(Second Informal Review Draft) ISO/IEC 9075:1992, Database
Language SQL- July 30, 1992
Digital Equipment Corporation
Maynard, Massachusetts
Contents Page
Foreword....................................................................xi
Introduction................................................................xiii
1 Scope ...................................................................... 1
2 Normative references ............................................. 3
3 Definitions, notations, and conventions ................. 5
3.1 Definitions ........................................................... 5
3.1.1Definitions taken from ISO/IEC 10646 .................. 5
3.1.2Definitions taken from ISO 8601 ............................ 5
3.1.3Definitions provided in this International Standard . 5
3.2 Notation ................................................... 7
3.3 Conventions ................................................ 9
3.3.1Informative elements ....................................... 9
3.3.2Specification of syntactic elements ........................ 9
3.3.3Specification of the Information Schema ....................10
3.3.4Use of terms ...............................................10
3.3.4Exceptions .................................................10
3.3.4Syntactic containment ......................................11
3.3.4Terms denoting rule requirements ...........................12
3.3.4Rule evaluation order ......................................12
3.3.4Conditional rules ..........................................13
3.3.4Syntactic substitution .....................................13
3.3.4Other terms ................................................14
3.3.5Descriptors ................................................14
3.3.6Index typography ...........................................15
3.4 Object identifier for Database Language SQL ................16
4 Concepts .....................................................19
4.1 Data types .................................................19
4.2 Character strings ..........................................20
4.2.1Character strings and collating sequences ..................20
4.2.2Operations involving character strings .....................22
4.2.2Operators that operate on character strings and return char-
acter strings...............................................22
4.2.2Other operators involving character strings ................23
4.2.3Rules determining collating sequence usage .................23
4.3 Bit strings ................................................26
4.3.1Bit string comparison and assignment .......................27
4.3.2Operations involving bit strings ...........................27
4.3.2Operators that operate on bit strings and return bit strings
............................................................27
4.3.2Other operators involving bit strings ......................27
ii Database Language SQL
4.4 Numbers ....................................................27
4.4.1Characteristics of numbers .................................28
4.4.2Operations involving numbers ...............................29
4.5 Datetimes and intervals ....................................29
4.5.1Datetimes ..................................................30
4.5.2Intervals ..................................................32
4.5.3Operations involving datetimes and intervals ...............34
4.6 Type conversions and mixing of data types ..................34
4.7 Domains ....................................................35
4.8 Columns ....................................................36
4.9 Tables .....................................................37
4.10 Integrity constraints ......................................40
4.10.Checking of constraints ....................................41
4.10.Table constraints ..........................................41
4.10.Domain constraints .........................................43
4.10.Assertions .................................................43
4.11 SQL-schemas ................................................44
4.12 Catalogs ...................................................45
4.13 Clusters of catalogs .......................................45
4.14 SQL-data ...................................................45
4.15 SQL-environment ............................................46
4.16 Modules ....................................................46
4.17 Procedures .................................................47
4.18 Parameters .................................................47
4.18.Status parameters ..........................................47
4.18.Data parameters ............................................48
4.18.Indicator parameters .......................................48
4.19 Diagnostics area ...........................................48
4.20 Standard programming languages .............................49
4.21 Cursors ....................................................49
4.22 SQL-statements .............................................51
4.22.Classes of SQL-statements ..................................51
4.22.SQL-statements classified by function ......................52
4.22.Embeddable SQL-statements ..................................55
4.22.Preparable and immediately executable SQL-statements .......56
4.22.Directly executable SQL-statements .........................58
4.22.SQL-statements and transaction states ......................59
4.23 Embedded syntax ............................................61
4.24 SQL dynamic statements .....................................61