How to reset auto-increment values?

Auto-increment feature assigned to a column generates a unique key to the row. The attribute ge...

Error handling in stored procedures

When an error is found during execution of a stored procedure, it can be handled in MySQL in two ways. The current block may continue to execute by throwing a warning or exit from executin...

Raising Error Conditions with SIGNAL / RESIGNAL Statements

The SIGNAL statements are used as a way to return an error message appearing during code execution. These statements provide...

Comparing two MySQL tables

When data is moved from one database or server to another, we need to compare two tables to identify if the data is valid to be migrated or not. If we have a legacy database whose data has to be mi...

How to copying a table in MySQL

Sometimes we need to copy a table from MySQL database to another one, whether because of a backup or building another, similar table, or any another reason. When a table has to be cloned for applic...