(This is stale and you may wish to find a more up-to-date copy, but it is preserved here for posterity. Enjoy -- Daria 24 Nov 2017)
Information Technology -
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
4.25 Direct invocation of SQL ...................................64
4.26 Privileges .................................................64
4.27 SQL-agents .................................................66
4.28 SQL-transactions ...........................................67
4.29 SQL-connections ............................................70
4.30 SQL-sessions ...............................................72
Table of Contents iii
4.31 Client-server operation ....................................74
4.32 Information Schema .........................................75
4.33 Leveling ...................................................75
4.34 SQL Flagger ................................................76
5 Lexical elements .............................................79
5.1 ...................................79
5.2 and ....................................82
5.3 ..................................................89
5.4 Names and identifiers ......................................98
6 Scalar expressions ...........................................107
6.1 ................................................107
6.2 and ...........114
6.3 ..........................................118
6.4 .........................................121
6.5 ...............................124
6.6 ...................................128
6.7 ....................................132
6.8 ..................................139
6.9 ..........................................141
6.10 .......................................144
6.11 .........................................155
6.12 .................................157
6.13 ..................................160
6.14 ................................165
6.15 ................................168
7 Query expressions ............................................173
7.1 ....................................173
7.2 ..................................176
7.3 .........................................177
7.4 ..............................................178
7.5 .............................................180
7.6 .............................................185
7.7 ..........................................187
7.8 ............................................189
7.9 ......................................191
7.10 .........................................196
7.11 , , and ....203
8 Predicates ...................................................205
8.1 ................................................205
8.2 .....................................207
8.3 ........................................211
8.4 .............................................212
iv Database Language SQL
8.5 ...........................................214
8.6 ...........................................218
8.7 ..........................220
8.8 .........................................222
8.9 .........................................223
8.10 ..........................................224
8.11 .......................................227
8.12 .........................................229
9 Data assignment rules ........................................231
9.1 Retrieval assignment .......................................231
9.2 Store assignment ...........................................234
9.3 Set operation result data types ............................237
10 Additional common elements ...................................239
10.1 .......................................239
10.2 ..........................................243
10.3 ...............................................245
10.4 ..............................248
10.5 ...........................................251
10.6 and ...252
11 Schema definition and manipulation ...........................255
11.1 ........................................255
11.2 ....................................258
11.3 .........................................260
11.4 ........................................262
11.5 ...........................................266
11.6 ..............................270
11.7 .............................272
11.8 ........................274
11.9 ..............................281
11.10 ....................................283
11.11 ....................................284
11.12 ..................................286
11.13 ................................287
11.14 ...............................288
11.15 ...................................289
11.16 ..........................291
11.17 .........................292
11.18 .....................................294
11.19 ..........................................296
11.20 ......................................300
11.21 ........................................301
11.22 ...................................304
11.23 ................................305
Table of Contents v
11.24 ...............................306
11.25 .........................307
11.26 ........................308
11.27 ....................................309
11.28 .................................311
11.29 .............................313
11.30 .....................................314
11.31 .................................318
11.32 ...................................320
11.33 ...............................323
11.34 .....................................325
11.35 .................................328
11.36 ..........................................329
11.37 .........................................333
12 Module .......................................................341
12.1 ...................................................341
12.2 .......................................344
12.3 ................................................346
12.4 Calls to a .....................................352
12.5 ..................................368
13 Data manipulation ............................................371
13.1 ...........................................371
13.2 ...........................................375
13.3 ..........................................377
13.4 ..........................................381
13.5