Query below lists tables with their number of foreign keys and number of tables they refer to.

See also:
Query
select 
tabschema concat '.' concat tabname as table,
count(constname) as foreign_keys,
count(distinct reftabschema concat '.' concat reftabname) as referenced_tables
from syscat.references
group by tabschema concat '.' concat tabname
order by count(*) desc
Columns
- table - table with schema name
- foreign_keys - number of foreign keys in a table
- referenced_tables - number of referenced tables. Note that it is not the same as number of foreign keys, as multiple foreign keys may reference the same table.
Rows
- One row represents one table in a database
- Scope of rows: tables in a database that have foreign keys (reference other tables)
- Ordered by number of foreign keys from the ones with the most
Sample results
Tables in GSDB with most foreign keys:

 
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                     
                                                                 
                                                             
                                                             
                                                             
                                                             
                                                                 
                                                             
                                                             
                                                                 
                                                             
                                                             
                                                             
                                                             Marcin Nagly
                                                                        Marcin Nagly
                                 IBM Db2
                                                                IBM Db2
                                 SQL Server
                                                                                                SQL Server
                                             Azure SQL Database
                                                                                                Azure SQL Database
                                             Oracle database
                                                                                                Oracle database
                                             Snowflake
                                                                                                Snowflake
                                             Amazon Redshift
                                                                                                Amazon Redshift
                                             Teradata
                                                                                                Teradata
                                             Vertica
                                                                                                Vertica
                                             PostgreSQL
                                                                                                PostgreSQL
                                             MySQL
                                                                                                MySQL
                                             MariaDB
                                                                                                MariaDB