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 a sql*loader control file?

790


how to use 'mysql' to run sql statements? : Sql dba

738


How do I run a sql query?

738


Which is the correct statement about truncate and delete?

757


what is sub-query? : Transact sql

839






how to increment dates by 1 in mysql? : Sql dba

724


What is structural independence and why is it important?

758


What is sql comments?

813


How long does it take to learn pl sql?

792


What is the most important ddl statements in sql are?

727


What is range partitioning?

692


What is a field in a database?

760


how can we take a backup of a mysql table and how can we restore it. ? : Sql dba

718


Is microsoft sql free?

778


Enlist the data types that can be used in pl/sql?

747