Example 1
Drop a temporary table and confirm other tables are unaffected
archive is dropped without error. The SELECT from products confirms that unrelated tables are not affected. To avoid an error if the table does not exist, use DROP TABLE IF EXISTS archive.
Source table data Rows loaded before the example query runs.
Setup
CREATE TABLE archive (id INT);
CREATE TABLE products (id INT, name VARCHAR(50));
INSERT INTO
products (id, name)
VALUES
(1, 'Keyboard');Validated query Shared across supported engines.
SQL
DROP TABLE archive;
SELECT
id,
name
FROM
products
ORDER BY
id;Expected result Returned rows for the shared example.
| id | name |
|---|---|
| 1 | Keyboard |
Output is identical across all engines.