Simple commands to Create a table, insert values, query/verify them and Delete the entries and table itself in Oracle

Creating an empty table:

CREATE TABLE usage_stats (timeofday DATE, cnt NUMBER) 

 

Inserting values into the table:

insert into usage_stats values (to_date(‘2014-03-01 00:09’, ‘YYYY-MM-DD HH24:MI’), 1)

 

Query/Verify the inserted entries:

Select * from usage_stats

 

Delete all the entries in the table:

DELETE from usage_stats

 

Delete the table itself ()

DROP TABLE  usage_stats

Leave a Reply

Your email address will not be published. Required fields are marked *