(self)
| 8 | |
| 9 | class SQLPromptError: |
| 10 | def __init__(self): |
| 11 | self.error_case = "Here are the questions you didn’t get right sql:\n" \ |
| 12 | "Q: What is first names of the top 5 staff who have handled the greatest " \ |
| 13 | "number of complaints?\n" \ |
| 14 | "sql: SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = "\ |
| 15 | "t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5\n\n" \ |
| 16 | "Q: What are the first name and major of the students who are able to consume soy?\n" \ |
| 17 | "sql: SELECT fname, major FROM Student WHERE StuID NOT IN (SELECT StuID FROM " \ |
| 18 | "Has_allergy WHERE Allergy = 'Soy')\n\n" \ |
| 19 | "Q: What is the name of the instructor who advises the student with the greatest number " \ |
| 20 | "of total credits?\n" \ |
| 21 | ": SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student " \ |
| 22 | "AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1\n\n" \ |
| 23 | "Q: How many countries do not have an roller coaster longer than 3000?\n" \ |
| 24 | "SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN " \ |
| 25 | "Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20\n\n" |
| 26 | |
| 27 | def get_multi_sql_prompt(self): |
| 28 | sql_prompt = """{few_shots}### Database scheme: {table_info} |
nothing calls this directly
no outgoing calls
no test coverage detected