| name | schema-exploration |
| description | For discovering and understanding database structure, tables, columns, and relationships |
Schema Exploration Skill
When to Use This Skill
Use this skill when you need to:
- Understand the database structure
- Find which tables contain certain types of data
- Discover column names and data types
- Map relationships between tables
Workflow
1. List All Tables
Use sql_db_list_tables tool to see all available tables in the database.
2. Get Schema for Specific Tables
Use sql_db_schema tool with table names to examine:
- Column names - What fields are available
- Data types - INTEGER, TEXT, DATETIME, etc.
- Sample data - 3 example rows to understand content
- Primary keys - Unique identifiers for rows
- Foreign keys - Relationships to other tables
3. Map Relationships
Identify how tables connect:
- Look for columns ending in "Id" (e.g., CustomerId, ArtistId)
- Foreign keys link to primary keys in other tables
- Document parent-child relationships
4. Answer the Question
Provide clear information about:
- Available tables and their purpose
- Column names and what they contain
- How tables relate to each other
- Sample data to illustrate content
Common Exploration Patterns
Pattern 1: Find a Table
"Which table has customer information?"
→ Use list_tables, then describe Customer table
Pattern 2: Understand Structure
"What's in the Invoice table?"
→ Use schema tool to show columns and sample data
Pattern 3: Map Relationships
"How are artists connected to sales?"
→ Trace the foreign key chain: Artist → Album → Track → InvoiceLine → Invoice
Tips
- Table names in Chinook are singular and capitalized (Customer, not customers)
- Foreign keys typically have "Id" suffix and match a table name
- Use sample data to understand what values look like
- When unsure which table to use, list all tables first