# 数据库查询任务

这是一个可以对数据库连接器执行 SQL 查询的任务。

在编写 SQL 查询时，可以使用脚本上下文的 data 和 variables 等[脚本内置变量](../concept/script-internal-variables.md)中的变量值。

```
# SQL示例

Select * from LOT
where product='${variables.search.product}' // variables：场景输入变量
  and operation='${data.lot.operation}' // data：场景执行数据
  and factory='${domain.attributes.factory}' // domain：当前租户信息
```
