()
| 219 | |
| 220 | |
| 221 | def get_nested_sql_prompt(): |
| 222 | sql_prompt = """{few_shots}### Database scheme: |
| 223 | {table_info} |
| 224 | |
| 225 | ### Please think carefully about the related fields or calculation methods of '{main_metric}', then write valid SQLite to solve the following questions based on the above table information, and do not select extra columns that are not explicitly requested in the query. |
| 226 | |
| 227 | ### Query: {query} |
| 228 | ### HINT: The question may needs nested queries like INTERSECT, UNION, EXCEPT, NOT IN. |
| 229 | |
| 230 | ### specification |
| 231 | 1."LIMIT" just is used when explicitly requesting how much to retrieve in the query. |
| 232 | 2.Don't use "IN", "OR", "LEFT JOIN" in sql because they aren't supported in execution engine, you can use "INTERSECT" or "EXCEPT" instead. |
| 233 | 3.In sql, just select columns that are explicitly requested in the query. |
| 234 | 4.The output format must strictly meet the given json specification: {{"the most related fields or calculation methods of '{main_metric}'": "zzz", "sql": "ccc"}} |
| 235 | """ |
| 236 | return sql_prompt |
| 237 | |
| 238 | |
| 239 | def get_characters_from_sql_prompt(): |
no outgoing calls
no test coverage detected