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 are the advantages of stored procedure?

544


Which command is used to delete a package?

577


What is user in sql?

584


List and explain the different types of join clauses supported in ansi-standard sql?

825


What is sql in java?

547






Can cursors be part of a trigger body?

1122


What is union, minus and interact commands?

750


what is union, minus and interact commands? : Sql dba

666


Mention what plvcmt and plvrb does in pl/sql?

643


What are the constraints available in sql?

580


What is denormalization in a database?

593


Can we edit a view in sql?

552


What is raid? How does it help storage of databases?

604


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

554


What is sql not null constraint?

606