Text Generator
Text Generator > Use Cases >SQL translate

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

    * FROM `salaries` WHERE salary_type IN ('Monthly Income Paid', 'Weekly Payable' )

  • star

    d.name FROM ( SELECT DISTINCT DEPT_CODE from s_membership_salaries WHERE empID > 20 UNION SELECT 'DET01' + strsep('-') as dept_code from membership_payrolls WHERE month = 'MO12'

  • star

    DISTINCT DEPT.name FROM `employee` E LEFT JOIN ( SELECT MIN (COUNT) AS nbrEmployees from salypayroll_pay_entries p INNER join employment_info ei ON ei.id_employment = spayroll_epd_payment_details_salypayment_entry_detail_pk ) D on PEPD_DEPT_ID equals? OR EPDPE_DEPT_ID Equals '0000'

  • star

    `employee`.* FROM (Employee as e INNER JOIN Dept on CompanyId = 2 AND DepartementName LIKE 'DEPARTMENT_%' ) inner join (select id from salaries where salary_pay_type='INCOME' and payed=0) as IncomeOnPay ON EmployeId=EmployeeID LEFT OUTER JOIN ( select Name FROM ( SELECT Empno FROM ( Select * From tblSalariates ) AS All WHERE SumSums(salary_salary_in_days) >=10 ) union all ( /* some other joins */ ) InnerJoinDept1 On (CompanyID=company1 And employees=employe1andde

try it yourself: Text Generator Playground - SQL translate