Tuesday, March 10, 2015

PL/SQL Technical Questions List-1

1. How to create new table from existing table only structure of table ?

create table new_table as select * from existing_table where 1=2

2. How to copy all the records from one table to another table while new table creation ?

create table new_table as select * from existing_table 

3. Multiple insert statement in single insert query?

 insert all
 into  student1
 into  student2
 into  student3
 select * from student

structure of student1,student2,student3 should be same as student

4. Difference between DATE and TIMESTAMP in oracle?


TIMESTAMP and DATE vary in formats as follows:
  • DATE stores values as century, year, month, date, hour, minute, and second.
  • TIMESTAMP stores values as year, month, day, hour, minute, second, and fractional seconds.

5. Difference between char and varchar ?

 CHAR values have a fixed length, They are padded with space characters to match the specified length.

VARCHAR have used only assigned values, rest of the unallocated spaces are released from memory



No comments:

Post a Comment