{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/natural-sql-making-sql-easier-to-infer-from","title":"Natural SQL: Making SQL Easier to Infer from Natural Language Specifications","arxiv_id":"2109.05153","date":"2021-09-11","proceeding":"Findings (EMNLP) 2021 11","authors":["Yujian Gan","Xinyun Chen","Jinxia Xie","Matthew Purver","John R. Woodward","John Drake","Qiaofu Zhang"],"abstract":"Addressing the mismatch between natural language descriptions and the corresponding SQL queries is a key challenge for text-to-SQL translation. To bridge this gap, we propose an SQL intermediate representation (IR) called Natural SQL (NatSQL). Specifically, NatSQL preserves the core functionalities of SQL, while it simplifies the queries as follows: (1) dispensing with operators and keywords such as GROUP BY, HAVING, FROM, JOIN ON, which are usually hard to find counterparts for in the text descriptions; (2) removing the need for nested subqueries and set operators; and (3) making schema linking easier by reducing the required number of schema items. On Spider, a challenging text-to-SQL benchmark that contains complex and nested SQL queries, we demonstrate that NatSQL outperforms other IRs, and significantly improves the performance of several previous SOTA models. Furthermore, for existing models that do not support executable SQL generation, NatSQL easily enables them to generate executable SQL queries, and achieves the new state-of-the-art execution accuracy.","url_abs":"https://arxiv.org/abs/2109.05153v1","url_pdf":"https://arxiv.org/pdf/2109.05153v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"natural-sql-making-sql-easier-to-infer-from","repo_url":"https://github.com/ygan/natsql","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"natural-sql-making-sql-easier-to-infer-from","repo_url":"https://github.com/cuplv/text-to-sql-wizardcoder","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"natural-sql-making-sql-easier-to-infer-from","repo_url":"https://github.com/saparina/text2sql-nlvariation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"text-to-sql","task_name":"Text to SQL"},{"task_slug":"text-to-sql","task_name":"Text-To-SQL"},{"task_slug":"translation","task_name":"Translation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2109.05153","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2109.05153"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/saparina/text2sql-nlvariation","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cuplv/text-to-sql-wizardcoder","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ygan/natsql","reach":{"status":"ok"}}],"summary":{"ran_honours":2,"unverified":1},"by_repo_kind":{"official":{"samples":3,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":3,"samples":[{"code_sha256_prefix":"b0825d653a089615","entry":"natsql_idx_to_table2_idx","repo":"ygan/natsql","repo_kind":"official","path":"natsql2sql/natsql2sql.py","file_url":"https://github.com/ygan/natsql/blob/HEAD/natsql2sql/natsql2sql.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b0825d653a089615"}},{"code_sha256_prefix":"48b57e02e3f2c83d","entry":"reversed_link_back_col","repo":"ygan/natsql","repo_kind":"official","path":"table_transform.py","file_url":"https://github.com/ygan/natsql/blob/HEAD/table_transform.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"48b57e02e3f2c83d"}},{"code_sha256_prefix":"14ad4335d565ea1d","entry":"check_relation","repo":"ygan/natsql","repo_kind":"official","path":"natsql2sql/natsql2sql.py","file_url":"https://github.com/ygan/natsql/blob/HEAD/natsql2sql/natsql2sql.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"14ad4335d565ea1d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}