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
how can we find the number of rows in a table using mysql? : Sql dba
Can a select statement fire a trigger?
Which kind of parameters cannot have a default value in pl sql?
What are the different ways to optimize a sql query?
How to rename a column in the output of sql query?
How does postgresql compare to oracle/db2/ms sql server/informix?
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
what is union? : Sql dba
How to select random rows from a table?
What is dense_rank?
what are the join types in tsql? : Transact sql
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
Why do we use view in sql?
what are the advantages of mysql in comparison to oracle? : Sql dba
explain mysql aggregate functions. : Sql dba