-- 10/23 tee 2024_10_23_sql_log.txt use toyu -- System Catalog -- Getting selected columns from information_schema SELECT table_name, table_type, row_format, table_rows, avg_row_length FROM information_schema.tables WHERE table_schema = 'information_schema' ORDER BY table_name DESC; SELECT table_name, table_type, row_format, table_rows, avg_row_length FROM information_schema.tables WHERE table_schema = 'toyu' ORDER BY table_name DESC; SELECT table_name, table_type, row_format, table_rows, avg_row_length FROM information_schema.tables WHERE table_schema = 'toyu' AND TABLE_TYPE = 'BASE TABLE' ORDER BY table_name DESC; -- databases and tables SELECT t.TABLE_SCHEMA AS `schema`, COUNT(t.TABLE_NAME) AS num_tables FROM information_schema.tables AS t GROUP BY `schema` ORDER BY num_tables DESC; SELECT table_rows FROM information_schema.tables WHERE table_schema = 'toyu' AND table_name = 'student'; SELECT t.TABLE_SCHEMA AS `schema`, t.ENGINE, COUNT(t.TABLE_NAME) AS num_tables FROM information_schema.tables t GROUP BY `schema`, t.ENGINE ORDER BY `schema`, num_tables DESC;