home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
579a.lha
/
sqldb_v1.0alpha2
/
doc
/
sqldb_sqlref.doc
< prev
next >
Wrap
Text File
|
1991-11-22
|
2KB
|
129 lines
-----------------
|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
-----------------
|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
------
|MISC|
------
DISPLAY TABLE table;
DISPLAY DATABASE;