Following command is used to get all table names of a particular database.
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA={DATABASE_NAME};
Example
mysql> SELECT TABLE_NAME
-> FROM INFORMATION_SCHEMA.TABLES
-> WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA='demo';
+---------------+
| TABLE_NAME |
+---------------+
| customer |
| employee |
| test_customer |
+---------------+
3 rows in set (0.00 sec)
No comments:
Post a Comment