Query that returns tables with number of columns, ordered from the ones that have the most.
Query
select table_schema,
       table_name,
       count(*) as columns
from v_catalog.columns
group by table_schema,
         table_name
order by columns desc;
Columns
- table_schema - name of the schema
- table_name - name of the table
- columns - number of columns in table
Rows
- One row represents one table in a database
- Scope of rows: all tables in a database
- Ordered by number of columns descending - from tables with the most columns
Sample results

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