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 are the differences between drop a table and truncate
a table?

Answers were Sorted based on User's Feedback



What are the differences between drop a table and truncate a table?..

Answer / velmurugan

Drop - will Delete the table date as well as the table
structure.
Truncate - Will Delete the table data only. The table
structure will remains.

Is This Answer Correct ?    71 Yes 9 No

What are the differences between drop a table and truncate a table?..

Answer / meena bisht

Drop: drop means it will drop the table including structure
and free the memory from hard disk.

Truncate: Truncate will truncate the data. The structure
will remain there and also will free the memory.

Is This Answer Correct ?    33 Yes 4 No

What are the differences between drop a table and truncate a table?..

Answer / soumik

1.DELETE table will result into deletion of data from the
table without affecting the table structure. But since
delete statement is a DML(Data Manipulation Language)
statement, it directly dosnt reflect the database. In other
words, the deleted data will be stored in a separate
tablespace called UNDO tablespace(which takes up memory)
that can be retrieved by using a ROLLBACK statement.

2. DROP table results into loss of data and structure both
which cannot be retrieved. Drop statement is DDL(Data
Definition Language) which is AUTO-COMMIT.

3. TRUNCATE table will clear the data from the table only
without affecting the table structure. Data cannot be
retrieved after executing this statement as well, since it
an AUTO-COMMIT statement. Truncate is also a DDL statement.

Is This Answer Correct ?    9 Yes 0 No

What are the differences between drop a table and truncate a table?..

Answer / ramavtar rajput

drop--> means table is delete ,not roll back,

truncate-->

Is This Answer Correct ?    18 Yes 11 No

What are the differences between drop a table and truncate a table?..

Answer / ......v......

TRUNCATE <table_name>;
This will only Remove table data and not structure of table

DROP <table_name>;
This will Remove table data and structure both

In both the cases data can be Rollbacked in SQL Server 2000
or 2005.....,But NOT POSSIBLE in other.........!

Is This Answer Correct ?    10 Yes 4 No

What are the differences between drop a table and truncate a table?..

Answer / guru

1.DELETE:
- delete space allocated by mysql server and the structure of table remains same.
- used by either 'WHERE' clause or without it in mysql.
- data can be roll backed
2.TRUNCATE:
- Remove rows from mysql table but the structure of table remains same.
- The data cannot be roll backed
- can be used by only without 'WHERE' clause in mysql.
3. DROP:
- Remove whole table from mysql database.
- The data cannot be roll backed

For more details visit: http://www.phponwebsites.com/2014/01/mysql-delete-truncate-drop-difference.html

Is This Answer Correct ?    3 Yes 0 No

What are the differences between drop a table and truncate a table?..

Answer / shital

Delete - delete all the data from table but structure still remains as it is.
Truncate - delete all data from table but structure remains and memory still allocated for table.
Drop - delete all data as well as structure and also free the memory.

Is This Answer Correct ?    1 Yes 0 No

What are the differences between drop a table and truncate a table?..

Answer / raabhu

Drop a Table : Delete over all table is called drop...

Truncate a table : Delete only the field names of table is
called truncate...

Is This Answer Correct ?    6 Yes 12 No

What are the differences between drop a table and truncate a table?..

Answer / karthik

truncate means it will truncate the data, we can retrieve
it whenever we want using commit
drop - it delete the full structure as well as the data.
cant make a recovery.

Is This Answer Correct ?    2 Yes 10 No

What are the differences between drop a table and truncate a table?..

Answer / sudha

Truncate Table - Truncate table is the combination of Drop
and Create. It [Truncate]can drop and recreate the table.
Delete - Delete will deletes all the data in the table and
structure of the table.

Is This Answer Correct ?    4 Yes 20 No

Post New Answer

More MySQL Interview Questions

Why do we use group by and order by function in mysql?

0 Answers  


How to use count function in mysql?

0 Answers  


What is default schema in mysql?

0 Answers  


What is difference between mysql and mysqli?

0 Answers  


What is the difference between mysql and sql?

0 Answers  


What is delimiter $$?

0 Answers  


mysql> select * from store; +------+-------+-------+ | id | month | sales | +------+-------+-------+ | 1 | 1 | 100 | | 1 | 2 | 100 | | 1 | 3 | 200 | | 1 | 4 | 300 | | 1 | 5 | NULL | | 1 | 6 | 200 | | 1 | 7 | 800 | | 1 | 8 | 100 | | 1 | 9 | 240 | | 1 | 10 | 140 | | 1 | 11 | 400 | | 1 | 12 | 300 | | 2 | 1 | 300 | | 2 | 2 | 300 | | 2 | 3 | 300 | | 2 | 4 | 200 | | 2 | 5 | 200 | | 2 | 6 | 200 | | 2 | 7 | 100 | | 2 | 8 | 100 | | 2 | 9 | 300 | | 2 | 10 | 100 | | 2 | 11 | 150 | | 2 | 12 | 150 | +------+-------+-------+ this is my table. i need to display output like this. +------+----------+----------+----------+----------+ | id | quarter1 | quarter2 | quarter3 | quarter4 | +------+----------+----------+----------+----------+ | 1 | 400 | 500 | 1140 | 840 | | 2 | 900 | 600 | 500 | 400 | +------+----------+----------+----------+----------+ what single query i have to write for this. i tried this query and it displays like the below mysql> select id,sum(sales) as quarter1,(select sum(sales) from store where mont h>3 and month<7 ) as quarter2,(select sum(sales) from store where month>6 and mo nth<10)as quarter3 from store where month>0 and month<4 group by id; +------+----------+----------+----------+ | id | quarter1 | quarter2 | quarter3 | +------+----------+----------+----------+ | 1 | 400 | 1100 | 1640 | | 2 | 900 | 1100 | 1640 | +------+----------+----------+----------+ 2 rows in set (0.00 sec) tel me how to rectify it.

2 Answers  


What data structure does mysql use?

0 Answers  


How can you create and drop view in mysql?

0 Answers  


What is mysql server?

0 Answers  


What is the difference between a Table and a View?

3 Answers  


Does mysql case matter?

0 Answers  


Categories