6. Annexe

6-1 Syntaxe SQL

Pour une description détaillée, se référer à l'URL suivant: http://tecfa.unige.ch/guides/msql/msql2/spec.htm.

CREATE

CREATE TABLE table_name ( 
                  col_name col_type [ not null ] 
                  [ , col_name col_type [ not null ] ]** 
            ) 

CREATE [ UNIQUE ] INDEX index_name ON table_name ( 
                  field_name 
                  [ , field_name ] ** 
            ) 

CREATE SEQUENCE ON table_name [ STEP step_val ] [ VALUE initial_val ] 

DROP

DROP TABLE table_name
DROP INDEX index_name FROM table_name
DROP SEQUENCE FROM table_name 

INSERT

INSERT INTO table_name [ ( column [ , column ]** ) ] 

SELECT

SELECT [table.]column [ , [table.]column ]** 
        FROM table [ = alias] [ , table [ = alias] ]** 
        [ WHERE [table.] column OPERATOR VALUE 
        [ AND | OR [table.]column OPERATOR VALUE]** ]
        [ ORDER BY [table.]column [DESC] [, [table.]column [DESC] ] 


OPERATOR can be <, >, =, <=, >=, <>, LIKE, RLIKE or CLIKE
VALUE can be a literal value or a column name 

Where clauses may contain '(' ')' to nest conditions e.g. "where (age < 20 or age > 30) and sex = 'male'" . 
                

DELETE

DELETE FROM table_name 
                  WHERE column OPERATOR value 
                  [ AND | OR column OPERATOR value ]** 

OPERATOR can be <, >, =, <=, >=, <>, LIKE, RLIKE, or CLIKE 

UPDATE

UPDATE table_name SET column=value [ , column=value ]** 
                  WHERE column OPERATOR value 
                       [ AND | OR column OPERATOR value ]**

OPERATOR can be <, >, =, <=, >=, <>, LIKE, RLIKE or CLIKE 




Memo mSQL - 27 Nov 1997

Generated with Harlequin WebMaker