oraSqlD01

The whole SQL collection: SQL Codes

select <column_name> from <table_name> where <condition >

insert into <table_name> (<column_name1>,<column_name2>,<column_name3>, . . . ) values (<value1>,<value2>,<value3>,. . .)

create table <table_name>
(column_1    column_dataType,
 column_2    column_dataType,
     …    
 column_n    column_dataType
);

alter table <table name>
add <column_name> <column_dataType>;

ALTER TABLE table_name
ADD (column_1    column_dataType,
     column_2    column_dataType,
     …    
     column_n    column_dataType);

alter table <table name>
drop column <column_name>;

ALTER TABLE <table_name>
 MODIFY <column_name> <column_dataType>;

ALTER TABLE table_name
MODIFY (column_1    column_type,
     column_2    column_type,
     …    
     column_n    column_type );

ALTER TABLE <table_name>
 RENAME COLUMN <old_name> to <new_name>;

ALTER TABLE <table_name>
 RENAME TO <new_table_name>;

ALTER TABLE <table_name>
ALTER COLUMN <column_name> <column_type>;

UPDATE table_name
SET column1=value, column2=value2,…
WHERE some_column=some_value.

rename <old table name > to <new table name>

truncate table < table name>

delete from < table name>

Advertisements