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 dml statement?

509


What are sql procedures?

574


What are different sql data types?

500


What is difference between group by and partition by?

488


What is pivot in sql?

504






How does stored procedure reduce network traffic?

531


How do you bind variables in pl sql?

568


What is database white box testing and black box testing?

628


Is there a 64 bit version of ssms?

506


What are database links used for?

586


how is myisam table stored? : Sql dba

597


Why do we use procedures?

506


what is the use of double ampersand (&&) in sql queries?

616


What is difference between stored procedures and application procedures?

560


Can we update views in sql?

525