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

How do temporal tables work?

692


What does stand for in sql?

713


State some properties of relational databases?

756


What is the difference between a primary key and a unique key?

743


what is online transaction processing (oltp)? : Sql dba

713






What is 19 null in sql?

703


What are keys in sql?

722


Can we use pl sql in sql server?

739


What are tuples in sql?

773


Which is better cte or subquery?

713


Can unique keys be null?

662


How do I restart sql?

721


What are the most important characteristics of pl/sql?

782


What is cursor in pl sql?

766


How do I copy a table in sql?

693