The impermanent tables could be valuable sometimes to keep transitory information. The main thing that ought to be known for brief tables is that they will be erased when the current customer meeting ends.
As expressed before, impermanent tables will just keep going as long as the meeting is alive. In the event that you run the code in a PHP content, the brief table will be devastated consequently when the content gets done with executing. In the event that you are associated with the MySQL information base worker through the MySQLi customer program, at that point the transitory table will exist until you close the customer or physically pulverize the table.
Example
Here is a model indicating you use of transitory table. Same code can be utilized in PHP contents utilizing mysqli_query() work.
mysql> CREATE TEMPORARY TABLE SalesSummary (
-> product_name VARCHAR(50) NOT NULL
-> , total_sales DECIMAL(12,2) NOT NULL DEFAULT 0.00
-> , avg_unit_price DECIMAL(7,2) NOT NULL DEFAULT 0.00
-> , total_units_sold INT UNSIGNED NOT NULL DEFAULT 0
-> );
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO SalesSummary
-> (product_name, total_sales, avg_unit_price, total_units_sold)
-> VALUES
-> ('cucumber', 100.25, 90, 2);
mysql> SELECT * FROM SalesSummary;
+--------------+-------------+----------------+------------------+
| product_name | total_sales | avg_unit_price | total_units_sold |
+--------------+-------------+----------------+------------------+
| cucumber | 100.25 | 90.00 | 2 |
+--------------+-------------+----------------+------------------+
1 row in set (0.00 sec)
At the point when you issue a SHOW TABLES order, at that point your brief table would not be rattled off in the rundown. Presently, on the off chance that you will log out of the MySQLi meeting and, at that point you will give a SELECT order, at that point you will discover no information accessible in the data set. Indeed, even your impermanent table would likewise not exist.
Dropping Temporary Tables
Naturally, all the brief tables are erased by MySQLi when your data set association gets ended. Still on the off chance that you need to erase them in the middle, at that point you do as such by giving DROP TABLE order.
Following is the model on dropping a transitory table −
mysql> DROP TABLE SalesSummary;
mysql> SELECT * FROM SalesSummary;
ERROR 1146: Table 'TUTORIALS.SalesSummary' doesn't exist