Shyam Patil’s DECK

It’s all I see happening around me!!!!!!!!!

SQL Command Reference

Data Definition Statements

CREATE TABLE table ( table-def-item-list )
DROP TABLE table [ drop-options ]
ALTER TABLE table alter-action
CREATE VIEW view [ ( column-list ) ]

AS query-spec [ WITH CHECK OPTION ]

DROP VIEW view [ drop-options ]  CREATE db-object-type db-object-name [ db-object-spec ]
DROP db-object-type [ drop-options ]
ALTER db-object-type alter-action
GRANT { ALL PRIVILEGES | privilege-list }

ON { table | db-object-type db-object-name }
TO { PUBLIC | user-list } [ WITH GRANT OPTION ]
REVOKE { ALL PRIVILEGES | privilege-list }
ON { table | db-object-type db-object-name }
FROM { PUBLIC | user-list } [ WITH GRANT OPTION ]

Basic Data Manipulation Statements
SELECT [ ALL | DISTINCT ] { select-item-list | * }

INTO variable-list FROM table-ref-list [ WHERE search-condition ]

 

SELECT [ ALL | DISTINCT ] { select-item-list | * }

INTO host-variable-list FROM table-ref-list [ WHERE search-condition ]
[ GROUP BY column-ref-list ] [ HAVING search-condition ] [ ORDER BY sort-item-list ]

 

 

 

INSERT INTO table [ ( column-list ) ] { VALUES ( insert-item-list ) | query-expr }
 
DELETE FROM table [ WHERE search-condition ]  UPDATE table SET set-assignment-list [ WHERE search-condition ]
 

 

Transaction Processing Statements

 

COMMIT [ WORK ]

ROLLBACK [ WORK ]
 

 

 

Cursor-Based Statements

 
DECLARE cursor [ SCROLL ] CURSOR FOR query-expr
[ ORDER BY sort-item-list ]  [ FOR { READ ONLY | UPDATE [ OF column-list ] } ]
 
OPEN cursor
CLOSE cursor
FETCH [ [ fetch-dir ] FROM ] cursor INTO variable-list
 
DELETE FROM table WHERE CURRENT OF cursor
UPDATE table SET set-assignment-list WHERE CURRENT OF cursor

 

NEXT | PRIOR | FIRST | LAST | ABSOLUTE row-nr | RELATIVE row-nr
 

June 27, 2007 Posted by Shyam Patil | Database | | No Comments Yet