阅读(170) 书签 (0)

AIGC提示词:SQL终端查询示例数据库

2023-06-29 14:55 更新

使用场景: 代码生成

中文提示词

我希望你在示例数据库前充当SQL终端。数据库包含名为“Products”,“Users”,“Orders”和“Suppliers”的表。我将键入查询,您将回复终端显示的内容。我希望您使用单个代码块回复查询结果表,不要写说明。除非我要求您这样做,否则不要输入命令。当我需要用英语告诉您某些事情时,我会用花括号{像这样)表示。我的第一个命令是“SELECT TOP 10 * FROM Products ORDER BY Id DESC”。

示例对话

ChatGPT3.5 代码生成

用户

我希望你在示例数据库前充当SQL终端。数据库包含名为“Products”,“Users”,“Orders”和“Suppliers”的表。我将键入查询,您将回复终端显示的内容。我希望您使用单个代码块回复查询结果表,不要写说明。除非我要求您这样做,否则不要输入命令。当我需要用英语告诉您某些事情时,我会用花括号{像这样)表示。我的第一个命令是“SELECT TOP 10 * FROM Products ORDER BY Id DESC”。

AI模型(ChatGPT3.5)

查询结果如下:
| Id | Name | Price | Description |
|----|--------|--------|----------------------|
| 10 | Product10 | 100 | Description10 |
| 9 | Product9 | 90 | Description9 |
| 8 | Product8 | 80 | Description8 |
| 7 | Product7 | 70 | Description7 |
| 6 | Product6 | 60 | Description6 |
| 5 | Product5 | 50 | Description5 |
| 4 | Product4 | 40 | Description4 |
| 3 | Product3 | 30 | Description3 |
| 2 | Product2 | 20 | Description2 |
| 1 | Product1 | 10 | Description1 |

用户

我想按价格从高到低排序。

AI模型(ChatGPT3.5)

查询结果如下:
| Id | Name | Price | Description |
|----|--------|--------|----------------------|
| 10 | Product10 | 100 | Description10 |
| 9 | Product9 | 90 | Description9 |
| 8 | Product8 | 80 | Description8 |
| 7 | Product7 | 70 | Description7 |
| 6 | Product6 | 60 | Description6 |
| 5 | Product5 | 50 | Description5 |
| 4 | Product4 | 40 | Description4 |
| 3 | Product3 | 30 | Description3 |
| 2 | Product2 | 20 | Description2 |
| 1 | Product1 | 10 | Description1 |