List tables / collections
Oracle
SELECT table_name FROM user_tables ORDER BY table_name;
-- All schemas: SELECT owner, table_name FROM dba_tables ORDER BY owner, table_name;user_tables returns tables in the current schema, all_tables those that are accessible.
PostgreSQL
SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog','information_schema')
ORDER BY 1, 2;
-- psql shortcut: \dt *.*For the public schema only: WHERE table_schema = 'public'.
MySQL
SHOW TABLES;
-- Another schema: SHOW TABLES FROM mydb;For details: SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = DATABASE();
SQL Server
SELECT s.name AS schema_name, t.name AS table_name
FROM sys.tables t
JOIN sys.schemas s ON t.schema_id = s.schema_id
ORDER BY s.name, t.name;Shortcut: SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';
MongoDB
show collections
// or: db.getCollectionNames()To also see system collections: db.getCollectionInfos().
Redis
SCAN 0 MATCH * COUNT 100
# Continue with SCAN <cursor> ... using the returned cursorRedis has no 'tables'; keys are listed. NEVER use KEYS * in production (it blocks); SCAN is cursor-based.