We can execute several queries in oracle info like select, alter table, delete, insert and update.

. Select Query of Oracle

Oracle select query is used to select records from database. For example

select * from employee;

. Insert Query of Oracle

Oracle Insert query is used to select records in database. For example

insert into employee(E-41,’Anuj’,’Mumbai’);;

. Delete Query of Oracle

Oracle delete query is used to delete records in database. For example

delete from employee where id=E-41; 

. Update Query of Oracle

Oracle update query is used to update records in database. For example

update employee set name=‘Manoj’, city=‘Delhi’ where id=E-41;

. Truncate Query of Oracle

Oracle truncate query is used to  remove records of a table. It doesn’t remove structure. For example:

truncate table employee;

. Drop Query of Oracle

Oracle drop query is used to drop a table or view. It remove structure and data. For example:

drop table employee;

. Create Query of Oracle

Oracle create query is used to create a table, view, sequence, procedure and function. For example:

CREATE TABLE employee    

( id number(20) NOT NULL,    

  name varchar2(50) NOT NULL,    

 town varchar2(50),  

CONSTRAINT customers_pk PRIMARY KEY (id)      

);

. Alter Query of Oracle

Oracle alter query is used to add, modify, delete or drop columns of a table. Let’s see a query to delete column in employee table:

ALTER TABLE employee  Delete town varchar2(50);

LEAVE A REPLY

Please enter your comment!
Please enter your name here