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 benefits of triggers?

589


Name the different types of indexes in sql and define them.

555


How do I find duplicates in two columns?

542


What is nosql example?

575


What is range partitioning?

508






What is not in sql?

486


How can you fetch first 5 characters of the string?

538


Is sql port 1433 encrypted?

562


How to select 10 records from a table?

637


Which sql statement is used to delete data from a database?

451


Can a primary key be a foreign key?

568


Inline the values in PL/SQL, what does it mean.?

619


How to display Row Number with Records in Oracle SQL Plus?

584


What information is needed to connect sql*plus an oracle server?

577


How to pipe multiline string to isql?

564