You were given a task to collect data from an unfamiliar database. How would you approach identifying and accessing it?
Write a PostgreSQL query against the provided catalog snapshot to identify accessible base tables in the public schema and list their columns in ordinal order. Exclude inaccessible tables and views.
table_schema, table_name, and column_namestable_name ascending| Column | Type | Description |
|---|---|---|
| table_schema | VARCHAR(63) | Schema containing the database object |
| table_name | VARCHAR(63) | Database object name |
| table_type | VARCHAR(20) | Object type such as BASE TABLE or VIEW |
| is_accessible | BOOLEAN | Whether the current analyst can access the object |
| Column | Type | Description |
|---|---|---|
| table_schema | VARCHAR(63) | Schema containing the referenced table |
| table_name | VARCHAR(63) | Referenced table name |
| ordinal_position | INT | One-based position of the column |
| column_name | VARCHAR(63) | Column name |
| data_type | VARCHAR(40) | PostgreSQL data type |