SQL translate
Translate natural language to SQL queries.
Example input
-
### Postgres SQL tables, with their properties: # # Employee(id, name, department_id) # Department(id, name, address) # Salary_Payments(id, employee_id, amount, date) # ### A query to list the names of the departments which employed more than 10 employees in the last 3 months SELECT
Example real generated results
-
star
d.name FROM SALARY_PAYMENTS AS s INNER JOIN DEPARTMENT D ON S.DEPARTMENT_ID = D.ID WHERE DATEADD (MONTH, -3, DATE(s.date)) > SYSDATE AND s.employee_id > 0 ORDER BY COUNT (*) DESC LIMIT 5
-
star
d.name FROM salpayments_sheet_table ss JOIN depttable d USING (dept_id) WHERE YEARWEEK(ss.date_created) >= '20190101' AND YEARWEEK(SS.DATE_CREATED) <= '20191231'
-
star
d.name FROM salary_payments s JOIN employees e ON e.id=s.employee_id AND e.status='active' JOIN departments_dated D ON D.date=getdate()-330 GROUP BY d.name ORDER BY count(d.name) DESC LIMIT 20
-
star
d.name FROM salpays s JOIN deptdept d ON (d.id=s.departmet_id) AND ((TO_DATE(s.start_date,'dd/mm/yyyy')) >= TO_DATE(NOW(), 'dd/mm/yyyy') AND (TO_DATE(SALARY_PAYMENT_AMOUNT,('YYYY-MM-DD HH24:MI:SS'))) BETWEEN DATE_ADD( TO_DATE(CURRENT_TIMESTAMP, 'Days:3 MONTHS'), '+10 HOURS')) WHERE d.employees > 10
try it yourself: Text Generator Playground - SQL translate
Sign up