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

Answer Posted / saurabh agrawal

We can only copy the structure of the table and not the
constraints.
Syntax is as below:
Create table newtablename as select * from oldtablename;

In this way only NOT NULL constraint specified on any
column of the OLDTABLE will automatically get copied into
the NEWTABLE but other constraint will have to be created
manually.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a procedure in pl sql?

555


What schema means?

529


Can we use pl sql in sql server?

545


What is a temporal table?

499


How can we link a sql database to an existing android app?

550






How consistent is the view of the data between and within multiple sessions, transactions or statements ?

1718


What are packages in pl sql and also explain its advantages?

538


What is dense_rank?

542


what is an extent ? : Sql dba

586


Is id a reserved word in sql?

668


What are tuples in sql?

571


What is delete command in sql?

563


Write a unique difference between a function and a stored procedure.

537


how to show all tables with 'mysql'? : Sql dba

612


what are the advantages a stored procedure? : Sql dba

553