Saturday, February 28, 2015

What command is used to create a table by copying the structure of another table?

Question:What command is used to create a table by copying the structure of another table??

Answer: </P><P><B>Answer :</B></P><P>CREATE TABLE .. AS SELECT command</P><P><B>Explanation : </B></P><P>To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement as in the following.</P><P>CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2;</P><P>If the WHERE condition is true, then all the rows or rows satisfying the condition will be copied to the new table.</P><P>

Tags:Interview Questions, Database, SQL,

Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.



Sponsor Advertisement



Hospital Management  Software

Hotel Management System Software

Hotel Management System software is a web based system help to manage reservations, roomstays, bookings, guests, folios, invoices and billing etc. The software features include revenue management, booking calendar, guest relationship management, check-in & check-out, invoices and receipts etc...

No comments:

Post a Comment