Quiz Question: How could you drop a table twice?

How can this happen?

mysql> DROP TABLE t;
Query OK, 0 rows affected (0.00 sec)

mysql> DROP TABLE t;
Query OK, 0 rows affected (0.00 sec)

Well, just use a temporary table.

mysql> CREATE TABLE t (i INT);
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE TEMPORARY TABLE t (d DATE);
Query OK, 0 rows affected (0.01 sec)

mysql> DROP TABLE t;
Query OK, 0 rows affected (0.00 sec)

mysql> DROP TABLE t;
Query OK, 0 rows affected (0.00 sec)

I will add more such silly/hard/cool/whatever questions from time to time here.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.