SELECT
Used to select particular coloumn from a tableSyntax: SELECT*FROM TABLE NAME;
INSERT
Used to create a row in the data base object and insert statement canhave many forms.HOW TO INSERT MULTIPLE ROWS
syntax:INSERT INTO TABLE NAME VALUES(V1,V2..............);INSERT USING SUBSTITUTION VARIABLES
Syntax:INSERT INTO TABLE NAME VALUES(&COL1,&COL2.............);HOW TO COPY ROWS FROM ONE TABLE TO OTHER
Syntax:INSERT INTO TABLE1(COL1,COL2...........) SELECT COL1,COL2.......................FROM TABLE2 WHERE CONDITION;
UPDATE
used to update existing records in the table.syntax: UPDATE TABLE NAME SET COLOUMN NAME=VAL1,COL2=VAL2............
WHERE CONDITION;
UPDATE 2 COLOUMNS BY USING A SUB QUERY
Syntax: UPDATE TABLE NAME SET(COL1,COL2...............)=((SUB QUERY1),(SUB QUERY2)................) WHERE CONDITION;DELETE
Syntax: DELETE FROM TABLE NAME[WHERE CONDITION];DELETE*FROM TABLE NAME;
TRUNCATE
Used to delete all th data from particular tablesyntax:truncate table table name;
MERGE
Used to insert new records and to update existing records based on weither or not a condition matches.
syntax: MERGE INTO TABLE NAME USING TABLE REFERENCE
ON CONDITION WHEN MATCHED THEN UPDATE
SET COL1=VAL1[,......................]
WHEN NOT MATCHED THEN INSERT[COL1,...........] VALUES[VAL1.......];
No comments:
Post a Comment