SecureAIAutonomyLab / TexttoSql

MIT License
0 stars 0 forks source link

POC: Simple application to convert text to sql with adventure works db and chatgpt api #22

Closed marcenugo1 closed 1 year ago

marcenugo1 commented 1 year ago

TASKS

Test Cases:

  1. One where condition. Ex. What is "name" salary?

SELECT Base Salary FROM Compensation WHERE Name = 'Mark Zuckerberg'

  1. Multiple where conditions EX. Who makes less than $100k base in software engineering dept? SELECT Name FROM Compensation WHERE Department = 'Software Engineering' AND Base Salary < 10000

  2. With an aggregation EX. “total stock award given out to ppl in data science hired after 2000?" SELECT SUM(Stock Awards) FROM Compensation WHERE Department = 'Data Science' AND Hiring Date > 2000-01-01

  3. With JOIN, GROUB BY, HAVING, ORDER BY EX. “What is Mark Zuckerberg's salary?" SELECT Base Salary FROM Compensation c JOIN Employees e ON c.EmployeeId = e.EmployeeId WHERE e.FirstName = 'Mark' AND e.LastName = 'Zuckerberg'