what command is used to create a table by copying the
structure of another table including constraints ?

Answer Posted / a.jyothsna

I know copying the structure of one table but not the
constraints also:
create table newtablename as
select * from oldtablename;

with the above query total data will also be copied.
But to copy only the structure.

create table newtablename as
select * from oldtablename
where 1=2;

Is This Answer Correct ?    20 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a database and a relational database?

558


What is exception? What are the types of exceptions?

545


What is sql and explain its components?

589


How do I partition a table in sql?

531


Can we connect to postgresql using sql developer?

483






How do you create an update query?

514


What is a column in a table?

546


what are the 'mysql' command line arguments? : Sql dba

642


What type of database is sql?

610


What is sql in oracle?

614


What is the plv (pl/vision) package offers?

605


Why we use cross join?

534


Why do we need cursors in pl sql?

512


What is the maximum database size for sql express?

522


What is bind variable in pl sql?

517