将自然語言翻譯為SQL查詢。
提示
### Postgres SQL表,及其屬性:
#
# Employee(id, name, department_id)
# Department(id, name, address)
# Salary_Payments(id, employee_id, amount, date)
#
### 查詢在過去3個月内雇傭了超過10名員工的部門名稱
SELECT
示例響應
SELECT d.name
FROM Department d
INNER JOIN Employee e ON d.id = e.department_id
INNER JOIN Salary_Payments sp ON e.id = sp.employee_id
WHERE sp.date > NOW() - INTERVAL '3 months'
GROUP BY d.name
HAVING COUNT(*) > 10
评论