Loading...
    • 开发者指南
    • API 参考
    • MCP
    • 资源
    • 发布说明
    Search...
    ⌘K

    资源

    overview术语表系统提示词

    用例

    概述工单路由客户支持代理内容审核法律文件摘要

    提示库

    提示词库宇宙按键企业透视师网站向导Excel公式专家Google apps 脚本编写器Python 错误修复器时间旅行顾问故事创作伙伴引用你的来源SQL 魔法师梦境解释师双关语专家烹饪创作者混成词诗人Hal 幽默助手LaTeX 传奇情绪着色器Git 高手比喻专家道德困境导航器会议记录员习语阐释器代码顾问函数制造器新词创造者CSV 转换器表情符号编码器散文润色器观点思考者问答题生成器正念导师二年级简化器VR健身创新者PII 净化器备忘录大师职业教练评分大师绕口令面试问题制作器语法精灵猜猜这个谜语代码解释器外星人类学家数据整理器品牌建设者效率估算器评论分类器方向解码器励志缪斯邮箱地址提取器主审核员课程规划师苏格拉底智者头韵炼金术师未来主义时尚顾问多语言超能力产品命名专家哲学思辨电子表格魔法师科幻场景模拟器自适应编辑器Babel的广播推文语调检测器机场代码分析器
    Console
    提示库

    SQL 魔法师

    将日常语言转换为 SQL 查询。

    将此提示复制到我们的开发者控制台中亲自试用!

    内容
    System将以下自然语言请求转换为有效的 SQL 查询。假设存在一个具有以下表和列的数据库:

    Customers:
    - customer_id (INT, PRIMARY KEY)
    - first_name (VARCHAR)
    - last_name (VARCHAR)
    - email (VARCHAR)
    - phone (VARCHAR)
    - address (VARCHAR)
    - city (VARCHAR)
    - state (VARCHAR)
    - zip_code (VARCHAR)

    Products:
    - product_id (INT, PRIMARY KEY)
    - product_name (VARCHAR)
    - description (TEXT)
    - category (VARCHAR)
    - price (DECIMAL)
    - stock_quantity (INT)

    Orders:
    - order_id (INT, PRIMARY KEY)
    - customer_id (INT, FOREIGN KEY REFERENCES Customers)
    - order_date (DATE)
    - total_amount (DECIMAL)
    - status (VARCHAR)

    Order_Items:
    - order_item_id (INT, PRIMARY KEY)
    - order_id (INT, FOREIGN KEY REFERENCES Orders)
    - product_id (INT, FOREIGN KEY REFERENCES Products)
    - quantity (INT)
    - price (DECIMAL)

    Reviews:
    - review_id (INT, PRIMARY KEY)
    - product_id (INT, FOREIGN KEY REFERENCES Products)
    - customer_id (INT, FOREIGN KEY REFERENCES Customers)
    - rating (INT)
    - comment (TEXT)
    - review_date (DATE)

    Employees:
    - employee_id (INT, PRIMARY KEY)
    - first_name (VARCHAR)
    - last_name (VARCHAR)
    - email (VARCHAR)
    - phone (VARCHAR)
    - hire_date (DATE)
    - job_title (VARCHAR)
    - department (VARCHAR)
    - salary (DECIMAL)

    提供基于自然语言请求检索数据的 SQL 查询。
    User获取已下订单但未提供任何评论的客户列表,以及他们在订单上花费的总金额。

    示例输出

    SELECT c.first_name, c.last_name, SUM(o.total_amount) AS total_spent
    FROM Customers c
    INNER JOIN Orders o ON c.customer_id = o.customer_id
    LEFT JOIN Reviews r ON c.customer_id = r.customer_id
    WHERE r.review_id IS NULL
    GROUP BY c.customer_id, c.first_name, c.last_name;
    

    API 请求


    • API 请求
    © 2025 ANTHROPIC PBC

    Products

    • Claude
    • Claude Code
    • Max plan
    • Team plan
    • Enterprise plan
    • Download app
    • Pricing
    • Log in

    Features

    • Claude and Slack
    • Claude in Excel

    Models

    • Opus
    • Sonnet
    • Haiku

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Claude Developer Platform

    • Overview
    • Developer docs
    • Pricing
    • Amazon Bedrock
    • Google Cloud’s Vertex AI
    • Console login

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Help and security

    • Availability
    • Status
    • Support center

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy

    Products

    • Claude
    • Claude Code
    • Max plan
    • Team plan
    • Enterprise plan
    • Download app
    • Pricing
    • Log in

    Features

    • Claude and Slack
    • Claude in Excel

    Models

    • Opus
    • Sonnet
    • Haiku

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Claude Developer Platform

    • Overview
    • Developer docs
    • Pricing
    • Amazon Bedrock
    • Google Cloud’s Vertex AI
    • Console login

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Help and security

    • Availability
    • Status
    • Support center

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    © 2025 ANTHROPIC PBC