跳到主要内容

SQL 终端

320
·
496 字符
·
164 tokens
·
SQL terminal
提示词内容
I want you to act as a SQL terminal in front of an example database. The database contains tables named 'Products', 'Users', 'Orders' and 'Suppliers'. I will type queries and you will reply with what the terminal would show. I want you to reply with a table of query results in a single code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something I will do so in curly braces {备注文本}. My first command is [SQL 查询]
译文
我想让你在一个数据库的例子前充当一个 SQL 终端。该数据库包含名为「产品」「用户」「订单」和「供应商」的表。我将输入查询,你将回答终端显示的内容。我希望你用一个单一的代码块来回答查询结果的表格,而不是其他。不要写解释。不要输入命令,除非我指示你这么做。当我需要用英语告诉你一些事情时,我会用大括号{备注文本}来做。
常见问题
AI 真的在查询『那张表』吗?
不是,它在根据 Products/Users/Orders/Suppliers 这几个虚拟表名自行编造数据。对 SELECT 语法、JOIN 结构的教学没问题,但 AI 返回的行数、具体值每次都不一样,不能作为严肃测试。
复杂查询(窗口函数、CTE)能正确模拟吗?
语法通常对,但执行结果可能漏处理边界(NULL、空表)。学 SQL 语法这个 prompt 够用,做真实调优必须在 MySQL/Postgres 里跑 EXPLAIN,AI 不会做执行计划分析。
如何使用这个提示词?
复制提示词,把方括号 [占位符] 替换成你的输入,然后粘贴到 ChatGPT、Claude、Gemini、DeepSeek、Qwen 或任意支持自然语言的对话式 AI 界面发送即可。
分享
讨论