Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

how can we find the number of rows in a table using mysql? : Sql dba

1120


Can a select statement fire a trigger?

1202


Which kind of parameters cannot have a default value in pl sql?

1202


What are the different ways to optimize a sql query?

984


How to rename a column in the output of sql query?

1119


How does postgresql compare to oracle/db2/ms sql server/informix?

1087


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

1009


what is union? : Sql dba

1077


How to select random rows from a table?

1128


What is dense_rank?

985


what are the join types in tsql? : Transact sql

1099


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

2063


Why do we use view in sql?

1015


what are the advantages of mysql in comparison to oracle? : Sql dba

1044


explain mysql aggregate functions. : Sql dba

1024