Oracle PL/SQL – Finding number of rows in each table by a single query

Sample:


select
table_name,
to_number(extractvalue(xmltype(dbms_xmlgen.getxml('select count(*) c from '||table_name)),'/ROWSET/ROW/C')) as RowCount
from user_tables
where iot_type != 'IOT_OVERFLOW'
or iot_type is null;

Results:

OR

select owner, table_name, num_rows, last_analyzed from all_tables;