I have 3 tables (janitor, security & manager)
which inherited from the user table
.
What is the query can be used to produce the following result(list all the name of the child tables)?
Thank you. Cheer :)
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityI have 3 tables (janitor, security & manager)
which inherited from the user table
.
What is the query can be used to produce the following result(list all the name of the child tables)?
Thank you. Cheer :)
Try this:
SELECT
table_name
FROM information_schema.KEY_COLUMN_USAGE
WHERE table_schema = 'database_name'
AND referenced_table_name = 'user';
This will list of referenced tables under table 'user'
.