Archive for the MySQL Category

Transfer database from one host to other using mysqldump and shell

Transferring your blog or web site from one host to another can sometimes be very cumbersome if not troublesome. There may be instances when you get stuck at few points and one of the major loop hole is to transfer data from one host to another. Most of us use browser based user friendly phpmyadmin

Read Full Post

Difference between truncate and delete in mysql

Well this is very common but much confused discussion. This question is often asked from freshers in interviews as well. The difference is pretty simple but yet people confuse it because they see the result to be the same of both the queries. Truncate and Delete are both SQL commands which result

Read Full Post

Insert and update in single mysql query using on duplicate key

Hey Guys, Let me first explain you the scenario in which more likely you can use this type of query. A generic scenario would be that  you are inserting data into a table and along with this you want to update a counter which is nothing but a field in the same table. More precisely or by taking

Read Full Post

Delete duplicate entries/rows/values in mysql table in one query

Hi all, During my starting phase of career, i faced several challenging questions (being a fresher at that time). I wanted to share this one as simple as pie but can be difficult at times if you do not know how to do it. Question can be : How can you delete or remove duplicate entries from

Read Full Post