home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
526.lha
/
sqldb_v1.0alpha
/
doc
/
my_sql_standard.doc
next >
Wrap
Text File
|
1991-07-01
|
2KB
|
128 lines
-----------------
|DATA DEFINITION|
-----------------
CREATE TABLE table ( table-def-item-list )
----------
|DATA I/O|
----------
LOAD TABLE table;
OPEN TABLE table;
CLOSE TABLE table;
-------------------------
|BASIC DATA MANIPULATION|
-------------------------
query-spec: SELECT { select-item-list | * }
FROM table-ref-list
[ WHERE search-condition ]
[ GROUP BY column-ref-list ]
[ HAVING search-condition ]
[ OUTPUT TO file-name ]
subquery: \[ query-spec \]
INSERT INTO table [ ( column-list ) ]
VALUES ( insert-item-list )
DELETE FROM table [ WHERE search-condition ]
UPDATE table SET assignment-list [ WHERE search-condition ]
-------------------------
|CURSOR BASED STATEMENTS|
-------------------------
DECLARE cursor CURSOR FOR query-expr
OPEN cursor
CLOSE cursor
FETCH { COLUMNS | FIRST | LAST | PREVIOUS | NEXT |
ABSOLUTE integer | RELATIVE integer } OF cursor-name
-------------------
|SEARCH CONDITIONS|
-------------------
search-condition: search-item | search-item { AND | OR } search-item
search-item: { search-test | { NOT | MAYBE_A | MAYBE_I | MAYBE } ( search-condition ) }
search-test: comparison-test | like-test | set-test |
quantified-test | existence-test
comparison-test: expr { = | <> | < | <= | > | >= } { expr | subquery }
like-test: column-ref [ NOT ] LIKE string-pattern
set-test: expr [ NOT ] IN { value-list | subquery }
quantified-test: expr { = | <> | < | <= | > | >= } { ALL | ANY | SOME } subquery
existence-test: [ NOT ] EXISTS subquery
-------------
|EXPRESSIONS|
-------------
expr: function | expr2
expr2: expr-item | expr-item { + | - | * | / } expr-item
expr-item: value | column-ref | ( expr2 )
value: literal | AMARK | IMARK | NULL
function: { AVG | MAX | MIN | SUM | COUNT } ( expr2 )
--------------------
|STATEMENT ELEMENTS|
--------------------
assignment: column = expr
insert-item: value
select-item: expr
table-ref: table [ table alias ]
column-ref: [ { table | alias } . ] column
table-def-item: column-def
column-def: column data-type
-----------------
|SIMPLE ELEMENTS|
-----------------
table: a table name
column: a column name
literal: number or string enclosed in quotes
data-type: FLOAT | SMALLINT | INTEGER | CHAR ( integer )
alias: SQL identifier
cursor: SQL identifier
------
|MISC|
------
DISPLAY TABLE table;
DISPLAY DATABASE;