Is there a way to test the mysql queries, without modifying my database?
For example, can I run a delete from my_table where id=101
without actual delete anything? What about insert and update?
TY
You can test your MySQL skills with W3Schools' Exercises.
MySQL and SQL Online Test | TestDome.
mysqlslap is a diagnostic program designed to emulate client load for a MySQL server and to report the timing of each stage. It works as if multiple clients are accessing the server.
MySQL Online is online editor and compiler. C, C++, Java, Ruby, Python, PHP, Perl,... More than 20 languages are supported. You can use for learn programming, scrape web sites, write batch, etc...
You could start a transaction before running your queries and then rollback after running them. Note that to do this you'll require InnoDB or XtraDb tables (won't work on MyISAM).
To start a transaction send to MySQL the following statement:
START TRANSACTION;
And at the end of your queries run the following statement:
ROLLBACK;
Your database will never be modified from the point of view of other connections. Your current connection will see the changes until ROLLBACK, and after that the original state will be restored.
If you just want to see how many rows would be deleted why not substitute 'delete' with 'select count(*)'?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With