MySQL Metadata Queries — Find all tables in a Schema

Joshua Otwell
Level Up Coding
Published in
4 min readSep 7, 2022

--

Of course, there are other ways to determine what tables are present in a particular MySQL Database or Schema. You can also find this information if your database user account has permissions for the INFORMATION_SCHEMA database. Continue reading and follow along with an example query…

Image by Clker-Free-Vector-Images from Pixabay

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, when you subscribe to the OpenLampTech newsletter.

As I explore and learn more about the INFORMATION_SCHEMA database, I wish to share my findings with others who may be interested.

INFORMATION_SCHEMA TABLES Table

All that is needed is a simple query against the INFORMATION_SCHEMA TABLES table. I have a ‘walking’ database where I store data pertaining to walking for exercise and if I want to know what tables are part of that schema, this query will retrieve that information:

SELECT TABLE_NAME
FROM TABLES
WHERE TABLE_SCHEMA = 'walking';

I hope you find it useful!

Educational — SQL Cookbook: Query Solutions and Techniques for All SQL Users

Like what you have read? See anything incorrect? Please comment below and thank you for reading!!!

A Call To Action!

Thank you for taking the time to read this post. I truly hope you discovered something interesting and enlightening. Please share your findings here, with someone else you know who would get the same value out of it as well.

Visit the Portfolio-Projects page to see blog posts/technical writing I have completed for clients.

Coffee is my favorite drink and fuel!!!

To receive email notifications (Never Spam) from this blog (“Digital Owl’s Prose”) for the latest blog posts as they are published, please subscribe (of your own volition) by clicking the ‘Click To Subscribe!’ button in the sidebar on the homepage! (Feel free at any time to review the Digital Owl’s Prose Privacy Policy Page for any questions you may have about: email updates, opt-in, opt-out, contact forms, etc…)

Be sure and visit the “Best Of” page for a collection of my best blog posts.

--

--

SQL | PHP | Photography. Sign-up for my free developer newsletter, OpenLampTech, here: openlamptech.substack.com