()
| 201 | |
| 202 | |
| 203 | def get_join_nested_sql_prompt(): |
| 204 | sql_prompt = """{few_shots}### Database scheme: |
| 205 | {table_info} |
| 206 | |
| 207 | ### 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. |
| 208 | |
| 209 | ### Query: {query} |
| 210 | ### HINT: The question may needs nested queries like INTERSECT, UNION, EXCEPT, NOT IN. |
| 211 | |
| 212 | ### specification |
| 213 | 1."LIMIT" just is used when explicitly requesting how much to retrieve in the query. |
| 214 | 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. |
| 215 | 3.In sql, just select columns that are explicitly requested in the query. |
| 216 | 4.The output format must strictly meet the given json specification: {{"the most related fields or calculation methods of '{main_metric}'": "zzz", "sql": "ccc"}} |
| 217 | """ |
| 218 | return sql_prompt |
| 219 | |
| 220 | |
| 221 | def get_nested_sql_prompt(): |
no outgoing calls
no test coverage detected