schema-exploration by langchain-ai/deepagents
npx skills add https://github.com/langchain-ai/deepagents --skill schema-exploration使用 sql_db_list_tables 工具查看数据库中的所有可用表。
这将返回您可以查询的完整表列表。
使用 sql_db_schema 工具配合表名来检查:
识别表之间的连接方式:
提供关于以下方面的清晰信息:
步骤 1: 使用 sql_db_list_tables
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
响应:
Chinook 数据库包含 11 个表:
1. Artist - 音乐艺术家
2. Album - 音乐专辑
3. Track - 单首歌曲
4. Genre - 音乐流派
5. MediaType - 文件格式(MP3、AAC 等)
6. Playlist - 用户创建的播放列表
7. PlaylistTrack - 播放列表中的曲目
8. Customer - 商店客户
9. Employee - 商店员工
10. Invoice - 客户购买记录
11. InvoiceLine - 发票中的单个项目
步骤 1: 使用 sql_db_schema 并指定表名 "Customer"
响应:
Customer 表包含以下列:
- CustomerId (INTEGER) - 主键,唯一的客户 ID
- FirstName (NVARCHAR) - 客户的名字
- LastName (NVARCHAR) - 客户的姓氏
- Company (NVARCHAR) - 公司名称(可选)
- Address, City, State, Country, PostalCode - 位置字段
- Phone (NVARCHAR) - 电话号码
- Fax (NVARCHAR) - 传真号码
- Email (NVARCHAR) - 电子邮件地址
- SupportRepId (INTEGER) - 指向 Employee 表的外键
示例数据显示了如下的客户:
- 来自巴西的 Luís Gonçalves
- 来自德国的 Leonie Köhler
- 来自加拿大的 François Tremblay
步骤 1: 识别所需的表
步骤 2: 映射关系
Artist (ArtistId)
↓ 1:多
Album (ArtistId, AlbumId)
↓ 1:多
Track (AlbumId, TrackId)
↓ 1:多
InvoiceLine (TrackId, UnitPrice, Quantity)
响应:
要按艺术家查找收入,您需要:
1. 从 Artist 表开始
2. 通过 ArtistId 连接到 Album
3. 通过 AlbumId 连接到 Track
4. 通过 TrackId 连接到 InvoiceLine
5. 计算收入总和(UnitPrice * Quantity)
6. 按艺术家名称分组
这需要使用查询编写技能来执行。
对于"列出表"的问题:
对于"描述表"的问题:
对于"如何查询 X"的问题:
每周安装量
172
代码仓库
GitHub 星标数
17.1K
首次出现
2026 年 1 月 22 日
安全审计
安装于
opencode158
codex158
gemini-cli155
cursor151
github-copilot150
claude-code147
Use sql_db_list_tables tool to see all available tables in the database.
This returns the complete list of tables you can query.
Use sql_db_schema tool with table names to examine:
Identify how tables connect:
Provide clear information about:
Step 1: Use sql_db_list_tables
Response:
The Chinook database has 11 tables:
1. Artist - Music artists
2. Album - Music albums
3. Track - Individual songs
4. Genre - Music genres
5. MediaType - File formats (MP3, AAC, etc.)
6. Playlist - User-created playlists
7. PlaylistTrack - Tracks in playlists
8. Customer - Store customers
9. Employee - Store employees
10. Invoice - Customer purchases
11. InvoiceLine - Individual items in invoices
Step 1: Use sql_db_schema with table name "Customer"
Response:
The Customer table has these columns:
- CustomerId (INTEGER) - Primary key, unique customer ID
- FirstName (NVARCHAR) - Customer's first name
- LastName (NVARCHAR) - Customer's last name
- Company (NVARCHAR) - Company name (optional)
- Address, City, State, Country, PostalCode - Location fields
- Phone (NVARCHAR) - Phone number
- Fax (NVARCHAR) - Fax number
- Email (NVARCHAR) - Email address
- SupportRepId (INTEGER) - Foreign key to Employee table
Sample data shows customers like:
- Luís Gonçalves from Brazil
- Leonie Köhler from Germany
- François Tremblay from Canada
Step 1: Identify tables needed
Step 2: Map relationships
Artist (ArtistId)
↓ 1:many
Album (ArtistId, AlbumId)
↓ 1:many
Track (AlbumId, TrackId)
↓ 1:many
InvoiceLine (TrackId, UnitPrice, Quantity)
Response:
To find revenue by artist, you'll need to:
1. Start with the Artist table
2. JOIN to Album on ArtistId
3. JOIN to Track on AlbumId
4. JOIN to InvoiceLine on TrackId
5. SUM the revenue (UnitPrice * Quantity)
6. GROUP BY artist name
This requires the query-writing skill to execute.
For "list tables" questions:
For "describe table" questions:
For "how do I query X" questions:
Weekly Installs
172
Repository
GitHub Stars
17.1K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode158
codex158
gemini-cli155
cursor151
github-copilot150
claude-code147
Python PDF处理教程:合并拆分、提取文本表格、创建PDF文件
61,100 周安装