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
What is auto increment in sql?
How can we optimize a sql query?
What is sp_helptext?
What happens when a trigger is associated to a view?
The in operator may be used if you know the exact value you want to return for at least one of the columns.
Which operator is used in query for pattern matching?
What is a constraint?
What is procedure in pl sql?
What is the difference between the sql*loader and import utilities? : aql loader
Is id a reserved word in sql?
What does count (*) mean in sql?
how to analyze tables with 'mysqlcheck'? : Sql dba
What is rowtype?
Explain the difference between triggers and constraints?
What is sql*loader and what is it used for?