Find tables with digits in their names in MariaDB database

Tables usually do not have digits in their names, and if they do, they have a special meaning. We use them to name backup tables with the date of a backup (of a single specific table while performing a sensitive operation), archival tables with year or for partition tables.

The query below finds all tables with digits in their names in all databases (schemas).


select table_schema as database_name,
from information_schema.tables
where table_type = 'BASE TABLE'
    and table_name rlike ('[0-9]')
order by table_schema,


  • database_name - name of the database (schema) where the table was found
  • table_name - name of the table found


  • One row: represents one table
  • Scope of rows: all found tables
  • Ordered by: database (schema) name, table name

Sample results

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.