diff --git a/.gitattributes b/.gitattributes index bed0738c7eeb449bca98b5d2f33c89a1ee56349a..24cd5842aaed66e6e26724f63d2129128e1b0a84 100644 --- a/.gitattributes +++ b/.gitattributes @@ -58,3 +58,16 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text # Video files - compressed *.mp4 filter=lfs diff=lfs merge=lfs -text *.webm filter=lfs diff=lfs merge=lfs -text +databases/baseball_1/baseball_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/bike_1/bike_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/chinook_1/chinook_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/college_2/college_2.sqlite filter=lfs diff=lfs merge=lfs -text +databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite filter=lfs diff=lfs merge=lfs -text +databases/csu_1/csu_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/flight_4/flight_4.sqlite filter=lfs diff=lfs merge=lfs -text +databases/formula_1/formula_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/sakila_1/sakila_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/soccer_1/soccer_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/store_1/store_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/world_1/world_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/wta_1/wta_1.sqlite filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7faeca9d50c2b4cb9ce2874ed5394c7776e4336f --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +--- +license: cc-by-sa-4.0 +task_categories: +- text2text-generation +language: +- en +tags: +- text-to-sql +- spider +- self-healing +pretty_name: Self-heal SQL - Spider splits +--- + +# Self-heal SQL: database-disjoint Spider splits + +Splits and SQLite databases used for a self-healing text-to-SQL agent +(detect failures -> classify -> generate corrective examples -> DPO retrain -> gate). + +Derived from **Spider** (Yu et al., 2018, https://yale-lily.github.io/spider), CC BY-SA 4.0. + +| split | source | purpose | +|---|---|---| +| `pool` | Spider train, DB group A | failure pool; its failures become training data | +| `gate` | Spider train, DB group B | held-out deployment gate; never used to build training data | +| `test` | Spider dev | headline before/after numbers | + +No database appears in more than one split (asserted at build time). Rows whose gold query +errors, times out or returns zero rows were dropped. + +Row fields: `qid, split, db_id, question, gold_sql, db_path, schema`. +`db_path` is relative to the repo root. diff --git a/databases/activity_1/activity_1.sqlite b/databases/activity_1/activity_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..3226a20b0adc79993f4a00d9a5c2e8e61835d557 Binary files /dev/null and b/databases/activity_1/activity_1.sqlite differ diff --git a/databases/aircraft/aircraft.sqlite b/databases/aircraft/aircraft.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..23967c90aa67bff8ee56332781f5ec9fa7ad6fd4 Binary files /dev/null and b/databases/aircraft/aircraft.sqlite differ diff --git a/databases/allergy_1/allergy_1.sqlite b/databases/allergy_1/allergy_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4c8e83e71d214bcbc9996af75a9af6cf6cf5a956 Binary files /dev/null and b/databases/allergy_1/allergy_1.sqlite differ diff --git a/databases/apartment_rentals/apartment_rentals.sqlite b/databases/apartment_rentals/apartment_rentals.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..52fac7d3652db0d983b23dd55e5721d516211955 Binary files /dev/null and b/databases/apartment_rentals/apartment_rentals.sqlite differ diff --git a/databases/architecture/architecture.sqlite b/databases/architecture/architecture.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d41fe90bd88bef947545e8887c00a892cd77ca36 Binary files /dev/null and b/databases/architecture/architecture.sqlite differ diff --git a/databases/assets_maintenance/assets_maintenance.sqlite b/databases/assets_maintenance/assets_maintenance.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..98066158448fc2cca0434ede1cb09fb80295290c Binary files /dev/null and b/databases/assets_maintenance/assets_maintenance.sqlite differ diff --git a/databases/baseball_1/baseball_1.sqlite b/databases/baseball_1/baseball_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..566d239a779f8899ce86e73b60a950b94516fabd --- /dev/null +++ b/databases/baseball_1/baseball_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbeb49298ffc84465f7a27f3477fe73e05a2ced8d4c3c972d20d75c25820f29b +size 29794304 diff --git a/databases/battle_death/battle_death.sqlite b/databases/battle_death/battle_death.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b7bb0daa4768cbd6e47c3ee7684e83907c0323be Binary files /dev/null and b/databases/battle_death/battle_death.sqlite differ diff --git a/databases/behavior_monitoring/behavior_monitoring.sqlite b/databases/behavior_monitoring/behavior_monitoring.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c5604e0057cbe3525bee8f574b68da119f0ff3cd Binary files /dev/null and b/databases/behavior_monitoring/behavior_monitoring.sqlite differ diff --git a/databases/bike_1/bike_1.sqlite b/databases/bike_1/bike_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..97a09e9c44b2caa456e3936dc1faea22d908e8f7 --- /dev/null +++ b/databases/bike_1/bike_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5ae0e24e3a9d860a38ec6256828e3b9e37691c80931ef554adc202f8eb2950c +size 1785856 diff --git a/databases/browser_web/browser_web.sqlite b/databases/browser_web/browser_web.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..cabd9d6e7a3e897488c3e87f16a74e862be618c5 Binary files /dev/null and b/databases/browser_web/browser_web.sqlite differ diff --git a/databases/candidate_poll/candidate_poll.sqlite b/databases/candidate_poll/candidate_poll.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..457eb2b8e08bca4f203f6595b6c7c4761172c269 Binary files /dev/null and b/databases/candidate_poll/candidate_poll.sqlite differ diff --git a/databases/car_1/car_1.sqlite b/databases/car_1/car_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b2c94f19fb637f9234b514bfb2f41ea94b31dec3 Binary files /dev/null and b/databases/car_1/car_1.sqlite differ diff --git a/databases/chinook_1/chinook_1.sqlite b/databases/chinook_1/chinook_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ca54f623ca0503ff4c79e6df1b6bd38d8a2eeb3b --- /dev/null +++ b/databases/chinook_1/chinook_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70b3eb8c3ffb5351eb7943e3bf05b693a5397c22d200ff022ef99e2ca18ab7b9 +size 901120 diff --git a/databases/cinema/cinema.sqlite b/databases/cinema/cinema.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ca06db836453352eff5b01a24da69e49dab05ea9 Binary files /dev/null and b/databases/cinema/cinema.sqlite differ diff --git a/databases/city_record/city_record.sqlite b/databases/city_record/city_record.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ee18b99d42aecf224580b7649c59ca89e5993497 Binary files /dev/null and b/databases/city_record/city_record.sqlite differ diff --git a/databases/climbing/climbing.sqlite b/databases/climbing/climbing.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c23a873d00223c7497affa87070c27454f72dc5a Binary files /dev/null and b/databases/climbing/climbing.sqlite differ diff --git a/databases/club_1/club_1.sqlite b/databases/club_1/club_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8f86df601e058bf85614268dcae0ed5f5ed4aee7 Binary files /dev/null and b/databases/club_1/club_1.sqlite differ diff --git a/databases/college_1/college_1.sqlite b/databases/college_1/college_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8e187f5ee84e7d1125465b7fbf18770a041ae08a Binary files /dev/null and b/databases/college_1/college_1.sqlite differ diff --git a/databases/college_2/college_2.sqlite b/databases/college_2/college_2.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..240e1f2479d3f25b99faa7c61bb67d55d7c8ebfc --- /dev/null +++ b/databases/college_2/college_2.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb729920ad0b7f06d38a12f6f678307964acc7d3417af83d98c519c65c90d386 +size 2117632 diff --git a/databases/college_3/college_3.sqlite b/databases/college_3/college_3.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..fd8eb674ad895e0dd8e1dcf244ebcd0eb3204315 Binary files /dev/null and b/databases/college_3/college_3.sqlite differ diff --git a/databases/company_1/company_1.sqlite b/databases/company_1/company_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0d001f8bf49d4981fcc9e2cd9d3c7c81e7ba12c5 Binary files /dev/null and b/databases/company_1/company_1.sqlite differ diff --git a/databases/company_office/company_office.sqlite b/databases/company_office/company_office.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..54c794070b9f68504195972beadca0a0ea3b2f04 Binary files /dev/null and b/databases/company_office/company_office.sqlite differ diff --git a/databases/concert_singer/concert_singer.sqlite b/databases/concert_singer/concert_singer.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..5b06f95a70eac2ebb0d5f7cef67989c12665eed4 Binary files /dev/null and b/databases/concert_singer/concert_singer.sqlite differ diff --git a/databases/course_teach/course_teach.sqlite b/databases/course_teach/course_teach.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..15eff134cbb8b92da1ba45cd446de0bc8c0af4af Binary files /dev/null and b/databases/course_teach/course_teach.sqlite differ diff --git a/databases/cre_Doc_Control_Systems/cre_Doc_Control_Systems.sqlite b/databases/cre_Doc_Control_Systems/cre_Doc_Control_Systems.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d8dc0ab5c3d82ffd74c0bd10cf26c9b39ae34bfd Binary files /dev/null and b/databases/cre_Doc_Control_Systems/cre_Doc_Control_Systems.sqlite differ diff --git a/databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite b/databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..df09eb910edea6c639bcd5bf010fa199d4bfec4e Binary files /dev/null and b/databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite differ diff --git a/databases/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite b/databases/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..78f0bb6806894d7b862be90de56858f8ea928f7a Binary files /dev/null and b/databases/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite differ diff --git a/databases/cre_Docs_and_Epenses/cre_Docs_and_Epenses.sqlite b/databases/cre_Docs_and_Epenses/cre_Docs_and_Epenses.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..48f51ca537cb00360b83aa14c94fd58b8f9f150a Binary files /dev/null and b/databases/cre_Docs_and_Epenses/cre_Docs_and_Epenses.sqlite differ diff --git a/databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite b/databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e3ad86f911765ed853d645744cc13d2aad8acefb --- /dev/null +++ b/databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9a9e215fae2314be429307b47ee7fc3ffdc749fba933faba980b97a5f6b9a0a +size 147456 diff --git a/databases/cre_Theme_park/cre_Theme_park.sqlite b/databases/cre_Theme_park/cre_Theme_park.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4e00b364e9a03b8667cfadacf10d4b447e195679 Binary files /dev/null and b/databases/cre_Theme_park/cre_Theme_park.sqlite differ diff --git a/databases/csu_1/csu_1.sqlite b/databases/csu_1/csu_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c20e779f7fb8c1c5928a469fc411c699ff0a778e --- /dev/null +++ b/databases/csu_1/csu_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c66e85b742a4941118aab88183c4be7f3e238f9d2558a5e68f8818c504e2710d +size 102400 diff --git a/databases/culture_company/culture_company.sqlite b/databases/culture_company/culture_company.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..f4290e156662d069a642af1367195eddb2376440 Binary files /dev/null and b/databases/culture_company/culture_company.sqlite differ diff --git a/databases/customer_complaints/customer_complaints.sqlite b/databases/customer_complaints/customer_complaints.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..984b15e4f871b90999a74febb8d90efc7533c58f Binary files /dev/null and b/databases/customer_complaints/customer_complaints.sqlite differ diff --git a/databases/customers_and_addresses/customers_and_addresses.sqlite b/databases/customers_and_addresses/customers_and_addresses.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a8957605eac67f08a57c6f4483ae03fb36f762ff Binary files /dev/null and b/databases/customers_and_addresses/customers_and_addresses.sqlite differ diff --git a/databases/customers_and_invoices/customers_and_invoices.sqlite b/databases/customers_and_invoices/customers_and_invoices.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..630da62dc20b170de1e77ffde7c8e37f2fec2ed1 Binary files /dev/null and b/databases/customers_and_invoices/customers_and_invoices.sqlite differ diff --git a/databases/customers_campaigns_ecommerce/customers_campaigns_ecommerce.sqlite b/databases/customers_campaigns_ecommerce/customers_campaigns_ecommerce.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..330bf5f1034e54a6d8f685b08a40d818581f488f Binary files /dev/null and b/databases/customers_campaigns_ecommerce/customers_campaigns_ecommerce.sqlite differ diff --git a/databases/customers_card_transactions/customers_card_transactions.sqlite b/databases/customers_card_transactions/customers_card_transactions.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..1960ce440a81f35e60dbdf688380ac64140928d9 Binary files /dev/null and b/databases/customers_card_transactions/customers_card_transactions.sqlite differ diff --git a/databases/decoration_competition/decoration_competition.sqlite b/databases/decoration_competition/decoration_competition.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..082156773bd3a2fb773588c8f578d394dc640604 Binary files /dev/null and b/databases/decoration_competition/decoration_competition.sqlite differ diff --git a/databases/department_management/department_management.sqlite b/databases/department_management/department_management.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..847f801643785e0dc34c238c54c147b57a40e10f Binary files /dev/null and b/databases/department_management/department_management.sqlite differ diff --git a/databases/department_store/department_store.sqlite b/databases/department_store/department_store.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..afa2ab62e1f9737da818f85105c175302bdc3ae3 Binary files /dev/null and b/databases/department_store/department_store.sqlite differ diff --git a/databases/device/device.sqlite b/databases/device/device.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0e056b8ee43d544bf4626689fc2fc586f66d0ddc Binary files /dev/null and b/databases/device/device.sqlite differ diff --git a/databases/dog_kennels/dog_kennels.sqlite b/databases/dog_kennels/dog_kennels.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..102f9e770a76366af3c45878a46ce0ddbeb77690 Binary files /dev/null and b/databases/dog_kennels/dog_kennels.sqlite differ diff --git a/databases/dorm_1/dorm_1.sqlite b/databases/dorm_1/dorm_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..cf579a590332b0a02afb56b9eae5ebc4457c4836 Binary files /dev/null and b/databases/dorm_1/dorm_1.sqlite differ diff --git a/databases/driving_school/driving_school.sqlite b/databases/driving_school/driving_school.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..72ae5177fe45d7a1213c10ac7890dc00b975ea64 Binary files /dev/null and b/databases/driving_school/driving_school.sqlite differ diff --git a/databases/e_government/e_government.sqlite b/databases/e_government/e_government.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0cc2d1fd69bd6fa5efa34f937b10d9ebc91a1235 Binary files /dev/null and b/databases/e_government/e_government.sqlite differ diff --git a/databases/e_learning/e_learning.sqlite b/databases/e_learning/e_learning.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b1496dd81c78ab8f5a945121c24cccad0dfc2575 Binary files /dev/null and b/databases/e_learning/e_learning.sqlite differ diff --git a/databases/election/election.sqlite b/databases/election/election.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d8dad1f7aa96f41ed0d672cdd75b5f10076c101e Binary files /dev/null and b/databases/election/election.sqlite differ diff --git a/databases/election_representative/election_representative.sqlite b/databases/election_representative/election_representative.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..dc6a662880ed5e43a1be16f36a6b52d4005e844c Binary files /dev/null and b/databases/election_representative/election_representative.sqlite differ diff --git a/databases/employee_hire_evaluation/employee_hire_evaluation.sqlite b/databases/employee_hire_evaluation/employee_hire_evaluation.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..daa2ecfdd2e6030bbe476d6a891b79eead647fee Binary files /dev/null and b/databases/employee_hire_evaluation/employee_hire_evaluation.sqlite differ diff --git a/databases/entrepreneur/entrepreneur.sqlite b/databases/entrepreneur/entrepreneur.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..9599e53265eb0980468a1c3bb9e84ab12a59905f Binary files /dev/null and b/databases/entrepreneur/entrepreneur.sqlite differ diff --git a/databases/farm/farm.sqlite b/databases/farm/farm.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..3fa3b9efa101f8aed0c7c2e7ba54c79f36958b04 Binary files /dev/null and b/databases/farm/farm.sqlite differ diff --git a/databases/film_rank/film_rank.sqlite b/databases/film_rank/film_rank.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e3d51cd9928958df4a25b6771259083b863d1594 Binary files /dev/null and b/databases/film_rank/film_rank.sqlite differ diff --git a/databases/flight_1/flight_1.sqlite b/databases/flight_1/flight_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d4404c23f209904a223b19d08c91e80f2581ad8f Binary files /dev/null and b/databases/flight_1/flight_1.sqlite differ diff --git a/databases/flight_2/flight_2.sqlite b/databases/flight_2/flight_2.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..657a06136e3968d08b18543009765b7a67c787f0 Binary files /dev/null and b/databases/flight_2/flight_2.sqlite differ diff --git a/databases/flight_4/flight_4.sqlite b/databases/flight_4/flight_4.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..de6b0fc3c63ade01c428721b1aaa5bb8e41556b0 --- /dev/null +++ b/databases/flight_4/flight_4.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4885150ab97173411aee5b73009ac2a28ce1748ce1218331608b939d9d54330e +size 3129344 diff --git a/databases/flight_company/flight_company.sqlite b/databases/flight_company/flight_company.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..9d85c1d7a97e8822f743dd41268efd71c0b53300 Binary files /dev/null and b/databases/flight_company/flight_company.sqlite differ diff --git a/databases/formula_1/formula_1.sqlite b/databases/formula_1/formula_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4aa6f325ab3937efd98b8d56fbe1e6e36700234e --- /dev/null +++ b/databases/formula_1/formula_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb6dad97c0a4da22f01bdf817a77fe8f6b6559554661ff0120b40cb81b8c3b68 +size 2940928 diff --git a/databases/game_1/game_1.sqlite b/databases/game_1/game_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b6739d991e324b1db1633fa7fba2660066a91f1f Binary files /dev/null and b/databases/game_1/game_1.sqlite differ diff --git a/databases/game_injury/game_injury.sqlite b/databases/game_injury/game_injury.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..6666c000343d0ed555e231d648803c0e8dcdd75c Binary files /dev/null and b/databases/game_injury/game_injury.sqlite differ diff --git a/databases/gas_company/gas_company.sqlite b/databases/gas_company/gas_company.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..2ba42b3ccde444b91251b1320b562dc202299886 Binary files /dev/null and b/databases/gas_company/gas_company.sqlite differ diff --git a/databases/gymnast/gymnast.sqlite b/databases/gymnast/gymnast.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ba8663104f0432509c510670ce2abc31d6421b38 Binary files /dev/null and b/databases/gymnast/gymnast.sqlite differ diff --git a/databases/hospital_1/hospital_1.sqlite b/databases/hospital_1/hospital_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..cbce26efabe6ae479acf6bb5d7a702543985dfea Binary files /dev/null and b/databases/hospital_1/hospital_1.sqlite differ diff --git a/databases/hr_1/hr_1.sqlite b/databases/hr_1/hr_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..bb05596914cd114514b9d7761455c1679cc8e7c9 Binary files /dev/null and b/databases/hr_1/hr_1.sqlite differ diff --git a/databases/icfp_1/icfp_1.sqlite b/databases/icfp_1/icfp_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..bf9067d3d9a4684e2c36b1b67b436da16c196500 Binary files /dev/null and b/databases/icfp_1/icfp_1.sqlite differ diff --git a/databases/inn_1/inn_1.sqlite b/databases/inn_1/inn_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..5e7ebacdf82c1e6b83fe9d25bb8836d4524f0088 Binary files /dev/null and b/databases/inn_1/inn_1.sqlite differ diff --git a/databases/insurance_and_eClaims/insurance_and_eClaims.sqlite b/databases/insurance_and_eClaims/insurance_and_eClaims.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..cbb5d30626ee0bc4b08450d9d10787f659b8017d Binary files /dev/null and b/databases/insurance_and_eClaims/insurance_and_eClaims.sqlite differ diff --git a/databases/insurance_fnol/insurance_fnol.sqlite b/databases/insurance_fnol/insurance_fnol.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a065d64f49b2da3ec9c6245b31310166ca5e290d Binary files /dev/null and b/databases/insurance_fnol/insurance_fnol.sqlite differ diff --git a/databases/insurance_policies/insurance_policies.sqlite b/databases/insurance_policies/insurance_policies.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..9b1ffca54a7980a1e7fd8b31d1449c5ad96d29fc Binary files /dev/null and b/databases/insurance_policies/insurance_policies.sqlite differ diff --git a/databases/loan_1/loan_1.sqlite b/databases/loan_1/loan_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8220f921865da303f3d63b29f9f753a748098f66 Binary files /dev/null and b/databases/loan_1/loan_1.sqlite differ diff --git a/databases/local_govt_and_lot/local_govt_and_lot.sqlite b/databases/local_govt_and_lot/local_govt_and_lot.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c37cc556d7ad6fc66f7748a8dbd4bbd95be01bff Binary files /dev/null and b/databases/local_govt_and_lot/local_govt_and_lot.sqlite differ diff --git a/databases/machine_repair/machine_repair.sqlite b/databases/machine_repair/machine_repair.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..1b2894377d3c430b6e0948878568a0cce04a26f1 Binary files /dev/null and b/databases/machine_repair/machine_repair.sqlite differ diff --git a/databases/manufactory_1/manufactory_1.sqlite b/databases/manufactory_1/manufactory_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..df92c733bacf5c9408006be0649ea25651982309 Binary files /dev/null and b/databases/manufactory_1/manufactory_1.sqlite differ diff --git a/databases/manufacturer/manufacturer.sqlite b/databases/manufacturer/manufacturer.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4fd26cf8db80f2624e7bddc95dc878acb28c7b15 Binary files /dev/null and b/databases/manufacturer/manufacturer.sqlite differ diff --git a/databases/match_season/match_season.sqlite b/databases/match_season/match_season.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ec1524f648493e12391c5a884b78e30fb9e3d92c Binary files /dev/null and b/databases/match_season/match_season.sqlite differ diff --git a/databases/medicine_enzyme_interaction/medicine_enzyme_interaction.sqlite b/databases/medicine_enzyme_interaction/medicine_enzyme_interaction.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..17a63c93b7f8045c49cf195bb69ce3e12a05573d Binary files /dev/null and b/databases/medicine_enzyme_interaction/medicine_enzyme_interaction.sqlite differ diff --git a/databases/mountain_photos/mountain_photos.sqlite b/databases/mountain_photos/mountain_photos.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e32cceed05e6f517475cf938d1b25cd7c6a97b7b Binary files /dev/null and b/databases/mountain_photos/mountain_photos.sqlite differ diff --git a/databases/movie_1/movie_1.sqlite b/databases/movie_1/movie_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0cceca6082b0b8725402d169c848ae381ad152fb Binary files /dev/null and b/databases/movie_1/movie_1.sqlite differ diff --git a/databases/museum_visit/museum_visit.sqlite b/databases/museum_visit/museum_visit.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..36aa825e1c8afbce191539deb070c5bf0a076287 Binary files /dev/null and b/databases/museum_visit/museum_visit.sqlite differ diff --git a/databases/music_1/music_1.sqlite b/databases/music_1/music_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..1fcca9786e67b5d3b1abf4809c5f492cb8c27380 Binary files /dev/null and b/databases/music_1/music_1.sqlite differ diff --git a/databases/music_2/music_2.sqlite b/databases/music_2/music_2.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ffa690bd9f4257c71900b9cdd9a2fec0f7d347cd Binary files /dev/null and b/databases/music_2/music_2.sqlite differ diff --git a/databases/music_4/music_4.sqlite b/databases/music_4/music_4.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..87d4bf6495f97d2296d2fee674dfc82841fbdca0 Binary files /dev/null and b/databases/music_4/music_4.sqlite differ diff --git a/databases/network_1/network_1.sqlite b/databases/network_1/network_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8eac1cc841cf49a0b596a7df232e6cb8b3fde723 Binary files /dev/null and b/databases/network_1/network_1.sqlite differ diff --git a/databases/network_2/network_2.sqlite b/databases/network_2/network_2.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..115a096f3d6083b943f78ddc680ec8dd2f14a257 Binary files /dev/null and b/databases/network_2/network_2.sqlite differ diff --git a/databases/news_report/news_report.sqlite b/databases/news_report/news_report.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0d331f4c34c1dee9b4527018c6c59f7320a452a9 Binary files /dev/null and b/databases/news_report/news_report.sqlite differ diff --git a/databases/orchestra/orchestra.sqlite b/databases/orchestra/orchestra.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..054d4f92e1512c7eb8699f61b5ead49c82e28594 Binary files /dev/null and b/databases/orchestra/orchestra.sqlite differ diff --git a/databases/party_people/party_people.sqlite b/databases/party_people/party_people.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..795c311c747ea8905f140eeea9c44e74b7ad0b55 Binary files /dev/null and b/databases/party_people/party_people.sqlite differ diff --git a/databases/perpetrator/perpetrator.sqlite b/databases/perpetrator/perpetrator.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..26ca9a501b873d8169e1c2e2d2750a6d34545adb Binary files /dev/null and b/databases/perpetrator/perpetrator.sqlite differ diff --git a/databases/pets_1/pets_1.sqlite b/databases/pets_1/pets_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0e2fac07993409a0db9ce89538a564a9588cf9cb Binary files /dev/null and b/databases/pets_1/pets_1.sqlite differ diff --git a/databases/phone_market/phone_market.sqlite b/databases/phone_market/phone_market.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..23077075385ddaf3eb3bfea5a97564de61f77b40 Binary files /dev/null and b/databases/phone_market/phone_market.sqlite differ diff --git a/databases/pilot_record/pilot_record.sqlite b/databases/pilot_record/pilot_record.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..1c5c84e21c70451f37a5bd35bb06b34b5e402ded Binary files /dev/null and b/databases/pilot_record/pilot_record.sqlite differ diff --git a/databases/poker_player/poker_player.sqlite b/databases/poker_player/poker_player.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..99fec5f0029860d39b4bb5939c6be06896a68f37 Binary files /dev/null and b/databases/poker_player/poker_player.sqlite differ diff --git a/databases/product_catalog/product_catalog.sqlite b/databases/product_catalog/product_catalog.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d5e153952831325488f0af17b9456334681a1bef Binary files /dev/null and b/databases/product_catalog/product_catalog.sqlite differ diff --git a/databases/products_gen_characteristics/products_gen_characteristics.sqlite b/databases/products_gen_characteristics/products_gen_characteristics.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..3132b1b6062dbca8e09a4f9f73e9b1b76dd2f898 Binary files /dev/null and b/databases/products_gen_characteristics/products_gen_characteristics.sqlite differ diff --git a/databases/program_share/program_share.sqlite b/databases/program_share/program_share.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..cc3da5871c5da3897cd52c31300e7c6f3e775ee0 Binary files /dev/null and b/databases/program_share/program_share.sqlite differ diff --git a/databases/protein_institute/protein_institute.sqlite b/databases/protein_institute/protein_institute.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b1532ab4b2f3babd9ff2ee7f642f757a47170a03 Binary files /dev/null and b/databases/protein_institute/protein_institute.sqlite differ diff --git a/databases/race_track/race_track.sqlite b/databases/race_track/race_track.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..415459c4fa9402ce14d0ce128ab4dae157a7150c Binary files /dev/null and b/databases/race_track/race_track.sqlite differ diff --git a/databases/real_estate_properties/real_estate_properties.sqlite b/databases/real_estate_properties/real_estate_properties.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8432e6b3ee88edaff6caa08ba659139d33ded7c1 Binary files /dev/null and b/databases/real_estate_properties/real_estate_properties.sqlite differ diff --git a/databases/restaurant_1/restaurant_1.sqlite b/databases/restaurant_1/restaurant_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..59f07378078ed90685ca77d7adc0a670e144e26c Binary files /dev/null and b/databases/restaurant_1/restaurant_1.sqlite differ diff --git a/databases/sakila_1/sakila_1.sqlite b/databases/sakila_1/sakila_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8de9d60085d9df3d09c6a1c9ae5714f6ccd39330 --- /dev/null +++ b/databases/sakila_1/sakila_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fe25744a6e2acf29295eba0fb73a98065008c0a365b92a86de6237310a72444 +size 3706880 diff --git a/databases/school_bus/school_bus.sqlite b/databases/school_bus/school_bus.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..9362948c18883d6f96f5e4a6f06e18f5674d5086 Binary files /dev/null and b/databases/school_bus/school_bus.sqlite differ diff --git a/databases/scientist_1/scientist_1.sqlite b/databases/scientist_1/scientist_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..791d767902aa85f1d67988fa8dd54ef1484b74ed Binary files /dev/null and b/databases/scientist_1/scientist_1.sqlite differ diff --git a/databases/ship_1/ship_1.sqlite b/databases/ship_1/ship_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..942c19c837e3c01830aaf5fd168b6ca32fa47a68 Binary files /dev/null and b/databases/ship_1/ship_1.sqlite differ diff --git a/databases/ship_mission/ship_mission.sqlite b/databases/ship_mission/ship_mission.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c5410cf7ae65561fae82f4acc5dc682d884d5e9c Binary files /dev/null and b/databases/ship_mission/ship_mission.sqlite differ diff --git a/databases/shop_membership/shop_membership.sqlite b/databases/shop_membership/shop_membership.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..63b27738cda7bf33fa2f7d4e86d78ebe619ba710 Binary files /dev/null and b/databases/shop_membership/shop_membership.sqlite differ diff --git a/databases/singer/singer.sqlite b/databases/singer/singer.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..62c79092c0b2d2eca0b283ad355f47df51886219 Binary files /dev/null and b/databases/singer/singer.sqlite differ diff --git a/databases/small_bank_1/small_bank_1.sqlite b/databases/small_bank_1/small_bank_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0034f47b6aaf460cb2d3aac686f464c3329a323c Binary files /dev/null and b/databases/small_bank_1/small_bank_1.sqlite differ diff --git a/databases/soccer_1/soccer_1.sqlite b/databases/soccer_1/soccer_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..00a954e732fc880a83d99d310e3851f692a4d521 --- /dev/null +++ b/databases/soccer_1/soccer_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:402ea587e7cc71051f4479b5c2b70dcda1ac75176af15b3a1932febee4a528e5 +size 316854272 diff --git a/databases/soccer_2/soccer_2.sqlite b/databases/soccer_2/soccer_2.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..419ec5d0cff2d17344d5a649f8c9dcfbf152886f Binary files /dev/null and b/databases/soccer_2/soccer_2.sqlite differ diff --git a/databases/sports_competition/sports_competition.sqlite b/databases/sports_competition/sports_competition.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..eac7009dbe5daee77c4b05cf468fc3fda62398bb Binary files /dev/null and b/databases/sports_competition/sports_competition.sqlite differ diff --git a/databases/store_1/store_1.sqlite b/databases/store_1/store_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..f1b490cd2488a53b0932f6e6cc730a851d5f3f6b --- /dev/null +++ b/databases/store_1/store_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d9212f03e0fcfd875750d37067c4c9ac06efaf7334e91776f687976723da26e +size 1155072 diff --git a/databases/store_product/store_product.sqlite b/databases/store_product/store_product.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c2386ce46e88d7acdff34a3afb4feacdafe5dc6c Binary files /dev/null and b/databases/store_product/store_product.sqlite differ diff --git a/databases/student_1/student_1.sqlite b/databases/student_1/student_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..7479ff61e9d4768334598681c1964cab252629c8 Binary files /dev/null and b/databases/student_1/student_1.sqlite differ diff --git a/databases/student_assessment/student_assessment.sqlite b/databases/student_assessment/student_assessment.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d8d7d110f7be52a30a6d42f135709fc1737917bf Binary files /dev/null and b/databases/student_assessment/student_assessment.sqlite differ diff --git a/databases/student_transcripts_tracking/student_transcripts_tracking.sqlite b/databases/student_transcripts_tracking/student_transcripts_tracking.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..f336b2e73964da4d662d15ef0fa1db8bb1b82eb3 Binary files /dev/null and b/databases/student_transcripts_tracking/student_transcripts_tracking.sqlite differ diff --git a/databases/swimming/swimming.sqlite b/databases/swimming/swimming.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..40ef09780ff62870b49f17646f4d41dffd1ce196 Binary files /dev/null and b/databases/swimming/swimming.sqlite differ diff --git a/databases/theme_gallery/theme_gallery.sqlite b/databases/theme_gallery/theme_gallery.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b93731cfc21f0d1002fee041744f4d3d885028ea Binary files /dev/null and b/databases/theme_gallery/theme_gallery.sqlite differ diff --git a/databases/tracking_grants_for_research/tracking_grants_for_research.sqlite b/databases/tracking_grants_for_research/tracking_grants_for_research.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..58865acc95b87855d175d1dc0fcafb73db150a22 Binary files /dev/null and b/databases/tracking_grants_for_research/tracking_grants_for_research.sqlite differ diff --git a/databases/tracking_orders/tracking_orders.sqlite b/databases/tracking_orders/tracking_orders.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..83e4d30d4101b99b5050e7108ea2445a62a5aa41 Binary files /dev/null and b/databases/tracking_orders/tracking_orders.sqlite differ diff --git a/databases/tracking_share_transactions/tracking_share_transactions.sqlite b/databases/tracking_share_transactions/tracking_share_transactions.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..af4a6e2199a9c34024045df13d89f748e0ab3d23 Binary files /dev/null and b/databases/tracking_share_transactions/tracking_share_transactions.sqlite differ diff --git a/databases/tracking_software_problems/tracking_software_problems.sqlite b/databases/tracking_software_problems/tracking_software_problems.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c3c4fc184c3b2213b4b2c436df1b8988685961a3 Binary files /dev/null and b/databases/tracking_software_problems/tracking_software_problems.sqlite differ diff --git a/databases/train_station/train_station.sqlite b/databases/train_station/train_station.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c9f06444d08237642804746ec1cd7f9227180681 Binary files /dev/null and b/databases/train_station/train_station.sqlite differ diff --git a/databases/tvshow/tvshow.sqlite b/databases/tvshow/tvshow.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..27f07498c46ef1b9dcd2676d62b92faec2ccbd34 Binary files /dev/null and b/databases/tvshow/tvshow.sqlite differ diff --git a/databases/twitter_1/twitter_1.sqlite b/databases/twitter_1/twitter_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..71dca2364ca8c0102c658a5ccf930a32984045fa Binary files /dev/null and b/databases/twitter_1/twitter_1.sqlite differ diff --git a/databases/university_basketball/university_basketball.sqlite b/databases/university_basketball/university_basketball.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c9c9cf0fed754919d1807a9ba90d12618be249e9 Binary files /dev/null and b/databases/university_basketball/university_basketball.sqlite differ diff --git a/databases/voter_1/voter_1.sqlite b/databases/voter_1/voter_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0fe9731f6d979e6175271daf9b150b19c4f8a1c9 Binary files /dev/null and b/databases/voter_1/voter_1.sqlite differ diff --git a/databases/voter_2/voter_2.sqlite b/databases/voter_2/voter_2.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ce798de9b7847372638ae5817ac10d39f7428683 Binary files /dev/null and b/databases/voter_2/voter_2.sqlite differ diff --git a/databases/wedding/wedding.sqlite b/databases/wedding/wedding.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..969486b47ed635e2607e1f51dffd083735019b43 Binary files /dev/null and b/databases/wedding/wedding.sqlite differ diff --git a/databases/wine_1/wine_1.sqlite b/databases/wine_1/wine_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..350dba76febe876d918831e8a83608a940dbe695 Binary files /dev/null and b/databases/wine_1/wine_1.sqlite differ diff --git a/databases/workshop_paper/workshop_paper.sqlite b/databases/workshop_paper/workshop_paper.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..2e76244dd8b83f036db260b47eb52ddaa7107edb Binary files /dev/null and b/databases/workshop_paper/workshop_paper.sqlite differ diff --git a/databases/world_1/world_1.sqlite b/databases/world_1/world_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..5f5c321486c0a0e728a2237b3e63ea70f4e8f717 --- /dev/null +++ b/databases/world_1/world_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17b986695f16786d58d66f85e49dba87bdfe72953207ab9b1b49da9d2301ef65 +size 319488 diff --git a/databases/wta_1/wta_1.sqlite b/databases/wta_1/wta_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b95456566add60d50eed6b3eb2710e6952a024ce --- /dev/null +++ b/databases/wta_1/wta_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f20747456d7748674b4f05432f3de96446ced95b8bd5a6fd01284f6c28f727c +size 104738816 diff --git a/splits/gate.jsonl b/splits/gate.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..bda99075401ff4b2ac51cafa59fb268dec23c9c9 --- /dev/null +++ b/splits/gate.jsonl @@ -0,0 +1,100 @@ +{"qid": "gate_0000", "split": "gate", "db_id": "hr_1", "question": "Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.", "gold_sql": "SELECT first_name , last_name , department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)", "db_path": "databases/hr_1/hr_1.sqlite", "schema": "CREATE TABLE `countries` (\n `COUNTRY_ID` varchar(2) NOT NULL,\n `COUNTRY_NAME` varchar(40) DEFAULT NULL,\n `REGION_ID` decimal(10,0) DEFAULT NULL,\n PRIMARY KEY (`COUNTRY_ID`),\n FOREIGN KEY (`REGION_ID`) REFERENCES regions (`REGION_ID`)\n);\nCREATE TABLE `departments` (\n `DEPARTMENT_ID` decimal(4,0) NOT NULL DEFAULT '0',\n `DEPARTMENT_NAME` varchar(30) NOT NULL,\n `MANAGER_ID` decimal(6,0) DEFAULT NULL,\n `LOCATION_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`DEPARTMENT_ID`)\n);\nCREATE TABLE `employees` (\n `EMPLOYEE_ID` decimal(6,0) NOT NULL DEFAULT '0',\n `FIRST_NAME` varchar(20) DEFAULT NULL,\n `LAST_NAME` varchar(25) NOT NULL,\n `EMAIL` varchar(25) NOT NULL,\n `PHONE_NUMBER` varchar(20) DEFAULT NULL,\n `HIRE_DATE` date NOT NULL,\n `JOB_ID` varchar(10) NOT NULL,\n `SALARY` decimal(8,2) DEFAULT NULL,\n `COMMISSION_PCT` decimal(2,2) DEFAULT NULL,\n `MANAGER_ID` decimal(6,0) DEFAULT NULL,\n `DEPARTMENT_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`EMPLOYEE_ID`),\n FOREIGN KEY (`DEPARTMENT_ID`) REFERENCES departments(`DEPARTMENT_ID`),\n FOREIGN KEY (`JOB_ID`) REFERENCES jobs(`JOB_ID`)\n);\nCREATE TABLE `job_history` (\n `EMPLOYEE_ID` decimal(6,0) NOT NULL,\n `START_DATE` date NOT NULL,\n `END_DATE` date NOT NULL,\n `JOB_ID` varchar(10) NOT NULL,\n `DEPARTMENT_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`EMPLOYEE_ID`,`START_DATE`),\n FOREIGN KEY (`EMPLOYEE_ID`) REFERENCES employees(`EMPLOYEE_ID`),\n FOREIGN KEY (`DEPARTMENT_ID`) REFERENCES departments(`DEPARTMENT_ID`),\n FOREIGN KEY (`JOB_ID`) REFERENCES jobs(`JOB_ID`)\n);\nCREATE TABLE `jobs` (\n `JOB_ID` varchar(10) NOT NULL DEFAULT '',\n `JOB_TITLE` varchar(35) NOT NULL,\n `MIN_SALARY` decimal(6,0) DEFAULT NULL,\n `MAX_SALARY` decimal(6,0) DEFAULT NULL,\n PRIMARY KEY (`JOB_ID`)\n);\nCREATE TABLE `locations` (\n `LOCATION_ID` decimal(4,0) NOT NULL DEFAULT '0',\n `STREET_ADDRESS` varchar(40) DEFAULT NULL,\n `POSTAL_CODE` varchar(12) DEFAULT NULL,\n `CITY` varchar(30) NOT NULL,\n `STATE_PROVINCE` varchar(25) DEFAULT NULL,\n `COUNTRY_ID` varchar(2) DEFAULT NULL,\n PRIMARY KEY (`LOCATION_ID`),\n FOREIGN KEY (`COUNTRY_ID`) REFERENCES countries(`COUNTRY_ID`)\n);\nCREATE TABLE `regions` (\n `REGION_ID` decimal(5,0) NOT NULL,\n `REGION_NAME` varchar(25) DEFAULT NULL,\n PRIMARY KEY (`REGION_ID`)\n);"} +{"qid": "gate_0001", "split": "gate", "db_id": "culture_company", "question": "Show publishers with a book published in 1989 and a book in 1990.", "gold_sql": "SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990", "db_path": "databases/culture_company/culture_company.sqlite", "schema": "CREATE TABLE \"book_club\" (\n\"book_club_id\" int,\n\"Year\" int,\n\"Author_or_Editor\" text,\n\"Book_Title\" text,\n\"Publisher\" text,\n\"Category\" text,\n\"Result\" text,\nPRIMARY KEY (\"book_club_id\")\n);\nCREATE TABLE \"culture_company\" (\n\"Company_name\" text,\n\"Type\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\n\"book_club_id\" text,\n\"movie_id\" text,\nPRIMARY KEY(\"Company_name\"),\nFOREIGN KEY (\"book_club_id\") REFERENCES \"book_club\"(\"book_club_id\"),\nFOREIGN KEY (\"movie_id\") REFERENCES \"movie\"(\"movie_id\")\n);\nCREATE TABLE \"movie\" (\n\"movie_id\" int,\n\"Title\" text,\n\"Year\" int,\n\"Director\" text,\n\"Budget_million\" real,\n\"Gross_worldwide\" int,\nPRIMARY KEY(\"movie_id\")\n);"} +{"qid": "gate_0002", "split": "gate", "db_id": "insurance_fnol", "question": "Find the phone numbers of customers using the most common policy type among the available policies.", "gold_sql": "SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1)", "db_path": "databases/insurance_fnol/insurance_fnol.sqlite", "schema": "CREATE TABLE Available_Policies (\nPolicy_ID INTEGER NOT NULL,\npolicy_type_code CHAR(15),\nCustomer_Phone VARCHAR(255),\nPRIMARY KEY (Policy_ID),\nUNIQUE (Policy_ID)\n);\nCREATE TABLE Claims (\nClaim_ID INTEGER NOT NULL,\nFNOL_ID INTEGER NOT NULL,\nEffective_Date DATE,\nPRIMARY KEY (Claim_ID),\nUNIQUE (Claim_ID),\nFOREIGN KEY (FNOL_ID) REFERENCES First_Notification_of_Loss (FNOL_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID INTEGER NOT NULL,\nCustomer_name VARCHAR(40),\nPRIMARY KEY (Customer_ID)\n);\nCREATE TABLE Customers_Policies (\nCustomer_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nDate_Opened DATE,\nDate_Closed DATE,\nPRIMARY KEY (Customer_ID, Policy_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Policy_ID) REFERENCES Available_Policies (Policy_ID)\n);\nCREATE TABLE First_Notification_of_Loss (\nFNOL_ID INTEGER NOT NULL,\nCustomer_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nPRIMARY KEY (FNOL_ID),\nUNIQUE (FNOL_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID),\nFOREIGN KEY (Customer_ID, Policy_ID) REFERENCES Customers_Policies (Customer_ID,Policy_ID)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_name VARCHAR(40),\nPRIMARY KEY (Service_ID)\n);\nCREATE TABLE Settlements (\nSettlement_ID INTEGER NOT NULL,\nClaim_ID INTEGER,\nEffective_Date DATE,\nSettlement_Amount REAL,\nPRIMARY KEY (Settlement_ID),\nUNIQUE (Settlement_ID),\nFOREIGN KEY (Claim_ID) REFERENCES Claims (Claim_ID)\n);"} +{"qid": "gate_0003", "split": "gate", "db_id": "student_1", "question": "Count the number of students the teacher LORIA ONDERSMA teaches.", "gold_sql": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"LORIA\" AND T2.lastname = \"ONDERSMA\"", "db_path": "databases/student_1/student_1.sqlite", "schema": "CREATE TABLE \"list\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Grade\" INTEGER, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);\nCREATE TABLE \"teachers\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);"} +{"qid": "gate_0004", "split": "gate", "db_id": "cre_Doc_Control_Systems", "question": "What address was the document with id 4 mailed to?", "gold_sql": "SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4;", "db_path": "databases/cre_Doc_Control_Systems/cre_Doc_Control_Systems.sqlite", "schema": "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);\nCREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);\nCREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);\nCREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);\nCREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);\nCREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);\nCREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);\nCREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);\nCREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);\nCREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);"} +{"qid": "gate_0005", "split": "gate", "db_id": "game_1", "question": "How many different types of sports do we offer?", "gold_sql": "SELECT count(DISTINCT sportname) FROM Sportsinfo", "db_path": "databases/game_1/game_1.sqlite", "schema": "CREATE TABLE Plays_Games (\n StuID INTEGER,\n GameID INTEGER,\n Hours_Played INTEGER,\n FOREIGN KEY(GameID) REFERENCES Video_Games(GameID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE SportsInfo (\n StuID INTEGER,\n SportName VARCHAR(32),\n HoursPerWeek INTEGER,\n GamesPlayed INTEGER,\n OnScholarship VARCHAR(1),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );\nCREATE TABLE Video_Games (\n GameID INTEGER PRIMARY KEY,\n GName VARCHAR(40),\n GType VARCHAR(40)\n);"} +{"qid": "gate_0006", "split": "gate", "db_id": "insurance_fnol", "question": "Which customer uses the most policies? Give me the customer name.", "gold_sql": "SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/insurance_fnol/insurance_fnol.sqlite", "schema": "CREATE TABLE Available_Policies (\nPolicy_ID INTEGER NOT NULL,\npolicy_type_code CHAR(15),\nCustomer_Phone VARCHAR(255),\nPRIMARY KEY (Policy_ID),\nUNIQUE (Policy_ID)\n);\nCREATE TABLE Claims (\nClaim_ID INTEGER NOT NULL,\nFNOL_ID INTEGER NOT NULL,\nEffective_Date DATE,\nPRIMARY KEY (Claim_ID),\nUNIQUE (Claim_ID),\nFOREIGN KEY (FNOL_ID) REFERENCES First_Notification_of_Loss (FNOL_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID INTEGER NOT NULL,\nCustomer_name VARCHAR(40),\nPRIMARY KEY (Customer_ID)\n);\nCREATE TABLE Customers_Policies (\nCustomer_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nDate_Opened DATE,\nDate_Closed DATE,\nPRIMARY KEY (Customer_ID, Policy_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Policy_ID) REFERENCES Available_Policies (Policy_ID)\n);\nCREATE TABLE First_Notification_of_Loss (\nFNOL_ID INTEGER NOT NULL,\nCustomer_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nPRIMARY KEY (FNOL_ID),\nUNIQUE (FNOL_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID),\nFOREIGN KEY (Customer_ID, Policy_ID) REFERENCES Customers_Policies (Customer_ID,Policy_ID)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_name VARCHAR(40),\nPRIMARY KEY (Service_ID)\n);\nCREATE TABLE Settlements (\nSettlement_ID INTEGER NOT NULL,\nClaim_ID INTEGER,\nEffective_Date DATE,\nSettlement_Amount REAL,\nPRIMARY KEY (Settlement_ID),\nUNIQUE (Settlement_ID),\nFOREIGN KEY (Claim_ID) REFERENCES Claims (Claim_ID)\n);"} +{"qid": "gate_0007", "split": "gate", "db_id": "twitter_1", "question": "What is the partition id of the user named \"Iron Man\".", "gold_sql": "SELECT partitionid FROM user_profiles WHERE name = 'Iron Man'", "db_path": "databases/twitter_1/twitter_1.sqlite", "schema": "CREATE TABLE `follows` (\n `f1` int(11) NOT NULL,\n `f2` int(11) NOT NULL,\n PRIMARY KEY (`f1`,`f2`),\n FOREIGN KEY (`f1`) REFERENCES `user_profiles`(`uid`),\n FOREIGN KEY (`f2`) REFERENCES `user_profiles`(`uid`)\n\n);\nCREATE TABLE `tweets` (\n `id` bigint(20) NOT NULL,\n `uid` int(11) NOT NULL,\n `text` char(140) NOT NULL,\n `createdate` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`),\n FOREIGN KEY (`uid`) REFERENCES `user_profiles`(`uid`)\n);\nCREATE TABLE \"user_profiles\" (`uid` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `partitionid` int(11) DEFAULT NULL, `followers` int(11) DEFAULT NULL, PRIMARY KEY (`uid`));"} +{"qid": "gate_0008", "split": "gate", "db_id": "school_bus", "question": "Show the school name and type for schools without a school bus.", "gold_sql": "SELECT school , TYPE FROM school WHERE school_id NOT IN (SELECT school_id FROM school_bus)", "db_path": "databases/school_bus/school_bus.sqlite", "schema": "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);\nCREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);\nCREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);"} +{"qid": "gate_0009", "split": "gate", "db_id": "race_track", "question": "What are the names, classes, and dates for all races?", "gold_sql": "SELECT name , CLASS , date FROM race", "db_path": "databases/race_track/race_track.sqlite", "schema": "CREATE TABLE \"race\" (\n\"Race_ID\" int,\n\"Name\" text,\n\"Class\" text,\n\"Date\" text,\n\"Track_ID\" text,\nPRIMARY KEY (\"Race_ID\"),\nFOREIGN KEY (\"Track_ID\") REFERENCES \"track\"(\"Track_ID\")\n);\nCREATE TABLE \"track\" (\n\"Track_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"Seating\" real,\n\"Year_Opened\" real,\nPRIMARY KEY (\"Track_ID\")\n);"} +{"qid": "gate_0010", "split": "gate", "db_id": "club_1", "question": "Tell me the location of the club \"Hopkins Student Enterprises\".", "gold_sql": "SELECT clublocation FROM club WHERE clubname = \"Hopkins Student Enterprises\"", "db_path": "databases/club_1/club_1.sqlite", "schema": "CREATE TABLE Club (\n ClubID INTEGER PRIMARY KEY,\n ClubName VARCHAR(40),\n ClubDesc VARCHAR(1024),\n ClubLocation VARCHAR(40)\n);\nCREATE TABLE Member_of_club (\n StuID INTEGER,\n ClubID INTEGER,\n Position VARCHAR(40),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(ClubID) REFERENCES Club(ClubID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "gate_0011", "split": "gate", "db_id": "party_people", "question": "Return the minister who left office at the latest time.", "gold_sql": "SELECT minister FROM party ORDER BY left_office DESC LIMIT 1", "db_path": "databases/party_people/party_people.sqlite", "schema": "CREATE TABLE \"member\" (\n\"Member_ID\" int,\n\"Member_Name\" text,\n\"Party_ID\" text,\n\"In_office\" text,\nPRIMARY KEY (\"Member_ID\"),\nFOREIGN KEY (`Party_ID`) REFERENCES `party`(`Party_ID`)\n);\nCREATE TABLE \"party\" (\n\"Party_ID\" int,\n\"Minister\" text,\n\"Took_office\" text,\n\"Left_office\" text,\n\"Region_ID\" int,\n\"Party_name\" text,\nPRIMARY KEY (\"Party_ID\"),\nFOREIGN KEY (`Region_ID`) REFERENCES `region`(`Region_ID`)\n);\nCREATE TABLE \"party_events\" (\n\"Event_ID\" int,\n\"Event_Name\" text,\n\"Party_ID\" int,\n\"Member_in_charge_ID\" int,\nPRIMARY KEY (\"Event_ID\"),\nFOREIGN KEY (`Party_ID`) REFERENCES `party`(`Party_ID`),\nFOREIGN KEY (`Member_in_charge_ID`) REFERENCES `member`(`Member_ID`)\n);\nCREATE TABLE \"region\" (\n\"Region_ID\" int,\n\"Region_name\" text,\n\"Date\" text,\n\"Label\" text,\n\"Format\" text,\n\"Catalogue\" text,\nPRIMARY KEY (\"Region_ID\")\n);"} +{"qid": "gate_0012", "split": "gate", "db_id": "candidate_poll", "question": "Find the name of the candidates whose oppose percentage is the lowest for each sex.", "gold_sql": "SELECT t1.name , t1.sex , min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex", "db_path": "databases/candidate_poll/candidate_poll.sqlite", "schema": "CREATE TABLE \"candidate\" (\n\"Candidate_ID\" int,\n\"People_ID\" int,\n\"Poll_Source\" text,\n\"Date\" text,\n\"Support_rate\" real,\n\"Consider_rate\" real,\n\"Oppose_rate\" real,\n\"Unsure_rate\" real,\nPRIMARY KEY (\"Candidate_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Sex\" text,\n\"Name\" text,\n\"Date_of_Birth\" text,\n\"Height\" real,\n\"Weight\" real,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "gate_0013", "split": "gate", "db_id": "manufactory_1", "question": "How many products are there for each manufacturer?", "gold_sql": "SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name", "db_path": "databases/manufactory_1/manufactory_1.sqlite", "schema": "CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL,\n Headquarter VARCHAR(255) NOT NULL,\n Founder VARCHAR(255) NOT NULL,\n Revenue REAL,\n PRIMARY KEY (Code) \n);\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL ,\n Price DECIMAL NOT NULL ,\n Manufacturer INTEGER NOT NULL,\n PRIMARY KEY (Code), \n FOREIGN KEY (Manufacturer) REFERENCES Manufacturers(Code)\n);"} +{"qid": "gate_0014", "split": "gate", "db_id": "race_track", "question": "Give the names of tracks that do not have a race in the class 'GT'.", "gold_sql": "SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id WHERE T1.class = 'GT'", "db_path": "databases/race_track/race_track.sqlite", "schema": "CREATE TABLE \"race\" (\n\"Race_ID\" int,\n\"Name\" text,\n\"Class\" text,\n\"Date\" text,\n\"Track_ID\" text,\nPRIMARY KEY (\"Race_ID\"),\nFOREIGN KEY (\"Track_ID\") REFERENCES \"track\"(\"Track_ID\")\n);\nCREATE TABLE \"track\" (\n\"Track_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"Seating\" real,\n\"Year_Opened\" real,\nPRIMARY KEY (\"Track_ID\")\n);"} +{"qid": "gate_0015", "split": "gate", "db_id": "game_1", "question": "What are the average, minimum, and max ages for each of the different majors?", "gold_sql": "SELECT major , avg(age) , min(age) , max(age) FROM Student GROUP BY major", "db_path": "databases/game_1/game_1.sqlite", "schema": "CREATE TABLE Plays_Games (\n StuID INTEGER,\n GameID INTEGER,\n Hours_Played INTEGER,\n FOREIGN KEY(GameID) REFERENCES Video_Games(GameID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE SportsInfo (\n StuID INTEGER,\n SportName VARCHAR(32),\n HoursPerWeek INTEGER,\n GamesPlayed INTEGER,\n OnScholarship VARCHAR(1),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );\nCREATE TABLE Video_Games (\n GameID INTEGER PRIMARY KEY,\n GName VARCHAR(40),\n GType VARCHAR(40)\n);"} +{"qid": "gate_0016", "split": "gate", "db_id": "soccer_1", "question": "Of all players with an overall rating greater than 80, how many are right-footed and left-footed?", "gold_sql": "SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot", "db_path": "databases/soccer_1/soccer_1.sqlite", "schema": "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);\nCREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);\nCREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);\nCREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);\nCREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);\nCREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "gate_0017", "split": "gate", "db_id": "party_people", "question": "Who are the ministers and what parties do they belong to, listed descending by the times they took office?", "gold_sql": "SELECT minister , party_name FROM party ORDER BY took_office DESC", "db_path": "databases/party_people/party_people.sqlite", "schema": "CREATE TABLE \"member\" (\n\"Member_ID\" int,\n\"Member_Name\" text,\n\"Party_ID\" text,\n\"In_office\" text,\nPRIMARY KEY (\"Member_ID\"),\nFOREIGN KEY (`Party_ID`) REFERENCES `party`(`Party_ID`)\n);\nCREATE TABLE \"party\" (\n\"Party_ID\" int,\n\"Minister\" text,\n\"Took_office\" text,\n\"Left_office\" text,\n\"Region_ID\" int,\n\"Party_name\" text,\nPRIMARY KEY (\"Party_ID\"),\nFOREIGN KEY (`Region_ID`) REFERENCES `region`(`Region_ID`)\n);\nCREATE TABLE \"party_events\" (\n\"Event_ID\" int,\n\"Event_Name\" text,\n\"Party_ID\" int,\n\"Member_in_charge_ID\" int,\nPRIMARY KEY (\"Event_ID\"),\nFOREIGN KEY (`Party_ID`) REFERENCES `party`(`Party_ID`),\nFOREIGN KEY (`Member_in_charge_ID`) REFERENCES `member`(`Member_ID`)\n);\nCREATE TABLE \"region\" (\n\"Region_ID\" int,\n\"Region_name\" text,\n\"Date\" text,\n\"Label\" text,\n\"Format\" text,\n\"Catalogue\" text,\nPRIMARY KEY (\"Region_ID\")\n);"} +{"qid": "gate_0018", "split": "gate", "db_id": "product_catalog", "question": "Find the entry names of the catalog with the attribute that have the most entries.", "gold_sql": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)", "db_path": "databases/product_catalog/product_catalog.sqlite", "schema": "CREATE TABLE `Attribute_Definitions` (\n`attribute_id` INTEGER PRIMARY KEY,\n`attribute_name` VARCHAR(30),\n`attribute_data_type` VARCHAR(10)\n);\nCREATE TABLE `Catalog_Contents` (\n`catalog_entry_id` INTEGER PRIMARY KEY,\n`catalog_level_number` INTEGER NOT NULL,\n`parent_entry_id` INTEGER,\n`previous_entry_id` INTEGER,\n`next_entry_id` INTEGER,\n`catalog_entry_name` VARCHAR(80),\n`product_stock_number` VARCHAR(50),\n`price_in_dollars` DOUBLE NULL,\n`price_in_euros` DOUBLE NULL,\n`price_in_pounds` DOUBLE NULL,\n`capacity` VARCHAR(20),\n`length` VARCHAR(20),\n`height` VARCHAR(20),\n`width` VARCHAR(20),\nFOREIGN KEY (`catalog_level_number` ) REFERENCES `Catalog_Structure`(`catalog_level_number` )\n);\nCREATE TABLE `Catalog_Contents_Additional_Attributes` (\n`catalog_entry_id` INTEGER NOT NULL,\n`catalog_level_number` INTEGER NOT NULL,\n`attribute_id` INTEGER NOT NULL,\n`attribute_value` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`catalog_entry_id` ) REFERENCES `Catalog_Contents`(`catalog_entry_id` ),\nFOREIGN KEY (`catalog_level_number` ) REFERENCES `Catalog_Structure`(`catalog_level_number` )\n);\nCREATE TABLE `Catalog_Structure` (\n`catalog_level_number` INTEGER PRIMARY KEY,\n`catalog_id` INTEGER NOT NULL,\n`catalog_level_name` VARCHAR(50),\nFOREIGN KEY (`catalog_id` ) REFERENCES `Catalogs`(`catalog_id` )\n);\nCREATE TABLE `Catalogs` (\n`catalog_id` INTEGER PRIMARY KEY,\n`catalog_name` VARCHAR(50),\n`catalog_publisher` VARCHAR(80),\n`date_of_publication` DATETIME,\n`date_of_latest_revision` DATETIME\n);"} +{"qid": "gate_0019", "split": "gate", "db_id": "formula_1", "question": "What is the first and last name of all the German drivers?", "gold_sql": "SELECT forename , surname FROM drivers WHERE nationality = \"German\"", "db_path": "databases/formula_1/formula_1.sqlite", "schema": "CREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" TEXT,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);\nCREATE TABLE \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" TEXT,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" TEXT,\n \"time\" TEXT,\n \"milliseconds\" TEXT,\n \"fastestLap\" TEXT,\n \"rank\" TEXT,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);\nCREATE TABLE \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);"} +{"qid": "gate_0020", "split": "gate", "db_id": "store_product", "question": "What city is the headquarter of the store Blackville?", "gold_sql": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = \"Blackville\"", "db_path": "databases/store_product/store_product.sqlite", "schema": "CREATE TABLE \"district\" (\n\"District_ID\" int,\n\"District_name\" text,\n\"Headquartered_City\" text,\n\"City_Population\" real,\n\"City_Area\" real,\nPRIMARY KEY (\"District_ID\")\n);\nCREATE TABLE \"product\" (\n\"product_id\" int,\n\"product\" text,\n\"dimensions\" text,\n\"dpi\" real,\n\"pages_per_minute_color\" real,\n\"max_page_size\" text,\n\"interface\" text,\nPRIMARY KEY (\"product_id\")\n);\nCREATE TABLE \"store\" (\n\"Store_ID\" int,\n\"Store_Name\" text,\n\"Type\" text,\n\"Area_size\" real,\n\"Number_of_product_category\" real,\n\"Ranking\" int,\nPRIMARY KEY (\"Store_ID\")\n);\nCREATE TABLE \"store_district\" (\n\"Store_ID\" int,\n\"District_ID\" int,\nPRIMARY KEY (\"Store_ID\"),\nFOREIGN KEY (`Store_ID`) REFERENCES `store`(`Store_ID`),\nFOREIGN KEY (`District_ID`) REFERENCES `district`(`District_ID`)\n);\nCREATE TABLE \"store_product\" (\n\"Store_ID\" int,\n\"Product_ID\" int,\nPRIMARY KEY (\"Store_ID\",\"Product_ID\"),\nFOREIGN KEY (`Store_ID`) REFERENCES `store`(`Store_ID`),\nFOREIGN KEY (`Product_ID`) REFERENCES `product`(`Product_ID`)\n);"} +{"qid": "gate_0021", "split": "gate", "db_id": "medicine_enzyme_interaction", "question": "What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.", "gold_sql": "SELECT T1.id , T1.Name , T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC", "db_path": "databases/medicine_enzyme_interaction/medicine_enzyme_interaction.sqlite", "schema": "CREATE TABLE \"enzyme\" (\n\"id\" int,\n\"name\" text,\n\"Location\" text,\n\"Product\" text,\n\"Chromosome\" text,\n\"OMIM\" int,\n\"Porphyria\" text,\nprimary key (\"id\")\n);\nCREATE TABLE \"medicine\" (\n\"id\" int,\n\"name\" text,\n\"Trade_Name\" text,\n\"FDA_approved\" text,\nprimary key (\"id\")\n);\nCREATE TABLE \"medicine_enzyme_interaction\" (\n\"enzyme_id\" int,\n\"medicine_id\" int,\n\"interaction_type\" text,\nprimary key (\"enzyme_id\", \"medicine_id\"),\nforeign key (\"enzyme_id\") references `enzyme`(\"id\"),\nforeign key (\"medicine_id\") references `medicine`(\"id\")\n);"} +{"qid": "gate_0022", "split": "gate", "db_id": "candidate_poll", "question": "Find the average and minimum weight for each gender.", "gold_sql": "SELECT avg(weight) , min(weight) , sex FROM people GROUP BY sex", "db_path": "databases/candidate_poll/candidate_poll.sqlite", "schema": "CREATE TABLE \"candidate\" (\n\"Candidate_ID\" int,\n\"People_ID\" int,\n\"Poll_Source\" text,\n\"Date\" text,\n\"Support_rate\" real,\n\"Consider_rate\" real,\n\"Oppose_rate\" real,\n\"Unsure_rate\" real,\nPRIMARY KEY (\"Candidate_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Sex\" text,\n\"Name\" text,\n\"Date_of_Birth\" text,\n\"Height\" real,\n\"Weight\" real,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "gate_0023", "split": "gate", "db_id": "inn_1", "question": "What are the name of rooms booked by customers whose first name has \"ROY\" in part?", "gold_sql": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'", "db_path": "databases/inn_1/inn_1.sqlite", "schema": "CREATE TABLE \"Reservations\" ( \n\t\"Code\" INTEGER PRIMARY KEY, \n\t\"Room\" TEXT, \n\t\"CheckIn\" TEXT, \n\t\"CheckOut\" TEXT, \n\t\"Rate\" REAL, \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Adults\" INTEGER, \n\t\"Kids\" INTEGER,\n\tFOREIGN KEY (Room) REFERENCES Rooms(RoomId)\n);\nCREATE TABLE \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t\"roomName\" TEXT, \n\t\"beds\" INTEGER, \n\t\"bedType\" TEXT, \n\t\"maxOccupancy\" INTEGER, \n\t\"basePrice\" INTEGER, \n\t\"decor\" TEXT\n\n);"} +{"qid": "gate_0024", "split": "gate", "db_id": "perpetrator", "question": "What is the total kills of the perpetrators with height more than 1.84.", "gold_sql": "SELECT sum(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84", "db_path": "databases/perpetrator/perpetrator.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Height\" real,\n\"Weight\" real,\n\"Home Town\" text,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"perpetrator\" (\n\"Perpetrator_ID\" int,\n\"People_ID\" int,\n\"Date\" text,\n\"Year\" real,\n\"Location\" text,\n\"Country\" text,\n\"Killed\" int,\n\"Injured\" int,\nPRIMARY KEY (\"Perpetrator_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);"} +{"qid": "gate_0025", "split": "gate", "db_id": "inn_1", "question": "Find the number of rooms for each bed type.", "gold_sql": "SELECT bedType , count(*) FROM Rooms GROUP BY bedType;", "db_path": "databases/inn_1/inn_1.sqlite", "schema": "CREATE TABLE \"Reservations\" ( \n\t\"Code\" INTEGER PRIMARY KEY, \n\t\"Room\" TEXT, \n\t\"CheckIn\" TEXT, \n\t\"CheckOut\" TEXT, \n\t\"Rate\" REAL, \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Adults\" INTEGER, \n\t\"Kids\" INTEGER,\n\tFOREIGN KEY (Room) REFERENCES Rooms(RoomId)\n);\nCREATE TABLE \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t\"roomName\" TEXT, \n\t\"beds\" INTEGER, \n\t\"bedType\" TEXT, \n\t\"maxOccupancy\" INTEGER, \n\t\"basePrice\" INTEGER, \n\t\"decor\" TEXT\n\n);"} +{"qid": "gate_0026", "split": "gate", "db_id": "formula_1", "question": "What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?", "gold_sql": "SELECT avg(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year", "db_path": "databases/formula_1/formula_1.sqlite", "schema": "CREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" TEXT,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);\nCREATE TABLE \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" TEXT,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" TEXT,\n \"time\" TEXT,\n \"milliseconds\" TEXT,\n \"fastestLap\" TEXT,\n \"rank\" TEXT,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);\nCREATE TABLE \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);"} +{"qid": "gate_0027", "split": "gate", "db_id": "formula_1", "question": "Find the distinct names of all races held between 2014 and 2017?", "gold_sql": "SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017", "db_path": "databases/formula_1/formula_1.sqlite", "schema": "CREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" TEXT,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);\nCREATE TABLE \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" TEXT,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" TEXT,\n \"time\" TEXT,\n \"milliseconds\" TEXT,\n \"fastestLap\" TEXT,\n \"rank\" TEXT,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);\nCREATE TABLE \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);"} +{"qid": "gate_0028", "split": "gate", "db_id": "insurance_fnol", "question": "Find the maximum and minimum settlement amount.", "gold_sql": "SELECT max(settlement_amount) , min(settlement_amount) FROM settlements", "db_path": "databases/insurance_fnol/insurance_fnol.sqlite", "schema": "CREATE TABLE Available_Policies (\nPolicy_ID INTEGER NOT NULL,\npolicy_type_code CHAR(15),\nCustomer_Phone VARCHAR(255),\nPRIMARY KEY (Policy_ID),\nUNIQUE (Policy_ID)\n);\nCREATE TABLE Claims (\nClaim_ID INTEGER NOT NULL,\nFNOL_ID INTEGER NOT NULL,\nEffective_Date DATE,\nPRIMARY KEY (Claim_ID),\nUNIQUE (Claim_ID),\nFOREIGN KEY (FNOL_ID) REFERENCES First_Notification_of_Loss (FNOL_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID INTEGER NOT NULL,\nCustomer_name VARCHAR(40),\nPRIMARY KEY (Customer_ID)\n);\nCREATE TABLE Customers_Policies (\nCustomer_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nDate_Opened DATE,\nDate_Closed DATE,\nPRIMARY KEY (Customer_ID, Policy_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Policy_ID) REFERENCES Available_Policies (Policy_ID)\n);\nCREATE TABLE First_Notification_of_Loss (\nFNOL_ID INTEGER NOT NULL,\nCustomer_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nPRIMARY KEY (FNOL_ID),\nUNIQUE (FNOL_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID),\nFOREIGN KEY (Customer_ID, Policy_ID) REFERENCES Customers_Policies (Customer_ID,Policy_ID)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_name VARCHAR(40),\nPRIMARY KEY (Service_ID)\n);\nCREATE TABLE Settlements (\nSettlement_ID INTEGER NOT NULL,\nClaim_ID INTEGER,\nEffective_Date DATE,\nSettlement_Amount REAL,\nPRIMARY KEY (Settlement_ID),\nUNIQUE (Settlement_ID),\nFOREIGN KEY (Claim_ID) REFERENCES Claims (Claim_ID)\n);"} +{"qid": "gate_0029", "split": "gate", "db_id": "hr_1", "question": "What are the department names, cities, and state provinces for each department?", "gold_sql": "SELECT T1.department_name , T2.city , T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id", "db_path": "databases/hr_1/hr_1.sqlite", "schema": "CREATE TABLE `countries` (\n `COUNTRY_ID` varchar(2) NOT NULL,\n `COUNTRY_NAME` varchar(40) DEFAULT NULL,\n `REGION_ID` decimal(10,0) DEFAULT NULL,\n PRIMARY KEY (`COUNTRY_ID`),\n FOREIGN KEY (`REGION_ID`) REFERENCES regions (`REGION_ID`)\n);\nCREATE TABLE `departments` (\n `DEPARTMENT_ID` decimal(4,0) NOT NULL DEFAULT '0',\n `DEPARTMENT_NAME` varchar(30) NOT NULL,\n `MANAGER_ID` decimal(6,0) DEFAULT NULL,\n `LOCATION_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`DEPARTMENT_ID`)\n);\nCREATE TABLE `employees` (\n `EMPLOYEE_ID` decimal(6,0) NOT NULL DEFAULT '0',\n `FIRST_NAME` varchar(20) DEFAULT NULL,\n `LAST_NAME` varchar(25) NOT NULL,\n `EMAIL` varchar(25) NOT NULL,\n `PHONE_NUMBER` varchar(20) DEFAULT NULL,\n `HIRE_DATE` date NOT NULL,\n `JOB_ID` varchar(10) NOT NULL,\n `SALARY` decimal(8,2) DEFAULT NULL,\n `COMMISSION_PCT` decimal(2,2) DEFAULT NULL,\n `MANAGER_ID` decimal(6,0) DEFAULT NULL,\n `DEPARTMENT_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`EMPLOYEE_ID`),\n FOREIGN KEY (`DEPARTMENT_ID`) REFERENCES departments(`DEPARTMENT_ID`),\n FOREIGN KEY (`JOB_ID`) REFERENCES jobs(`JOB_ID`)\n);\nCREATE TABLE `job_history` (\n `EMPLOYEE_ID` decimal(6,0) NOT NULL,\n `START_DATE` date NOT NULL,\n `END_DATE` date NOT NULL,\n `JOB_ID` varchar(10) NOT NULL,\n `DEPARTMENT_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`EMPLOYEE_ID`,`START_DATE`),\n FOREIGN KEY (`EMPLOYEE_ID`) REFERENCES employees(`EMPLOYEE_ID`),\n FOREIGN KEY (`DEPARTMENT_ID`) REFERENCES departments(`DEPARTMENT_ID`),\n FOREIGN KEY (`JOB_ID`) REFERENCES jobs(`JOB_ID`)\n);\nCREATE TABLE `jobs` (\n `JOB_ID` varchar(10) NOT NULL DEFAULT '',\n `JOB_TITLE` varchar(35) NOT NULL,\n `MIN_SALARY` decimal(6,0) DEFAULT NULL,\n `MAX_SALARY` decimal(6,0) DEFAULT NULL,\n PRIMARY KEY (`JOB_ID`)\n);\nCREATE TABLE `locations` (\n `LOCATION_ID` decimal(4,0) NOT NULL DEFAULT '0',\n `STREET_ADDRESS` varchar(40) DEFAULT NULL,\n `POSTAL_CODE` varchar(12) DEFAULT NULL,\n `CITY` varchar(30) NOT NULL,\n `STATE_PROVINCE` varchar(25) DEFAULT NULL,\n `COUNTRY_ID` varchar(2) DEFAULT NULL,\n PRIMARY KEY (`LOCATION_ID`),\n FOREIGN KEY (`COUNTRY_ID`) REFERENCES countries(`COUNTRY_ID`)\n);\nCREATE TABLE `regions` (\n `REGION_ID` decimal(5,0) NOT NULL,\n `REGION_NAME` varchar(25) DEFAULT NULL,\n PRIMARY KEY (`REGION_ID`)\n);"} +{"qid": "gate_0030", "split": "gate", "db_id": "product_catalog", "question": "Name all the products with next entry ID greater than 8.", "gold_sql": "SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8", "db_path": "databases/product_catalog/product_catalog.sqlite", "schema": "CREATE TABLE `Attribute_Definitions` (\n`attribute_id` INTEGER PRIMARY KEY,\n`attribute_name` VARCHAR(30),\n`attribute_data_type` VARCHAR(10)\n);\nCREATE TABLE `Catalog_Contents` (\n`catalog_entry_id` INTEGER PRIMARY KEY,\n`catalog_level_number` INTEGER NOT NULL,\n`parent_entry_id` INTEGER,\n`previous_entry_id` INTEGER,\n`next_entry_id` INTEGER,\n`catalog_entry_name` VARCHAR(80),\n`product_stock_number` VARCHAR(50),\n`price_in_dollars` DOUBLE NULL,\n`price_in_euros` DOUBLE NULL,\n`price_in_pounds` DOUBLE NULL,\n`capacity` VARCHAR(20),\n`length` VARCHAR(20),\n`height` VARCHAR(20),\n`width` VARCHAR(20),\nFOREIGN KEY (`catalog_level_number` ) REFERENCES `Catalog_Structure`(`catalog_level_number` )\n);\nCREATE TABLE `Catalog_Contents_Additional_Attributes` (\n`catalog_entry_id` INTEGER NOT NULL,\n`catalog_level_number` INTEGER NOT NULL,\n`attribute_id` INTEGER NOT NULL,\n`attribute_value` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`catalog_entry_id` ) REFERENCES `Catalog_Contents`(`catalog_entry_id` ),\nFOREIGN KEY (`catalog_level_number` ) REFERENCES `Catalog_Structure`(`catalog_level_number` )\n);\nCREATE TABLE `Catalog_Structure` (\n`catalog_level_number` INTEGER PRIMARY KEY,\n`catalog_id` INTEGER NOT NULL,\n`catalog_level_name` VARCHAR(50),\nFOREIGN KEY (`catalog_id` ) REFERENCES `Catalogs`(`catalog_id` )\n);\nCREATE TABLE `Catalogs` (\n`catalog_id` INTEGER PRIMARY KEY,\n`catalog_name` VARCHAR(50),\n`catalog_publisher` VARCHAR(80),\n`date_of_publication` DATETIME,\n`date_of_latest_revision` DATETIME\n);"} +{"qid": "gate_0031", "split": "gate", "db_id": "inn_1", "question": "How many king beds are there?", "gold_sql": "SELECT sum(beds) FROM Rooms WHERE bedtype = 'King';", "db_path": "databases/inn_1/inn_1.sqlite", "schema": "CREATE TABLE \"Reservations\" ( \n\t\"Code\" INTEGER PRIMARY KEY, \n\t\"Room\" TEXT, \n\t\"CheckIn\" TEXT, \n\t\"CheckOut\" TEXT, \n\t\"Rate\" REAL, \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Adults\" INTEGER, \n\t\"Kids\" INTEGER,\n\tFOREIGN KEY (Room) REFERENCES Rooms(RoomId)\n);\nCREATE TABLE \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t\"roomName\" TEXT, \n\t\"beds\" INTEGER, \n\t\"bedType\" TEXT, \n\t\"maxOccupancy\" INTEGER, \n\t\"basePrice\" INTEGER, \n\t\"decor\" TEXT\n\n);"} +{"qid": "gate_0032", "split": "gate", "db_id": "club_1", "question": "How many students are there?", "gold_sql": "SELECT count(*) FROM student", "db_path": "databases/club_1/club_1.sqlite", "schema": "CREATE TABLE Club (\n ClubID INTEGER PRIMARY KEY,\n ClubName VARCHAR(40),\n ClubDesc VARCHAR(1024),\n ClubLocation VARCHAR(40)\n);\nCREATE TABLE Member_of_club (\n StuID INTEGER,\n ClubID INTEGER,\n Position VARCHAR(40),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(ClubID) REFERENCES Club(ClubID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "gate_0033", "split": "gate", "db_id": "tracking_orders", "question": "What are the distinct details of invoices created before 1989-09-03 or after 2007-12-25?", "gold_sql": "SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < \"1989-09-03\" OR invoice_date > \"2007-12-25\"", "db_path": "databases/tracking_orders/tracking_orders.sqlite", "schema": "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_name` VARCHAR(80),\n`customer_details` VARCHAR(255)\n);\nCREATE TABLE `Invoices` (\n`invoice_number` INTEGER PRIMARY KEY,\n`invoice_date` DATETIME,\n`invoice_details` VARCHAR(255)\n);\nCREATE TABLE `Order_Items` (\n`order_item_id` INTEGER PRIMARY KEY,\n`product_id` INTEGER NOT NULL,\n`order_id` INTEGER NOT NULL,\n`order_item_status` VARCHAR(10) NOT NULL,\n`order_item_details` VARCHAR(255),\nFOREIGN KEY (`order_id` ) REFERENCES `Orders`(`order_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status` VARCHAR(10) NOT NULL,\n`date_order_placed` DATETIME NOT NULL,\n`order_details` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_name` VARCHAR(80),\n`product_details` VARCHAR(255)\n);\nCREATE TABLE `Shipment_Items` (\n`shipment_id` INTEGER NOT NULL,\n`order_item_id` INTEGER NOT NULL,\nFOREIGN KEY (`order_item_id` ) REFERENCES `Order_Items`(`order_item_id` ),\nFOREIGN KEY (`shipment_id` ) REFERENCES `Shipments`(`shipment_id` )\n);\nCREATE TABLE `Shipments` (\n`shipment_id` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`invoice_number` INTEGER NOT NULL,\n`shipment_tracking_number` VARCHAR(80),\n`shipment_date` DATETIME,\n`other_shipment_details` VARCHAR(255),\nFOREIGN KEY (`order_id` ) REFERENCES `Orders`(`order_id` ),\nFOREIGN KEY (`invoice_number` ) REFERENCES `Invoices`(`invoice_number` )\n);"} +{"qid": "gate_0034", "split": "gate", "db_id": "student_1", "question": "Find the number of students in total.", "gold_sql": "SELECT count(*) FROM list", "db_path": "databases/student_1/student_1.sqlite", "schema": "CREATE TABLE \"list\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Grade\" INTEGER, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);\nCREATE TABLE \"teachers\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);"} +{"qid": "gate_0035", "split": "gate", "db_id": "behavior_monitoring", "question": "Find all information about student addresses, and sort by monthly rental in descending order.", "gold_sql": "SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC", "db_path": "databases/behavior_monitoring/behavior_monitoring.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);\nCREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);\nCREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);\nCREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);\nCREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);\nCREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);"} +{"qid": "gate_0036", "split": "gate", "db_id": "cre_Doc_Control_Systems", "question": "For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.", "gold_sql": "SELECT document_id , count(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id;", "db_path": "databases/cre_Doc_Control_Systems/cre_Doc_Control_Systems.sqlite", "schema": "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);\nCREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);\nCREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);\nCREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);\nCREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);\nCREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);\nCREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);\nCREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);\nCREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);\nCREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);"} +{"qid": "gate_0037", "split": "gate", "db_id": "customers_and_addresses", "question": "Return the channel code and contact number of the customer contact channel whose active duration was the longest.", "gold_sql": "SELECT channel_code , contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)", "db_path": "databases/customers_and_addresses/customers_and_addresses.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`address_content` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Customer_Addresses` (\n`customer_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Contact_Channels` (\n`customer_id` INTEGER NOT NULL,\n`channel_code` VARCHAR(15) NOT NULL,\n`active_from_date` DATETIME NOT NULL,\n`active_to_date` DATETIME,\n`contact_number` VARCHAR(50) NOT NULL,\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status` VARCHAR(15) NOT NULL,\n`order_date` DATETIME,\n`order_details` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`payment_method` VARCHAR(15) NOT NULL,\n`customer_name` VARCHAR(80),\n`date_became_customer` DATETIME,\n`other_customer_details` VARCHAR(255)\n);\nCREATE TABLE `Order_Items` (\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\n`order_quantity` VARCHAR(15),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_details` VARCHAR(255)\n);"} +{"qid": "gate_0038", "split": "gate", "db_id": "formula_1", "question": "What are the unique names of races that held after 2000 and the circuits were in Spain?", "gold_sql": "SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = \"Spain\" AND T1.year > 2000", "db_path": "databases/formula_1/formula_1.sqlite", "schema": "CREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" TEXT,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);\nCREATE TABLE \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" TEXT,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" TEXT,\n \"time\" TEXT,\n \"milliseconds\" TEXT,\n \"fastestLap\" TEXT,\n \"rank\" TEXT,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);\nCREATE TABLE \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);"} +{"qid": "gate_0039", "split": "gate", "db_id": "tracking_share_transactions", "question": "Show the average amount of transactions for different lots, ordered by average amount of transactions.", "gold_sql": "SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY avg(amount_of_transaction)", "db_path": "databases/tracking_share_transactions/tracking_share_transactions.sqlite", "schema": "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);\nCREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);\nCREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);\nCREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);\nCREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);\nCREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);\nCREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);"} +{"qid": "gate_0040", "split": "gate", "db_id": "game_1", "question": "What are the first names for all students who are from the major numbered 600?", "gold_sql": "SELECT Fname FROM Student WHERE Major = 600", "db_path": "databases/game_1/game_1.sqlite", "schema": "CREATE TABLE Plays_Games (\n StuID INTEGER,\n GameID INTEGER,\n Hours_Played INTEGER,\n FOREIGN KEY(GameID) REFERENCES Video_Games(GameID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE SportsInfo (\n StuID INTEGER,\n SportName VARCHAR(32),\n HoursPerWeek INTEGER,\n GamesPlayed INTEGER,\n OnScholarship VARCHAR(1),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );\nCREATE TABLE Video_Games (\n GameID INTEGER PRIMARY KEY,\n GName VARCHAR(40),\n GType VARCHAR(40)\n);"} +{"qid": "gate_0041", "split": "gate", "db_id": "customers_card_transactions", "question": "What are the ids and first names of customers who do not hold a credit card?", "gold_sql": "SELECT customer_id , customer_first_name FROM Customers EXCEPT SELECT T1.customer_id , T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE card_type_code = \"Credit\"", "db_path": "databases/customers_card_transactions/customers_card_transactions.sqlite", "schema": "CREATE TABLE `Accounts` (\n`account_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`account_name` VARCHAR(50),\n`other_account_details` VARCHAR(255)\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_first_name` VARCHAR(20),\n`customer_last_name` VARCHAR(20),\n`customer_address` VARCHAR(255),\n`customer_phone` VARCHAR(255),\n`customer_email` VARCHAR(255),\n`other_customer_details` VARCHAR(255)\n);\nCREATE TABLE `Customers_Cards` (\n`card_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`card_type_code` VARCHAR(15) NOT NULL,\n`card_number` VARCHAR(80),\n`date_valid_from` DATETIME,\n`date_valid_to` DATETIME,\n`other_card_details` VARCHAR(255)\n);\nCREATE TABLE `Financial_Transactions` (\n`transaction_id` INTEGER NOT NULL ,\n`previous_transaction_id` INTEGER,\n`account_id` INTEGER NOT NULL,\n`card_id` INTEGER NOT NULL,\n`transaction_type` VARCHAR(15) NOT NULL,\n`transaction_date` DATETIME,\n`transaction_amount` DOUBLE NULL,\n`transaction_comment` VARCHAR(255),\n`other_transaction_details` VARCHAR(255),\nFOREIGN KEY (`card_id` ) REFERENCES `Customers_Cards`(`card_id` ),\nFOREIGN KEY (`account_id` ) REFERENCES `Accounts`(`account_id` )\n);"} +{"qid": "gate_0042", "split": "gate", "db_id": "ship_1", "question": "List all ship names in the order of built year and class.", "gold_sql": "SELECT name FROM ship ORDER BY built_year , CLASS", "db_path": "databases/ship_1/ship_1.sqlite", "schema": "CREATE TABLE \"Ship\" (\n\"Ship_ID\" int,\n\"Name\" text,\n\"Type\" text,\n\"Built_Year\" real,\n\"Class\" text,\n\"Flag\" text,\nPRIMARY KEY (\"Ship_ID\")\n);\nCREATE TABLE \"captain\" (\n\"Captain_ID\" int,\n\"Name\" text,\n\"Ship_ID\" int,\n\"age\" text,\n\"Class\" text,\n\"Rank\" text,\nPRIMARY KEY (\"Captain_ID\"),\nFOREIGN KEY (\"Ship_ID\") REFERENCES \"Ship\"(\"Ship_ID\")\n);"} +{"qid": "gate_0043", "split": "gate", "db_id": "behavior_monitoring", "question": "Find the id and city of the student address with the highest average monthly rental.", "gold_sql": "SELECT T2.address_id , T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1", "db_path": "databases/behavior_monitoring/behavior_monitoring.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);\nCREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);\nCREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);\nCREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);\nCREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);\nCREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);"} +{"qid": "gate_0044", "split": "gate", "db_id": "hr_1", "question": "What the full names, ids of each employee and the name of the country they are in?", "gold_sql": "SELECT T1.first_name , T1.last_name , T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id", "db_path": "databases/hr_1/hr_1.sqlite", "schema": "CREATE TABLE `countries` (\n `COUNTRY_ID` varchar(2) NOT NULL,\n `COUNTRY_NAME` varchar(40) DEFAULT NULL,\n `REGION_ID` decimal(10,0) DEFAULT NULL,\n PRIMARY KEY (`COUNTRY_ID`),\n FOREIGN KEY (`REGION_ID`) REFERENCES regions (`REGION_ID`)\n);\nCREATE TABLE `departments` (\n `DEPARTMENT_ID` decimal(4,0) NOT NULL DEFAULT '0',\n `DEPARTMENT_NAME` varchar(30) NOT NULL,\n `MANAGER_ID` decimal(6,0) DEFAULT NULL,\n `LOCATION_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`DEPARTMENT_ID`)\n);\nCREATE TABLE `employees` (\n `EMPLOYEE_ID` decimal(6,0) NOT NULL DEFAULT '0',\n `FIRST_NAME` varchar(20) DEFAULT NULL,\n `LAST_NAME` varchar(25) NOT NULL,\n `EMAIL` varchar(25) NOT NULL,\n `PHONE_NUMBER` varchar(20) DEFAULT NULL,\n `HIRE_DATE` date NOT NULL,\n `JOB_ID` varchar(10) NOT NULL,\n `SALARY` decimal(8,2) DEFAULT NULL,\n `COMMISSION_PCT` decimal(2,2) DEFAULT NULL,\n `MANAGER_ID` decimal(6,0) DEFAULT NULL,\n `DEPARTMENT_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`EMPLOYEE_ID`),\n FOREIGN KEY (`DEPARTMENT_ID`) REFERENCES departments(`DEPARTMENT_ID`),\n FOREIGN KEY (`JOB_ID`) REFERENCES jobs(`JOB_ID`)\n);\nCREATE TABLE `job_history` (\n `EMPLOYEE_ID` decimal(6,0) NOT NULL,\n `START_DATE` date NOT NULL,\n `END_DATE` date NOT NULL,\n `JOB_ID` varchar(10) NOT NULL,\n `DEPARTMENT_ID` decimal(4,0) DEFAULT NULL,\n PRIMARY KEY (`EMPLOYEE_ID`,`START_DATE`),\n FOREIGN KEY (`EMPLOYEE_ID`) REFERENCES employees(`EMPLOYEE_ID`),\n FOREIGN KEY (`DEPARTMENT_ID`) REFERENCES departments(`DEPARTMENT_ID`),\n FOREIGN KEY (`JOB_ID`) REFERENCES jobs(`JOB_ID`)\n);\nCREATE TABLE `jobs` (\n `JOB_ID` varchar(10) NOT NULL DEFAULT '',\n `JOB_TITLE` varchar(35) NOT NULL,\n `MIN_SALARY` decimal(6,0) DEFAULT NULL,\n `MAX_SALARY` decimal(6,0) DEFAULT NULL,\n PRIMARY KEY (`JOB_ID`)\n);\nCREATE TABLE `locations` (\n `LOCATION_ID` decimal(4,0) NOT NULL DEFAULT '0',\n `STREET_ADDRESS` varchar(40) DEFAULT NULL,\n `POSTAL_CODE` varchar(12) DEFAULT NULL,\n `CITY` varchar(30) NOT NULL,\n `STATE_PROVINCE` varchar(25) DEFAULT NULL,\n `COUNTRY_ID` varchar(2) DEFAULT NULL,\n PRIMARY KEY (`LOCATION_ID`),\n FOREIGN KEY (`COUNTRY_ID`) REFERENCES countries(`COUNTRY_ID`)\n);\nCREATE TABLE `regions` (\n `REGION_ID` decimal(5,0) NOT NULL,\n `REGION_NAME` varchar(25) DEFAULT NULL,\n PRIMARY KEY (`REGION_ID`)\n);"} +{"qid": "gate_0045", "split": "gate", "db_id": "student_1", "question": "Which teachers teach in classroom 110? Give me their first names.", "gold_sql": "SELECT firstname FROM teachers WHERE classroom = 110", "db_path": "databases/student_1/student_1.sqlite", "schema": "CREATE TABLE \"list\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Grade\" INTEGER, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);\nCREATE TABLE \"teachers\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);"} +{"qid": "gate_0046", "split": "gate", "db_id": "university_basketball", "question": "How many universities have a location that contains NY?", "gold_sql": "SELECT count(*) FROM university WHERE LOCATION LIKE \"%NY%\"", "db_path": "databases/university_basketball/university_basketball.sqlite", "schema": "CREATE TABLE \"basketball_match\" (\n\"Team_ID\" int,\n\"School_ID\" int,\n\"Team_Name\" text,\n\"ACC_Regular_Season\" text,\n\"ACC_Percent\" text,\n\"ACC_Home\" text,\n\"ACC_Road\" text,\n\"All_Games\" text,\n\"All_Games_Percent\" int,\n\"All_Home\" text,\n\"All_Road\" text,\n\"All_Neutral\" text,\nPRIMARY KEY (\"Team_ID\"),\nFOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`)\n);\nCREATE TABLE \"university\" (\n\"School_ID\" int,\n\"School\" text,\n\"Location\" text,\n\"Founded\" real,\n\"Affiliation\" text,\n\"Enrollment\" real,\n\"Nickname\" text,\n\"Primary_conference\" text,\nPRIMARY KEY (\"School_ID\")\n);"} +{"qid": "gate_0047", "split": "gate", "db_id": "customers_and_addresses", "question": "What is the \"active to date\" of the latest contact channel used by \"Tillman Ernser\"?", "gold_sql": "SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Tillman Ernser\"", "db_path": "databases/customers_and_addresses/customers_and_addresses.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`address_content` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Customer_Addresses` (\n`customer_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Contact_Channels` (\n`customer_id` INTEGER NOT NULL,\n`channel_code` VARCHAR(15) NOT NULL,\n`active_from_date` DATETIME NOT NULL,\n`active_to_date` DATETIME,\n`contact_number` VARCHAR(50) NOT NULL,\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status` VARCHAR(15) NOT NULL,\n`order_date` DATETIME,\n`order_details` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`payment_method` VARCHAR(15) NOT NULL,\n`customer_name` VARCHAR(80),\n`date_became_customer` DATETIME,\n`other_customer_details` VARCHAR(255)\n);\nCREATE TABLE `Order_Items` (\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\n`order_quantity` VARCHAR(15),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_details` VARCHAR(255)\n);"} +{"qid": "gate_0048", "split": "gate", "db_id": "university_basketball", "question": "Count the number of different affiliation types.", "gold_sql": "SELECT count(DISTINCT affiliation) FROM university", "db_path": "databases/university_basketball/university_basketball.sqlite", "schema": "CREATE TABLE \"basketball_match\" (\n\"Team_ID\" int,\n\"School_ID\" int,\n\"Team_Name\" text,\n\"ACC_Regular_Season\" text,\n\"ACC_Percent\" text,\n\"ACC_Home\" text,\n\"ACC_Road\" text,\n\"All_Games\" text,\n\"All_Games_Percent\" int,\n\"All_Home\" text,\n\"All_Road\" text,\n\"All_Neutral\" text,\nPRIMARY KEY (\"Team_ID\"),\nFOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`)\n);\nCREATE TABLE \"university\" (\n\"School_ID\" int,\n\"School\" text,\n\"Location\" text,\n\"Founded\" real,\n\"Affiliation\" text,\n\"Enrollment\" real,\n\"Nickname\" text,\n\"Primary_conference\" text,\nPRIMARY KEY (\"School_ID\")\n);"} +{"qid": "gate_0049", "split": "gate", "db_id": "customers_card_transactions", "question": "Give the full name and customer id of the customer with the fewest accounts.", "gold_sql": "SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1", "db_path": "databases/customers_card_transactions/customers_card_transactions.sqlite", "schema": "CREATE TABLE `Accounts` (\n`account_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`account_name` VARCHAR(50),\n`other_account_details` VARCHAR(255)\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_first_name` VARCHAR(20),\n`customer_last_name` VARCHAR(20),\n`customer_address` VARCHAR(255),\n`customer_phone` VARCHAR(255),\n`customer_email` VARCHAR(255),\n`other_customer_details` VARCHAR(255)\n);\nCREATE TABLE `Customers_Cards` (\n`card_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`card_type_code` VARCHAR(15) NOT NULL,\n`card_number` VARCHAR(80),\n`date_valid_from` DATETIME,\n`date_valid_to` DATETIME,\n`other_card_details` VARCHAR(255)\n);\nCREATE TABLE `Financial_Transactions` (\n`transaction_id` INTEGER NOT NULL ,\n`previous_transaction_id` INTEGER,\n`account_id` INTEGER NOT NULL,\n`card_id` INTEGER NOT NULL,\n`transaction_type` VARCHAR(15) NOT NULL,\n`transaction_date` DATETIME,\n`transaction_amount` DOUBLE NULL,\n`transaction_comment` VARCHAR(255),\n`other_transaction_details` VARCHAR(255),\nFOREIGN KEY (`card_id` ) REFERENCES `Customers_Cards`(`card_id` ),\nFOREIGN KEY (`account_id` ) REFERENCES `Accounts`(`account_id` )\n);"} +{"qid": "gate_0050", "split": "gate", "db_id": "insurance_policies", "question": "Count the total number of settlements made.", "gold_sql": "SELECT count(*) FROM Settlements", "db_path": "databases/insurance_policies/insurance_policies.sqlite", "schema": "CREATE TABLE Claims (\nClaim_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nDate_Claim_Made DATE,\nDate_Claim_Settled DATE,\nAmount_Claimed INTEGER,\nAmount_Settled INTEGER,\nPRIMARY KEY (Claim_ID),\nFOREIGN KEY (Policy_ID) REFERENCES Customer_Policies (Policy_ID)\n);\nCREATE TABLE Customer_Policies (\nPolicy_ID INTEGER NOT NULL,\nCustomer_ID INTEGER NOT NULL,\nPolicy_Type_Code CHAR(15) NOT NULL,\nStart_Date DATE,\nEnd_Date DATE,\nPRIMARY KEY (Policy_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID INTEGER NOT NULL,\nCustomer_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Customer_ID)\n);\nCREATE TABLE Payments (\nPayment_ID INTEGER NOT NULL,\nSettlement_ID INTEGER NOT NULL,\nPayment_Method_Code VARCHAR(255),\nDate_Payment_Made DATE,\nAmount_Payment INTEGER,\nPRIMARY KEY (Payment_ID),\nFOREIGN KEY (Settlement_ID) REFERENCES Settlements (Settlement_ID)\n);\nCREATE TABLE Settlements (\nSettlement_ID INTEGER NOT NULL,\nClaim_ID INTEGER NOT NULL,\nDate_Claim_Made DATE,\nDate_Claim_Settled DATE,\nAmount_Claimed INTEGER,\nAmount_Settled INTEGER,\nCustomer_Policy_ID INTEGER NOT NULL,\nPRIMARY KEY (Settlement_ID),\nFOREIGN KEY (Claim_ID) REFERENCES Claims (Claim_ID)\n);"} +{"qid": "gate_0051", "split": "gate", "db_id": "medicine_enzyme_interaction", "question": "What are the names of enzymes that include the string 'ALA'?", "gold_sql": "SELECT name FROM enzyme WHERE name LIKE \"%ALA%\"", "db_path": "databases/medicine_enzyme_interaction/medicine_enzyme_interaction.sqlite", "schema": "CREATE TABLE \"enzyme\" (\n\"id\" int,\n\"name\" text,\n\"Location\" text,\n\"Product\" text,\n\"Chromosome\" text,\n\"OMIM\" int,\n\"Porphyria\" text,\nprimary key (\"id\")\n);\nCREATE TABLE \"medicine\" (\n\"id\" int,\n\"name\" text,\n\"Trade_Name\" text,\n\"FDA_approved\" text,\nprimary key (\"id\")\n);\nCREATE TABLE \"medicine_enzyme_interaction\" (\n\"enzyme_id\" int,\n\"medicine_id\" int,\n\"interaction_type\" text,\nprimary key (\"enzyme_id\", \"medicine_id\"),\nforeign key (\"enzyme_id\") references `enzyme`(\"id\"),\nforeign key (\"medicine_id\") references `medicine`(\"id\")\n);"} +{"qid": "gate_0052", "split": "gate", "db_id": "student_1", "question": "Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.", "gold_sql": "SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname != \"COVIN\" AND T2.lastname != \"JEROME\"", "db_path": "databases/student_1/student_1.sqlite", "schema": "CREATE TABLE \"list\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Grade\" INTEGER, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);\nCREATE TABLE \"teachers\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);"} +{"qid": "gate_0053", "split": "gate", "db_id": "tracking_share_transactions", "question": "What are the details of all sales and purchases?", "gold_sql": "SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases", "db_path": "databases/tracking_share_transactions/tracking_share_transactions.sqlite", "schema": "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);\nCREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);\nCREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);\nCREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);\nCREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);\nCREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);\nCREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);"} +{"qid": "gate_0054", "split": "gate", "db_id": "inn_1", "question": "What is the decor of room Recluse and defiance?", "gold_sql": "SELECT decor FROM Rooms WHERE roomName = \"Recluse and defiance\";", "db_path": "databases/inn_1/inn_1.sqlite", "schema": "CREATE TABLE \"Reservations\" ( \n\t\"Code\" INTEGER PRIMARY KEY, \n\t\"Room\" TEXT, \n\t\"CheckIn\" TEXT, \n\t\"CheckOut\" TEXT, \n\t\"Rate\" REAL, \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Adults\" INTEGER, \n\t\"Kids\" INTEGER,\n\tFOREIGN KEY (Room) REFERENCES Rooms(RoomId)\n);\nCREATE TABLE \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t\"roomName\" TEXT, \n\t\"beds\" INTEGER, \n\t\"bedType\" TEXT, \n\t\"maxOccupancy\" INTEGER, \n\t\"basePrice\" INTEGER, \n\t\"decor\" TEXT\n\n);"} +{"qid": "gate_0055", "split": "gate", "db_id": "inn_1", "question": "Find the name of rooms whose price is higher than the average price.", "gold_sql": "SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms );", "db_path": "databases/inn_1/inn_1.sqlite", "schema": "CREATE TABLE \"Reservations\" ( \n\t\"Code\" INTEGER PRIMARY KEY, \n\t\"Room\" TEXT, \n\t\"CheckIn\" TEXT, \n\t\"CheckOut\" TEXT, \n\t\"Rate\" REAL, \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Adults\" INTEGER, \n\t\"Kids\" INTEGER,\n\tFOREIGN KEY (Room) REFERENCES Rooms(RoomId)\n);\nCREATE TABLE \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t\"roomName\" TEXT, \n\t\"beds\" INTEGER, \n\t\"bedType\" TEXT, \n\t\"maxOccupancy\" INTEGER, \n\t\"basePrice\" INTEGER, \n\t\"decor\" TEXT\n\n);"} +{"qid": "gate_0056", "split": "gate", "db_id": "small_bank_1", "question": "Find the name, checking balance and savings balance of all accounts in the bank sorted by their total checking and savings balance in descending order.", "gold_sql": "SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance DESC", "db_path": "databases/small_bank_1/small_bank_1.sqlite", "schema": "CREATE TABLE ACCOUNTS (\n custid BIGINT NOT NULL PRIMARY KEY,\n name VARCHAR(64) NOT NULL\n);\nCREATE TABLE CHECKING (\n custid BIGINT NOT NULL PRIMARY KEY,\n balance FLOAT NOT NULL,\n FOREIGN KEY (custid) REFERENCES ACCOUNTS (custid)\n);\nCREATE TABLE SAVINGS (\n custid BIGINT NOT NULL PRIMARY KEY,\n balance FLOAT NOT NULL,\n FOREIGN KEY (custid) REFERENCES ACCOUNTS (custid)\n);"} +{"qid": "gate_0057", "split": "gate", "db_id": "tracking_orders", "question": "List the ids of all distinct orders ordered by placed date.", "gold_sql": "SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed", "db_path": "databases/tracking_orders/tracking_orders.sqlite", "schema": "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_name` VARCHAR(80),\n`customer_details` VARCHAR(255)\n);\nCREATE TABLE `Invoices` (\n`invoice_number` INTEGER PRIMARY KEY,\n`invoice_date` DATETIME,\n`invoice_details` VARCHAR(255)\n);\nCREATE TABLE `Order_Items` (\n`order_item_id` INTEGER PRIMARY KEY,\n`product_id` INTEGER NOT NULL,\n`order_id` INTEGER NOT NULL,\n`order_item_status` VARCHAR(10) NOT NULL,\n`order_item_details` VARCHAR(255),\nFOREIGN KEY (`order_id` ) REFERENCES `Orders`(`order_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status` VARCHAR(10) NOT NULL,\n`date_order_placed` DATETIME NOT NULL,\n`order_details` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_name` VARCHAR(80),\n`product_details` VARCHAR(255)\n);\nCREATE TABLE `Shipment_Items` (\n`shipment_id` INTEGER NOT NULL,\n`order_item_id` INTEGER NOT NULL,\nFOREIGN KEY (`order_item_id` ) REFERENCES `Order_Items`(`order_item_id` ),\nFOREIGN KEY (`shipment_id` ) REFERENCES `Shipments`(`shipment_id` )\n);\nCREATE TABLE `Shipments` (\n`shipment_id` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`invoice_number` INTEGER NOT NULL,\n`shipment_tracking_number` VARCHAR(80),\n`shipment_date` DATETIME,\n`other_shipment_details` VARCHAR(255),\nFOREIGN KEY (`order_id` ) REFERENCES `Orders`(`order_id` ),\nFOREIGN KEY (`invoice_number` ) REFERENCES `Invoices`(`invoice_number` )\n);"} +{"qid": "gate_0058", "split": "gate", "db_id": "inn_1", "question": "What are the name of rooms that cost more than the average.", "gold_sql": "SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms );", "db_path": "databases/inn_1/inn_1.sqlite", "schema": "CREATE TABLE \"Reservations\" ( \n\t\"Code\" INTEGER PRIMARY KEY, \n\t\"Room\" TEXT, \n\t\"CheckIn\" TEXT, \n\t\"CheckOut\" TEXT, \n\t\"Rate\" REAL, \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Adults\" INTEGER, \n\t\"Kids\" INTEGER,\n\tFOREIGN KEY (Room) REFERENCES Rooms(RoomId)\n);\nCREATE TABLE \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t\"roomName\" TEXT, \n\t\"beds\" INTEGER, \n\t\"bedType\" TEXT, \n\t\"maxOccupancy\" INTEGER, \n\t\"basePrice\" INTEGER, \n\t\"decor\" TEXT\n\n);"} +{"qid": "gate_0059", "split": "gate", "db_id": "machine_repair", "question": "What is the team and starting year for each technician?", "gold_sql": "SELECT Team , Starting_Year FROM technician", "db_path": "databases/machine_repair/machine_repair.sqlite", "schema": "CREATE TABLE \"machine\" (\n\"Machine_ID\" int,\n\"Making_Year\" int,\n\"Class\" text,\n\"Team\" text,\n\"Machine_series\" text,\n\"value_points\" real,\n\"quality_rank\" int,\nPRIMARY KEY (\"Machine_ID\")\n);\nCREATE TABLE \"repair\" (\n\"repair_ID\" int,\n\"name\" text,\n\"Launch_Date\" text,\n\"Notes\" text,\nPRIMARY KEY (\"repair_ID\")\n);\nCREATE TABLE \"repair_assignment\" (\n\"technician_id\" int,\n\"repair_ID\" int,\n\"Machine_ID\" int,\nPRIMARY Key (\"technician_id\",\"repair_ID\",\"Machine_ID\"),\nFOREIGN KEY (`technician_id`) REFERENCES `technician`(`technician_id`),\nFOREIGN KEY (`repair_ID`) REFERENCES `repair`(`repair_ID`),\nFOREIGN KEY (`Machine_ID`) REFERENCES `machine`(`Machine_ID`)\n);\nCREATE TABLE \"technician\" (\n\"technician_id\" real,\n\"Name\" text,\n\"Team\" text,\n\"Starting_Year\" real,\n\"Age\" int,\nPRIMARY Key (\"technician_id\")\n);"} +{"qid": "gate_0060", "split": "gate", "db_id": "club_1", "question": "Find the location of the club \"Pen and Paper Gaming\".", "gold_sql": "SELECT clublocation FROM club WHERE clubname = \"Pen and Paper Gaming\"", "db_path": "databases/club_1/club_1.sqlite", "schema": "CREATE TABLE Club (\n ClubID INTEGER PRIMARY KEY,\n ClubName VARCHAR(40),\n ClubDesc VARCHAR(1024),\n ClubLocation VARCHAR(40)\n);\nCREATE TABLE Member_of_club (\n StuID INTEGER,\n ClubID INTEGER,\n Position VARCHAR(40),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(ClubID) REFERENCES Club(ClubID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "gate_0061", "split": "gate", "db_id": "inn_1", "question": "How many rooms have a king bed?", "gold_sql": "SELECT count(*) FROM Rooms WHERE bedType = \"King\";", "db_path": "databases/inn_1/inn_1.sqlite", "schema": "CREATE TABLE \"Reservations\" ( \n\t\"Code\" INTEGER PRIMARY KEY, \n\t\"Room\" TEXT, \n\t\"CheckIn\" TEXT, \n\t\"CheckOut\" TEXT, \n\t\"Rate\" REAL, \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Adults\" INTEGER, \n\t\"Kids\" INTEGER,\n\tFOREIGN KEY (Room) REFERENCES Rooms(RoomId)\n);\nCREATE TABLE \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t\"roomName\" TEXT, \n\t\"beds\" INTEGER, \n\t\"bedType\" TEXT, \n\t\"maxOccupancy\" INTEGER, \n\t\"basePrice\" INTEGER, \n\t\"decor\" TEXT\n\n);"} +{"qid": "gate_0062", "split": "gate", "db_id": "race_track", "question": "Give the different locations of tracks.", "gold_sql": "SELECT DISTINCT LOCATION FROM track", "db_path": "databases/race_track/race_track.sqlite", "schema": "CREATE TABLE \"race\" (\n\"Race_ID\" int,\n\"Name\" text,\n\"Class\" text,\n\"Date\" text,\n\"Track_ID\" text,\nPRIMARY KEY (\"Race_ID\"),\nFOREIGN KEY (\"Track_ID\") REFERENCES \"track\"(\"Track_ID\")\n);\nCREATE TABLE \"track\" (\n\"Track_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"Seating\" real,\n\"Year_Opened\" real,\nPRIMARY KEY (\"Track_ID\")\n);"} +{"qid": "gate_0063", "split": "gate", "db_id": "store_product", "question": "What is the city with the most number of flagship stores?", "gold_sql": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/store_product/store_product.sqlite", "schema": "CREATE TABLE \"district\" (\n\"District_ID\" int,\n\"District_name\" text,\n\"Headquartered_City\" text,\n\"City_Population\" real,\n\"City_Area\" real,\nPRIMARY KEY (\"District_ID\")\n);\nCREATE TABLE \"product\" (\n\"product_id\" int,\n\"product\" text,\n\"dimensions\" text,\n\"dpi\" real,\n\"pages_per_minute_color\" real,\n\"max_page_size\" text,\n\"interface\" text,\nPRIMARY KEY (\"product_id\")\n);\nCREATE TABLE \"store\" (\n\"Store_ID\" int,\n\"Store_Name\" text,\n\"Type\" text,\n\"Area_size\" real,\n\"Number_of_product_category\" real,\n\"Ranking\" int,\nPRIMARY KEY (\"Store_ID\")\n);\nCREATE TABLE \"store_district\" (\n\"Store_ID\" int,\n\"District_ID\" int,\nPRIMARY KEY (\"Store_ID\"),\nFOREIGN KEY (`Store_ID`) REFERENCES `store`(`Store_ID`),\nFOREIGN KEY (`District_ID`) REFERENCES `district`(`District_ID`)\n);\nCREATE TABLE \"store_product\" (\n\"Store_ID\" int,\n\"Product_ID\" int,\nPRIMARY KEY (\"Store_ID\",\"Product_ID\"),\nFOREIGN KEY (`Store_ID`) REFERENCES `store`(`Store_ID`),\nFOREIGN KEY (`Product_ID`) REFERENCES `product`(`Product_ID`)\n);"} +{"qid": "gate_0064", "split": "gate", "db_id": "wedding", "question": "Show the name and opening year for three churches that opened most recently.", "gold_sql": "SELECT name , open_date FROM church ORDER BY open_date DESC LIMIT 3", "db_path": "databases/wedding/wedding.sqlite", "schema": "CREATE TABLE \"church\" (\n\"Church_ID\" int,\n\"Name\" text,\n\"Organized_by\" text,\n\"Open_Date\" int,\n\"Continuation_of\" text,\nPRIMARY KEY (\"Church_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Is_Male\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"wedding\" (\n\"Church_ID\" int,\n\"Male_ID\" int,\n\"Female_ID\" int,\n\"Year\" int,\nPRIMARY KEY (\"Church_ID\",\"Male_ID\",\"Female_ID\"),\nFOREIGN KEY (\"Church_ID\") REFERENCES `church`(\"Church_ID\"),\nFOREIGN KEY (\"Male_ID\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Female_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "gate_0065", "split": "gate", "db_id": "formula_1", "question": "How many drivers did not participate in the races held in 2009?", "gold_sql": "SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )", "db_path": "databases/formula_1/formula_1.sqlite", "schema": "CREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);\nCREATE TABLE \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" TEXT,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);\nCREATE TABLE \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);\nCREATE TABLE \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" TEXT,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" TEXT,\n \"time\" TEXT,\n \"milliseconds\" TEXT,\n \"fastestLap\" TEXT,\n \"rank\" TEXT,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);\nCREATE TABLE \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);\nCREATE TABLE \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);"} +{"qid": "gate_0066", "split": "gate", "db_id": "train_station", "question": "Show the station name and number of trains in each station.", "gold_sql": "SELECT T2.name , count(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id", "db_path": "databases/train_station/train_station.sqlite", "schema": "CREATE TABLE \"station\" (\n\"Station_ID\" int,\n\"Name\" text,\n\"Annual_entry_exit\" real,\n\"Annual_interchanges\" real,\n\"Total_Passengers\" real,\n\"Location\" text,\n\"Main_Services\" text,\n\"Number_of_Platforms\" int,\nPRIMARY KEY (\"Station_ID\")\n);\nCREATE TABLE \"train\" (\n\"Train_ID\" int,\n\"Name\" text,\n\"Time\" text,\n\"Service\" text,\nPRIMARY KEY (\"Train_ID\")\n);\nCREATE TABLE \"train_station\" (\n\"Train_ID\" int,\n\"Station_ID\" int,\t\nPRIMARY KEY (\"Train_ID\",\"Station_ID\"),\nFOREIGN KEY (\"Train_ID\") REFERENCES \"train\"(\"Train_ID\"),\nFOREIGN KEY (\"Station_ID\") REFERENCES \"station\"(\"Station_ID\")\n);"} +{"qid": "gate_0067", "split": "gate", "db_id": "candidate_poll", "question": "What are the average height and weight across males (sex is M)?", "gold_sql": "SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'", "db_path": "databases/candidate_poll/candidate_poll.sqlite", "schema": "CREATE TABLE \"candidate\" (\n\"Candidate_ID\" int,\n\"People_ID\" int,\n\"Poll_Source\" text,\n\"Date\" text,\n\"Support_rate\" real,\n\"Consider_rate\" real,\n\"Oppose_rate\" real,\n\"Unsure_rate\" real,\nPRIMARY KEY (\"Candidate_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Sex\" text,\n\"Name\" text,\n\"Date_of_Birth\" text,\n\"Height\" real,\n\"Weight\" real,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "gate_0068", "split": "gate", "db_id": "department_management", "question": "Which department has more than 1 head at a time? List the id, name and the number of heads.", "gold_sql": "SELECT T1.department_id , T1.name , count(*) FROM management AS T2 JOIN department AS T1 ON T1.department_id = T2.department_id GROUP BY T1.department_id HAVING count(*) > 1", "db_path": "databases/department_management/department_management.sqlite", "schema": "CREATE TABLE \"department\" (\n\"Department_ID\" int,\n\"Name\" text,\n\"Creation\" text,\n\"Ranking\" int,\n\"Budget_in_Billions\" real,\n\"Num_Employees\" real,\nPRIMARY KEY (\"Department_ID\")\n);\nCREATE TABLE \"head\" (\n\"head_ID\" int,\n\"name\" text,\n\"born_state\" text,\n\"age\" real,\nPRIMARY KEY (\"head_ID\")\n);\nCREATE TABLE \"management\" (\n\"department_ID\" int,\n\"head_ID\" int,\n\"temporary_acting\" text,\nPRIMARY KEY (\"Department_ID\",\"head_ID\"),\nFOREIGN KEY (\"Department_ID\") REFERENCES `department`(\"Department_ID\"),\nFOREIGN KEY (\"head_ID\") REFERENCES `head`(\"head_ID\")\n);"} +{"qid": "gate_0069", "split": "gate", "db_id": "insurance_policies", "question": "How many settlements are there in total?", "gold_sql": "SELECT count(*) FROM Settlements", "db_path": "databases/insurance_policies/insurance_policies.sqlite", "schema": "CREATE TABLE Claims (\nClaim_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nDate_Claim_Made DATE,\nDate_Claim_Settled DATE,\nAmount_Claimed INTEGER,\nAmount_Settled INTEGER,\nPRIMARY KEY (Claim_ID),\nFOREIGN KEY (Policy_ID) REFERENCES Customer_Policies (Policy_ID)\n);\nCREATE TABLE Customer_Policies (\nPolicy_ID INTEGER NOT NULL,\nCustomer_ID INTEGER NOT NULL,\nPolicy_Type_Code CHAR(15) NOT NULL,\nStart_Date DATE,\nEnd_Date DATE,\nPRIMARY KEY (Policy_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID INTEGER NOT NULL,\nCustomer_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Customer_ID)\n);\nCREATE TABLE Payments (\nPayment_ID INTEGER NOT NULL,\nSettlement_ID INTEGER NOT NULL,\nPayment_Method_Code VARCHAR(255),\nDate_Payment_Made DATE,\nAmount_Payment INTEGER,\nPRIMARY KEY (Payment_ID),\nFOREIGN KEY (Settlement_ID) REFERENCES Settlements (Settlement_ID)\n);\nCREATE TABLE Settlements (\nSettlement_ID INTEGER NOT NULL,\nClaim_ID INTEGER NOT NULL,\nDate_Claim_Made DATE,\nDate_Claim_Settled DATE,\nAmount_Claimed INTEGER,\nAmount_Settled INTEGER,\nCustomer_Policy_ID INTEGER NOT NULL,\nPRIMARY KEY (Settlement_ID),\nFOREIGN KEY (Claim_ID) REFERENCES Claims (Claim_ID)\n);"} +{"qid": "gate_0070", "split": "gate", "db_id": "ship_1", "question": "Find the name, type, and flag of the ship that is built in the most recent year.", "gold_sql": "SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1", "db_path": "databases/ship_1/ship_1.sqlite", "schema": "CREATE TABLE \"Ship\" (\n\"Ship_ID\" int,\n\"Name\" text,\n\"Type\" text,\n\"Built_Year\" real,\n\"Class\" text,\n\"Flag\" text,\nPRIMARY KEY (\"Ship_ID\")\n);\nCREATE TABLE \"captain\" (\n\"Captain_ID\" int,\n\"Name\" text,\n\"Ship_ID\" int,\n\"age\" text,\n\"Class\" text,\n\"Rank\" text,\nPRIMARY KEY (\"Captain_ID\"),\nFOREIGN KEY (\"Ship_ID\") REFERENCES \"Ship\"(\"Ship_ID\")\n);"} +{"qid": "gate_0071", "split": "gate", "db_id": "tracking_share_transactions", "question": "Show the maximum amount of transaction.", "gold_sql": "SELECT max(amount_of_transaction) FROM TRANSACTIONS", "db_path": "databases/tracking_share_transactions/tracking_share_transactions.sqlite", "schema": "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);\nCREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);\nCREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);\nCREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);\nCREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);\nCREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);\nCREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);"} +{"qid": "gate_0072", "split": "gate", "db_id": "perpetrator", "question": "List the number of people injured by perpetrators in ascending order.", "gold_sql": "SELECT Injured FROM perpetrator ORDER BY Injured ASC", "db_path": "databases/perpetrator/perpetrator.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Height\" real,\n\"Weight\" real,\n\"Home Town\" text,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"perpetrator\" (\n\"Perpetrator_ID\" int,\n\"People_ID\" int,\n\"Date\" text,\n\"Year\" real,\n\"Location\" text,\n\"Country\" text,\n\"Killed\" int,\n\"Injured\" int,\nPRIMARY KEY (\"Perpetrator_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);"} +{"qid": "gate_0073", "split": "gate", "db_id": "candidate_poll", "question": "What are the names of candidates who have a lower support rate than oppose rate?", "gold_sql": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate", "db_path": "databases/candidate_poll/candidate_poll.sqlite", "schema": "CREATE TABLE \"candidate\" (\n\"Candidate_ID\" int,\n\"People_ID\" int,\n\"Poll_Source\" text,\n\"Date\" text,\n\"Support_rate\" real,\n\"Consider_rate\" real,\n\"Oppose_rate\" real,\n\"Unsure_rate\" real,\nPRIMARY KEY (\"Candidate_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Sex\" text,\n\"Name\" text,\n\"Date_of_Birth\" text,\n\"Height\" real,\n\"Weight\" real,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "gate_0074", "split": "gate", "db_id": "wedding", "question": "How many weddings are there in year 2016?", "gold_sql": "SELECT count(*) FROM wedding WHERE YEAR = 2016", "db_path": "databases/wedding/wedding.sqlite", "schema": "CREATE TABLE \"church\" (\n\"Church_ID\" int,\n\"Name\" text,\n\"Organized_by\" text,\n\"Open_Date\" int,\n\"Continuation_of\" text,\nPRIMARY KEY (\"Church_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Is_Male\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"wedding\" (\n\"Church_ID\" int,\n\"Male_ID\" int,\n\"Female_ID\" int,\n\"Year\" int,\nPRIMARY KEY (\"Church_ID\",\"Male_ID\",\"Female_ID\"),\nFOREIGN KEY (\"Church_ID\") REFERENCES `church`(\"Church_ID\"),\nFOREIGN KEY (\"Male_ID\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Female_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "gate_0075", "split": "gate", "db_id": "insurance_policies", "question": "List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement.", "gold_sql": "SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1", "db_path": "databases/insurance_policies/insurance_policies.sqlite", "schema": "CREATE TABLE Claims (\nClaim_ID INTEGER NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nDate_Claim_Made DATE,\nDate_Claim_Settled DATE,\nAmount_Claimed INTEGER,\nAmount_Settled INTEGER,\nPRIMARY KEY (Claim_ID),\nFOREIGN KEY (Policy_ID) REFERENCES Customer_Policies (Policy_ID)\n);\nCREATE TABLE Customer_Policies (\nPolicy_ID INTEGER NOT NULL,\nCustomer_ID INTEGER NOT NULL,\nPolicy_Type_Code CHAR(15) NOT NULL,\nStart_Date DATE,\nEnd_Date DATE,\nPRIMARY KEY (Policy_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID INTEGER NOT NULL,\nCustomer_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Customer_ID)\n);\nCREATE TABLE Payments (\nPayment_ID INTEGER NOT NULL,\nSettlement_ID INTEGER NOT NULL,\nPayment_Method_Code VARCHAR(255),\nDate_Payment_Made DATE,\nAmount_Payment INTEGER,\nPRIMARY KEY (Payment_ID),\nFOREIGN KEY (Settlement_ID) REFERENCES Settlements (Settlement_ID)\n);\nCREATE TABLE Settlements (\nSettlement_ID INTEGER NOT NULL,\nClaim_ID INTEGER NOT NULL,\nDate_Claim_Made DATE,\nDate_Claim_Settled DATE,\nAmount_Claimed INTEGER,\nAmount_Settled INTEGER,\nCustomer_Policy_ID INTEGER NOT NULL,\nPRIMARY KEY (Settlement_ID),\nFOREIGN KEY (Claim_ID) REFERENCES Claims (Claim_ID)\n);"} +{"qid": "gate_0076", "split": "gate", "db_id": "film_rank", "question": "What are the titles of films that do not have a film market estimation?", "gold_sql": "SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)", "db_path": "databases/film_rank/film_rank.sqlite", "schema": "CREATE TABLE \"film\" (\n\"Film_ID\" int,\n\"Title\" text,\n\"Studio\" text,\n\"Director\" text,\n\"Gross_in_dollar\" int,\nPRIMARY KEY (\"Film_ID\")\n);\nCREATE TABLE \"film_market_estimation\" (\n\"Estimation_ID\" int,\n\"Low_Estimate\" real,\n\"High_Estimate\" real,\n\"Film_ID\" int,\n\"Type\" text,\n\"Market_ID\" int,\n\"Year\" int,\nPRIMARY KEY (\"Estimation_ID\"),\nFOREIGN KEY (\"Film_ID\") REFERENCES film(\"Film_ID\"),\nFOREIGN KEY (\"Market_ID\") REFERENCES market(\"Market_ID\")\n);\nCREATE TABLE \"market\" (\n\"Market_ID\" int,\n\"Country\" text,\n\"Number_cities\" int,\nPRIMARY KEY (\"Market_ID\")\n);"} +{"qid": "gate_0077", "split": "gate", "db_id": "club_1", "question": "What is the location of the club named \"Tennis Club\"?", "gold_sql": "SELECT clublocation FROM club WHERE clubname = \"Tennis Club\"", "db_path": "databases/club_1/club_1.sqlite", "schema": "CREATE TABLE Club (\n ClubID INTEGER PRIMARY KEY,\n ClubName VARCHAR(40),\n ClubDesc VARCHAR(1024),\n ClubLocation VARCHAR(40)\n);\nCREATE TABLE Member_of_club (\n StuID INTEGER,\n ClubID INTEGER,\n Position VARCHAR(40),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(ClubID) REFERENCES Club(ClubID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "gate_0078", "split": "gate", "db_id": "game_1", "question": "Count the number of video games with Massively multiplayer online game type .", "gold_sql": "SELECT count(*) FROM Video_games WHERE gtype = \"Massively multiplayer online game\"", "db_path": "databases/game_1/game_1.sqlite", "schema": "CREATE TABLE Plays_Games (\n StuID INTEGER,\n GameID INTEGER,\n Hours_Played INTEGER,\n FOREIGN KEY(GameID) REFERENCES Video_Games(GameID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE SportsInfo (\n StuID INTEGER,\n SportName VARCHAR(32),\n HoursPerWeek INTEGER,\n GamesPlayed INTEGER,\n OnScholarship VARCHAR(1),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );\nCREATE TABLE Video_Games (\n GameID INTEGER PRIMARY KEY,\n GName VARCHAR(40),\n GType VARCHAR(40)\n);"} +{"qid": "gate_0079", "split": "gate", "db_id": "store_product", "question": "For each type of store, how many of them are there?", "gold_sql": "SELECT TYPE , count(*) FROM store GROUP BY TYPE", "db_path": "databases/store_product/store_product.sqlite", "schema": "CREATE TABLE \"district\" (\n\"District_ID\" int,\n\"District_name\" text,\n\"Headquartered_City\" text,\n\"City_Population\" real,\n\"City_Area\" real,\nPRIMARY KEY (\"District_ID\")\n);\nCREATE TABLE \"product\" (\n\"product_id\" int,\n\"product\" text,\n\"dimensions\" text,\n\"dpi\" real,\n\"pages_per_minute_color\" real,\n\"max_page_size\" text,\n\"interface\" text,\nPRIMARY KEY (\"product_id\")\n);\nCREATE TABLE \"store\" (\n\"Store_ID\" int,\n\"Store_Name\" text,\n\"Type\" text,\n\"Area_size\" real,\n\"Number_of_product_category\" real,\n\"Ranking\" int,\nPRIMARY KEY (\"Store_ID\")\n);\nCREATE TABLE \"store_district\" (\n\"Store_ID\" int,\n\"District_ID\" int,\nPRIMARY KEY (\"Store_ID\"),\nFOREIGN KEY (`Store_ID`) REFERENCES `store`(`Store_ID`),\nFOREIGN KEY (`District_ID`) REFERENCES `district`(`District_ID`)\n);\nCREATE TABLE \"store_product\" (\n\"Store_ID\" int,\n\"Product_ID\" int,\nPRIMARY KEY (\"Store_ID\",\"Product_ID\"),\nFOREIGN KEY (`Store_ID`) REFERENCES `store`(`Store_ID`),\nFOREIGN KEY (`Product_ID`) REFERENCES `product`(`Product_ID`)\n);"} +{"qid": "gate_0080", "split": "gate", "db_id": "candidate_poll", "question": "Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate.", "gold_sql": "SELECT Support_rate , Consider_rate , Oppose_rate FROM candidate ORDER BY unsure_rate", "db_path": "databases/candidate_poll/candidate_poll.sqlite", "schema": "CREATE TABLE \"candidate\" (\n\"Candidate_ID\" int,\n\"People_ID\" int,\n\"Poll_Source\" text,\n\"Date\" text,\n\"Support_rate\" real,\n\"Consider_rate\" real,\n\"Oppose_rate\" real,\n\"Unsure_rate\" real,\nPRIMARY KEY (\"Candidate_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Sex\" text,\n\"Name\" text,\n\"Date_of_Birth\" text,\n\"Height\" real,\n\"Weight\" real,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "gate_0081", "split": "gate", "db_id": "soccer_1", "question": "List all of the ids for left-footed players with a height between 180cm and 190cm.", "gold_sql": "SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = \"left\"", "db_path": "databases/soccer_1/soccer_1.sqlite", "schema": "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);\nCREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);\nCREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);\nCREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);\nCREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);\nCREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "gate_0082", "split": "gate", "db_id": "twitter_1", "question": "Find the emails of the user named \"Mary\".", "gold_sql": "SELECT email FROM user_profiles WHERE name = 'Mary'", "db_path": "databases/twitter_1/twitter_1.sqlite", "schema": "CREATE TABLE `follows` (\n `f1` int(11) NOT NULL,\n `f2` int(11) NOT NULL,\n PRIMARY KEY (`f1`,`f2`),\n FOREIGN KEY (`f1`) REFERENCES `user_profiles`(`uid`),\n FOREIGN KEY (`f2`) REFERENCES `user_profiles`(`uid`)\n\n);\nCREATE TABLE `tweets` (\n `id` bigint(20) NOT NULL,\n `uid` int(11) NOT NULL,\n `text` char(140) NOT NULL,\n `createdate` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`),\n FOREIGN KEY (`uid`) REFERENCES `user_profiles`(`uid`)\n);\nCREATE TABLE \"user_profiles\" (`uid` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `partitionid` int(11) DEFAULT NULL, `followers` int(11) DEFAULT NULL, PRIMARY KEY (`uid`));"} +{"qid": "gate_0083", "split": "gate", "db_id": "sakila_1", "question": "Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name.", "gold_sql": "SELECT T2.first_name , T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING count(*) > 30", "db_path": "databases/sakila_1/sakila_1.sqlite", "schema": "CREATE TABLE actor (\n actor_id SMALLINT UNSIGNED NOT NULL,\n first_name VARCHAR(45) NOT NULL,\n last_name VARCHAR(45) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (actor_id)\n);\nCREATE TABLE address (\n address_id SMALLINT UNSIGNED NOT NULL,\n address VARCHAR(50) NOT NULL,\n address2 VARCHAR(50) DEFAULT NULL,\n district VARCHAR(20) NOT NULL,\n city_id SMALLINT UNSIGNED NOT NULL,\n postal_code VARCHAR(10) DEFAULT NULL,\n phone VARCHAR(20) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (address_id),\n FOREIGN KEY (city_id) REFERENCES city (city_id)\n);\nCREATE TABLE category (\n category_id TINYINT UNSIGNED NOT NULL,\n name VARCHAR(25) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (category_id)\n);\nCREATE TABLE city (\n city_id SMALLINT UNSIGNED NOT NULL,\n city VARCHAR(50) NOT NULL,\n country_id SMALLINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (city_id),\n FOREIGN KEY (country_id) REFERENCES country (country_id)\n);\nCREATE TABLE country (\n country_id SMALLINT UNSIGNED NOT NULL,\n country VARCHAR(50) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (country_id)\n);\nCREATE TABLE customer (\n customer_id SMALLINT UNSIGNED NOT NULL,\n store_id TINYINT UNSIGNED NOT NULL,\n first_name VARCHAR(45) NOT NULL,\n last_name VARCHAR(45) NOT NULL,\n email VARCHAR(50) DEFAULT NULL,\n address_id SMALLINT UNSIGNED NOT NULL,\n active BOOLEAN NOT NULL DEFAULT TRUE,\n create_date DATETIME NOT NULL,\n last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (customer_id),\n FOREIGN KEY (address_id) REFERENCES address (address_id),\n FOREIGN KEY (store_id) REFERENCES store (store_id)\n);\nCREATE TABLE film (\n film_id SMALLINT UNSIGNED NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT DEFAULT NULL,\n release_year YEAR DEFAULT NULL,\n language_id TINYINT UNSIGNED NOT NULL,\n original_language_id TINYINT UNSIGNED DEFAULT NULL,\n rental_duration TINYINT UNSIGNED NOT NULL DEFAULT 3,\n rental_rate DECIMAL(4,2) NOT NULL DEFAULT 4.99,\n length SMALLINT UNSIGNED DEFAULT NULL,\n replacement_cost DECIMAL(5,2) NOT NULL DEFAULT 19.99,\n rating DEFAULT 'G',\n special_features DEFAULT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (film_id),\n FOREIGN KEY (language_id) REFERENCES language (language_id),\n FOREIGN KEY (original_language_id) REFERENCES language (language_id)\n);\nCREATE TABLE film_actor (\n actor_id SMALLINT UNSIGNED NOT NULL,\n film_id SMALLINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (actor_id,film_id),\n FOREIGN KEY (actor_id) REFERENCES actor (actor_id),\n FOREIGN KEY (film_id) REFERENCES film (film_id)\n);\nCREATE TABLE film_category (\n film_id SMALLINT UNSIGNED NOT NULL,\n category_id TINYINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (film_id, category_id),\n FOREIGN KEY (film_id) REFERENCES film (film_id),\n FOREIGN KEY (category_id) REFERENCES category (category_id)\n);\nCREATE TABLE film_text (\n film_id SMALLINT NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT,\n PRIMARY KEY (film_id)\n);\nCREATE TABLE inventory (\n inventory_id MEDIUMINT UNSIGNED NOT NULL,\n film_id SMALLINT UNSIGNED NOT NULL,\n store_id TINYINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (inventory_id),\n FOREIGN KEY (store_id) REFERENCES store (store_id),\n FOREIGN KEY (film_id) REFERENCES film (film_id)\n);\nCREATE TABLE language (\n language_id TINYINT UNSIGNED NOT NULL,\n name CHAR(20) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (language_id)\n);\nCREATE TABLE payment (\n payment_id SMALLINT UNSIGNED NOT NULL,\n customer_id SMALLINT UNSIGNED NOT NULL,\n staff_id TINYINT UNSIGNED NOT NULL,\n rental_id INT DEFAULT NULL,\n amount DECIMAL(5,2) NOT NULL,\n payment_date DATETIME NOT NULL,\n last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (payment_id),\n FOREIGN KEY (rental_id) REFERENCES rental (rental_id),\n FOREIGN KEY (customer_id) REFERENCES customer (customer_id),\n FOREIGN KEY (staff_id) REFERENCES staff (staff_id)\n);\nCREATE TABLE rental (\n rental_id INT NOT NULL,\n rental_date DATETIME NOT NULL,\n inventory_id MEDIUMINT UNSIGNED NOT NULL,\n customer_id SMALLINT UNSIGNED NOT NULL,\n return_date DATETIME DEFAULT NULL,\n staff_id TINYINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (rental_id),\n FOREIGN KEY (staff_id) REFERENCES staff (staff_id),\n FOREIGN KEY (inventory_id) REFERENCES inventory (inventory_id),\n FOREIGN KEY (customer_id) REFERENCES customer (customer_id)\n);\nCREATE TABLE staff (\n staff_id TINYINT UNSIGNED NOT NULL,\n first_name VARCHAR(45) NOT NULL,\n last_name VARCHAR(45) NOT NULL,\n address_id SMALLINT UNSIGNED NOT NULL,\n picture BLOB DEFAULT NULL,\n email VARCHAR(50) DEFAULT NULL,\n store_id TINYINT UNSIGNED NOT NULL,\n active BOOLEAN NOT NULL DEFAULT TRUE,\n username VARCHAR(16) NOT NULL,\n password VARCHAR(40) DEFAULT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (staff_id),\n --FOREIGN KEY (store_id) REFERENCES store (store_id),\n FOREIGN KEY (address_id) REFERENCES address (address_id)\n);\nCREATE TABLE store (\n store_id TINYINT UNSIGNED NOT NULL,\n manager_staff_id TINYINT UNSIGNED NOT NULL,\n address_id SMALLINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (store_id),\n FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id),\n FOREIGN KEY (address_id) REFERENCES address (address_id)\n);"} +{"qid": "gate_0084", "split": "gate", "db_id": "pilot_record", "question": "What is the joined year of the pilot of the highest rank?", "gold_sql": "SELECT Join_Year FROM pilot ORDER BY Rank ASC LIMIT 1", "db_path": "databases/pilot_record/pilot_record.sqlite", "schema": "CREATE TABLE \"aircraft\" (\n\"Aircraft_ID\" int,\n\"Order_Year\" int,\n\"Manufacturer\" text,\n\"Model\" text,\n\"Fleet_Series\" text,\n\"Powertrain\" text,\n\"Fuel_Propulsion\" text,\nPRIMARY KEY (\"Aircraft_ID\")\n);\nCREATE TABLE \"pilot\" (\n\"Pilot_ID\" int,\n\"Pilot_name\" text,\n\"Rank\" int,\n\"Age\" int,\n\"Nationality\" text,\n\"Position\" text,\n\"Join_Year\" int,\n\"Team\" text,\nPRIMARY KEY (\"Pilot_ID\")\n);\nCREATE TABLE \"pilot_record\" (\n\"Record_ID\" int,\n\"Pilot_ID\" int,\n\"Aircraft_ID\" int,\n\"Date\" text,\nPRIMARY KEY (\"Pilot_ID\", \"Aircraft_ID\", \"Date\"),\nFOREIGN KEY (`Pilot_ID`) REFERENCES `pilot`(`Pilot_ID`),\nFOREIGN KEY (`Aircraft_ID`) REFERENCES `aircraft`(`Aircraft_ID`)\n);"} +{"qid": "gate_0085", "split": "gate", "db_id": "product_catalog", "question": "What are the attribute data types with more than 3 attribute definitions?", "gold_sql": "SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 3", "db_path": "databases/product_catalog/product_catalog.sqlite", "schema": "CREATE TABLE `Attribute_Definitions` (\n`attribute_id` INTEGER PRIMARY KEY,\n`attribute_name` VARCHAR(30),\n`attribute_data_type` VARCHAR(10)\n);\nCREATE TABLE `Catalog_Contents` (\n`catalog_entry_id` INTEGER PRIMARY KEY,\n`catalog_level_number` INTEGER NOT NULL,\n`parent_entry_id` INTEGER,\n`previous_entry_id` INTEGER,\n`next_entry_id` INTEGER,\n`catalog_entry_name` VARCHAR(80),\n`product_stock_number` VARCHAR(50),\n`price_in_dollars` DOUBLE NULL,\n`price_in_euros` DOUBLE NULL,\n`price_in_pounds` DOUBLE NULL,\n`capacity` VARCHAR(20),\n`length` VARCHAR(20),\n`height` VARCHAR(20),\n`width` VARCHAR(20),\nFOREIGN KEY (`catalog_level_number` ) REFERENCES `Catalog_Structure`(`catalog_level_number` )\n);\nCREATE TABLE `Catalog_Contents_Additional_Attributes` (\n`catalog_entry_id` INTEGER NOT NULL,\n`catalog_level_number` INTEGER NOT NULL,\n`attribute_id` INTEGER NOT NULL,\n`attribute_value` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`catalog_entry_id` ) REFERENCES `Catalog_Contents`(`catalog_entry_id` ),\nFOREIGN KEY (`catalog_level_number` ) REFERENCES `Catalog_Structure`(`catalog_level_number` )\n);\nCREATE TABLE `Catalog_Structure` (\n`catalog_level_number` INTEGER PRIMARY KEY,\n`catalog_id` INTEGER NOT NULL,\n`catalog_level_name` VARCHAR(50),\nFOREIGN KEY (`catalog_id` ) REFERENCES `Catalogs`(`catalog_id` )\n);\nCREATE TABLE `Catalogs` (\n`catalog_id` INTEGER PRIMARY KEY,\n`catalog_name` VARCHAR(50),\n`catalog_publisher` VARCHAR(80),\n`date_of_publication` DATETIME,\n`date_of_latest_revision` DATETIME\n);"} +{"qid": "gate_0086", "split": "gate", "db_id": "race_track", "question": "What is the name of the track that has had the greatest number of races?", "gold_sql": "SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/race_track/race_track.sqlite", "schema": "CREATE TABLE \"race\" (\n\"Race_ID\" int,\n\"Name\" text,\n\"Class\" text,\n\"Date\" text,\n\"Track_ID\" text,\nPRIMARY KEY (\"Race_ID\"),\nFOREIGN KEY (\"Track_ID\") REFERENCES \"track\"(\"Track_ID\")\n);\nCREATE TABLE \"track\" (\n\"Track_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"Seating\" real,\n\"Year_Opened\" real,\nPRIMARY KEY (\"Track_ID\")\n);"} +{"qid": "gate_0087", "split": "gate", "db_id": "train_station", "question": "Show the station name with at least two trains.", "gold_sql": "SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING count(*) >= 2", "db_path": "databases/train_station/train_station.sqlite", "schema": "CREATE TABLE \"station\" (\n\"Station_ID\" int,\n\"Name\" text,\n\"Annual_entry_exit\" real,\n\"Annual_interchanges\" real,\n\"Total_Passengers\" real,\n\"Location\" text,\n\"Main_Services\" text,\n\"Number_of_Platforms\" int,\nPRIMARY KEY (\"Station_ID\")\n);\nCREATE TABLE \"train\" (\n\"Train_ID\" int,\n\"Name\" text,\n\"Time\" text,\n\"Service\" text,\nPRIMARY KEY (\"Train_ID\")\n);\nCREATE TABLE \"train_station\" (\n\"Train_ID\" int,\n\"Station_ID\" int,\t\nPRIMARY KEY (\"Train_ID\",\"Station_ID\"),\nFOREIGN KEY (\"Train_ID\") REFERENCES \"train\"(\"Train_ID\"),\nFOREIGN KEY (\"Station_ID\") REFERENCES \"station\"(\"Station_ID\")\n);"} +{"qid": "gate_0088", "split": "gate", "db_id": "pilot_record", "question": "List the names of pilots in ascending order of rank.", "gold_sql": "SELECT Pilot_name FROM pilot ORDER BY Rank ASC", "db_path": "databases/pilot_record/pilot_record.sqlite", "schema": "CREATE TABLE \"aircraft\" (\n\"Aircraft_ID\" int,\n\"Order_Year\" int,\n\"Manufacturer\" text,\n\"Model\" text,\n\"Fleet_Series\" text,\n\"Powertrain\" text,\n\"Fuel_Propulsion\" text,\nPRIMARY KEY (\"Aircraft_ID\")\n);\nCREATE TABLE \"pilot\" (\n\"Pilot_ID\" int,\n\"Pilot_name\" text,\n\"Rank\" int,\n\"Age\" int,\n\"Nationality\" text,\n\"Position\" text,\n\"Join_Year\" int,\n\"Team\" text,\nPRIMARY KEY (\"Pilot_ID\")\n);\nCREATE TABLE \"pilot_record\" (\n\"Record_ID\" int,\n\"Pilot_ID\" int,\n\"Aircraft_ID\" int,\n\"Date\" text,\nPRIMARY KEY (\"Pilot_ID\", \"Aircraft_ID\", \"Date\"),\nFOREIGN KEY (`Pilot_ID`) REFERENCES `pilot`(`Pilot_ID`),\nFOREIGN KEY (`Aircraft_ID`) REFERENCES `aircraft`(`Aircraft_ID`)\n);"} +{"qid": "gate_0089", "split": "gate", "db_id": "club_1", "question": "Find the average age of the members in the club \"Bootup Baltimore\".", "gold_sql": "SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\"", "db_path": "databases/club_1/club_1.sqlite", "schema": "CREATE TABLE Club (\n ClubID INTEGER PRIMARY KEY,\n ClubName VARCHAR(40),\n ClubDesc VARCHAR(1024),\n ClubLocation VARCHAR(40)\n);\nCREATE TABLE Member_of_club (\n StuID INTEGER,\n ClubID INTEGER,\n Position VARCHAR(40),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(ClubID) REFERENCES Club(ClubID)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "gate_0090", "split": "gate", "db_id": "cre_Doc_Control_Systems", "question": "What document type codes do we have?", "gold_sql": "SELECT document_type_code FROM Ref_Document_Types;", "db_path": "databases/cre_Doc_Control_Systems/cre_Doc_Control_Systems.sqlite", "schema": "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);\nCREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);\nCREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);\nCREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);\nCREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);\nCREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);\nCREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);\nCREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);\nCREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);\nCREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);"} +{"qid": "gate_0091", "split": "gate", "db_id": "student_1", "question": "Find the number of students taught by TARRING LEIA.", "gold_sql": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"TARRING\" AND T2.lastname = \"LEIA\"", "db_path": "databases/student_1/student_1.sqlite", "schema": "CREATE TABLE \"list\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Grade\" INTEGER, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);\nCREATE TABLE \"teachers\" ( \n\t\"LastName\" TEXT, \n\t\"FirstName\" TEXT, \n\t\"Classroom\" INTEGER,\n\tPRIMARY KEY(LastName, FirstName)\n);"} +{"qid": "gate_0092", "split": "gate", "db_id": "tracking_share_transactions", "question": "Show the average share count of transactions for different investors.", "gold_sql": "SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id", "db_path": "databases/tracking_share_transactions/tracking_share_transactions.sqlite", "schema": "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);\nCREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);\nCREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);\nCREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);\nCREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);\nCREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);\nCREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);"} +{"qid": "gate_0093", "split": "gate", "db_id": "race_track", "question": "Return the names of tracks that have no had any races.", "gold_sql": "SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)", "db_path": "databases/race_track/race_track.sqlite", "schema": "CREATE TABLE \"race\" (\n\"Race_ID\" int,\n\"Name\" text,\n\"Class\" text,\n\"Date\" text,\n\"Track_ID\" text,\nPRIMARY KEY (\"Race_ID\"),\nFOREIGN KEY (\"Track_ID\") REFERENCES \"track\"(\"Track_ID\")\n);\nCREATE TABLE \"track\" (\n\"Track_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"Seating\" real,\n\"Year_Opened\" real,\nPRIMARY KEY (\"Track_ID\")\n);"} +{"qid": "gate_0094", "split": "gate", "db_id": "farm", "question": "Give the years and official names of the cities of each competition.", "gold_sql": "SELECT T2.Year , T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID", "db_path": "databases/farm/farm.sqlite", "schema": "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"Official_Name\" text,\n\"Status\" text,\n\"Area_km_2\" real,\n\"Population\" real,\n\"Census_Ranking\" text,\nPRIMARY KEY (\"City_ID\")\n);\nCREATE TABLE \"competition_record\" (\n\"Competition_ID\" int,\n\"Farm_ID\" int,\n\"Rank\" int,\nPRIMARY KEY (\"Competition_ID\",\"Farm_ID\"),\nFOREIGN KEY (`Competition_ID`) REFERENCES `farm_competition`(`Competition_ID`),\nFOREIGN KEY (`Farm_ID`) REFERENCES `farm`(`Farm_ID`)\n);\nCREATE TABLE \"farm\" (\n\"Farm_ID\" int,\n\"Year\" int,\n\"Total_Horses\" real,\n\"Working_Horses\" real,\n\"Total_Cattle\" real,\n\"Oxen\" real,\n\"Bulls\" real,\n\"Cows\" real,\n\"Pigs\" real,\n\"Sheep_and_Goats\" real,\nPRIMARY KEY (\"Farm_ID\")\n);\nCREATE TABLE \"farm_competition\" (\n\"Competition_ID\" int,\n\"Year\" int,\n\"Theme\" text,\n\"Host_city_ID\" int,\n\"Hosts\" text,\nPRIMARY KEY (\"Competition_ID\"),\nFOREIGN KEY (`Host_city_ID`) REFERENCES `city`(`City_ID`)\n);"} +{"qid": "gate_0095", "split": "gate", "db_id": "product_catalog", "question": "Find the name and capacity of products with price greater than 700 (in USD).", "gold_sql": "SELECT catalog_entry_name , capacity FROM Catalog_Contents WHERE price_in_dollars > 700", "db_path": "databases/product_catalog/product_catalog.sqlite", "schema": "CREATE TABLE `Attribute_Definitions` (\n`attribute_id` INTEGER PRIMARY KEY,\n`attribute_name` VARCHAR(30),\n`attribute_data_type` VARCHAR(10)\n);\nCREATE TABLE `Catalog_Contents` (\n`catalog_entry_id` INTEGER PRIMARY KEY,\n`catalog_level_number` INTEGER NOT NULL,\n`parent_entry_id` INTEGER,\n`previous_entry_id` INTEGER,\n`next_entry_id` INTEGER,\n`catalog_entry_name` VARCHAR(80),\n`product_stock_number` VARCHAR(50),\n`price_in_dollars` DOUBLE NULL,\n`price_in_euros` DOUBLE NULL,\n`price_in_pounds` DOUBLE NULL,\n`capacity` VARCHAR(20),\n`length` VARCHAR(20),\n`height` VARCHAR(20),\n`width` VARCHAR(20),\nFOREIGN KEY (`catalog_level_number` ) REFERENCES `Catalog_Structure`(`catalog_level_number` )\n);\nCREATE TABLE `Catalog_Contents_Additional_Attributes` (\n`catalog_entry_id` INTEGER NOT NULL,\n`catalog_level_number` INTEGER NOT NULL,\n`attribute_id` INTEGER NOT NULL,\n`attribute_value` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`catalog_entry_id` ) REFERENCES `Catalog_Contents`(`catalog_entry_id` ),\nFOREIGN KEY (`catalog_level_number` ) REFERENCES `Catalog_Structure`(`catalog_level_number` )\n);\nCREATE TABLE `Catalog_Structure` (\n`catalog_level_number` INTEGER PRIMARY KEY,\n`catalog_id` INTEGER NOT NULL,\n`catalog_level_name` VARCHAR(50),\nFOREIGN KEY (`catalog_id` ) REFERENCES `Catalogs`(`catalog_id` )\n);\nCREATE TABLE `Catalogs` (\n`catalog_id` INTEGER PRIMARY KEY,\n`catalog_name` VARCHAR(50),\n`catalog_publisher` VARCHAR(80),\n`date_of_publication` DATETIME,\n`date_of_latest_revision` DATETIME\n);"} +{"qid": "gate_0096", "split": "gate", "db_id": "customer_complaints", "question": "What are lines 1 and 2 of the addressed of the customer with the email \"vbogisich@example.org\"?", "gold_sql": "SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = \"vbogisich@example.org\"", "db_path": "databases/customer_complaints/customer_complaints.sqlite", "schema": "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);"} +{"qid": "gate_0097", "split": "gate", "db_id": "customers_card_transactions", "question": "Return the id and full name of the customer who has the fewest accounts.", "gold_sql": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1", "db_path": "databases/customers_card_transactions/customers_card_transactions.sqlite", "schema": "CREATE TABLE `Accounts` (\n`account_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`account_name` VARCHAR(50),\n`other_account_details` VARCHAR(255)\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_first_name` VARCHAR(20),\n`customer_last_name` VARCHAR(20),\n`customer_address` VARCHAR(255),\n`customer_phone` VARCHAR(255),\n`customer_email` VARCHAR(255),\n`other_customer_details` VARCHAR(255)\n);\nCREATE TABLE `Customers_Cards` (\n`card_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`card_type_code` VARCHAR(15) NOT NULL,\n`card_number` VARCHAR(80),\n`date_valid_from` DATETIME,\n`date_valid_to` DATETIME,\n`other_card_details` VARCHAR(255)\n);\nCREATE TABLE `Financial_Transactions` (\n`transaction_id` INTEGER NOT NULL ,\n`previous_transaction_id` INTEGER,\n`account_id` INTEGER NOT NULL,\n`card_id` INTEGER NOT NULL,\n`transaction_type` VARCHAR(15) NOT NULL,\n`transaction_date` DATETIME,\n`transaction_amount` DOUBLE NULL,\n`transaction_comment` VARCHAR(255),\n`other_transaction_details` VARCHAR(255),\nFOREIGN KEY (`card_id` ) REFERENCES `Customers_Cards`(`card_id` ),\nFOREIGN KEY (`account_id` ) REFERENCES `Accounts`(`account_id` )\n);"} +{"qid": "gate_0098", "split": "gate", "db_id": "manufacturer", "question": "what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.", "gold_sql": "SELECT max(num_of_shops) , avg(Num_of_Factories) FROM manufacturer WHERE open_year < 1990", "db_path": "databases/manufacturer/manufacturer.sqlite", "schema": "CREATE TABLE \"furniture\" (\n \"Furniture_ID\" int,\n \"Name\" text,\n \"Num_of_Component\" int,\n \"Market_Rate\" real,\n PRIMARY KEY (\"Furniture_ID\")\n);\nCREATE TABLE \"furniture_manufacte\" (\n \"Manufacturer_ID\" int,\n \"Furniture_ID\" int,\n \"Price_in_Dollar\" real,\n PRIMARY KEY (\"Manufacturer_ID\",\"Furniture_ID\"),\n FOREIGN KEY (\"Manufacturer_ID\") REFERENCES `manufacturer`(\"Manufacturer_ID\"),\n FOREIGN KEY (\"Furniture_ID\") REFERENCES `furniture`(\"Furniture_ID\")\n);\nCREATE TABLE \"manufacturer\" (\n \"Manufacturer_ID\" int,\n \"Open_Year\" real,\n \"Name\" text,\n \"Num_of_Factories\" int,\n \"Num_of_Shops\" int,\n PRIMARY KEY (\"Manufacturer_ID\")\n);"} +{"qid": "gate_0099", "split": "gate", "db_id": "manufactory_1", "question": "What is the headquarter of the company whose founder is James?", "gold_sql": "SELECT headquarter FROM manufacturers WHERE founder = 'James'", "db_path": "databases/manufactory_1/manufactory_1.sqlite", "schema": "CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL,\n Headquarter VARCHAR(255) NOT NULL,\n Founder VARCHAR(255) NOT NULL,\n Revenue REAL,\n PRIMARY KEY (Code) \n);\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL ,\n Price DECIMAL NOT NULL ,\n Manufacturer INTEGER NOT NULL,\n PRIMARY KEY (Code), \n FOREIGN KEY (Manufacturer) REFERENCES Manufacturers(Code)\n);"} diff --git a/splits/pool.jsonl b/splits/pool.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..74c0d76c7dcd41ca222ab5ba953c6a4aac3a86a7 --- /dev/null +++ b/splits/pool.jsonl @@ -0,0 +1,200 @@ +{"qid": "pool_0000", "split": "pool", "db_id": "aircraft", "question": "List names of all pilot aged 30 or younger in descending alphabetical order.", "gold_sql": "SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC", "db_path": "databases/aircraft/aircraft.sqlite", "schema": "CREATE TABLE `aircraft` (\n \"Aircraft_ID\" int(11) NOT NULL,\n \"Aircraft\" varchar(50) NOT NULL,\n \"Description\" varchar(50) NOT NULL,\n \"Max_Gross_Weight\" varchar(50) NOT NULL,\n \"Total_disk_area\" varchar(50) NOT NULL,\n \"Max_disk_Loading\" varchar(50) NOT NULL,\n PRIMARY KEY (`Aircraft_ID`)\n);\nCREATE TABLE `airport` (\n\"Airport_ID\" int,\n\"Airport_Name\" text,\n\"Total_Passengers\" real,\n\"%_Change_2007\" text,\n\"International_Passengers\" real,\n\"Domestic_Passengers\" real,\n\"Transit_Passengers\" real,\n\"Aircraft_Movements\" real,\n\"Freight_Metric_Tonnes\" real,\nPRIMARY KEY (\"Airport_ID\")\n);\nCREATE TABLE `airport_aircraft` (\n\"ID\" int,\n\"Airport_ID\" int,\n\"Aircraft_ID\" int,\nPRIMARY KEY (\"Airport_ID\",\"Aircraft_ID\"),\nFOREIGN KEY (\"Airport_ID\") REFERENCES `airport`(`Airport_ID`),\nFOREIGN KEY (\"Aircraft_ID\") REFERENCES `aircraft`(`Aircraft_ID`)\n);\nCREATE TABLE `match` (\n\"Round\" real,\n\"Location\" text,\n\"Country\" text,\n\"Date\" text,\n\"Fastest_Qualifying\" text,\n\"Winning_Pilot\" text,\n\"Winning_Aircraft\" text,\nPRIMARY KEY (\"Round\"),\nFOREIGN KEY (`Winning_Aircraft`) REFERENCES `aircraft`(`Aircraft_ID`),\nFOREIGN KEY (`Winning_Pilot`) REFERENCES `pilot`(`Pilot_Id`)\n);\nCREATE TABLE `pilot` (\n `Pilot_Id` int(11) NOT NULL,\n `Name` varchar(50) NOT NULL,\n `Age` int(11) NOT NULL,\n PRIMARY KEY (`Pilot_Id`)\n);"} +{"qid": "pool_0001", "split": "pool", "db_id": "activity_1", "question": "What are the names of the activities Mark Giuliano is involved in", "gold_sql": "SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = \"Mark\" AND T1.lname = \"Giuliano\"", "db_path": "databases/activity_1/activity_1.sqlite", "schema": "CREATE TABLE Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);\nCREATE TABLE Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0002", "split": "pool", "db_id": "match_season", "question": "For each player, what are their name, season, and country that they belong to?", "gold_sql": "SELECT T2.Season , T2.Player , T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country", "db_path": "databases/match_season/match_season.sqlite", "schema": "CREATE TABLE \"country\" (\n \"Country_id\" int,\n \"Country_name\" text,\n \"Capital\" text,\n \"Official_native_language\" text,\n PRIMARY KEY (\"Country_id\")\n);\nCREATE TABLE \"match_season\" (\n \"Season\" real,\n \"Player\" text,\n \"Position\" text,\n \"Country\" int,\n \"Team\" int,\n \"Draft_Pick_Number\" int,\n \"Draft_Class\" text,\n \"College\" text,\n PRIMARY KEY (\"Season\"),\n FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE \"player\" (\n \"Player_ID\" int,\n \"Player\" text,\n \"Years_Played\" text,\n \"Total_WL\" text,\n \"Singles_WL\" text,\n \"Doubles_WL\" text,\n \"Team\" int,\n PRIMARY KEY (\"Player_ID\"),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE `team` (\n `Team_id` int,\n `Name` text,\n PRIMARY KEY (`Team_id`)\n);"} +{"qid": "pool_0003", "split": "pool", "db_id": "music_1", "question": "What are the names of all songs that are in mp3 format and have a resolution lower than 1000?", "gold_sql": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = \"mp3\" INTERSECT SELECT song_name FROM song WHERE resolution < 1000", "db_path": "databases/music_1/music_1.sqlite", "schema": "CREATE TABLE artist(\n\tartist_name varchar2(50) not null,\n\tcountry varchar2(20),\n\tgender varchar2(20),\n\tpreferred_genre varchar2(50),\n\tconstraint a_name primary key(artist_name),\n\tforeign key(preferred_genre) references genre(g_name) ON DELETE CASCADE\n);\nCREATE TABLE files(\n\tf_id number(10) not null,\n\tartist_name varchar2(50),\n\tfile_size varchar2(20),\n\tduration varchar2(20),\n\tformats varchar2(20),\n\tprimary key(f_id),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE\n);\nCREATE TABLE genre(\n\tg_name varchar2(20) not null,\n\trating varchar2(10),\n\tmost_popular_in varchar2(50),\n\tprimary key(g_name)\n);\nCREATE TABLE song(\n\tsong_name varchar2(50),\n\tartist_name varchar2(50),\n\tcountry varchar2(20),\n\tf_id number(10),\n \tgenre_is varchar2(20),\n\trating number(10) check(rating>0 and rating<11),\n\tlanguages varchar2(20),\n\treleasedate Date, \n\tresolution number(10) not null,\n\tconstraint s_name primary key(song_name),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE,\n\tforeign key(f_id) references files(f_id) ON DELETE CASCADE,\n\tforeign key(genre_is) references genre(g_name) ON DELETE CASCADE\n);"} +{"qid": "pool_0004", "split": "pool", "db_id": "aircraft", "question": "List all pilot names in ascending alphabetical order.", "gold_sql": "SELECT Name FROM pilot ORDER BY Name ASC", "db_path": "databases/aircraft/aircraft.sqlite", "schema": "CREATE TABLE `aircraft` (\n \"Aircraft_ID\" int(11) NOT NULL,\n \"Aircraft\" varchar(50) NOT NULL,\n \"Description\" varchar(50) NOT NULL,\n \"Max_Gross_Weight\" varchar(50) NOT NULL,\n \"Total_disk_area\" varchar(50) NOT NULL,\n \"Max_disk_Loading\" varchar(50) NOT NULL,\n PRIMARY KEY (`Aircraft_ID`)\n);\nCREATE TABLE `airport` (\n\"Airport_ID\" int,\n\"Airport_Name\" text,\n\"Total_Passengers\" real,\n\"%_Change_2007\" text,\n\"International_Passengers\" real,\n\"Domestic_Passengers\" real,\n\"Transit_Passengers\" real,\n\"Aircraft_Movements\" real,\n\"Freight_Metric_Tonnes\" real,\nPRIMARY KEY (\"Airport_ID\")\n);\nCREATE TABLE `airport_aircraft` (\n\"ID\" int,\n\"Airport_ID\" int,\n\"Aircraft_ID\" int,\nPRIMARY KEY (\"Airport_ID\",\"Aircraft_ID\"),\nFOREIGN KEY (\"Airport_ID\") REFERENCES `airport`(`Airport_ID`),\nFOREIGN KEY (\"Aircraft_ID\") REFERENCES `aircraft`(`Aircraft_ID`)\n);\nCREATE TABLE `match` (\n\"Round\" real,\n\"Location\" text,\n\"Country\" text,\n\"Date\" text,\n\"Fastest_Qualifying\" text,\n\"Winning_Pilot\" text,\n\"Winning_Aircraft\" text,\nPRIMARY KEY (\"Round\"),\nFOREIGN KEY (`Winning_Aircraft`) REFERENCES `aircraft`(`Aircraft_ID`),\nFOREIGN KEY (`Winning_Pilot`) REFERENCES `pilot`(`Pilot_Id`)\n);\nCREATE TABLE `pilot` (\n `Pilot_Id` int(11) NOT NULL,\n `Name` varchar(50) NOT NULL,\n `Age` int(11) NOT NULL,\n PRIMARY KEY (`Pilot_Id`)\n);"} +{"qid": "pool_0005", "split": "pool", "db_id": "protein_institute", "question": "Show the protein name and the institution name.", "gold_sql": "SELECT T2.protein_name , T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id", "db_path": "databases/protein_institute/protein_institute.sqlite", "schema": "CREATE TABLE \"Institution\" (\n\"Institution_id\" text,\n\"Institution\" text,\n\"Location\" text,\n\"Founded\" real,\n\"Type\" text,\n\"Enrollment\" int,\n\"Team\" text,\n\"Primary_Conference\" text,\n\"building_id\" text,\nPRIMARY KEY(\"Institution_id\"),\nFOREIGN KEY (\"building_id\") REFERENCES \"building\"(\"building_id\")\n);\nCREATE TABLE \"building\" (\n\"building_id\" text,\n\"Name\" text,\n\"Street_address\" text,\n\"Years_as_tallest\" text,\n\"Height_feet\" int,\n\"Floors\" int,\nPRIMARY KEY(\"building_id\")\n);\nCREATE TABLE \"protein\" (\n\"common_name\" text,\n\"protein_name\" text,\n\"divergence_from_human_lineage\" real,\n\"accession_number\" text,\n\"sequence_length\" real,\n\"sequence_identity_to_human_protein\" text,\n\"Institution_id\" text,\nPRIMARY KEY(\"common_name\"),\nFOREIGN KEY(\"Institution_id\") REFERENCES \"Institution\"(\"Institution_id\")\n);"} +{"qid": "pool_0006", "split": "pool", "db_id": "activity_1", "question": "What are the ids of the students who are not involved in any activity", "gold_sql": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in", "db_path": "databases/activity_1/activity_1.sqlite", "schema": "CREATE TABLE Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);\nCREATE TABLE Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0007", "split": "pool", "db_id": "loan_1", "question": "What is the name, account type, and account balance corresponding to the customer with the highest credit score?", "gold_sql": "SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1", "db_path": "databases/loan_1/loan_1.sqlite", "schema": "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));\nCREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));\nCREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));"} +{"qid": "pool_0008", "split": "pool", "db_id": "cre_Drama_Workshop_Groups", "question": "Show all payment method codes and the number of orders for each code.", "gold_sql": "SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code", "db_path": "databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite", "schema": "CREATE TABLE Addresses (\nAddress_ID VARCHAR(100) NOT NULL,\nLine_1 VARCHAR(255),\nLine_2 VARCHAR(255),\nCity_Town VARCHAR(255),\nState_County VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Address_ID),\nUNIQUE (Address_ID)\n);\nCREATE TABLE Bookings (\nBooking_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nWorkshop_Group_ID VARCHAR(100) NOT NULL,\nStatus_Code CHAR(15) NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Booking_ID),\nUNIQUE (Booking_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Clients (Client_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID)\n);\nCREATE TABLE Bookings_Services (\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Product_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (Product_ID) REFERENCES Services (Service_ID)\n);\nCREATE TABLE Clients (\nClient_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Email_Address VARCHAR(255),\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Client_ID),\nUNIQUE (Client_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Customer_Orders (\nOrder_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Order_ID),\nUNIQUE (Order_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Store_ID) REFERENCES Stores (Store_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Customer_ID),\nUNIQUE (Customer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Drama_Workshop_Groups (\nWorkshop_Group_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCurrency_Code CHAR(15) NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Workshop_Group_ID),\nUNIQUE (Workshop_Group_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Invoice_Items (\nInvoice_Item_ID INTEGER NOT NULL ,\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\nOrder_Item_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity INTEGER,\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Invoice_Item_ID),\nFOREIGN KEY (Order_Item_ID) REFERENCES Order_Items (Order_Item_ID),\nFOREIGN KEY (Invoice_ID) REFERENCES Invoices (Invoice_ID),\nFOREIGN KEY (Order_ID, Product_ID) REFERENCES Bookings_Services (Order_ID,Product_ID)\n);\nCREATE TABLE Invoices (\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\npayment_method_code CHAR(15),\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nOrder_Item_ID INTEGER NOT NULL,\nPRIMARY KEY (Invoice_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (payment_method_code) REFERENCES Ref_Payment_Methods (payment_method_code)\n);\nCREATE TABLE Marketing_Regions (\nMarketing_Region_Code CHAR(15) NOT NULL,\nMarketing_Region_Name VARCHAR(255) NOT NULL,\nMarketing_Region_Descriptrion VARCHAR(255) NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Marketing_Region_Code),\nUNIQUE (Marketing_Region_Code)\n);\nCREATE TABLE Order_Items (\nOrder_Item_ID INTEGER NOT NULL ,\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Order_Item_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Product_ID) REFERENCES Products (Product_ID)\n);\nCREATE TABLE Performers (\nPerformer_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Performer_ID),\nUNIQUE (Performer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Performers_in_Bookings (\nOrder_ID INTEGER NOT NULL,\nPerformer_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Performer_ID),\nFOREIGN KEY (Performer_ID) REFERENCES Performers (Performer_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID)\n);\nCREATE TABLE Products (\nProduct_ID VARCHAR(100) NOT NULL,\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nProduct_Description VARCHAR(255),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Product_ID),\nUNIQUE (Product_ID)\n);\nCREATE TABLE Ref_Payment_Methods (\npayment_method_code CHAR(10) NOT NULL,\npayment_method_description VARCHAR(80),\nPRIMARY KEY (payment_method_code),\nUNIQUE (payment_method_code)\n);\nCREATE TABLE Ref_Service_Types (\nService_Type_Code CHAR(15) NOT NULL,\nParent_Service_Type_Code CHAR(15),\nService_Type_Description VARCHAR(255),\nPRIMARY KEY (Service_Type_Code),\nUNIQUE (Service_Type_Code)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15),\nWorkshop_Group_ID INTEGER NOT NULL,\nProduct_Description VARCHAR(255),\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Service_ID),\nUNIQUE (Service_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID),\nFOREIGN KEY (Service_Type_Code) REFERENCES Ref_Service_Types (Service_Type_Code)\n);\nCREATE TABLE Stores (\nStore_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Store_ID),\nUNIQUE (Store_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID),\nFOREIGN KEY (Marketing_Region_Code) REFERENCES Marketing_Regions (Marketing_Region_Code)\n);"} +{"qid": "pool_0009", "split": "pool", "db_id": "csu_1", "question": "Find the count of universities whose campus fee is greater than the average campus fee.", "gold_sql": "SELECT count(*) FROM csu_fees WHERE campusfee > (SELECT avg(campusfee) FROM csu_fees)", "db_path": "databases/csu_1/csu_1.sqlite", "schema": "CREATE TABLE \"Campuses\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Campus\" TEXT, \n\t\"Location\" TEXT, \n\t\"County\" TEXT, \n\t\"Year\" INTEGER \n);\nCREATE TABLE \"csu_fees\" ( \n\t\"Campus\" INTEGER PRIMARY KEY, \n\t\"Year\" INTEGER, \n\t\"CampusFee\" INTEGER,\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"degrees\" ( \n\t\"Year\" INTEGER,\n\t\"Campus\" INTEGER, \n\t\"Degrees\" INTEGER,\n\tPRIMARY KEY (Year, Campus),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"discipline_enrollments\" ( \n\t\"Campus\" INTEGER, \n\t\"Discipline\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"Undergraduate\" INTEGER, \n\t\"Graduate\" INTEGER,\n\tPRIMARY KEY (Campus, Discipline),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"enrollments\" ( \n\t\"Campus\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"TotalEnrollment_AY\" INTEGER, \n\t\"FTE_AY\" INTEGER,\n\tPRIMARY KEY(Campus, Year),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"faculty\" ( \n\t\"Campus\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"Faculty\" REAL,\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id) \n);"} +{"qid": "pool_0010", "split": "pool", "db_id": "flight_4", "question": "How many cities are there that have more than 3 airports?", "gold_sql": "SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3)", "db_path": "databases/flight_4/flight_4.sqlite", "schema": "CREATE TABLE airlines (\n alid integer PRIMARY KEY, -- Id of the airline\n name text, -- Name of the airline\n iata varchar(2), -- 2-letter IATA code. empty or null if not assigned/unknown \n icao varchar(3), -- 3-letter ICAO code. empty or null if not assigned\n callsign text, -- Airline callsign\n country text, -- Country or territory where airline is incorporated\n active varchar(2) -- \"Y\" if the airline is or has until recently been operational,\n);\nCREATE TABLE airports (\n apid integer PRIMARY KEY, -- Id of the airport\n name text NOT NULL, -- Name of airport\n city text, -- Main city served by airport\n country text, -- Country or territory where airport is located\n x real, -- Latitude of airport: Decimal degrees, usually to six\n -- significant digits. Negative is South, positive is North\n y real, -- Longitude of airport: Decimal degrees, usually to six \n -- significant digits. Negative is West, positive is East\n elevation bigint, -- Altitude of airport measured in feets\n iata character varchar(3), -- 3-letter IATA code. empty or null if not assigned/unknown\n icao character varchar(4) -- 4-letter ICAO code. empty or null if not assigned\n \n);\nCREATE TABLE routes (\n rid integer PRIMARY KEY,\n dst_apid integer, -- Id of destination airport\n dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport\n src_apid bigint, -- Id of source airport\n src_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the source airport\n alid bigint, -- Id of airline\n airline varchar(4), -- 2-letter (IATA) or 3-letter (ICAO) code of the airline\n codeshare text, -- \"Y\" if this flight is a codeshare (that is, not operated by \n -- Airline, but another carrier), empty otherwise\n FOREIGN KEY(dst_apid) REFERENCES airports(apid),\n FOREIGN KEY(src_apid) REFERENCES airports(apid),\n FOREIGN KEY(alid) REFERENCES airlines(alid)\n);"} +{"qid": "pool_0011", "split": "pool", "db_id": "college_2", "question": "What are the names and salaries for instructors who earn less than the average salary of instructors in the Physics department?", "gold_sql": "SELECT name , salary FROM instructor WHERE salary < (SELECT avg(salary) FROM instructor WHERE dept_name = 'Physics')", "db_path": "databases/college_2/college_2.sqlite", "schema": "CREATE TABLE advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);\nCREATE TABLE course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );\nCREATE TABLE department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);\nCREATE TABLE instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);\nCREATE TABLE section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);\nCREATE TABLE student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);"} +{"qid": "pool_0012", "split": "pool", "db_id": "ship_mission", "question": "What are the names of the ships that are from either the US or the UK?", "gold_sql": "SELECT Name FROM ship WHERE Nationality = \"United States\" OR Nationality = \"United Kingdom\"", "db_path": "databases/ship_mission/ship_mission.sqlite", "schema": "CREATE TABLE \"mission\" (\n\"Mission_ID\" int,\n\"Ship_ID\" int,\n\"Code\" text,\n\"Launched_Year\" int,\n\"Location\" text,\n\"Speed_knots\" int,\n\"Fate\" text,\nPRIMARY KEY (\"Mission_ID\"),\nFOREIGN KEY (\"Ship_ID\") REFERENCES `ship`(\"Ship_ID\")\n);\nCREATE TABLE \"ship\" (\n\"Ship_ID\" int,\n\"Name\" text,\n\"Type\" text,\n\"Nationality\" text,\n\"Tonnage\" int,\nPRIMARY KEY (\"Ship_ID\")\n);"} +{"qid": "pool_0013", "split": "pool", "db_id": "company_1", "question": "Return the first names and last names of employees who earn more than 30000 in salary.", "gold_sql": "SELECT fname , lname FROM employee WHERE salary > 30000", "db_path": "databases/company_1/company_1.sqlite", "schema": "CREATE TABLE department(\nDname TEXT,\nDnumber INTEGER PRIMARY KEY,\nMgr_ssn INTEGER,\nMgr_start_date TEXT);\nCREATE TABLE dependent(\nEssn INTEGER,\nDependent_name TEXT,\nSex TEXT,\nBdate TEXT,\nRelationship TEXT,\nPRIMARY KEY(Essn, Dependent_name));\nCREATE TABLE dept_locations(\nDnumber INTEGER,\nDlocation TEXT,\nPRIMARY KEY(Dnumber, Dlocation));\nCREATE TABLE employee(\nFname TEXT,\nMinit TEXT,\nLname TEXT,\nSsn INTEGER PRIMARY KEY,\nBdate TEXT,\nAddress TEXT,\nSex TEXT,\nSalary INTEGER,\nSuper_ssn INTEGER, \nDno INTEGER);\nCREATE TABLE project(\nPname Text,\nPnumber INTEGER PRIMARY KEY,\nPlocation TEXT,\nDnum INTEGER);\nCREATE TABLE works_on(\nEssn INTEGER,\nPno INTEGER,\nHours REAL,\nPRIMARY KEY(Essn, Pno));"} +{"qid": "pool_0014", "split": "pool", "db_id": "flight_1", "question": "How many employees do we have?", "gold_sql": "SELECT count(*) FROM Employee", "db_path": "databases/flight_1/flight_1.sqlite", "schema": "CREATE TABLE aircraft(\n\taid number(9,0) primary key,\n\tname varchar2(30),\n\tdistance number(6,0));\nCREATE TABLE certificate(\n\teid number(9,0),\n\taid number(9,0),\n\tprimary key(eid,aid),\n\tforeign key(\"eid\") references `employee`(\"eid\"),\n\tforeign key(\"aid\") references `aircraft`(\"aid\"));\nCREATE TABLE employee(\n\teid number(9,0) primary key,\n\tname varchar2(30),\n\tsalary number(10,2));\nCREATE TABLE flight(\n\tflno number(4,0) primary key,\n\torigin varchar2(20),\n\tdestination varchar2(20),\n\tdistance number(6,0),\n\tdeparture_date date,\n\tarrival_date date,\n\tprice number(7,2),\n aid number(9,0),\n foreign key(\"aid\") references `aircraft`(\"aid\"));"} +{"qid": "pool_0015", "split": "pool", "db_id": "cre_Docs_and_Epenses", "question": "What are the account details with the largest value or with value having char '5' in it?", "gold_sql": "SELECT max(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE \"%5%\"", "db_path": "databases/cre_Docs_and_Epenses/cre_Docs_and_Epenses.sqlite", "schema": "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);\nCREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);\nCREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);\nCREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);\nCREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);\nCREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);"} +{"qid": "pool_0016", "split": "pool", "db_id": "gymnast", "question": "What are the names of people in ascending alphabetical order?", "gold_sql": "SELECT Name FROM People ORDER BY Name ASC", "db_path": "databases/gymnast/gymnast.sqlite", "schema": "CREATE TABLE \"gymnast\" (\n\"Gymnast_ID\" int,\n\"Floor_Exercise_Points\" real,\n\"Pommel_Horse_Points\" real,\n\"Rings_Points\" real,\n\"Vault_Points\" real,\n\"Parallel_Bars_Points\" real,\n\"Horizontal_Bar_Points\" real,\n\"Total_Points\" real,\nPRIMARY KEY (\"Gymnast_ID\"),\nFOREIGN KEY (\"Gymnast_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Age\" real,\n\"Height\" real,\n\"Hometown\" text,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "pool_0017", "split": "pool", "db_id": "college_2", "question": "Count the number of distinct instructors who have taught a course.", "gold_sql": "SELECT COUNT (DISTINCT id) FROM teaches", "db_path": "databases/college_2/college_2.sqlite", "schema": "CREATE TABLE advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);\nCREATE TABLE course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );\nCREATE TABLE department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);\nCREATE TABLE instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);\nCREATE TABLE section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);\nCREATE TABLE student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);"} +{"qid": "pool_0018", "split": "pool", "db_id": "baseball_1", "question": "Find the average height of the players who belong to the college called 'Yale University'.", "gold_sql": "SELECT avg(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University';", "db_path": "databases/baseball_1/baseball_1.sqlite", "schema": "CREATE TABLE all_star (\n player_id TEXT,\n year INTEGER,\n game_num INTEGER,\n game_id TEXT,\n team_id TEXT,\n league_id TEXT,\n gp NUMERIC,\n starting_pos NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE appearances (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n g_all NUMERIC,\n gs NUMERIC,\n g_batting INTEGER,\n g_defense NUMERIC,\n g_p INTEGER,\n g_c INTEGER,\n g_1b INTEGER,\n g_2b INTEGER,\n g_3b INTEGER,\n g_ss INTEGER,\n g_lf INTEGER,\n g_cf INTEGER,\n g_rf INTEGER,\n g_of INTEGER,\n g_dh NUMERIC,\n g_ph NUMERIC,\n g_pr NUMERIC,\n foreign key (team_id) references team(team_id),\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ab NUMERIC,\n r NUMERIC,\n h NUMERIC,\n double NUMERIC,\n triple NUMERIC,\n hr NUMERIC,\n rbi NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n bb NUMERIC,\n so NUMERIC,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC,\nforeign key (player_id) references player(player_id)\n);\nCREATE TABLE batting_postseason (\n year INTEGER,\n round TEXT,\n player_id TEXT,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab INTEGER,\n r INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n rbi INTEGER,\n sb INTEGER,\n cs NUMERIC,\n bb INTEGER,\n so INTEGER,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE college (\n college_id TEXT,\n name_full TEXT,\n city TEXT,\n state TEXT,\n country TEXT);\nCREATE TABLE fielding (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po NUMERIC,\n a NUMERIC,\n e NUMERIC,\n dp NUMERIC,\n pb NUMERIC,\n wp NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n zr NUMERIC,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE fielding_outfield (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n glf NUMERIC,\n gcf NUMERIC,\n grf NUMERIC,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE fielding_postseason (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n round TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po INTEGER,\n a INTEGER,\n e INTEGER,\n dp INTEGER,\n tp INTEGER,\n pb NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (team_id) references player(team_id)\n);\nCREATE TABLE hall_of_fame (\n player_id TEXT,\n yearid INTEGER,\n votedby TEXT,\n ballots NUMERIC,\n needed NUMERIC,\n votes NUMERIC,\n inducted TEXT,\n category TEXT,\n needed_note TEXT,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE home_game (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n park_id TEXT,\n span_first TEXT,\n span_last TEXT,\n games INTEGER,\n openings INTEGER,\n attendance INTEGER,\n\tforeign key (team_id) references team(team_id),\n\tforeign key (park_id) references park(park_id)\n);\nCREATE TABLE manager (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank NUMERIC,\n plyr_mgr TEXT,\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE manager_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE manager_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won INTEGER,\n points_max INTEGER,\n votes_first INTEGER);\nCREATE TABLE manager_half (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n half INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank INTEGER,\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE park (\n park_id TEXT,\n park_name TEXT,\n park_alias TEXT,\n city TEXT,\n state TEXT,\n country TEXT);\nCREATE TABLE pitching (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts NUMERIC,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp NUMERIC,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk INTEGER,\n bfp NUMERIC,\n gf NUMERIC,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC);\nCREATE TABLE pitching_postseason (\n player_id TEXT,\n year INTEGER,\n round TEXT,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp TEXT,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk NUMERIC,\n bfp NUMERIC,\n gf INTEGER,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC);\nCREATE TABLE player (\n player_id TEXT,\n birth_year NUMERIC,\n birth_month NUMERIC,\n birth_day NUMERIC,\n birth_country TEXT,\n birth_state TEXT,\n birth_city TEXT,\n death_year NUMERIC,\n death_month NUMERIC,\n death_day NUMERIC,\n death_country TEXT,\n death_state TEXT,\n death_city TEXT,\n name_first TEXT,\n name_last TEXT,\n name_given TEXT,\n weight NUMERIC,\n height NUMERIC,\n bats TEXT,\n throws TEXT,\n debut TEXT,\n final_game TEXT,\n retro_id TEXT,\n bbref_id TEXT);\nCREATE TABLE player_award ( \n\tplayer_id TEXT, \n\taward_id TEXT, \n\tyear INTEGER, \n\tleague_id TEXT,\n \ttie TEXT,\n \tnotes TEXT,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE player_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won NUMERIC,\n points_max INTEGER,\n votes_first NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE player_college ( player_id TEXT,\n college_id TEXT,\n year INTEGER,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (college_id) references college(college_id)\n);\nCREATE TABLE postseason (\n year INTEGER,\n round TEXT,\n team_id_winner TEXT,\n league_id_winner TEXT,\n team_id_loser TEXT,\n league_id_loser TEXT,\n wins INTEGER,\n losses INTEGER,\n ties INTEGER);\nCREATE TABLE salary (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n salary INTEGER);\nCREATE TABLE team (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n franchise_id TEXT,\n div_id TEXT,\n rank INTEGER,\n g INTEGER,\n ghome NUMERIC,\n w INTEGER,\n l INTEGER,\n div_win TEXT,\n wc_win TEXT,\n lg_win TEXT,\n ws_win TEXT,\n r INTEGER,\n ab INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n bb INTEGER,\n so NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n hbp NUMERIC,\n sf NUMERIC,\n ra INTEGER,\n er INTEGER,\n era NUMERIC,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n ha INTEGER,\n hra INTEGER,\n bba INTEGER,\n soa INTEGER,\n e INTEGER,\n dp NUMERIC,\n fp NUMERIC,\n name TEXT,\n park TEXT,\n attendance NUMERIC,\n bpf INTEGER,\n ppf INTEGER,\n team_id_br TEXT,\n team_id_lahman45 TEXT,\n team_id_retro TEXT);\nCREATE TABLE team_franchise (\n franchise_id TEXT,\n franchise_name TEXT,\n active TEXT,\n na_assoc TEXT);\nCREATE TABLE team_half (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n half INTEGER,\n div_id TEXT,\n div_win TEXT,\n rank INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER);"} +{"qid": "pool_0019", "split": "pool", "db_id": "music_1", "question": "What are the song names for every song whose rating is less than the minimum rating for English songs?", "gold_sql": "SELECT song_name FROM song WHERE rating < (SELECT min(rating) FROM song WHERE languages = 'english')", "db_path": "databases/music_1/music_1.sqlite", "schema": "CREATE TABLE artist(\n\tartist_name varchar2(50) not null,\n\tcountry varchar2(20),\n\tgender varchar2(20),\n\tpreferred_genre varchar2(50),\n\tconstraint a_name primary key(artist_name),\n\tforeign key(preferred_genre) references genre(g_name) ON DELETE CASCADE\n);\nCREATE TABLE files(\n\tf_id number(10) not null,\n\tartist_name varchar2(50),\n\tfile_size varchar2(20),\n\tduration varchar2(20),\n\tformats varchar2(20),\n\tprimary key(f_id),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE\n);\nCREATE TABLE genre(\n\tg_name varchar2(20) not null,\n\trating varchar2(10),\n\tmost_popular_in varchar2(50),\n\tprimary key(g_name)\n);\nCREATE TABLE song(\n\tsong_name varchar2(50),\n\tartist_name varchar2(50),\n\tcountry varchar2(20),\n\tf_id number(10),\n \tgenre_is varchar2(20),\n\trating number(10) check(rating>0 and rating<11),\n\tlanguages varchar2(20),\n\treleasedate Date, \n\tresolution number(10) not null,\n\tconstraint s_name primary key(song_name),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE,\n\tforeign key(f_id) references files(f_id) ON DELETE CASCADE,\n\tforeign key(genre_is) references genre(g_name) ON DELETE CASCADE\n);"} +{"qid": "pool_0020", "split": "pool", "db_id": "chinook_1", "question": "What are all the album titles, in alphabetical order?", "gold_sql": "SELECT Title FROM ALBUM ORDER BY Title", "db_path": "databases/chinook_1/chinook_1.sqlite", "schema": "CREATE TABLE `Album` (\n `AlbumId` integer NOT NULL\n, `Title` varchar(160) NOT NULL\n, `ArtistId` integer NOT NULL\n, PRIMARY KEY (`AlbumId`)\n, CONSTRAINT `FK_AlbumArtistId` FOREIGN KEY (`ArtistId`) REFERENCES `Artist` (`ArtistId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Artist` (\n `ArtistId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`ArtistId`)\n);\nCREATE TABLE `Customer` (\n `CustomerId` integer NOT NULL\n, `FirstName` varchar(40) NOT NULL\n, `LastName` varchar(20) NOT NULL\n, `Company` varchar(80) DEFAULT NULL\n, `Address` varchar(70) DEFAULT NULL\n, `City` varchar(40) DEFAULT NULL\n, `State` varchar(40) DEFAULT NULL\n, `Country` varchar(40) DEFAULT NULL\n, `PostalCode` varchar(10) DEFAULT NULL\n, `Phone` varchar(24) DEFAULT NULL\n, `Fax` varchar(24) DEFAULT NULL\n, `Email` varchar(60) NOT NULL\n, `SupportRepId` integer DEFAULT NULL\n, PRIMARY KEY (`CustomerId`)\n, CONSTRAINT `FK_CustomerSupportRepId` FOREIGN KEY (`SupportRepId`) REFERENCES `Employee` (`EmployeeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Employee` (\n `EmployeeId` integer NOT NULL\n, `LastName` varchar(20) NOT NULL\n, `FirstName` varchar(20) NOT NULL\n, `Title` varchar(30) DEFAULT NULL\n, `ReportsTo` integer DEFAULT NULL\n, `BirthDate` datetime DEFAULT NULL\n, `HireDate` datetime DEFAULT NULL\n, `Address` varchar(70) DEFAULT NULL\n, `City` varchar(40) DEFAULT NULL\n, `State` varchar(40) DEFAULT NULL\n, `Country` varchar(40) DEFAULT NULL\n, `PostalCode` varchar(10) DEFAULT NULL\n, `Phone` varchar(24) DEFAULT NULL\n, `Fax` varchar(24) DEFAULT NULL\n, `Email` varchar(60) DEFAULT NULL\n, PRIMARY KEY (`EmployeeId`)\n, CONSTRAINT `FK_EmployeeReportsTo` FOREIGN KEY (`ReportsTo`) REFERENCES `Employee` (`EmployeeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Genre` (\n `GenreId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`GenreId`)\n);\nCREATE TABLE `Invoice` (\n `InvoiceId` integer NOT NULL\n, `CustomerId` integer NOT NULL\n, `InvoiceDate` datetime NOT NULL\n, `BillingAddress` varchar(70) DEFAULT NULL\n, `BillingCity` varchar(40) DEFAULT NULL\n, `BillingState` varchar(40) DEFAULT NULL\n, `BillingCountry` varchar(40) DEFAULT NULL\n, `BillingPostalCode` varchar(10) DEFAULT NULL\n, `Total` decimal(10,2) NOT NULL\n, PRIMARY KEY (`InvoiceId`)\n, CONSTRAINT `FK_InvoiceCustomerId` FOREIGN KEY (`CustomerId`) REFERENCES `Customer` (`CustomerId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `InvoiceLine` (\n `InvoiceLineId` integer NOT NULL\n, `InvoiceId` integer NOT NULL\n, `TrackId` integer NOT NULL\n, `UnitPrice` decimal(10,2) NOT NULL\n, `Quantity` integer NOT NULL\n, PRIMARY KEY (`InvoiceLineId`)\n, CONSTRAINT `FK_InvoiceLineInvoiceId` FOREIGN KEY (`InvoiceId`) REFERENCES `Invoice` (`InvoiceId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_InvoiceLineTrackId` FOREIGN KEY (`TrackId`) REFERENCES `Track` (`TrackId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `MediaType` (\n `MediaTypeId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`MediaTypeId`)\n);\nCREATE TABLE `Playlist` (\n `PlaylistId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`PlaylistId`)\n);\nCREATE TABLE `PlaylistTrack` (\n `PlaylistId` integer NOT NULL\n, `TrackId` integer NOT NULL\n, PRIMARY KEY (`PlaylistId`,`TrackId`)\n, CONSTRAINT `FK_PlaylistTrackPlaylistId` FOREIGN KEY (`PlaylistId`) REFERENCES `Playlist` (`PlaylistId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_PlaylistTrackTrackId` FOREIGN KEY (`TrackId`) REFERENCES `Track` (`TrackId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Track` (\n `TrackId` integer NOT NULL\n, `Name` varchar(200) NOT NULL\n, `AlbumId` integer DEFAULT NULL\n, `MediaTypeId` integer NOT NULL\n, `GenreId` integer DEFAULT NULL\n, `Composer` varchar(220) DEFAULT NULL\n, `Milliseconds` integer NOT NULL\n, `Bytes` integer DEFAULT NULL\n, `UnitPrice` decimal(10,2) NOT NULL\n, PRIMARY KEY (`TrackId`)\n, CONSTRAINT `FK_TrackAlbumId` FOREIGN KEY (`AlbumId`) REFERENCES `Album` (`AlbumId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_TrackGenreId` FOREIGN KEY (`GenreId`) REFERENCES `Genre` (`GenreId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_TrackMediaTypeId` FOREIGN KEY (`MediaTypeId`) REFERENCES `MediaType` (`MediaTypeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);"} +{"qid": "pool_0021", "split": "pool", "db_id": "dorm_1", "question": "Find the capacity and gender type of the dorm whose name has substring ‘Donor’.", "gold_sql": "SELECT student_capacity , gender FROM dorm WHERE dorm_name LIKE '%Donor%'", "db_path": "databases/dorm_1/dorm_1.sqlite", "schema": "CREATE TABLE Dorm (\n dormid\t\tINTEGER,\n dorm_name\tVARCHAR(20),\n student_capacity\tINTEGER,\n gender\t\t\tVARCHAR(1)\n);\nCREATE TABLE Dorm_amenity (\n amenid\t\t\tINTEGER,\n amenity_name\t\tVARCHAR(25)\n);\nCREATE TABLE Has_amenity (\n dormid\t\t\tINTEGER,\n amenid\t\t\t\tINTEGER,\n\tFOREIGN KEY (dormid) REFERENCES `Dorm`(dormid),\n\tFOREIGN KEY (amenid) REFERENCES `Dorm_amenity`(amenid)\n);\nCREATE TABLE Lives_in (\n stuid \t INTEGER,\n dormid\t\tINTEGER,\n room_number\tINTEGER,\n\tFOREIGN KEY (stuid) REFERENCES `Student`(StuID),\n FOREIGN KEY (dormid) REFERENCES `Dorm`(dormid)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0022", "split": "pool", "db_id": "cre_Theme_park", "question": "What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?", "gold_sql": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = \"254 Ottilie Junction\" OR T2.How_to_Get_There = \"bus\"", "db_path": "databases/cre_Theme_park/cre_Theme_park.sqlite", "schema": "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);\nCREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);\nCREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);\nCREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);\nCREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);\nCREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);\nCREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);\nCREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);\nCREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);"} +{"qid": "pool_0023", "split": "pool", "db_id": "cre_Doc_Tracking_DB", "question": "Find the document type name of the document named \"How to read a book\".", "gold_sql": "SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = \"How to read a book\"", "db_path": "databases/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite", "schema": "CREATE TABLE All_Documents (\nDocument_ID INTEGER NOT NULL,\nDate_Stored DATETIME,\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Name CHAR(255),\nDocument_Description CHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Date_Stored) REFERENCES Ref_Calendar (Calendar_Date)\n);\nCREATE TABLE Document_Locations (\nDocument_ID INTEGER NOT NULL,\nLocation_Code CHAR(15) NOT NULL,\nDate_in_Location_From DATETIME NOT NULL,\nDate_in_Locaton_To DATETIME,\nPRIMARY KEY (Document_ID, Location_Code, Date_in_Location_From),\nFOREIGN KEY (Location_Code) REFERENCES Ref_Locations (Location_Code),\nFOREIGN KEY (Date_in_Location_From) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Date_in_Locaton_To) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)\n);\nCREATE TABLE Documents_to_be_Destroyed (\nDocument_ID INTEGER NOT NULL,\nDestruction_Authorised_by_Employee_ID INTEGER,\nDestroyed_by_Employee_ID INTEGER,\nPlanned_Destruction_Date DATETIME,\nActual_Destruction_Date DATETIME,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Destroyed_by_Employee_ID) REFERENCES Employees (Employee_ID),\nFOREIGN KEY (Destruction_Authorised_by_Employee_ID) REFERENCES Employees (Employee_ID),\nFOREIGN KEY (Planned_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Actual_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)\n);\nCREATE TABLE Employees (\nEmployee_ID INTEGER NOT NULL,\nRole_Code CHAR(15) NOT NULL,\nEmployee_Name VARCHAR(255),\nGender_MFU CHAR(1) NOT NULL,\nDate_of_Birth DATETIME NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Employee_ID),\nFOREIGN KEY (Role_Code) REFERENCES Roles (Role_Code)\n);\nCREATE TABLE Ref_Calendar (\nCalendar_Date DATETIME NOT NULL,\nDay_Number INTEGER,\nPRIMARY KEY (Calendar_Date)\n);\nCREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);\nCREATE TABLE Ref_Locations (\nLocation_Code CHAR(15) NOT NULL,\nLocation_Name VARCHAR(255) NOT NULL,\nLocation_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Location_Code)\n);\nCREATE TABLE Roles (\nRole_Code CHAR(15) NOT NULL,\nRole_Name VARCHAR(255),\nRole_Description VARCHAR(255),\nPRIMARY KEY (Role_Code)\n);"} +{"qid": "pool_0024", "split": "pool", "db_id": "baseball_1", "question": "Find the players' first name and last name who won award both in 1960 and in 1961.", "gold_sql": "SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961", "db_path": "databases/baseball_1/baseball_1.sqlite", "schema": "CREATE TABLE all_star (\n player_id TEXT,\n year INTEGER,\n game_num INTEGER,\n game_id TEXT,\n team_id TEXT,\n league_id TEXT,\n gp NUMERIC,\n starting_pos NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE appearances (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n g_all NUMERIC,\n gs NUMERIC,\n g_batting INTEGER,\n g_defense NUMERIC,\n g_p INTEGER,\n g_c INTEGER,\n g_1b INTEGER,\n g_2b INTEGER,\n g_3b INTEGER,\n g_ss INTEGER,\n g_lf INTEGER,\n g_cf INTEGER,\n g_rf INTEGER,\n g_of INTEGER,\n g_dh NUMERIC,\n g_ph NUMERIC,\n g_pr NUMERIC,\n foreign key (team_id) references team(team_id),\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ab NUMERIC,\n r NUMERIC,\n h NUMERIC,\n double NUMERIC,\n triple NUMERIC,\n hr NUMERIC,\n rbi NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n bb NUMERIC,\n so NUMERIC,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC,\nforeign key (player_id) references player(player_id)\n);\nCREATE TABLE batting_postseason (\n year INTEGER,\n round TEXT,\n player_id TEXT,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab INTEGER,\n r INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n rbi INTEGER,\n sb INTEGER,\n cs NUMERIC,\n bb INTEGER,\n so INTEGER,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE college (\n college_id TEXT,\n name_full TEXT,\n city TEXT,\n state TEXT,\n country TEXT);\nCREATE TABLE fielding (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po NUMERIC,\n a NUMERIC,\n e NUMERIC,\n dp NUMERIC,\n pb NUMERIC,\n wp NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n zr NUMERIC,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE fielding_outfield (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n glf NUMERIC,\n gcf NUMERIC,\n grf NUMERIC,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE fielding_postseason (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n round TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po INTEGER,\n a INTEGER,\n e INTEGER,\n dp INTEGER,\n tp INTEGER,\n pb NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (team_id) references player(team_id)\n);\nCREATE TABLE hall_of_fame (\n player_id TEXT,\n yearid INTEGER,\n votedby TEXT,\n ballots NUMERIC,\n needed NUMERIC,\n votes NUMERIC,\n inducted TEXT,\n category TEXT,\n needed_note TEXT,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE home_game (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n park_id TEXT,\n span_first TEXT,\n span_last TEXT,\n games INTEGER,\n openings INTEGER,\n attendance INTEGER,\n\tforeign key (team_id) references team(team_id),\n\tforeign key (park_id) references park(park_id)\n);\nCREATE TABLE manager (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank NUMERIC,\n plyr_mgr TEXT,\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE manager_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE manager_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won INTEGER,\n points_max INTEGER,\n votes_first INTEGER);\nCREATE TABLE manager_half (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n half INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank INTEGER,\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE park (\n park_id TEXT,\n park_name TEXT,\n park_alias TEXT,\n city TEXT,\n state TEXT,\n country TEXT);\nCREATE TABLE pitching (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts NUMERIC,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp NUMERIC,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk INTEGER,\n bfp NUMERIC,\n gf NUMERIC,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC);\nCREATE TABLE pitching_postseason (\n player_id TEXT,\n year INTEGER,\n round TEXT,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp TEXT,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk NUMERIC,\n bfp NUMERIC,\n gf INTEGER,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC);\nCREATE TABLE player (\n player_id TEXT,\n birth_year NUMERIC,\n birth_month NUMERIC,\n birth_day NUMERIC,\n birth_country TEXT,\n birth_state TEXT,\n birth_city TEXT,\n death_year NUMERIC,\n death_month NUMERIC,\n death_day NUMERIC,\n death_country TEXT,\n death_state TEXT,\n death_city TEXT,\n name_first TEXT,\n name_last TEXT,\n name_given TEXT,\n weight NUMERIC,\n height NUMERIC,\n bats TEXT,\n throws TEXT,\n debut TEXT,\n final_game TEXT,\n retro_id TEXT,\n bbref_id TEXT);\nCREATE TABLE player_award ( \n\tplayer_id TEXT, \n\taward_id TEXT, \n\tyear INTEGER, \n\tleague_id TEXT,\n \ttie TEXT,\n \tnotes TEXT,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE player_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won NUMERIC,\n points_max INTEGER,\n votes_first NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE player_college ( player_id TEXT,\n college_id TEXT,\n year INTEGER,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (college_id) references college(college_id)\n);\nCREATE TABLE postseason (\n year INTEGER,\n round TEXT,\n team_id_winner TEXT,\n league_id_winner TEXT,\n team_id_loser TEXT,\n league_id_loser TEXT,\n wins INTEGER,\n losses INTEGER,\n ties INTEGER);\nCREATE TABLE salary (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n salary INTEGER);\nCREATE TABLE team (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n franchise_id TEXT,\n div_id TEXT,\n rank INTEGER,\n g INTEGER,\n ghome NUMERIC,\n w INTEGER,\n l INTEGER,\n div_win TEXT,\n wc_win TEXT,\n lg_win TEXT,\n ws_win TEXT,\n r INTEGER,\n ab INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n bb INTEGER,\n so NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n hbp NUMERIC,\n sf NUMERIC,\n ra INTEGER,\n er INTEGER,\n era NUMERIC,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n ha INTEGER,\n hra INTEGER,\n bba INTEGER,\n soa INTEGER,\n e INTEGER,\n dp NUMERIC,\n fp NUMERIC,\n name TEXT,\n park TEXT,\n attendance NUMERIC,\n bpf INTEGER,\n ppf INTEGER,\n team_id_br TEXT,\n team_id_lahman45 TEXT,\n team_id_retro TEXT);\nCREATE TABLE team_franchise (\n franchise_id TEXT,\n franchise_name TEXT,\n active TEXT,\n na_assoc TEXT);\nCREATE TABLE team_half (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n half INTEGER,\n div_id TEXT,\n div_win TEXT,\n rank INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER);"} +{"qid": "pool_0025", "split": "pool", "db_id": "hospital_1", "question": "Which physicians are affiliated with either Surgery or Psychiatry department? Give me their names.", "gold_sql": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' OR T3.name = 'Psychiatry'", "db_path": "databases/hospital_1/hospital_1.sqlite", "schema": "CREATE TABLE Affiliated_With (\n Physician INTEGER NOT NULL,\n Department INTEGER NOT NULL,\n PrimaryAffiliation BOOLEAN NOT NULL,\n CONSTRAINT fk_Affiliated_With_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Affiliated_With_Department_DepartmentID FOREIGN KEY(Department) REFERENCES Department(DepartmentID),\n PRIMARY KEY(Physician, Department)\n);\nCREATE TABLE Appointment (\n AppointmentID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL, \n PrepNurse INTEGER,\n Physician INTEGER NOT NULL,\n Start DATETIME NOT NULL,\n End DATETIME NOT NULL,\n ExaminationRoom TEXT NOT NULL,\n CONSTRAINT fk_Appointment_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Appointment_Nurse_EmployeeID FOREIGN KEY(PrepNurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_Appointment_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Block (\n BlockFloor INTEGER NOT NULL,\n BlockCode INTEGER NOT NULL,\n PRIMARY KEY(BlockFloor, BlockCode)\n);\nCREATE TABLE Department (\n DepartmentID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Head INTEGER NOT NULL,\n CONSTRAINT pk_Department PRIMARY KEY(DepartmentID),\n CONSTRAINT fk_Department_Physician_EmployeeID FOREIGN KEY(Head) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Medication (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Brand VARCHAR(30) NOT NULL,\n Description VARCHAR(30) NOT NULL\n);\nCREATE TABLE Nurse (\n EmployeeID INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n Registered BOOLEAN NOT NULL,\n SSN INTEGER NOT NULL\n);\nCREATE TABLE On_Call (\n Nurse INTEGER NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL,\n OnCallStart DATETIME NOT NULL,\n OnCallEnd DATETIME NOT NULL,\n PRIMARY KEY(Nurse, BlockFloor, BlockCode, OnCallStart, OnCallEnd),\n CONSTRAINT fk_OnCall_Nurse_EmployeeID FOREIGN KEY(Nurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_OnCall_Block_Floor FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode) \n);\nCREATE TABLE Patient (\n SSN INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Address VARCHAR(30) NOT NULL,\n Phone VARCHAR(30) NOT NULL,\n InsuranceID INTEGER NOT NULL,\n PCP INTEGER NOT NULL,\n CONSTRAINT fk_Patient_Physician_EmployeeID FOREIGN KEY(PCP) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Physician (\n EmployeeID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n SSN INTEGER NOT NULL,\n CONSTRAINT pk_physician PRIMARY KEY(EmployeeID)\n);\nCREATE TABLE Prescribes (\n Physician INTEGER NOT NULL,\n Patient INTEGER NOT NULL, \n Medication INTEGER NOT NULL, \n Date DATETIME NOT NULL,\n Appointment INTEGER, \n Dose VARCHAR(30) NOT NULL,\n PRIMARY KEY(Physician, Patient, Medication, Date),\n CONSTRAINT fk_Prescribes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Prescribes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Prescribes_Medication_Code FOREIGN KEY(Medication) REFERENCES Medication(Code),\n CONSTRAINT fk_Prescribes_Appointment_AppointmentID FOREIGN KEY(Appointment) REFERENCES Appointment(AppointmentID)\n);\nCREATE TABLE Procedures (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Cost REAL NOT NULL\n);\nCREATE TABLE Room (\n RoomNumber INTEGER PRIMARY KEY NOT NULL,\n RoomType VARCHAR(30) NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL, \n Unavailable BOOLEAN NOT NULL,\n CONSTRAINT fk_Room_Block_PK FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode)\n);\nCREATE TABLE Stay (\n StayID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL,\n Room INTEGER NOT NULL,\n StayStart DATETIME NOT NULL,\n StayEnd DATETIME NOT NULL,\n CONSTRAINT fk_Stay_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Stay_Room_Number FOREIGN KEY(Room) REFERENCES Room(RoomNumber)\n);\nCREATE TABLE Trained_In (\n Physician INTEGER NOT NULL,\n Treatment INTEGER NOT NULL,\n CertificationDate DATETIME NOT NULL,\n CertificationExpires DATETIME NOT NULL,\n CONSTRAINT fk_Trained_In_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Trained_In_Procedures_Code FOREIGN KEY(Treatment) REFERENCES Procedures(Code),\n PRIMARY KEY(Physician, Treatment)\n);\nCREATE TABLE Undergoes (\n Patient INTEGER NOT NULL,\n Procedures INTEGER NOT NULL,\n Stay INTEGER NOT NULL,\n DateUndergoes DATETIME NOT NULL,\n Physician INTEGER NOT NULL,\n AssistingNurse INTEGER,\n PRIMARY KEY(Patient, Procedures, Stay, DateUndergoes),\n CONSTRAINT fk_Undergoes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Undergoes_Procedures_Code FOREIGN KEY(Procedures) REFERENCES Procedures(Code),\n CONSTRAINT fk_Undergoes_Stay_StayID FOREIGN KEY(Stay) REFERENCES Stay(StayID),\n CONSTRAINT fk_Undergoes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Undergoes_Nurse_EmployeeID FOREIGN KEY(AssistingNurse) REFERENCES Nurse(EmployeeID)\n);"} +{"qid": "pool_0026", "split": "pool", "db_id": "apartment_rentals", "question": "What are the start date and end date of the apartment bookings made by female guests (gender code \"Female\")?", "gold_sql": "SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = \"Female\"", "db_path": "databases/apartment_rentals/apartment_rentals.sqlite", "schema": "CREATE TABLE Apartment_Bookings (\napt_booking_id INTEGER NOT NULL,\napt_id INTEGER,\nguest_id INTEGER NOT NULL,\nbooking_status_code CHAR(15) NOT NULL,\nbooking_start_date DATETIME,\nbooking_end_date DATETIME,\nPRIMARY KEY (apt_booking_id),\nUNIQUE (apt_booking_id),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (guest_id) REFERENCES Guests (guest_id)\n);\nCREATE TABLE Apartment_Buildings (\nbuilding_id INTEGER NOT NULL,\nbuilding_short_name CHAR(15),\nbuilding_full_name VARCHAR(80),\nbuilding_description VARCHAR(255),\nbuilding_address VARCHAR(255),\nbuilding_manager VARCHAR(50),\nbuilding_phone VARCHAR(80),\nPRIMARY KEY (building_id),\nUNIQUE (building_id)\n);\nCREATE TABLE Apartment_Facilities (\napt_id INTEGER NOT NULL,\nfacility_code CHAR(15) NOT NULL,\nPRIMARY KEY (apt_id, facility_code),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id)\n);\nCREATE TABLE Apartments (\napt_id INTEGER NOT NULL ,\nbuilding_id INTEGER NOT NULL,\napt_type_code CHAR(15),\napt_number CHAR(10),\nbathroom_count INTEGER,\nbedroom_count INTEGER,\nroom_count CHAR(5),\nPRIMARY KEY (apt_id),\nUNIQUE (apt_id),\nFOREIGN KEY (building_id) REFERENCES Apartment_Buildings (building_id)\n);\nCREATE TABLE Guests (\nguest_id INTEGER NOT NULL ,\ngender_code CHAR(1),\nguest_first_name VARCHAR(80),\nguest_last_name VARCHAR(80),\ndate_of_birth DATETIME,\nPRIMARY KEY (guest_id),\nUNIQUE (guest_id)\n);\nCREATE TABLE View_Unit_Status (\napt_id INTEGER,\napt_booking_id INTEGER,\nstatus_date DATETIME NOT NULL,\navailable_yn BIT,\nPRIMARY KEY (status_date),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings (apt_booking_id)\n);"} +{"qid": "pool_0027", "split": "pool", "db_id": "game_injury", "question": "Find the id and name of the stadium where the largest number of injury accidents occurred.", "gold_sql": "SELECT T1.id , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/game_injury/game_injury.sqlite", "schema": "CREATE TABLE \"game\" (\n\"stadium_id\" int,\n\"id\" int,\n\"Season\" int,\n\"Date\" text,\n\"Home_team\" text,\n\"Away_team\" text,\n\"Score\" text,\n\"Competition\" text,\nprimary key (\"id\"),\nforeign key (\"stadium_id\") references `stadium`(\"id\")\n);\nCREATE TABLE \"injury_accident\" (\n\"game_id\" int,\n\"id\" int,\n\"Player\" text,\n\"Injury\" text,\n\"Number_of_matches\" text,\n\"Source\" text,\nprimary key (\"id\"),\nforeign key (\"game_id\") references `game`(\"id\")\n);\nCREATE TABLE \"stadium\" (\n\"id\" int,\n\"name\" text,\n\"Home_Games\" int,\n\"Average_Attendance\" real,\n\"Total_Attendance\" real,\n\"Capacity_Percentage\" real,\nprimary key (\"id\")\n);"} +{"qid": "pool_0028", "split": "pool", "db_id": "soccer_2", "question": "What are the different states that have students trying out?", "gold_sql": "SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName", "db_path": "databases/soccer_2/soccer_2.sqlite", "schema": "CREATE TABLE College \n ( cName \tvarchar(20) NOT NULL,\n state \tvarchar(2),\n enr \tnumeric(5,0),\n PRIMARY KEY (cName)\n );\nCREATE TABLE Player\n ( pID\t\t\tnumeric(5,0) NOT NULL,\n \tpName \tvarchar(20),\n yCard \tvarchar(3),\n HS \tnumeric(5,0),\n PRIMARY KEY (pID)\n );\nCREATE TABLE Tryout\n ( pID\t\t\tnumeric(5,0),\n \tcName \tvarchar(20),\n pPos \tvarchar(8),\n decision varchar(3),\n PRIMARY KEY (pID, cName),\n FOREIGN KEY (pID) REFERENCES Player(pID),\n FOREIGN KEY (cName) REFERENCES College(cName)\n );"} +{"qid": "pool_0029", "split": "pool", "db_id": "hospital_1", "question": "Find all procedures which cost more than 1000 or which physician John Wen was trained in.", "gold_sql": "SELECT name FROM procedures WHERE cost > 1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "db_path": "databases/hospital_1/hospital_1.sqlite", "schema": "CREATE TABLE Affiliated_With (\n Physician INTEGER NOT NULL,\n Department INTEGER NOT NULL,\n PrimaryAffiliation BOOLEAN NOT NULL,\n CONSTRAINT fk_Affiliated_With_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Affiliated_With_Department_DepartmentID FOREIGN KEY(Department) REFERENCES Department(DepartmentID),\n PRIMARY KEY(Physician, Department)\n);\nCREATE TABLE Appointment (\n AppointmentID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL, \n PrepNurse INTEGER,\n Physician INTEGER NOT NULL,\n Start DATETIME NOT NULL,\n End DATETIME NOT NULL,\n ExaminationRoom TEXT NOT NULL,\n CONSTRAINT fk_Appointment_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Appointment_Nurse_EmployeeID FOREIGN KEY(PrepNurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_Appointment_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Block (\n BlockFloor INTEGER NOT NULL,\n BlockCode INTEGER NOT NULL,\n PRIMARY KEY(BlockFloor, BlockCode)\n);\nCREATE TABLE Department (\n DepartmentID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Head INTEGER NOT NULL,\n CONSTRAINT pk_Department PRIMARY KEY(DepartmentID),\n CONSTRAINT fk_Department_Physician_EmployeeID FOREIGN KEY(Head) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Medication (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Brand VARCHAR(30) NOT NULL,\n Description VARCHAR(30) NOT NULL\n);\nCREATE TABLE Nurse (\n EmployeeID INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n Registered BOOLEAN NOT NULL,\n SSN INTEGER NOT NULL\n);\nCREATE TABLE On_Call (\n Nurse INTEGER NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL,\n OnCallStart DATETIME NOT NULL,\n OnCallEnd DATETIME NOT NULL,\n PRIMARY KEY(Nurse, BlockFloor, BlockCode, OnCallStart, OnCallEnd),\n CONSTRAINT fk_OnCall_Nurse_EmployeeID FOREIGN KEY(Nurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_OnCall_Block_Floor FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode) \n);\nCREATE TABLE Patient (\n SSN INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Address VARCHAR(30) NOT NULL,\n Phone VARCHAR(30) NOT NULL,\n InsuranceID INTEGER NOT NULL,\n PCP INTEGER NOT NULL,\n CONSTRAINT fk_Patient_Physician_EmployeeID FOREIGN KEY(PCP) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Physician (\n EmployeeID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n SSN INTEGER NOT NULL,\n CONSTRAINT pk_physician PRIMARY KEY(EmployeeID)\n);\nCREATE TABLE Prescribes (\n Physician INTEGER NOT NULL,\n Patient INTEGER NOT NULL, \n Medication INTEGER NOT NULL, \n Date DATETIME NOT NULL,\n Appointment INTEGER, \n Dose VARCHAR(30) NOT NULL,\n PRIMARY KEY(Physician, Patient, Medication, Date),\n CONSTRAINT fk_Prescribes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Prescribes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Prescribes_Medication_Code FOREIGN KEY(Medication) REFERENCES Medication(Code),\n CONSTRAINT fk_Prescribes_Appointment_AppointmentID FOREIGN KEY(Appointment) REFERENCES Appointment(AppointmentID)\n);\nCREATE TABLE Procedures (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Cost REAL NOT NULL\n);\nCREATE TABLE Room (\n RoomNumber INTEGER PRIMARY KEY NOT NULL,\n RoomType VARCHAR(30) NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL, \n Unavailable BOOLEAN NOT NULL,\n CONSTRAINT fk_Room_Block_PK FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode)\n);\nCREATE TABLE Stay (\n StayID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL,\n Room INTEGER NOT NULL,\n StayStart DATETIME NOT NULL,\n StayEnd DATETIME NOT NULL,\n CONSTRAINT fk_Stay_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Stay_Room_Number FOREIGN KEY(Room) REFERENCES Room(RoomNumber)\n);\nCREATE TABLE Trained_In (\n Physician INTEGER NOT NULL,\n Treatment INTEGER NOT NULL,\n CertificationDate DATETIME NOT NULL,\n CertificationExpires DATETIME NOT NULL,\n CONSTRAINT fk_Trained_In_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Trained_In_Procedures_Code FOREIGN KEY(Treatment) REFERENCES Procedures(Code),\n PRIMARY KEY(Physician, Treatment)\n);\nCREATE TABLE Undergoes (\n Patient INTEGER NOT NULL,\n Procedures INTEGER NOT NULL,\n Stay INTEGER NOT NULL,\n DateUndergoes DATETIME NOT NULL,\n Physician INTEGER NOT NULL,\n AssistingNurse INTEGER,\n PRIMARY KEY(Patient, Procedures, Stay, DateUndergoes),\n CONSTRAINT fk_Undergoes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Undergoes_Procedures_Code FOREIGN KEY(Procedures) REFERENCES Procedures(Code),\n CONSTRAINT fk_Undergoes_Stay_StayID FOREIGN KEY(Stay) REFERENCES Stay(StayID),\n CONSTRAINT fk_Undergoes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Undergoes_Nurse_EmployeeID FOREIGN KEY(AssistingNurse) REFERENCES Nurse(EmployeeID)\n);"} +{"qid": "pool_0030", "split": "pool", "db_id": "college_2", "question": "Count the number of rooms in Lamberton with capacity lower than 50.", "gold_sql": "SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50", "db_path": "databases/college_2/college_2.sqlite", "schema": "CREATE TABLE advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);\nCREATE TABLE course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );\nCREATE TABLE department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);\nCREATE TABLE instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);\nCREATE TABLE section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);\nCREATE TABLE student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);"} +{"qid": "pool_0031", "split": "pool", "db_id": "restaurant_1", "question": "Which major has least number of students? List the major and the number of students.", "gold_sql": "SELECT Major , count(*) FROM Student GROUP BY Major ORDER BY count(Major) ASC LIMIT 1;", "db_path": "databases/restaurant_1/restaurant_1.sqlite", "schema": "CREATE TABLE Restaurant (\n ResID INTEGER PRIMARY KEY,\n ResName VARCHAR(100),\n Address VARCHAR(100),\n Rating INTEGER\n);\nCREATE TABLE Restaurant_Type (\n ResTypeID INTEGER PRIMARY KEY,\n ResTypeName VARCHAR(40),\n ResTypeDescription VARCHAR(100)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );\nCREATE TABLE Type_Of_Restaurant (\n ResID INTEGER,\n ResTypeID INTEGER,\n FOREIGN KEY(ResID) REFERENCES Restaurant(ResID),\n FOREIGN KEY(ResTypeID) REFERENCES Restaurant_Type(ResTypeID)\n);\nCREATE TABLE Visits_Restaurant (\n StuID INTEGER,\n ResID INTEGER,\n Time TIMESTAMP,\n Spent FLOAT,\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(ResID) REFERENCES Restaurant(ResID)\n);"} +{"qid": "pool_0032", "split": "pool", "db_id": "loan_1", "question": "Find the total amount of loans offered by each bank branch.", "gold_sql": "SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname", "db_path": "databases/loan_1/loan_1.sqlite", "schema": "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));\nCREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));\nCREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));"} +{"qid": "pool_0033", "split": "pool", "db_id": "chinook_1", "question": "What are the names and ids of the different albums, and how many tracks are on each?", "gold_sql": "SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID", "db_path": "databases/chinook_1/chinook_1.sqlite", "schema": "CREATE TABLE `Album` (\n `AlbumId` integer NOT NULL\n, `Title` varchar(160) NOT NULL\n, `ArtistId` integer NOT NULL\n, PRIMARY KEY (`AlbumId`)\n, CONSTRAINT `FK_AlbumArtistId` FOREIGN KEY (`ArtistId`) REFERENCES `Artist` (`ArtistId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Artist` (\n `ArtistId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`ArtistId`)\n);\nCREATE TABLE `Customer` (\n `CustomerId` integer NOT NULL\n, `FirstName` varchar(40) NOT NULL\n, `LastName` varchar(20) NOT NULL\n, `Company` varchar(80) DEFAULT NULL\n, `Address` varchar(70) DEFAULT NULL\n, `City` varchar(40) DEFAULT NULL\n, `State` varchar(40) DEFAULT NULL\n, `Country` varchar(40) DEFAULT NULL\n, `PostalCode` varchar(10) DEFAULT NULL\n, `Phone` varchar(24) DEFAULT NULL\n, `Fax` varchar(24) DEFAULT NULL\n, `Email` varchar(60) NOT NULL\n, `SupportRepId` integer DEFAULT NULL\n, PRIMARY KEY (`CustomerId`)\n, CONSTRAINT `FK_CustomerSupportRepId` FOREIGN KEY (`SupportRepId`) REFERENCES `Employee` (`EmployeeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Employee` (\n `EmployeeId` integer NOT NULL\n, `LastName` varchar(20) NOT NULL\n, `FirstName` varchar(20) NOT NULL\n, `Title` varchar(30) DEFAULT NULL\n, `ReportsTo` integer DEFAULT NULL\n, `BirthDate` datetime DEFAULT NULL\n, `HireDate` datetime DEFAULT NULL\n, `Address` varchar(70) DEFAULT NULL\n, `City` varchar(40) DEFAULT NULL\n, `State` varchar(40) DEFAULT NULL\n, `Country` varchar(40) DEFAULT NULL\n, `PostalCode` varchar(10) DEFAULT NULL\n, `Phone` varchar(24) DEFAULT NULL\n, `Fax` varchar(24) DEFAULT NULL\n, `Email` varchar(60) DEFAULT NULL\n, PRIMARY KEY (`EmployeeId`)\n, CONSTRAINT `FK_EmployeeReportsTo` FOREIGN KEY (`ReportsTo`) REFERENCES `Employee` (`EmployeeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Genre` (\n `GenreId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`GenreId`)\n);\nCREATE TABLE `Invoice` (\n `InvoiceId` integer NOT NULL\n, `CustomerId` integer NOT NULL\n, `InvoiceDate` datetime NOT NULL\n, `BillingAddress` varchar(70) DEFAULT NULL\n, `BillingCity` varchar(40) DEFAULT NULL\n, `BillingState` varchar(40) DEFAULT NULL\n, `BillingCountry` varchar(40) DEFAULT NULL\n, `BillingPostalCode` varchar(10) DEFAULT NULL\n, `Total` decimal(10,2) NOT NULL\n, PRIMARY KEY (`InvoiceId`)\n, CONSTRAINT `FK_InvoiceCustomerId` FOREIGN KEY (`CustomerId`) REFERENCES `Customer` (`CustomerId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `InvoiceLine` (\n `InvoiceLineId` integer NOT NULL\n, `InvoiceId` integer NOT NULL\n, `TrackId` integer NOT NULL\n, `UnitPrice` decimal(10,2) NOT NULL\n, `Quantity` integer NOT NULL\n, PRIMARY KEY (`InvoiceLineId`)\n, CONSTRAINT `FK_InvoiceLineInvoiceId` FOREIGN KEY (`InvoiceId`) REFERENCES `Invoice` (`InvoiceId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_InvoiceLineTrackId` FOREIGN KEY (`TrackId`) REFERENCES `Track` (`TrackId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `MediaType` (\n `MediaTypeId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`MediaTypeId`)\n);\nCREATE TABLE `Playlist` (\n `PlaylistId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`PlaylistId`)\n);\nCREATE TABLE `PlaylistTrack` (\n `PlaylistId` integer NOT NULL\n, `TrackId` integer NOT NULL\n, PRIMARY KEY (`PlaylistId`,`TrackId`)\n, CONSTRAINT `FK_PlaylistTrackPlaylistId` FOREIGN KEY (`PlaylistId`) REFERENCES `Playlist` (`PlaylistId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_PlaylistTrackTrackId` FOREIGN KEY (`TrackId`) REFERENCES `Track` (`TrackId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Track` (\n `TrackId` integer NOT NULL\n, `Name` varchar(200) NOT NULL\n, `AlbumId` integer DEFAULT NULL\n, `MediaTypeId` integer NOT NULL\n, `GenreId` integer DEFAULT NULL\n, `Composer` varchar(220) DEFAULT NULL\n, `Milliseconds` integer NOT NULL\n, `Bytes` integer DEFAULT NULL\n, `UnitPrice` decimal(10,2) NOT NULL\n, PRIMARY KEY (`TrackId`)\n, CONSTRAINT `FK_TrackAlbumId` FOREIGN KEY (`AlbumId`) REFERENCES `Album` (`AlbumId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_TrackGenreId` FOREIGN KEY (`GenreId`) REFERENCES `Genre` (`GenreId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_TrackMediaTypeId` FOREIGN KEY (`MediaTypeId`) REFERENCES `MediaType` (`MediaTypeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);"} +{"qid": "pool_0034", "split": "pool", "db_id": "customers_and_invoices", "question": "What is the invoice number and invoice date corresponding to the invoice with the greatest number of transactions?", "gold_sql": "SELECT T2.invoice_number , T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/customers_and_invoices/customers_and_invoices.sqlite", "schema": "CREATE TABLE `Accounts` (\n`account_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`date_account_opened` DATETIME,\n`account_name` VARCHAR(50),\n`other_account_details` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_first_name` VARCHAR(50),\n`customer_middle_initial` VARCHAR(1),\n`customer_last_name` VARCHAR(50),\n`gender` VARCHAR(1),\n`email_address` VARCHAR(255),\n`login_name` VARCHAR(80),\n`login_password` VARCHAR(20),\n`phone_number` VARCHAR(255),\n`town_city` VARCHAR(50),\n`state_county_province` VARCHAR(50),\n`country` VARCHAR(50)\n);\nCREATE TABLE `Financial_Transactions` (\n`transaction_id` INTEGER NOT NULL ,\n`account_id` INTEGER NOT NULL,\n`invoice_number` INTEGER,\n`transaction_type` VARCHAR(15) NOT NULL,\n`transaction_date` DATETIME,\n`transaction_amount` DECIMAL(19,4),\n`transaction_comment` VARCHAR(255),\n`other_transaction_details` VARCHAR(255),\nFOREIGN KEY (`invoice_number` ) REFERENCES `Invoices`(`invoice_number` ),\nFOREIGN KEY (`account_id` ) REFERENCES `Accounts`(`account_id` )\n);\nCREATE TABLE `Invoice_Line_Items` (\n`order_item_id` INTEGER NOT NULL,\n`invoice_number` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\n`product_title` VARCHAR(80),\n`product_quantity` VARCHAR(50),\n`product_price` DECIMAL(19,4),\n`derived_product_cost` DECIMAL(19,4),\n`derived_vat_payable` DECIMAL(19,4),\n`derived_total_cost` DECIMAL(19,4),\nFOREIGN KEY (`order_item_id` ) REFERENCES `Order_Items`(`order_item_id` ),\nFOREIGN KEY (`invoice_number` ) REFERENCES `Invoices`(`invoice_number` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Invoices` (\n`invoice_number` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`invoice_date` DATETIME,\nFOREIGN KEY (`order_id` ) REFERENCES `Orders`(`order_id` )\n);\nCREATE TABLE `Order_Items` (\n`order_item_id` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\n`product_quantity` VARCHAR(50),\n`other_order_item_details` VARCHAR(255),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`order_id` ) REFERENCES `Orders`(`order_id` )\n);\nCREATE TABLE `Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`date_order_placed` DATETIME NOT NULL,\n`order_details` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Product_Categories` (\n`production_type_code` VARCHAR(15) PRIMARY KEY,\n`product_type_description` VARCHAR(80),\n`vat_rating` DECIMAL(19,4)\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`production_type_code` VARCHAR(15) NOT NULL,\n`unit_price` DECIMAL(19,4),\n`product_name` VARCHAR(80),\n`product_color` VARCHAR(20),\n`product_size` VARCHAR(20),\nFOREIGN KEY (`production_type_code` ) REFERENCES `Product_Categories`(`production_type_code` )\n);"} +{"qid": "pool_0035", "split": "pool", "db_id": "college_2", "question": "Find the title of course that is provided by Statistics but not Psychology departments.", "gold_sql": "SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'", "db_path": "databases/college_2/college_2.sqlite", "schema": "CREATE TABLE advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);\nCREATE TABLE course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );\nCREATE TABLE department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);\nCREATE TABLE instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);\nCREATE TABLE section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);\nCREATE TABLE student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);"} +{"qid": "pool_0036", "split": "pool", "db_id": "network_2", "question": "What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time?", "gold_sql": "SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')", "db_path": "databases/network_2/network_2.sqlite", "schema": "CREATE TABLE Person (\n name varchar(20) PRIMARY KEY,\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n);\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER,\n FOREIGN KEY (name) REFERENCES Person(name),\n FOREIGN KEY (friend) REFERENCES Person(name)\n);"} +{"qid": "pool_0037", "split": "pool", "db_id": "theme_gallery", "question": "What are the names of artist whose exhibitions draw over 200 attendees on average?", "gold_sql": "SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING avg(T1.attendance) > 200", "db_path": "databases/theme_gallery/theme_gallery.sqlite", "schema": "CREATE TABLE \"artist\" (\n\"Artist_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Year_Join\" int,\n\"Age\" int,\nPRIMARY KEY (\"Artist_ID\")\n);\nCREATE TABLE \"exhibition\" (\n\"Exhibition_ID\" int,\n\"Year\" int,\n\"Theme\" text,\n\"Artist_ID\" int,\n\"Ticket_Price\" real,\nPRIMARY KEY (\"Exhibition_ID\"),\nFOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)\n);\nCREATE TABLE \"exhibition_record\" (\n\"Exhibition_ID\" int,\n\"Date\" text,\n\"Attendance\" int,\nPRIMARY KEY (\"Exhibition_ID\",\"Date\"),\nFOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`)\n);"} +{"qid": "pool_0038", "split": "pool", "db_id": "e_learning", "question": "Find the student ID and personal name of the student with at least two enrollments.", "gold_sql": "SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2", "db_path": "databases/e_learning/e_learning.sqlite", "schema": "CREATE TABLE `Course_Authors_and_Tutors` (\n`author_id` INTEGER PRIMARY KEY,\n`author_tutor_ATB` VARCHAR(3),\n`login_name` VARCHAR(40),\n`password` VARCHAR(40),\n`personal_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`family_name` VARCHAR(80),\n`gender_mf` VARCHAR(1),\n`address_line_1` VARCHAR(80)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`author_id` INTEGER NOT NULL,\n`subject_id` INTEGER NOT NULL,\n`course_name` VARCHAR(120),\n`course_description` VARCHAR(255),\nFOREIGN KEY (`author_id` ) REFERENCES `Course_Authors_and_Tutors`(`author_id` ),\nFOREIGN KEY (`subject_id` ) REFERENCES `Subjects`(`subject_id` )\n);\nCREATE TABLE `Student_Course_Enrolment` (\n`registration_id` INTEGER PRIMARY KEY,\n`student_id` INTEGER NOT NULL,\n`course_id` INTEGER NOT NULL,\n`date_of_enrolment` DATETIME NOT NULL,\n`date_of_completion` DATETIME NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Tests_Taken` (\n`registration_id` INTEGER NOT NULL,\n`date_test_taken` DATETIME NOT NULL,\n`test_result` VARCHAR(255),\nFOREIGN KEY (`registration_id` ) REFERENCES `Student_Course_Enrolment`(`registration_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`date_of_registration` DATETIME,\n`date_of_latest_logon` DATETIME,\n`login_name` VARCHAR(40),\n`password` VARCHAR(10),\n`personal_name` VARCHAR(40),\n`middle_name` VARCHAR(40),\n`family_name` VARCHAR(40)\n);\nCREATE TABLE `Subjects` (\n`subject_id` INTEGER PRIMARY KEY,\n`subject_name` VARCHAR(120)\n);"} +{"qid": "pool_0039", "split": "pool", "db_id": "architecture", "question": "What are the distinct names and nationalities of the architects who have ever built a mill?", "gold_sql": "SELECT DISTINCT T1.name , T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id = T2.architect_id", "db_path": "databases/architecture/architecture.sqlite", "schema": "CREATE TABLE \"architect\" (\n\"id\" text,\n\"name\" text,\n\"nationality\" text,\n\"gender\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"bridge\" (\n\"architect_id\" int,\n\"id\" int,\n\"name\" text,\n\"location\" text,\n\"length_meters\" real,\n\"length_feet\" real,\nprimary key(\"id\"),\nforeign key (\"architect_id\" ) references `architect`(\"id\")\n);\nCREATE TABLE \"mill\" (\n\"architect_id\" int,\n\"id\" int,\n\"location\" text,\n\"name\" text,\n\"type\" text,\n\"built_year\" int,\n\"notes\" text,\nprimary key (\"id\"),\nforeign key (\"architect_id\" ) references `architect`(\"id\")\n);"} +{"qid": "pool_0040", "split": "pool", "db_id": "mountain_photos", "question": "What are the average prominence of the mountains in country 'Morocco'?", "gold_sql": "SELECT avg(prominence) FROM mountain WHERE country = 'Morocco'", "db_path": "databases/mountain_photos/mountain_photos.sqlite", "schema": "CREATE TABLE \"camera_lens\" (\n\"id\" int,\n\"brand\" text,\n\"name\" text,\n\"focal_length_mm\" real,\n\"max_aperture\" real,\nprimary key(\"id\")\n);\nCREATE TABLE \"mountain\" (\n\"id\" int,\n\"name\" text,\n\"Height\" real,\n\"Prominence\" real,\n\"Range\" text,\n\"Country\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"photos\" (\n\"id\" int, \n\"camera_lens_id\" int,\n\"mountain_id\" int,\n\"color\" text, \n\"name\" text,\nprimary key(\"id\"),\nforeign key(\"camera_lens_id\") references `camera_lens`(\"id\"),\nforeign key(\"mountain_id\") references `mountain`(\"id\")\n);"} +{"qid": "pool_0041", "split": "pool", "db_id": "college_2", "question": "What are the names of students who took a course in the Fall of 2003?", "gold_sql": "SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)", "db_path": "databases/college_2/college_2.sqlite", "schema": "CREATE TABLE advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);\nCREATE TABLE course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );\nCREATE TABLE department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);\nCREATE TABLE instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);\nCREATE TABLE section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);\nCREATE TABLE student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);"} +{"qid": "pool_0042", "split": "pool", "db_id": "cre_Drama_Workshop_Groups", "question": "Find the payment method that is used the most often in all the invoices. Give me its code.", "gold_sql": "SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite", "schema": "CREATE TABLE Addresses (\nAddress_ID VARCHAR(100) NOT NULL,\nLine_1 VARCHAR(255),\nLine_2 VARCHAR(255),\nCity_Town VARCHAR(255),\nState_County VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Address_ID),\nUNIQUE (Address_ID)\n);\nCREATE TABLE Bookings (\nBooking_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nWorkshop_Group_ID VARCHAR(100) NOT NULL,\nStatus_Code CHAR(15) NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Booking_ID),\nUNIQUE (Booking_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Clients (Client_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID)\n);\nCREATE TABLE Bookings_Services (\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Product_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (Product_ID) REFERENCES Services (Service_ID)\n);\nCREATE TABLE Clients (\nClient_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Email_Address VARCHAR(255),\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Client_ID),\nUNIQUE (Client_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Customer_Orders (\nOrder_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Order_ID),\nUNIQUE (Order_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Store_ID) REFERENCES Stores (Store_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Customer_ID),\nUNIQUE (Customer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Drama_Workshop_Groups (\nWorkshop_Group_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCurrency_Code CHAR(15) NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Workshop_Group_ID),\nUNIQUE (Workshop_Group_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Invoice_Items (\nInvoice_Item_ID INTEGER NOT NULL ,\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\nOrder_Item_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity INTEGER,\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Invoice_Item_ID),\nFOREIGN KEY (Order_Item_ID) REFERENCES Order_Items (Order_Item_ID),\nFOREIGN KEY (Invoice_ID) REFERENCES Invoices (Invoice_ID),\nFOREIGN KEY (Order_ID, Product_ID) REFERENCES Bookings_Services (Order_ID,Product_ID)\n);\nCREATE TABLE Invoices (\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\npayment_method_code CHAR(15),\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nOrder_Item_ID INTEGER NOT NULL,\nPRIMARY KEY (Invoice_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (payment_method_code) REFERENCES Ref_Payment_Methods (payment_method_code)\n);\nCREATE TABLE Marketing_Regions (\nMarketing_Region_Code CHAR(15) NOT NULL,\nMarketing_Region_Name VARCHAR(255) NOT NULL,\nMarketing_Region_Descriptrion VARCHAR(255) NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Marketing_Region_Code),\nUNIQUE (Marketing_Region_Code)\n);\nCREATE TABLE Order_Items (\nOrder_Item_ID INTEGER NOT NULL ,\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Order_Item_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Product_ID) REFERENCES Products (Product_ID)\n);\nCREATE TABLE Performers (\nPerformer_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Performer_ID),\nUNIQUE (Performer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Performers_in_Bookings (\nOrder_ID INTEGER NOT NULL,\nPerformer_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Performer_ID),\nFOREIGN KEY (Performer_ID) REFERENCES Performers (Performer_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID)\n);\nCREATE TABLE Products (\nProduct_ID VARCHAR(100) NOT NULL,\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nProduct_Description VARCHAR(255),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Product_ID),\nUNIQUE (Product_ID)\n);\nCREATE TABLE Ref_Payment_Methods (\npayment_method_code CHAR(10) NOT NULL,\npayment_method_description VARCHAR(80),\nPRIMARY KEY (payment_method_code),\nUNIQUE (payment_method_code)\n);\nCREATE TABLE Ref_Service_Types (\nService_Type_Code CHAR(15) NOT NULL,\nParent_Service_Type_Code CHAR(15),\nService_Type_Description VARCHAR(255),\nPRIMARY KEY (Service_Type_Code),\nUNIQUE (Service_Type_Code)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15),\nWorkshop_Group_ID INTEGER NOT NULL,\nProduct_Description VARCHAR(255),\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Service_ID),\nUNIQUE (Service_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID),\nFOREIGN KEY (Service_Type_Code) REFERENCES Ref_Service_Types (Service_Type_Code)\n);\nCREATE TABLE Stores (\nStore_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Store_ID),\nUNIQUE (Store_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID),\nFOREIGN KEY (Marketing_Region_Code) REFERENCES Marketing_Regions (Marketing_Region_Code)\n);"} +{"qid": "pool_0043", "split": "pool", "db_id": "protein_institute", "question": "What are the average, maximum, and minimum number of floors for all buildings?", "gold_sql": "SELECT avg(floors) , max(floors) , min(floors) FROM building", "db_path": "databases/protein_institute/protein_institute.sqlite", "schema": "CREATE TABLE \"Institution\" (\n\"Institution_id\" text,\n\"Institution\" text,\n\"Location\" text,\n\"Founded\" real,\n\"Type\" text,\n\"Enrollment\" int,\n\"Team\" text,\n\"Primary_Conference\" text,\n\"building_id\" text,\nPRIMARY KEY(\"Institution_id\"),\nFOREIGN KEY (\"building_id\") REFERENCES \"building\"(\"building_id\")\n);\nCREATE TABLE \"building\" (\n\"building_id\" text,\n\"Name\" text,\n\"Street_address\" text,\n\"Years_as_tallest\" text,\n\"Height_feet\" int,\n\"Floors\" int,\nPRIMARY KEY(\"building_id\")\n);\nCREATE TABLE \"protein\" (\n\"common_name\" text,\n\"protein_name\" text,\n\"divergence_from_human_lineage\" real,\n\"accession_number\" text,\n\"sequence_length\" real,\n\"sequence_identity_to_human_protein\" text,\n\"Institution_id\" text,\nPRIMARY KEY(\"common_name\"),\nFOREIGN KEY(\"Institution_id\") REFERENCES \"Institution\"(\"Institution_id\")\n);"} +{"qid": "pool_0044", "split": "pool", "db_id": "apartment_rentals", "question": "Give me a list of all the distinct building descriptions.", "gold_sql": "SELECT DISTINCT building_description FROM Apartment_Buildings", "db_path": "databases/apartment_rentals/apartment_rentals.sqlite", "schema": "CREATE TABLE Apartment_Bookings (\napt_booking_id INTEGER NOT NULL,\napt_id INTEGER,\nguest_id INTEGER NOT NULL,\nbooking_status_code CHAR(15) NOT NULL,\nbooking_start_date DATETIME,\nbooking_end_date DATETIME,\nPRIMARY KEY (apt_booking_id),\nUNIQUE (apt_booking_id),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (guest_id) REFERENCES Guests (guest_id)\n);\nCREATE TABLE Apartment_Buildings (\nbuilding_id INTEGER NOT NULL,\nbuilding_short_name CHAR(15),\nbuilding_full_name VARCHAR(80),\nbuilding_description VARCHAR(255),\nbuilding_address VARCHAR(255),\nbuilding_manager VARCHAR(50),\nbuilding_phone VARCHAR(80),\nPRIMARY KEY (building_id),\nUNIQUE (building_id)\n);\nCREATE TABLE Apartment_Facilities (\napt_id INTEGER NOT NULL,\nfacility_code CHAR(15) NOT NULL,\nPRIMARY KEY (apt_id, facility_code),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id)\n);\nCREATE TABLE Apartments (\napt_id INTEGER NOT NULL ,\nbuilding_id INTEGER NOT NULL,\napt_type_code CHAR(15),\napt_number CHAR(10),\nbathroom_count INTEGER,\nbedroom_count INTEGER,\nroom_count CHAR(5),\nPRIMARY KEY (apt_id),\nUNIQUE (apt_id),\nFOREIGN KEY (building_id) REFERENCES Apartment_Buildings (building_id)\n);\nCREATE TABLE Guests (\nguest_id INTEGER NOT NULL ,\ngender_code CHAR(1),\nguest_first_name VARCHAR(80),\nguest_last_name VARCHAR(80),\ndate_of_birth DATETIME,\nPRIMARY KEY (guest_id),\nUNIQUE (guest_id)\n);\nCREATE TABLE View_Unit_Status (\napt_id INTEGER,\napt_booking_id INTEGER,\nstatus_date DATETIME NOT NULL,\navailable_yn BIT,\nPRIMARY KEY (status_date),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings (apt_booking_id)\n);"} +{"qid": "pool_0045", "split": "pool", "db_id": "climbing", "question": "List the distinct ranges of the mountains with the top 3 prominence.", "gold_sql": "SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3", "db_path": "databases/climbing/climbing.sqlite", "schema": "CREATE TABLE \"climber\" (\n\"Climber_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Time\" text,\n\"Points\" real,\n\"Mountain_ID\" int,\nPRIMARY KEY (\"Climber_ID\"),\nFOREIGN KEY (\"Mountain_ID\") REFERENCES \"mountain\"(\"Mountain_ID\")\n);\nCREATE TABLE \"mountain\" (\n\"Mountain_ID\" int,\n\"Name\" text,\n\"Height\" real,\n\"Prominence\" real,\n\"Range\" text,\n\"Country\" text,\nPRIMARY KEY (\"Mountain_ID\")\n);"} +{"qid": "pool_0046", "split": "pool", "db_id": "e_learning", "question": "List the addresses of all the course authors or tutors.", "gold_sql": "SELECT address_line_1 FROM Course_Authors_and_Tutors", "db_path": "databases/e_learning/e_learning.sqlite", "schema": "CREATE TABLE `Course_Authors_and_Tutors` (\n`author_id` INTEGER PRIMARY KEY,\n`author_tutor_ATB` VARCHAR(3),\n`login_name` VARCHAR(40),\n`password` VARCHAR(40),\n`personal_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`family_name` VARCHAR(80),\n`gender_mf` VARCHAR(1),\n`address_line_1` VARCHAR(80)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`author_id` INTEGER NOT NULL,\n`subject_id` INTEGER NOT NULL,\n`course_name` VARCHAR(120),\n`course_description` VARCHAR(255),\nFOREIGN KEY (`author_id` ) REFERENCES `Course_Authors_and_Tutors`(`author_id` ),\nFOREIGN KEY (`subject_id` ) REFERENCES `Subjects`(`subject_id` )\n);\nCREATE TABLE `Student_Course_Enrolment` (\n`registration_id` INTEGER PRIMARY KEY,\n`student_id` INTEGER NOT NULL,\n`course_id` INTEGER NOT NULL,\n`date_of_enrolment` DATETIME NOT NULL,\n`date_of_completion` DATETIME NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Tests_Taken` (\n`registration_id` INTEGER NOT NULL,\n`date_test_taken` DATETIME NOT NULL,\n`test_result` VARCHAR(255),\nFOREIGN KEY (`registration_id` ) REFERENCES `Student_Course_Enrolment`(`registration_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`date_of_registration` DATETIME,\n`date_of_latest_logon` DATETIME,\n`login_name` VARCHAR(40),\n`password` VARCHAR(10),\n`personal_name` VARCHAR(40),\n`middle_name` VARCHAR(40),\n`family_name` VARCHAR(40)\n);\nCREATE TABLE `Subjects` (\n`subject_id` INTEGER PRIMARY KEY,\n`subject_name` VARCHAR(120)\n);"} +{"qid": "pool_0047", "split": "pool", "db_id": "college_1", "question": "Find the first name and office of the professor who is in the history department and has a Ph.D. degree.", "gold_sql": "SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'", "db_path": "databases/college_1/college_1.sqlite", "schema": "CREATE TABLE CLASS (\nCLASS_CODE varchar(5) PRIMARY KEY,\nCRS_CODE varchar(10),\nCLASS_SECTION varchar(2),\nCLASS_TIME varchar(20),\nCLASS_ROOM varchar(8),\nPROF_NUM int,\nFOREIGN KEY (CRS_CODE) REFERENCES COURSE(CRS_CODE)\nFOREIGN KEY (PROF_NUM) REFERENCES EMPLOYEE(EMP_NUM)\n);\nCREATE TABLE COURSE (\nCRS_CODE varchar(10) PRIMARY KEY,\nDEPT_CODE varchar(10),\nCRS_DESCRIPTION varchar(35),\nCRS_CREDIT float(8),\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);\nCREATE TABLE DEPARTMENT (\nDEPT_CODE varchar(10) PRIMARY KEY,\nDEPT_NAME varchar(30),\nSCHOOL_CODE varchar(8),\nEMP_NUM int,\nDEPT_ADDRESS varchar(20),\nDEPT_EXTENSION varchar(4),\nFOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM)\n);\nCREATE TABLE EMPLOYEE (\nEMP_NUM int PRIMARY KEY,\nEMP_LNAME varchar(15),\nEMP_FNAME varchar(12),\nEMP_INITIAL varchar(1),\nEMP_JOBCODE varchar(5),\nEMP_HIREDATE datetime,\nEMP_DOB datetime\n);\nCREATE TABLE ENROLL (\nCLASS_CODE varchar(5),\nSTU_NUM int,\nENROLL_GRADE varchar(50),\nFOREIGN KEY (CLASS_CODE) REFERENCES CLASS(CLASS_CODE)\nFOREIGN KEY (STU_NUM) REFERENCES STUDENT(STU_NUM)\n);\nCREATE TABLE PROFESSOR (\nEMP_NUM int,\nDEPT_CODE varchar(10),\nPROF_OFFICE varchar(50),\nPROF_EXTENSION varchar(4),\nPROF_HIGH_DEGREE varchar(5),\nFOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM),\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);\nCREATE TABLE STUDENT (\nSTU_NUM int PRIMARY KEY,\nSTU_LNAME varchar(15),\nSTU_FNAME varchar(15),\nSTU_INIT varchar(1),\nSTU_DOB datetime,\nSTU_HRS int,\nSTU_CLASS varchar(2),\nSTU_GPA float(8),\nSTU_TRANSFER numeric,\nDEPT_CODE varchar(18),\nSTU_PHONE varchar(4),\nPROF_NUM int,\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);"} +{"qid": "pool_0048", "split": "pool", "db_id": "cre_Drama_Workshop_Groups", "question": "Which city is the address of the store named \"FJA Filming\" located in?", "gold_sql": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = \"FJA Filming\"", "db_path": "databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite", "schema": "CREATE TABLE Addresses (\nAddress_ID VARCHAR(100) NOT NULL,\nLine_1 VARCHAR(255),\nLine_2 VARCHAR(255),\nCity_Town VARCHAR(255),\nState_County VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Address_ID),\nUNIQUE (Address_ID)\n);\nCREATE TABLE Bookings (\nBooking_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nWorkshop_Group_ID VARCHAR(100) NOT NULL,\nStatus_Code CHAR(15) NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Booking_ID),\nUNIQUE (Booking_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Clients (Client_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID)\n);\nCREATE TABLE Bookings_Services (\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Product_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (Product_ID) REFERENCES Services (Service_ID)\n);\nCREATE TABLE Clients (\nClient_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Email_Address VARCHAR(255),\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Client_ID),\nUNIQUE (Client_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Customer_Orders (\nOrder_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Order_ID),\nUNIQUE (Order_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Store_ID) REFERENCES Stores (Store_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Customer_ID),\nUNIQUE (Customer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Drama_Workshop_Groups (\nWorkshop_Group_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCurrency_Code CHAR(15) NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Workshop_Group_ID),\nUNIQUE (Workshop_Group_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Invoice_Items (\nInvoice_Item_ID INTEGER NOT NULL ,\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\nOrder_Item_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity INTEGER,\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Invoice_Item_ID),\nFOREIGN KEY (Order_Item_ID) REFERENCES Order_Items (Order_Item_ID),\nFOREIGN KEY (Invoice_ID) REFERENCES Invoices (Invoice_ID),\nFOREIGN KEY (Order_ID, Product_ID) REFERENCES Bookings_Services (Order_ID,Product_ID)\n);\nCREATE TABLE Invoices (\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\npayment_method_code CHAR(15),\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nOrder_Item_ID INTEGER NOT NULL,\nPRIMARY KEY (Invoice_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (payment_method_code) REFERENCES Ref_Payment_Methods (payment_method_code)\n);\nCREATE TABLE Marketing_Regions (\nMarketing_Region_Code CHAR(15) NOT NULL,\nMarketing_Region_Name VARCHAR(255) NOT NULL,\nMarketing_Region_Descriptrion VARCHAR(255) NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Marketing_Region_Code),\nUNIQUE (Marketing_Region_Code)\n);\nCREATE TABLE Order_Items (\nOrder_Item_ID INTEGER NOT NULL ,\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Order_Item_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Product_ID) REFERENCES Products (Product_ID)\n);\nCREATE TABLE Performers (\nPerformer_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Performer_ID),\nUNIQUE (Performer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Performers_in_Bookings (\nOrder_ID INTEGER NOT NULL,\nPerformer_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Performer_ID),\nFOREIGN KEY (Performer_ID) REFERENCES Performers (Performer_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID)\n);\nCREATE TABLE Products (\nProduct_ID VARCHAR(100) NOT NULL,\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nProduct_Description VARCHAR(255),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Product_ID),\nUNIQUE (Product_ID)\n);\nCREATE TABLE Ref_Payment_Methods (\npayment_method_code CHAR(10) NOT NULL,\npayment_method_description VARCHAR(80),\nPRIMARY KEY (payment_method_code),\nUNIQUE (payment_method_code)\n);\nCREATE TABLE Ref_Service_Types (\nService_Type_Code CHAR(15) NOT NULL,\nParent_Service_Type_Code CHAR(15),\nService_Type_Description VARCHAR(255),\nPRIMARY KEY (Service_Type_Code),\nUNIQUE (Service_Type_Code)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15),\nWorkshop_Group_ID INTEGER NOT NULL,\nProduct_Description VARCHAR(255),\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Service_ID),\nUNIQUE (Service_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID),\nFOREIGN KEY (Service_Type_Code) REFERENCES Ref_Service_Types (Service_Type_Code)\n);\nCREATE TABLE Stores (\nStore_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Store_ID),\nUNIQUE (Store_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID),\nFOREIGN KEY (Marketing_Region_Code) REFERENCES Marketing_Regions (Marketing_Region_Code)\n);"} +{"qid": "pool_0049", "split": "pool", "db_id": "cre_Doc_Tracking_DB", "question": "List all location codes and location names.", "gold_sql": "SELECT location_code , location_name FROM Ref_locations", "db_path": "databases/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite", "schema": "CREATE TABLE All_Documents (\nDocument_ID INTEGER NOT NULL,\nDate_Stored DATETIME,\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Name CHAR(255),\nDocument_Description CHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Date_Stored) REFERENCES Ref_Calendar (Calendar_Date)\n);\nCREATE TABLE Document_Locations (\nDocument_ID INTEGER NOT NULL,\nLocation_Code CHAR(15) NOT NULL,\nDate_in_Location_From DATETIME NOT NULL,\nDate_in_Locaton_To DATETIME,\nPRIMARY KEY (Document_ID, Location_Code, Date_in_Location_From),\nFOREIGN KEY (Location_Code) REFERENCES Ref_Locations (Location_Code),\nFOREIGN KEY (Date_in_Location_From) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Date_in_Locaton_To) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)\n);\nCREATE TABLE Documents_to_be_Destroyed (\nDocument_ID INTEGER NOT NULL,\nDestruction_Authorised_by_Employee_ID INTEGER,\nDestroyed_by_Employee_ID INTEGER,\nPlanned_Destruction_Date DATETIME,\nActual_Destruction_Date DATETIME,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Destroyed_by_Employee_ID) REFERENCES Employees (Employee_ID),\nFOREIGN KEY (Destruction_Authorised_by_Employee_ID) REFERENCES Employees (Employee_ID),\nFOREIGN KEY (Planned_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Actual_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)\n);\nCREATE TABLE Employees (\nEmployee_ID INTEGER NOT NULL,\nRole_Code CHAR(15) NOT NULL,\nEmployee_Name VARCHAR(255),\nGender_MFU CHAR(1) NOT NULL,\nDate_of_Birth DATETIME NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Employee_ID),\nFOREIGN KEY (Role_Code) REFERENCES Roles (Role_Code)\n);\nCREATE TABLE Ref_Calendar (\nCalendar_Date DATETIME NOT NULL,\nDay_Number INTEGER,\nPRIMARY KEY (Calendar_Date)\n);\nCREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);\nCREATE TABLE Ref_Locations (\nLocation_Code CHAR(15) NOT NULL,\nLocation_Name VARCHAR(255) NOT NULL,\nLocation_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Location_Code)\n);\nCREATE TABLE Roles (\nRole_Code CHAR(15) NOT NULL,\nRole_Name VARCHAR(255),\nRole_Description VARCHAR(255),\nPRIMARY KEY (Role_Code)\n);"} +{"qid": "pool_0050", "split": "pool", "db_id": "aircraft", "question": "Please list the location and the winning aircraft name.", "gold_sql": "SELECT T2.Location , T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft", "db_path": "databases/aircraft/aircraft.sqlite", "schema": "CREATE TABLE `aircraft` (\n \"Aircraft_ID\" int(11) NOT NULL,\n \"Aircraft\" varchar(50) NOT NULL,\n \"Description\" varchar(50) NOT NULL,\n \"Max_Gross_Weight\" varchar(50) NOT NULL,\n \"Total_disk_area\" varchar(50) NOT NULL,\n \"Max_disk_Loading\" varchar(50) NOT NULL,\n PRIMARY KEY (`Aircraft_ID`)\n);\nCREATE TABLE `airport` (\n\"Airport_ID\" int,\n\"Airport_Name\" text,\n\"Total_Passengers\" real,\n\"%_Change_2007\" text,\n\"International_Passengers\" real,\n\"Domestic_Passengers\" real,\n\"Transit_Passengers\" real,\n\"Aircraft_Movements\" real,\n\"Freight_Metric_Tonnes\" real,\nPRIMARY KEY (\"Airport_ID\")\n);\nCREATE TABLE `airport_aircraft` (\n\"ID\" int,\n\"Airport_ID\" int,\n\"Aircraft_ID\" int,\nPRIMARY KEY (\"Airport_ID\",\"Aircraft_ID\"),\nFOREIGN KEY (\"Airport_ID\") REFERENCES `airport`(`Airport_ID`),\nFOREIGN KEY (\"Aircraft_ID\") REFERENCES `aircraft`(`Aircraft_ID`)\n);\nCREATE TABLE `match` (\n\"Round\" real,\n\"Location\" text,\n\"Country\" text,\n\"Date\" text,\n\"Fastest_Qualifying\" text,\n\"Winning_Pilot\" text,\n\"Winning_Aircraft\" text,\nPRIMARY KEY (\"Round\"),\nFOREIGN KEY (`Winning_Aircraft`) REFERENCES `aircraft`(`Aircraft_ID`),\nFOREIGN KEY (`Winning_Pilot`) REFERENCES `pilot`(`Pilot_Id`)\n);\nCREATE TABLE `pilot` (\n `Pilot_Id` int(11) NOT NULL,\n `Name` varchar(50) NOT NULL,\n `Age` int(11) NOT NULL,\n PRIMARY KEY (`Pilot_Id`)\n);"} +{"qid": "pool_0051", "split": "pool", "db_id": "college_2", "question": "What are the ids of courses without prerequisites?", "gold_sql": "SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq", "db_path": "databases/college_2/college_2.sqlite", "schema": "CREATE TABLE advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);\nCREATE TABLE course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );\nCREATE TABLE department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);\nCREATE TABLE instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);\nCREATE TABLE section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);\nCREATE TABLE student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);"} +{"qid": "pool_0052", "split": "pool", "db_id": "match_season", "question": "Show the country name and capital of all countries.", "gold_sql": "SELECT Country_name , Capital FROM country", "db_path": "databases/match_season/match_season.sqlite", "schema": "CREATE TABLE \"country\" (\n \"Country_id\" int,\n \"Country_name\" text,\n \"Capital\" text,\n \"Official_native_language\" text,\n PRIMARY KEY (\"Country_id\")\n);\nCREATE TABLE \"match_season\" (\n \"Season\" real,\n \"Player\" text,\n \"Position\" text,\n \"Country\" int,\n \"Team\" int,\n \"Draft_Pick_Number\" int,\n \"Draft_Class\" text,\n \"College\" text,\n PRIMARY KEY (\"Season\"),\n FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE \"player\" (\n \"Player_ID\" int,\n \"Player\" text,\n \"Years_Played\" text,\n \"Total_WL\" text,\n \"Singles_WL\" text,\n \"Doubles_WL\" text,\n \"Team\" int,\n PRIMARY KEY (\"Player_ID\"),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE `team` (\n `Team_id` int,\n `Name` text,\n PRIMARY KEY (`Team_id`)\n);"} +{"qid": "pool_0053", "split": "pool", "db_id": "soccer_2", "question": "What are the different states that had students successfully try out?", "gold_sql": "SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'", "db_path": "databases/soccer_2/soccer_2.sqlite", "schema": "CREATE TABLE College \n ( cName \tvarchar(20) NOT NULL,\n state \tvarchar(2),\n enr \tnumeric(5,0),\n PRIMARY KEY (cName)\n );\nCREATE TABLE Player\n ( pID\t\t\tnumeric(5,0) NOT NULL,\n \tpName \tvarchar(20),\n yCard \tvarchar(3),\n HS \tnumeric(5,0),\n PRIMARY KEY (pID)\n );\nCREATE TABLE Tryout\n ( pID\t\t\tnumeric(5,0),\n \tcName \tvarchar(20),\n pPos \tvarchar(8),\n decision varchar(3),\n PRIMARY KEY (pID, cName),\n FOREIGN KEY (pID) REFERENCES Player(pID),\n FOREIGN KEY (cName) REFERENCES College(cName)\n );"} +{"qid": "pool_0054", "split": "pool", "db_id": "election", "question": "Sort the names of all counties in ascending order of population.", "gold_sql": "SELECT County_name FROM county ORDER BY Population ASC", "db_path": "databases/election/election.sqlite", "schema": "CREATE TABLE \"county\" (\n\"County_Id\" int,\n\"County_name\" text,\n\"Population\" real,\n\"Zip_code\" text,\nPRIMARY KEY (\"County_Id\")\n);\nCREATE TABLE \"election\" (\n\"Election_ID\" int,\n\"Counties_Represented\" text,\n\"District\" int,\n\"Delegate\" text,\n\"Party\" int,\n\"First_Elected\" real,\n\"Committee\" text,\nPRIMARY KEY (\"Election_ID\"),\nFOREIGN KEY (`Party`) REFERENCES `party`(`Party_ID`),\nFOREIGN KEY (`District`) REFERENCES `county`(`County_Id`)\n);\nCREATE TABLE \"party\" (\n\"Party_ID\" int,\n\"Year\" real,\n\"Party\" text,\n\"Governor\" text,\n\"Lieutenant_Governor\" text,\n\"Comptroller\" text,\n\"Attorney_General\" text,\n\"US_Senate\" text,\nPRIMARY KEY (\"Party_ID\")\n);"} +{"qid": "pool_0055", "split": "pool", "db_id": "election", "question": "Show the county name and population of all counties.", "gold_sql": "SELECT County_name , Population FROM county", "db_path": "databases/election/election.sqlite", "schema": "CREATE TABLE \"county\" (\n\"County_Id\" int,\n\"County_name\" text,\n\"Population\" real,\n\"Zip_code\" text,\nPRIMARY KEY (\"County_Id\")\n);\nCREATE TABLE \"election\" (\n\"Election_ID\" int,\n\"Counties_Represented\" text,\n\"District\" int,\n\"Delegate\" text,\n\"Party\" int,\n\"First_Elected\" real,\n\"Committee\" text,\nPRIMARY KEY (\"Election_ID\"),\nFOREIGN KEY (`Party`) REFERENCES `party`(`Party_ID`),\nFOREIGN KEY (`District`) REFERENCES `county`(`County_Id`)\n);\nCREATE TABLE \"party\" (\n\"Party_ID\" int,\n\"Year\" real,\n\"Party\" text,\n\"Governor\" text,\n\"Lieutenant_Governor\" text,\n\"Comptroller\" text,\n\"Attorney_General\" text,\n\"US_Senate\" text,\nPRIMARY KEY (\"Party_ID\")\n);"} +{"qid": "pool_0056", "split": "pool", "db_id": "voter_2", "question": "How many distinct president votes are recorded?", "gold_sql": "SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD", "db_path": "databases/voter_2/voter_2.sqlite", "schema": "CREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );\nCREATE TABLE Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"} +{"qid": "pool_0057", "split": "pool", "db_id": "cre_Drama_Workshop_Groups", "question": "What is the most frequent status of bookings?", "gold_sql": "SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite", "schema": "CREATE TABLE Addresses (\nAddress_ID VARCHAR(100) NOT NULL,\nLine_1 VARCHAR(255),\nLine_2 VARCHAR(255),\nCity_Town VARCHAR(255),\nState_County VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Address_ID),\nUNIQUE (Address_ID)\n);\nCREATE TABLE Bookings (\nBooking_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nWorkshop_Group_ID VARCHAR(100) NOT NULL,\nStatus_Code CHAR(15) NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Booking_ID),\nUNIQUE (Booking_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Clients (Client_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID)\n);\nCREATE TABLE Bookings_Services (\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Product_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (Product_ID) REFERENCES Services (Service_ID)\n);\nCREATE TABLE Clients (\nClient_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Email_Address VARCHAR(255),\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Client_ID),\nUNIQUE (Client_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Customer_Orders (\nOrder_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Order_ID),\nUNIQUE (Order_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Store_ID) REFERENCES Stores (Store_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Customer_ID),\nUNIQUE (Customer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Drama_Workshop_Groups (\nWorkshop_Group_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCurrency_Code CHAR(15) NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Workshop_Group_ID),\nUNIQUE (Workshop_Group_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Invoice_Items (\nInvoice_Item_ID INTEGER NOT NULL ,\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\nOrder_Item_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity INTEGER,\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Invoice_Item_ID),\nFOREIGN KEY (Order_Item_ID) REFERENCES Order_Items (Order_Item_ID),\nFOREIGN KEY (Invoice_ID) REFERENCES Invoices (Invoice_ID),\nFOREIGN KEY (Order_ID, Product_ID) REFERENCES Bookings_Services (Order_ID,Product_ID)\n);\nCREATE TABLE Invoices (\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\npayment_method_code CHAR(15),\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nOrder_Item_ID INTEGER NOT NULL,\nPRIMARY KEY (Invoice_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (payment_method_code) REFERENCES Ref_Payment_Methods (payment_method_code)\n);\nCREATE TABLE Marketing_Regions (\nMarketing_Region_Code CHAR(15) NOT NULL,\nMarketing_Region_Name VARCHAR(255) NOT NULL,\nMarketing_Region_Descriptrion VARCHAR(255) NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Marketing_Region_Code),\nUNIQUE (Marketing_Region_Code)\n);\nCREATE TABLE Order_Items (\nOrder_Item_ID INTEGER NOT NULL ,\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Order_Item_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Product_ID) REFERENCES Products (Product_ID)\n);\nCREATE TABLE Performers (\nPerformer_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Performer_ID),\nUNIQUE (Performer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Performers_in_Bookings (\nOrder_ID INTEGER NOT NULL,\nPerformer_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Performer_ID),\nFOREIGN KEY (Performer_ID) REFERENCES Performers (Performer_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID)\n);\nCREATE TABLE Products (\nProduct_ID VARCHAR(100) NOT NULL,\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nProduct_Description VARCHAR(255),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Product_ID),\nUNIQUE (Product_ID)\n);\nCREATE TABLE Ref_Payment_Methods (\npayment_method_code CHAR(10) NOT NULL,\npayment_method_description VARCHAR(80),\nPRIMARY KEY (payment_method_code),\nUNIQUE (payment_method_code)\n);\nCREATE TABLE Ref_Service_Types (\nService_Type_Code CHAR(15) NOT NULL,\nParent_Service_Type_Code CHAR(15),\nService_Type_Description VARCHAR(255),\nPRIMARY KEY (Service_Type_Code),\nUNIQUE (Service_Type_Code)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15),\nWorkshop_Group_ID INTEGER NOT NULL,\nProduct_Description VARCHAR(255),\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Service_ID),\nUNIQUE (Service_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID),\nFOREIGN KEY (Service_Type_Code) REFERENCES Ref_Service_Types (Service_Type_Code)\n);\nCREATE TABLE Stores (\nStore_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Store_ID),\nUNIQUE (Store_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID),\nFOREIGN KEY (Marketing_Region_Code) REFERENCES Marketing_Regions (Marketing_Region_Code)\n);"} +{"qid": "pool_0058", "split": "pool", "db_id": "match_season", "question": "Return the names of teams that have no match season record.", "gold_sql": "SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)", "db_path": "databases/match_season/match_season.sqlite", "schema": "CREATE TABLE \"country\" (\n \"Country_id\" int,\n \"Country_name\" text,\n \"Capital\" text,\n \"Official_native_language\" text,\n PRIMARY KEY (\"Country_id\")\n);\nCREATE TABLE \"match_season\" (\n \"Season\" real,\n \"Player\" text,\n \"Position\" text,\n \"Country\" int,\n \"Team\" int,\n \"Draft_Pick_Number\" int,\n \"Draft_Class\" text,\n \"College\" text,\n PRIMARY KEY (\"Season\"),\n FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE \"player\" (\n \"Player_ID\" int,\n \"Player\" text,\n \"Years_Played\" text,\n \"Total_WL\" text,\n \"Singles_WL\" text,\n \"Doubles_WL\" text,\n \"Team\" int,\n PRIMARY KEY (\"Player_ID\"),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE `team` (\n `Team_id` int,\n `Name` text,\n PRIMARY KEY (`Team_id`)\n);"} +{"qid": "pool_0059", "split": "pool", "db_id": "cre_Doc_Tracking_DB", "question": "How many locations are listed in the database?", "gold_sql": "SELECT count(*) FROM Ref_locations", "db_path": "databases/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite", "schema": "CREATE TABLE All_Documents (\nDocument_ID INTEGER NOT NULL,\nDate_Stored DATETIME,\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Name CHAR(255),\nDocument_Description CHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Date_Stored) REFERENCES Ref_Calendar (Calendar_Date)\n);\nCREATE TABLE Document_Locations (\nDocument_ID INTEGER NOT NULL,\nLocation_Code CHAR(15) NOT NULL,\nDate_in_Location_From DATETIME NOT NULL,\nDate_in_Locaton_To DATETIME,\nPRIMARY KEY (Document_ID, Location_Code, Date_in_Location_From),\nFOREIGN KEY (Location_Code) REFERENCES Ref_Locations (Location_Code),\nFOREIGN KEY (Date_in_Location_From) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Date_in_Locaton_To) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)\n);\nCREATE TABLE Documents_to_be_Destroyed (\nDocument_ID INTEGER NOT NULL,\nDestruction_Authorised_by_Employee_ID INTEGER,\nDestroyed_by_Employee_ID INTEGER,\nPlanned_Destruction_Date DATETIME,\nActual_Destruction_Date DATETIME,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Destroyed_by_Employee_ID) REFERENCES Employees (Employee_ID),\nFOREIGN KEY (Destruction_Authorised_by_Employee_ID) REFERENCES Employees (Employee_ID),\nFOREIGN KEY (Planned_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Actual_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)\n);\nCREATE TABLE Employees (\nEmployee_ID INTEGER NOT NULL,\nRole_Code CHAR(15) NOT NULL,\nEmployee_Name VARCHAR(255),\nGender_MFU CHAR(1) NOT NULL,\nDate_of_Birth DATETIME NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Employee_ID),\nFOREIGN KEY (Role_Code) REFERENCES Roles (Role_Code)\n);\nCREATE TABLE Ref_Calendar (\nCalendar_Date DATETIME NOT NULL,\nDay_Number INTEGER,\nPRIMARY KEY (Calendar_Date)\n);\nCREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);\nCREATE TABLE Ref_Locations (\nLocation_Code CHAR(15) NOT NULL,\nLocation_Name VARCHAR(255) NOT NULL,\nLocation_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Location_Code)\n);\nCREATE TABLE Roles (\nRole_Code CHAR(15) NOT NULL,\nRole_Name VARCHAR(255),\nRole_Description VARCHAR(255),\nPRIMARY KEY (Role_Code)\n);"} +{"qid": "pool_0060", "split": "pool", "db_id": "bike_1", "question": "Give me the zip code where the average mean humidity is below 70 and at least 100 trips took place.", "gold_sql": "SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_humidity) < 70 INTERSECT SELECT zip_code FROM trip GROUP BY zip_code HAVING count(*) >= 100", "db_path": "databases/bike_1/bike_1.sqlite", "schema": "CREATE TABLE station (\n id INTEGER PRIMARY KEY,\n name TEXT,\n lat NUMERIC,\n long NUMERIC,\n dock_count INTEGER,\n city TEXT,\n installation_date TEXT);\nCREATE TABLE status (\n station_id INTEGER,\n bikes_available INTEGER,\n docks_available INTEGER,\n time TEXT,\n FOREIGN KEY (station_id) REFERENCES station(id)\n);\nCREATE TABLE trip (\n id INTEGER PRIMARY KEY,\n duration INTEGER,\n start_date TEXT,\n start_station_name TEXT, -- this should be removed\n start_station_id INTEGER,\n end_date TEXT,\n end_station_name TEXT, -- this should be removed\n end_station_id INTEGER,\n bike_id INTEGER,\n subscription_type TEXT,\n zip_code INTEGER);\nCREATE TABLE weather (\n date TEXT,\n max_temperature_f INTEGER,\n mean_temperature_f INTEGER,\n min_temperature_f INTEGER,\n max_dew_point_f INTEGER,\n mean_dew_point_f INTEGER,\n min_dew_point_f INTEGER,\n max_humidity INTEGER,\n mean_humidity INTEGER,\n min_humidity INTEGER,\n max_sea_level_pressure_inches NUMERIC,\n mean_sea_level_pressure_inches NUMERIC,\n min_sea_level_pressure_inches NUMERIC,\n max_visibility_miles INTEGER,\n mean_visibility_miles INTEGER,\n min_visibility_miles INTEGER,\n max_wind_Speed_mph INTEGER,\n mean_wind_speed_mph INTEGER,\n max_gust_speed_mph INTEGER,\n precipitation_inches INTEGER,\n cloud_cover INTEGER,\n events TEXT,\n wind_dir_degrees INTEGER,\n zip_code INTEGER);"} +{"qid": "pool_0061", "split": "pool", "db_id": "apartment_rentals", "question": "Show each apartment type code, and the maximum and minimum number of rooms for each type.", "gold_sql": "SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_type_code", "db_path": "databases/apartment_rentals/apartment_rentals.sqlite", "schema": "CREATE TABLE Apartment_Bookings (\napt_booking_id INTEGER NOT NULL,\napt_id INTEGER,\nguest_id INTEGER NOT NULL,\nbooking_status_code CHAR(15) NOT NULL,\nbooking_start_date DATETIME,\nbooking_end_date DATETIME,\nPRIMARY KEY (apt_booking_id),\nUNIQUE (apt_booking_id),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (guest_id) REFERENCES Guests (guest_id)\n);\nCREATE TABLE Apartment_Buildings (\nbuilding_id INTEGER NOT NULL,\nbuilding_short_name CHAR(15),\nbuilding_full_name VARCHAR(80),\nbuilding_description VARCHAR(255),\nbuilding_address VARCHAR(255),\nbuilding_manager VARCHAR(50),\nbuilding_phone VARCHAR(80),\nPRIMARY KEY (building_id),\nUNIQUE (building_id)\n);\nCREATE TABLE Apartment_Facilities (\napt_id INTEGER NOT NULL,\nfacility_code CHAR(15) NOT NULL,\nPRIMARY KEY (apt_id, facility_code),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id)\n);\nCREATE TABLE Apartments (\napt_id INTEGER NOT NULL ,\nbuilding_id INTEGER NOT NULL,\napt_type_code CHAR(15),\napt_number CHAR(10),\nbathroom_count INTEGER,\nbedroom_count INTEGER,\nroom_count CHAR(5),\nPRIMARY KEY (apt_id),\nUNIQUE (apt_id),\nFOREIGN KEY (building_id) REFERENCES Apartment_Buildings (building_id)\n);\nCREATE TABLE Guests (\nguest_id INTEGER NOT NULL ,\ngender_code CHAR(1),\nguest_first_name VARCHAR(80),\nguest_last_name VARCHAR(80),\ndate_of_birth DATETIME,\nPRIMARY KEY (guest_id),\nUNIQUE (guest_id)\n);\nCREATE TABLE View_Unit_Status (\napt_id INTEGER,\napt_booking_id INTEGER,\nstatus_date DATETIME NOT NULL,\navailable_yn BIT,\nPRIMARY KEY (status_date),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings (apt_booking_id)\n);"} +{"qid": "pool_0062", "split": "pool", "db_id": "driving_school", "question": "What are the first and last names of all customers who lived in Lockmanfurt?", "gold_sql": "SELECT T1.first_name , T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = \"Lockmanfurt\";", "db_path": "databases/driving_school/driving_school.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);\nCREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);"} +{"qid": "pool_0063", "split": "pool", "db_id": "aircraft", "question": "find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.", "gold_sql": "SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/aircraft/aircraft.sqlite", "schema": "CREATE TABLE `aircraft` (\n \"Aircraft_ID\" int(11) NOT NULL,\n \"Aircraft\" varchar(50) NOT NULL,\n \"Description\" varchar(50) NOT NULL,\n \"Max_Gross_Weight\" varchar(50) NOT NULL,\n \"Total_disk_area\" varchar(50) NOT NULL,\n \"Max_disk_Loading\" varchar(50) NOT NULL,\n PRIMARY KEY (`Aircraft_ID`)\n);\nCREATE TABLE `airport` (\n\"Airport_ID\" int,\n\"Airport_Name\" text,\n\"Total_Passengers\" real,\n\"%_Change_2007\" text,\n\"International_Passengers\" real,\n\"Domestic_Passengers\" real,\n\"Transit_Passengers\" real,\n\"Aircraft_Movements\" real,\n\"Freight_Metric_Tonnes\" real,\nPRIMARY KEY (\"Airport_ID\")\n);\nCREATE TABLE `airport_aircraft` (\n\"ID\" int,\n\"Airport_ID\" int,\n\"Aircraft_ID\" int,\nPRIMARY KEY (\"Airport_ID\",\"Aircraft_ID\"),\nFOREIGN KEY (\"Airport_ID\") REFERENCES `airport`(`Airport_ID`),\nFOREIGN KEY (\"Aircraft_ID\") REFERENCES `aircraft`(`Aircraft_ID`)\n);\nCREATE TABLE `match` (\n\"Round\" real,\n\"Location\" text,\n\"Country\" text,\n\"Date\" text,\n\"Fastest_Qualifying\" text,\n\"Winning_Pilot\" text,\n\"Winning_Aircraft\" text,\nPRIMARY KEY (\"Round\"),\nFOREIGN KEY (`Winning_Aircraft`) REFERENCES `aircraft`(`Aircraft_ID`),\nFOREIGN KEY (`Winning_Pilot`) REFERENCES `pilot`(`Pilot_Id`)\n);\nCREATE TABLE `pilot` (\n `Pilot_Id` int(11) NOT NULL,\n `Name` varchar(50) NOT NULL,\n `Age` int(11) NOT NULL,\n PRIMARY KEY (`Pilot_Id`)\n);"} +{"qid": "pool_0064", "split": "pool", "db_id": "network_2", "question": "How old is each gender, on average?", "gold_sql": "SELECT avg(age) , gender FROM Person GROUP BY gender", "db_path": "databases/network_2/network_2.sqlite", "schema": "CREATE TABLE Person (\n name varchar(20) PRIMARY KEY,\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n);\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER,\n FOREIGN KEY (name) REFERENCES Person(name),\n FOREIGN KEY (friend) REFERENCES Person(name)\n);"} +{"qid": "pool_0065", "split": "pool", "db_id": "program_share", "question": "Find the names of channels that are not owned by CCTV.", "gold_sql": "SELECT name FROM channel WHERE OWNER != 'CCTV'", "db_path": "databases/program_share/program_share.sqlite", "schema": "CREATE TABLE \"broadcast\" (\n\"Channel_ID\" int,\n\"Program_ID\" int,\n\"Time_of_day\" text,\nPRIMARY KEY (\"Channel_ID\",\"Program_ID\"),\nFOREIGN KEY (`Channel_ID`) REFERENCES `channel`(`Channel_ID`),\nFOREIGN KEY (`Program_ID`) REFERENCES `program`(`Program_ID`)\n);\nCREATE TABLE \"broadcast_share\" (\n\"Channel_ID\" int,\n\"Program_ID\" int,\n\"Date\" text,\n\"Share_in_percent\" real,\nPRIMARY KEY (\"Channel_ID\",\"Program_ID\"),\nFOREIGN KEY (`Channel_ID`) REFERENCES `channel`(`Channel_ID`),\nFOREIGN KEY (`Program_ID`) REFERENCES `program`(`Program_ID`)\n);\nCREATE TABLE \"channel\" (\n\"Channel_ID\" int,\n\"Name\" text,\n\"Owner\" text,\n\"Share_in_percent\" real,\n\"Rating_in_percent\" real,\nPRIMARY KEY (\"Channel_ID\")\n);\nCREATE TABLE \"program\" (\n\"Program_ID\" int,\n\"Name\" text,\n\"Origin\" text,\n\"Launch\" real,\n\"Owner\" text,\nPRIMARY KEY (\"Program_ID\")\n);"} +{"qid": "pool_0066", "split": "pool", "db_id": "protein_institute", "question": "What is the name of the tallest building?", "gold_sql": "SELECT name FROM building ORDER BY height_feet DESC LIMIT 1", "db_path": "databases/protein_institute/protein_institute.sqlite", "schema": "CREATE TABLE \"Institution\" (\n\"Institution_id\" text,\n\"Institution\" text,\n\"Location\" text,\n\"Founded\" real,\n\"Type\" text,\n\"Enrollment\" int,\n\"Team\" text,\n\"Primary_Conference\" text,\n\"building_id\" text,\nPRIMARY KEY(\"Institution_id\"),\nFOREIGN KEY (\"building_id\") REFERENCES \"building\"(\"building_id\")\n);\nCREATE TABLE \"building\" (\n\"building_id\" text,\n\"Name\" text,\n\"Street_address\" text,\n\"Years_as_tallest\" text,\n\"Height_feet\" int,\n\"Floors\" int,\nPRIMARY KEY(\"building_id\")\n);\nCREATE TABLE \"protein\" (\n\"common_name\" text,\n\"protein_name\" text,\n\"divergence_from_human_lineage\" real,\n\"accession_number\" text,\n\"sequence_length\" real,\n\"sequence_identity_to_human_protein\" text,\n\"Institution_id\" text,\nPRIMARY KEY(\"common_name\"),\nFOREIGN KEY(\"Institution_id\") REFERENCES \"Institution\"(\"Institution_id\")\n);"} +{"qid": "pool_0067", "split": "pool", "db_id": "soccer_2", "question": "What is the number of states that has some college whose enrollment is larger than the average enrollment?", "gold_sql": "SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college)", "db_path": "databases/soccer_2/soccer_2.sqlite", "schema": "CREATE TABLE College \n ( cName \tvarchar(20) NOT NULL,\n state \tvarchar(2),\n enr \tnumeric(5,0),\n PRIMARY KEY (cName)\n );\nCREATE TABLE Player\n ( pID\t\t\tnumeric(5,0) NOT NULL,\n \tpName \tvarchar(20),\n yCard \tvarchar(3),\n HS \tnumeric(5,0),\n PRIMARY KEY (pID)\n );\nCREATE TABLE Tryout\n ( pID\t\t\tnumeric(5,0),\n \tcName \tvarchar(20),\n pPos \tvarchar(8),\n decision varchar(3),\n PRIMARY KEY (pID, cName),\n FOREIGN KEY (pID) REFERENCES Player(pID),\n FOREIGN KEY (cName) REFERENCES College(cName)\n );"} +{"qid": "pool_0068", "split": "pool", "db_id": "apartment_rentals", "question": "Return the apartment number with the largest number of bedrooms.", "gold_sql": "SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1", "db_path": "databases/apartment_rentals/apartment_rentals.sqlite", "schema": "CREATE TABLE Apartment_Bookings (\napt_booking_id INTEGER NOT NULL,\napt_id INTEGER,\nguest_id INTEGER NOT NULL,\nbooking_status_code CHAR(15) NOT NULL,\nbooking_start_date DATETIME,\nbooking_end_date DATETIME,\nPRIMARY KEY (apt_booking_id),\nUNIQUE (apt_booking_id),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (guest_id) REFERENCES Guests (guest_id)\n);\nCREATE TABLE Apartment_Buildings (\nbuilding_id INTEGER NOT NULL,\nbuilding_short_name CHAR(15),\nbuilding_full_name VARCHAR(80),\nbuilding_description VARCHAR(255),\nbuilding_address VARCHAR(255),\nbuilding_manager VARCHAR(50),\nbuilding_phone VARCHAR(80),\nPRIMARY KEY (building_id),\nUNIQUE (building_id)\n);\nCREATE TABLE Apartment_Facilities (\napt_id INTEGER NOT NULL,\nfacility_code CHAR(15) NOT NULL,\nPRIMARY KEY (apt_id, facility_code),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id)\n);\nCREATE TABLE Apartments (\napt_id INTEGER NOT NULL ,\nbuilding_id INTEGER NOT NULL,\napt_type_code CHAR(15),\napt_number CHAR(10),\nbathroom_count INTEGER,\nbedroom_count INTEGER,\nroom_count CHAR(5),\nPRIMARY KEY (apt_id),\nUNIQUE (apt_id),\nFOREIGN KEY (building_id) REFERENCES Apartment_Buildings (building_id)\n);\nCREATE TABLE Guests (\nguest_id INTEGER NOT NULL ,\ngender_code CHAR(1),\nguest_first_name VARCHAR(80),\nguest_last_name VARCHAR(80),\ndate_of_birth DATETIME,\nPRIMARY KEY (guest_id),\nUNIQUE (guest_id)\n);\nCREATE TABLE View_Unit_Status (\napt_id INTEGER,\napt_booking_id INTEGER,\nstatus_date DATETIME NOT NULL,\navailable_yn BIT,\nPRIMARY KEY (status_date),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings (apt_booking_id)\n);"} +{"qid": "pool_0069", "split": "pool", "db_id": "cre_Drama_Workshop_Groups", "question": "Show all the planned delivery dates and actual delivery dates of bookings.", "gold_sql": "SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS", "db_path": "databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite", "schema": "CREATE TABLE Addresses (\nAddress_ID VARCHAR(100) NOT NULL,\nLine_1 VARCHAR(255),\nLine_2 VARCHAR(255),\nCity_Town VARCHAR(255),\nState_County VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Address_ID),\nUNIQUE (Address_ID)\n);\nCREATE TABLE Bookings (\nBooking_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nWorkshop_Group_ID VARCHAR(100) NOT NULL,\nStatus_Code CHAR(15) NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Booking_ID),\nUNIQUE (Booking_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Clients (Client_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID)\n);\nCREATE TABLE Bookings_Services (\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Product_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (Product_ID) REFERENCES Services (Service_ID)\n);\nCREATE TABLE Clients (\nClient_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Email_Address VARCHAR(255),\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Client_ID),\nUNIQUE (Client_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Customer_Orders (\nOrder_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Order_ID),\nUNIQUE (Order_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Store_ID) REFERENCES Stores (Store_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Customer_ID),\nUNIQUE (Customer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Drama_Workshop_Groups (\nWorkshop_Group_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCurrency_Code CHAR(15) NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Workshop_Group_ID),\nUNIQUE (Workshop_Group_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Invoice_Items (\nInvoice_Item_ID INTEGER NOT NULL ,\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\nOrder_Item_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity INTEGER,\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Invoice_Item_ID),\nFOREIGN KEY (Order_Item_ID) REFERENCES Order_Items (Order_Item_ID),\nFOREIGN KEY (Invoice_ID) REFERENCES Invoices (Invoice_ID),\nFOREIGN KEY (Order_ID, Product_ID) REFERENCES Bookings_Services (Order_ID,Product_ID)\n);\nCREATE TABLE Invoices (\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\npayment_method_code CHAR(15),\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nOrder_Item_ID INTEGER NOT NULL,\nPRIMARY KEY (Invoice_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (payment_method_code) REFERENCES Ref_Payment_Methods (payment_method_code)\n);\nCREATE TABLE Marketing_Regions (\nMarketing_Region_Code CHAR(15) NOT NULL,\nMarketing_Region_Name VARCHAR(255) NOT NULL,\nMarketing_Region_Descriptrion VARCHAR(255) NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Marketing_Region_Code),\nUNIQUE (Marketing_Region_Code)\n);\nCREATE TABLE Order_Items (\nOrder_Item_ID INTEGER NOT NULL ,\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Order_Item_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Product_ID) REFERENCES Products (Product_ID)\n);\nCREATE TABLE Performers (\nPerformer_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Performer_ID),\nUNIQUE (Performer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Performers_in_Bookings (\nOrder_ID INTEGER NOT NULL,\nPerformer_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Performer_ID),\nFOREIGN KEY (Performer_ID) REFERENCES Performers (Performer_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID)\n);\nCREATE TABLE Products (\nProduct_ID VARCHAR(100) NOT NULL,\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nProduct_Description VARCHAR(255),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Product_ID),\nUNIQUE (Product_ID)\n);\nCREATE TABLE Ref_Payment_Methods (\npayment_method_code CHAR(10) NOT NULL,\npayment_method_description VARCHAR(80),\nPRIMARY KEY (payment_method_code),\nUNIQUE (payment_method_code)\n);\nCREATE TABLE Ref_Service_Types (\nService_Type_Code CHAR(15) NOT NULL,\nParent_Service_Type_Code CHAR(15),\nService_Type_Description VARCHAR(255),\nPRIMARY KEY (Service_Type_Code),\nUNIQUE (Service_Type_Code)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15),\nWorkshop_Group_ID INTEGER NOT NULL,\nProduct_Description VARCHAR(255),\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Service_ID),\nUNIQUE (Service_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID),\nFOREIGN KEY (Service_Type_Code) REFERENCES Ref_Service_Types (Service_Type_Code)\n);\nCREATE TABLE Stores (\nStore_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Store_ID),\nUNIQUE (Store_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID),\nFOREIGN KEY (Marketing_Region_Code) REFERENCES Marketing_Regions (Marketing_Region_Code)\n);"} +{"qid": "pool_0070", "split": "pool", "db_id": "music_1", "question": "Find the country of origin for the artist who made the least number of songs?", "gold_sql": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1", "db_path": "databases/music_1/music_1.sqlite", "schema": "CREATE TABLE artist(\n\tartist_name varchar2(50) not null,\n\tcountry varchar2(20),\n\tgender varchar2(20),\n\tpreferred_genre varchar2(50),\n\tconstraint a_name primary key(artist_name),\n\tforeign key(preferred_genre) references genre(g_name) ON DELETE CASCADE\n);\nCREATE TABLE files(\n\tf_id number(10) not null,\n\tartist_name varchar2(50),\n\tfile_size varchar2(20),\n\tduration varchar2(20),\n\tformats varchar2(20),\n\tprimary key(f_id),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE\n);\nCREATE TABLE genre(\n\tg_name varchar2(20) not null,\n\trating varchar2(10),\n\tmost_popular_in varchar2(50),\n\tprimary key(g_name)\n);\nCREATE TABLE song(\n\tsong_name varchar2(50),\n\tartist_name varchar2(50),\n\tcountry varchar2(20),\n\tf_id number(10),\n \tgenre_is varchar2(20),\n\trating number(10) check(rating>0 and rating<11),\n\tlanguages varchar2(20),\n\treleasedate Date, \n\tresolution number(10) not null,\n\tconstraint s_name primary key(song_name),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE,\n\tforeign key(f_id) references files(f_id) ON DELETE CASCADE,\n\tforeign key(genre_is) references genre(g_name) ON DELETE CASCADE\n);"} +{"qid": "pool_0071", "split": "pool", "db_id": "hospital_1", "question": "Find the physician who was trained in the most expensive procedure?", "gold_sql": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment ORDER BY T3.cost DESC LIMIT 1", "db_path": "databases/hospital_1/hospital_1.sqlite", "schema": "CREATE TABLE Affiliated_With (\n Physician INTEGER NOT NULL,\n Department INTEGER NOT NULL,\n PrimaryAffiliation BOOLEAN NOT NULL,\n CONSTRAINT fk_Affiliated_With_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Affiliated_With_Department_DepartmentID FOREIGN KEY(Department) REFERENCES Department(DepartmentID),\n PRIMARY KEY(Physician, Department)\n);\nCREATE TABLE Appointment (\n AppointmentID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL, \n PrepNurse INTEGER,\n Physician INTEGER NOT NULL,\n Start DATETIME NOT NULL,\n End DATETIME NOT NULL,\n ExaminationRoom TEXT NOT NULL,\n CONSTRAINT fk_Appointment_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Appointment_Nurse_EmployeeID FOREIGN KEY(PrepNurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_Appointment_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Block (\n BlockFloor INTEGER NOT NULL,\n BlockCode INTEGER NOT NULL,\n PRIMARY KEY(BlockFloor, BlockCode)\n);\nCREATE TABLE Department (\n DepartmentID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Head INTEGER NOT NULL,\n CONSTRAINT pk_Department PRIMARY KEY(DepartmentID),\n CONSTRAINT fk_Department_Physician_EmployeeID FOREIGN KEY(Head) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Medication (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Brand VARCHAR(30) NOT NULL,\n Description VARCHAR(30) NOT NULL\n);\nCREATE TABLE Nurse (\n EmployeeID INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n Registered BOOLEAN NOT NULL,\n SSN INTEGER NOT NULL\n);\nCREATE TABLE On_Call (\n Nurse INTEGER NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL,\n OnCallStart DATETIME NOT NULL,\n OnCallEnd DATETIME NOT NULL,\n PRIMARY KEY(Nurse, BlockFloor, BlockCode, OnCallStart, OnCallEnd),\n CONSTRAINT fk_OnCall_Nurse_EmployeeID FOREIGN KEY(Nurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_OnCall_Block_Floor FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode) \n);\nCREATE TABLE Patient (\n SSN INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Address VARCHAR(30) NOT NULL,\n Phone VARCHAR(30) NOT NULL,\n InsuranceID INTEGER NOT NULL,\n PCP INTEGER NOT NULL,\n CONSTRAINT fk_Patient_Physician_EmployeeID FOREIGN KEY(PCP) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Physician (\n EmployeeID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n SSN INTEGER NOT NULL,\n CONSTRAINT pk_physician PRIMARY KEY(EmployeeID)\n);\nCREATE TABLE Prescribes (\n Physician INTEGER NOT NULL,\n Patient INTEGER NOT NULL, \n Medication INTEGER NOT NULL, \n Date DATETIME NOT NULL,\n Appointment INTEGER, \n Dose VARCHAR(30) NOT NULL,\n PRIMARY KEY(Physician, Patient, Medication, Date),\n CONSTRAINT fk_Prescribes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Prescribes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Prescribes_Medication_Code FOREIGN KEY(Medication) REFERENCES Medication(Code),\n CONSTRAINT fk_Prescribes_Appointment_AppointmentID FOREIGN KEY(Appointment) REFERENCES Appointment(AppointmentID)\n);\nCREATE TABLE Procedures (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Cost REAL NOT NULL\n);\nCREATE TABLE Room (\n RoomNumber INTEGER PRIMARY KEY NOT NULL,\n RoomType VARCHAR(30) NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL, \n Unavailable BOOLEAN NOT NULL,\n CONSTRAINT fk_Room_Block_PK FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode)\n);\nCREATE TABLE Stay (\n StayID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL,\n Room INTEGER NOT NULL,\n StayStart DATETIME NOT NULL,\n StayEnd DATETIME NOT NULL,\n CONSTRAINT fk_Stay_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Stay_Room_Number FOREIGN KEY(Room) REFERENCES Room(RoomNumber)\n);\nCREATE TABLE Trained_In (\n Physician INTEGER NOT NULL,\n Treatment INTEGER NOT NULL,\n CertificationDate DATETIME NOT NULL,\n CertificationExpires DATETIME NOT NULL,\n CONSTRAINT fk_Trained_In_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Trained_In_Procedures_Code FOREIGN KEY(Treatment) REFERENCES Procedures(Code),\n PRIMARY KEY(Physician, Treatment)\n);\nCREATE TABLE Undergoes (\n Patient INTEGER NOT NULL,\n Procedures INTEGER NOT NULL,\n Stay INTEGER NOT NULL,\n DateUndergoes DATETIME NOT NULL,\n Physician INTEGER NOT NULL,\n AssistingNurse INTEGER,\n PRIMARY KEY(Patient, Procedures, Stay, DateUndergoes),\n CONSTRAINT fk_Undergoes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Undergoes_Procedures_Code FOREIGN KEY(Procedures) REFERENCES Procedures(Code),\n CONSTRAINT fk_Undergoes_Stay_StayID FOREIGN KEY(Stay) REFERENCES Stay(StayID),\n CONSTRAINT fk_Undergoes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Undergoes_Nurse_EmployeeID FOREIGN KEY(AssistingNurse) REFERENCES Nurse(EmployeeID)\n);"} +{"qid": "pool_0072", "split": "pool", "db_id": "scientist_1", "question": "List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.", "gold_sql": "SELECT T1.Name , T3.Name , T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name , T1.Name", "db_path": "databases/scientist_1/scientist_1.sqlite", "schema": "CREATE TABLE AssignedTo (\n Scientist int not null,\n Project char(4) not null,\n Primary Key (Scientist, Project),\n Foreign Key (Scientist) references Scientists (SSN),\n Foreign Key (Project) references Projects (Code)\n);\nCREATE TABLE Projects (\n Code Char(4),\n Name Char(50) not null,\n Hours int,\n Primary Key (Code)\n);\nCREATE TABLE Scientists (\n SSN int,\n Name Char(30) not null,\n Primary Key (SSN)\n);"} +{"qid": "pool_0073", "split": "pool", "db_id": "icfp_1", "question": "What are the last names of the author of the paper titled \"Binders Unbound\"?", "gold_sql": "SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = \"Binders Unbound\"", "db_path": "databases/icfp_1/icfp_1.sqlite", "schema": "CREATE TABLE Authors (\n authID INTEGER,\n lname TEXT,\n fname TEXT,\n PRIMARY KEY (authID)\n);\nCREATE TABLE Authorship (\n authID INTEGER,\n instID INTEGER,\n paperID INTEGER,\n authOrder INTEGER,\n PRIMARY KEY (authID, instID, paperID),\n FOREIGN KEY (authID) REFERENCES Authors (authID),\n FOREIGN KEY (instID) REFERENCES Inst (instID),\n FOREIGN KEY (paperID) REFERENCES Papers (paperID)\n);\nCREATE TABLE Inst (\n instID INTEGER,\n name TEXT,\n country TEXT, -- the home country of the institution (this is obviously an impoverished model)\n PRIMARY KEY (instID)\n);\nCREATE TABLE Papers (\n paperID INTEGER,\n title TEXT,\n PRIMARY KEY (paperID)\n);"} +{"qid": "pool_0074", "split": "pool", "db_id": "tracking_grants_for_research", "question": "Which role is most common for the staff?", "gold_sql": "SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/tracking_grants_for_research/tracking_grants_for_research.sqlite", "schema": "CREATE TABLE `Document_Types` (\n`document_type_code` VARCHAR(10) PRIMARY KEY,\n`document_description` VARCHAR(255) NOT NULL\n);\nCREATE TABLE `Documents` (\n`document_id` INTEGER PRIMARY KEY,\n`document_type_code` VARCHAR(10),\n`grant_id` INTEGER NOT NULL,\n`sent_date` DATETIME NOT NULL,\n`response_received_date` DATETIME NOT NULL,\n`other_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`document_type_code` ) REFERENCES `Document_Types`(`document_type_code` ),\nFOREIGN KEY (`grant_id` ) REFERENCES `Grants`(`grant_id` )\n);\nCREATE TABLE `Grants` (\n`grant_id` INTEGER PRIMARY KEY,\n`organisation_id` INTEGER NOT NULL,\n`grant_amount` DECIMAL(19,4) NOT NULL DEFAULT 0,\n`grant_start_date` DATETIME NOT NULL,\n`grant_end_date` DATETIME NOT NULL,\n`other_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`organisation_id` ) REFERENCES `Organisations`(`organisation_id` )\n);\nCREATE TABLE `Organisation_Types` (\n`organisation_type` VARCHAR(10) PRIMARY KEY,\n`organisation_type_description` VARCHAR(255) NOT NULL\n);\nCREATE TABLE `Organisations` (\n`organisation_id` INTEGER PRIMARY KEY,\n`organisation_type` VARCHAR(10) NOT NULL,\n`organisation_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`organisation_type` ) REFERENCES `Organisation_Types`(`organisation_type` )\n);\nCREATE TABLE `Project_Outcomes` (\n`project_id` INTEGER NOT NULL,\n`outcome_code` VARCHAR(10) NOT NULL,\n`outcome_details` VARCHAR(255),\nFOREIGN KEY (`project_id` ) REFERENCES `Projects`(`project_id` ),FOREIGN KEY (`outcome_code` ) REFERENCES `Research_Outcomes`(`outcome_code` )\n);\nCREATE TABLE `Project_Staff` (\n`staff_id` DOUBLE PRIMARY KEY,\n`project_id` INTEGER NOT NULL,\n`role_code` VARCHAR(10) NOT NULL,\n`date_from` DATETIME,\n`date_to` DATETIME,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`project_id` ) REFERENCES `Projects`(`project_id` ),FOREIGN KEY (`role_code` ) REFERENCES `Staff_Roles`(`role_code` )\n);\nCREATE TABLE `Projects` (\n`project_id` INTEGER PRIMARY KEY,\n`organisation_id` INTEGER NOT NULL,\n`project_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`organisation_id` ) REFERENCES `Organisations`(`organisation_id` )\n);\nCREATE TABLE `Research_Outcomes` (\n`outcome_code` VARCHAR(10) PRIMARY KEY,\n`outcome_description` VARCHAR(255) NOT NULL\n);\nCREATE TABLE `Research_Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`employer_organisation_id` INTEGER NOT NULL,\n`staff_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`employer_organisation_id` ) REFERENCES `Organisations`(`organisation_id` )\n);\nCREATE TABLE `Staff_Roles` (\n`role_code` VARCHAR(10) PRIMARY KEY,\n`role_description` VARCHAR(255) NOT NULL\n);\nCREATE TABLE `Tasks` (\n`task_id` INTEGER PRIMARY KEY,\n`project_id` INTEGER NOT NULL,\n`task_details` VARCHAR(255) NOT NULL,\n`eg Agree Objectives` VARCHAR(1),\nFOREIGN KEY (`project_id` ) REFERENCES `Projects`(`project_id` )\n);"} +{"qid": "pool_0075", "split": "pool", "db_id": "match_season", "question": "Which players are from Indonesia?", "gold_sql": "SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = \"Indonesia\"", "db_path": "databases/match_season/match_season.sqlite", "schema": "CREATE TABLE \"country\" (\n \"Country_id\" int,\n \"Country_name\" text,\n \"Capital\" text,\n \"Official_native_language\" text,\n PRIMARY KEY (\"Country_id\")\n);\nCREATE TABLE \"match_season\" (\n \"Season\" real,\n \"Player\" text,\n \"Position\" text,\n \"Country\" int,\n \"Team\" int,\n \"Draft_Pick_Number\" int,\n \"Draft_Class\" text,\n \"College\" text,\n PRIMARY KEY (\"Season\"),\n FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE \"player\" (\n \"Player_ID\" int,\n \"Player\" text,\n \"Years_Played\" text,\n \"Total_WL\" text,\n \"Singles_WL\" text,\n \"Doubles_WL\" text,\n \"Team\" int,\n PRIMARY KEY (\"Player_ID\"),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE `team` (\n `Team_id` int,\n `Name` text,\n PRIMARY KEY (`Team_id`)\n);"} +{"qid": "pool_0076", "split": "pool", "db_id": "sports_competition", "question": "What is the total number of clubs that have less than 10 medals in total?", "gold_sql": "SELECT count(*) FROM club_rank WHERE Total < 10", "db_path": "databases/sports_competition/sports_competition.sqlite", "schema": "CREATE TABLE \"club\" (\n\"Club_ID\" int,\n\"name\" text,\n\"Region\" text,\n\"Start_year\" text,\nPRIMARY KEY (\"Club_ID\")\n);\nCREATE TABLE \"club_rank\" (\n\"Rank\" real,\n\"Club_ID\" int,\n\"Gold\" real,\n\"Silver\" real,\n\"Bronze\" real,\n\"Total\" real,\nPRIMARY KEY (\"Rank\",\"Club_ID\")\nFOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`)\n);\nCREATE TABLE \"competition\" (\n\"Competition_ID\" int,\n\"Year\" real,\n\"Competition_type\" text,\n\"Country\" text,\nPRIMARY KEY (\"Competition_ID\")\n);\nCREATE TABLE \"competition_result\" (\n\"Competition_ID\" int,\n\"Club_ID_1\" int,\n\"Club_ID_2\" int,\n\"Score\" text,\nPRIMARY KEY (\"Competition_ID\",\"Club_ID_1\",\"Club_ID_2\"),\nFOREIGN KEY (`Club_ID_1`) REFERENCES `club`(`Club_ID`),\nFOREIGN KEY (`Club_ID_2`) REFERENCES `club`(`Club_ID`),\nFOREIGN KEY (`Competition_ID`) REFERENCES `competition`(`Competition_ID`)\n);\nCREATE TABLE \"player\" (\n\"Player_ID\" int,\n\"name\" text,\n\"Position\" text,\n\"Club_ID\" int,\n\"Apps\" real,\n\"Tries\" real,\n\"Goals\" text,\n\"Points\" real,\nPRIMARY KEY (\"Player_ID\"),\nFOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`)\n);"} +{"qid": "pool_0077", "split": "pool", "db_id": "assets_maintenance", "question": "Which engineer has visited the most times? Show the engineer id, first name and last name.", "gold_sql": "SELECT T1.engineer_id , T1.first_name , T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/assets_maintenance/assets_maintenance.sqlite", "schema": "CREATE TABLE `Asset_Parts` (\n`asset_id` INTEGER NOT NULL,\n`part_id` INTEGER NOT NULL,\nFOREIGN KEY (`part_id` ) REFERENCES `Parts`(`part_id` ),\nFOREIGN KEY (`asset_id` ) REFERENCES `Assets`(`asset_id` )\n);\nCREATE TABLE `Assets` (\n`asset_id` INTEGER PRIMARY KEY,\n`maintenance_contract_id` INTEGER NOT NULL,\n`supplier_company_id` INTEGER NOT NULL,\n`asset_details` VARCHAR(255),\n`asset_make` VARCHAR(20),\n`asset_model` VARCHAR(20),\n`asset_acquired_date` DATETIME,\n`asset_disposed_date` DATETIME,\n`other_asset_details` VARCHAR(255),\nFOREIGN KEY (`maintenance_contract_id` )\nREFERENCES `Maintenance_Contracts`(`maintenance_contract_id` ),\nFOREIGN KEY (`supplier_company_id` ) REFERENCES `Third_Party_Companies`(`company_id` )\n);\nCREATE TABLE `Engineer_Skills` (\n`engineer_id` INTEGER NOT NULL,\n`skill_id` INTEGER NOT NULL,\nFOREIGN KEY (`engineer_id` ) REFERENCES `Maintenance_Engineers`(`engineer_id` ),\nFOREIGN KEY (`skill_id` ) REFERENCES `Skills`(`skill_id` )\n);\nCREATE TABLE `Engineer_Visits` (\n`engineer_visit_id` INTEGER PRIMARY KEY,\n`contact_staff_id` INTEGER,\n`engineer_id` INTEGER NOT NULL,\n`fault_log_entry_id` INTEGER NOT NULL,\n`fault_status` VARCHAR(10) NOT NULL,\n`visit_start_datetime` DATETIME,\n`visit_end_datetime` DATETIME,\n`other_visit_details` VARCHAR(255),\nFOREIGN KEY (`fault_log_entry_id` ) REFERENCES `Fault_Log`(`fault_log_entry_id` ),\nFOREIGN KEY (`engineer_id` ) REFERENCES `Maintenance_Engineers`(`engineer_id` ),\nFOREIGN KEY (`contact_staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Fault_Log` (\n`fault_log_entry_id` INTEGER PRIMARY KEY,\n`asset_id` INTEGER NOT NULL,\n`recorded_by_staff_id` INTEGER NOT NULL,\n`fault_log_entry_datetime` DATETIME,\n`fault_description` VARCHAR(255),\n`other_fault_details` VARCHAR(255),\nFOREIGN KEY (`asset_id` ) REFERENCES `Assets`(`asset_id` ),\nFOREIGN KEY (`recorded_by_staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Fault_Log_Parts` (\n`fault_log_entry_id` INTEGER NOT NULL,\n`part_fault_id` INTEGER NOT NULL,\n`fault_status` VARCHAR(10) NOT NULL,\nFOREIGN KEY (`part_fault_id` ) REFERENCES `Part_Faults`(`part_fault_id` ),\nFOREIGN KEY (`fault_log_entry_id` ) REFERENCES `Fault_Log`(`fault_log_entry_id` )\n);\nCREATE TABLE `Maintenance_Contracts` (\n`maintenance_contract_id` INTEGER PRIMARY KEY,\n`maintenance_contract_company_id` INTEGER NOT NULL,\n`contract_start_date` DATETIME,\n`contract_end_date` DATETIME,\n`other_contract_details` VARCHAR(255),\nFOREIGN KEY (`maintenance_contract_company_id` ) REFERENCES `Third_Party_Companies`(`company_id` )\n);\nCREATE TABLE `Maintenance_Engineers` (\n`engineer_id` INTEGER PRIMARY KEY,\n`company_id` INTEGER NOT NULL,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`company_id` ) REFERENCES `Third_Party_Companies`(`company_id` )\n);\nCREATE TABLE `Part_Faults` (\n`part_fault_id` INTEGER PRIMARY KEY,\n`part_id` INTEGER NOT NULL,\n`fault_short_name` VARCHAR(20),\n`fault_description` VARCHAR(255),\n`other_fault_details` VARCHAR(255),\nFOREIGN KEY (`part_id` ) REFERENCES `Parts`(`part_id` )\n);\nCREATE TABLE `Parts` (\n`part_id` INTEGER PRIMARY KEY,\n`part_name` VARCHAR(255),\n`chargeable_yn` VARCHAR(1),\n`chargeable_amount` VARCHAR(20),\n`other_part_details` VARCHAR(255)\n);\nCREATE TABLE `Skills` (\n`skill_id` INTEGER PRIMARY KEY,\n`skill_code` VARCHAR(20),\n`skill_description` VARCHAR(255)\n);\nCREATE TABLE `Skills_Required_To_Fix` (\n`part_fault_id` INTEGER NOT NULL,\n`skill_id` INTEGER NOT NULL,\nFOREIGN KEY (`part_fault_id` ) REFERENCES `Part_Faults`(`part_fault_id` ),\nFOREIGN KEY (`skill_id` ) REFERENCES `Skills`(`skill_id` )\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_name` VARCHAR(255),\n`gender` VARCHAR(1),\n`other_staff_details` VARCHAR(255)\n);\nCREATE TABLE `Third_Party_Companies` (\n`company_id` INTEGER PRIMARY KEY ,\n`company_type` VARCHAR(5) NOT NULL,\n`company_name` VARCHAR(255),\n`company_address` VARCHAR(255),\n`other_company_details` VARCHAR(255)\n);"} +{"qid": "pool_0078", "split": "pool", "db_id": "shop_membership", "question": "What is the number of branches that have more than the average number of memberships?", "gold_sql": "SELECT count(*) FROM branch WHERE membership_amount > (SELECT avg(membership_amount) FROM branch)", "db_path": "databases/shop_membership/shop_membership.sqlite", "schema": "CREATE TABLE \"branch\" (\n\"Branch_ID\" int,\n\"Name\" text,\n\"Open_year\" text,\n\"Address_road\" text,\n\"City\" text,\n\"membership_amount\" text,\nPRIMARY KEY (\"Branch_ID\")\n);\nCREATE TABLE \"member\" (\n\"Member_ID\" int,\n\"Card_Number\" text,\n\"Name\" text,\n\"Hometown\" text,\n\"Level\" int,\nPRIMARY KEY (\"Member_ID\")\n);\nCREATE TABLE \"membership_register_branch\" (\n\"Member_ID\" int,\n\"Branch_ID\" text,\n\"Register_Year\" text,\nPRIMARY KEY (\"Member_ID\"),\nFOREIGN KEY (\"Member_ID\") REFERENCES \"member\"(\"Member_ID\"),\nFOREIGN KEY (\"Branch_ID\") REFERENCES \"branch\"(\"Branch_ID\")\n);\nCREATE TABLE \"purchase\" (\n\"Member_ID\" int,\n\"Branch_ID\" text,\n\"Year\" text,\n\"Total_pounds\" real,\nPRIMARY KEY (\"Member_ID\",\"Branch_ID\",\"Year\"),\nFOREIGN KEY (\"Member_ID\") REFERENCES \"member\"(\"Member_ID\"),\nFOREIGN KEY (\"Branch_ID\") REFERENCES \"branch\"(\"Branch_ID\")\n);"} +{"qid": "pool_0079", "split": "pool", "db_id": "csu_1", "question": "How many faculty is there in total in the year of 2002?", "gold_sql": "SELECT sum(faculty) FROM faculty WHERE YEAR = 2002", "db_path": "databases/csu_1/csu_1.sqlite", "schema": "CREATE TABLE \"Campuses\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Campus\" TEXT, \n\t\"Location\" TEXT, \n\t\"County\" TEXT, \n\t\"Year\" INTEGER \n);\nCREATE TABLE \"csu_fees\" ( \n\t\"Campus\" INTEGER PRIMARY KEY, \n\t\"Year\" INTEGER, \n\t\"CampusFee\" INTEGER,\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"degrees\" ( \n\t\"Year\" INTEGER,\n\t\"Campus\" INTEGER, \n\t\"Degrees\" INTEGER,\n\tPRIMARY KEY (Year, Campus),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"discipline_enrollments\" ( \n\t\"Campus\" INTEGER, \n\t\"Discipline\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"Undergraduate\" INTEGER, \n\t\"Graduate\" INTEGER,\n\tPRIMARY KEY (Campus, Discipline),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"enrollments\" ( \n\t\"Campus\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"TotalEnrollment_AY\" INTEGER, \n\t\"FTE_AY\" INTEGER,\n\tPRIMARY KEY(Campus, Year),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"faculty\" ( \n\t\"Campus\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"Faculty\" REAL,\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id) \n);"} +{"qid": "pool_0080", "split": "pool", "db_id": "cinema", "question": "Show the cinema name and location for cinemas with capacity above average.", "gold_sql": "SELECT name , LOCATION FROM cinema WHERE capacity > (SELECT avg(capacity) FROM cinema)", "db_path": "databases/cinema/cinema.sqlite", "schema": "CREATE TABLE \"cinema\" (\n\"Cinema_ID\" int,\n\"Name\" text,\n\"Openning_year\" int,\n\"Capacity\" int,\n\"Location\" text,\nPRIMARY KEY (\"Cinema_ID\"));\nCREATE TABLE \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\" int,\n\"Number_in_season\" int,\n\"Title\" text,\n\"Directed_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" text,\nPRIMARY KEY (\"Film_ID\")\n);\nCREATE TABLE \"schedule\" (\n\"Cinema_ID\" int,\n\"Film_ID\" int,\n\"Date\" text,\n\"Show_times_per_day\" int,\n\"Price\" float,\nPRIMARY KEY (\"Cinema_ID\",\"Film_ID\"),\nFOREIGN KEY (`Film_ID`) REFERENCES `film`(`Film_ID`),\nFOREIGN KEY (`Cinema_ID`) REFERENCES `cinema`(`Cinema_ID`)\n);"} +{"qid": "pool_0081", "split": "pool", "db_id": "csu_1", "question": "How many faculty members did the university that conferred the most degrees in 2002 have?", "gold_sql": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1", "db_path": "databases/csu_1/csu_1.sqlite", "schema": "CREATE TABLE \"Campuses\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Campus\" TEXT, \n\t\"Location\" TEXT, \n\t\"County\" TEXT, \n\t\"Year\" INTEGER \n);\nCREATE TABLE \"csu_fees\" ( \n\t\"Campus\" INTEGER PRIMARY KEY, \n\t\"Year\" INTEGER, \n\t\"CampusFee\" INTEGER,\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"degrees\" ( \n\t\"Year\" INTEGER,\n\t\"Campus\" INTEGER, \n\t\"Degrees\" INTEGER,\n\tPRIMARY KEY (Year, Campus),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"discipline_enrollments\" ( \n\t\"Campus\" INTEGER, \n\t\"Discipline\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"Undergraduate\" INTEGER, \n\t\"Graduate\" INTEGER,\n\tPRIMARY KEY (Campus, Discipline),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"enrollments\" ( \n\t\"Campus\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"TotalEnrollment_AY\" INTEGER, \n\t\"FTE_AY\" INTEGER,\n\tPRIMARY KEY(Campus, Year),\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id)\n);\nCREATE TABLE \"faculty\" ( \n\t\"Campus\" INTEGER, \n\t\"Year\" INTEGER, \n\t\"Faculty\" REAL,\n\tFOREIGN KEY (Campus) REFERENCES Campuses(Id) \n);"} +{"qid": "pool_0082", "split": "pool", "db_id": "movie_1", "question": "Find the titles of all movies directed by steven spielberg.", "gold_sql": "SELECT title FROM Movie WHERE director = 'Steven Spielberg'", "db_path": "databases/movie_1/movie_1.sqlite", "schema": "CREATE TABLE Movie(\n\tmID int primary key, \n\ttitle text, \n\tyear int, \n\tdirector text\n);\nCREATE TABLE Rating(\n\trID int, \n\tmID int, \n\tstars int, \n\tratingDate date,\n\tFOREIGN KEY (mID) references Movie(mID),\n\tFOREIGN KEY (rID) references Reviewer(rID)\n);\nCREATE TABLE Reviewer(\n\trID int primary key, \n\tname text);"} +{"qid": "pool_0083", "split": "pool", "db_id": "theme_gallery", "question": "Count the number of artists who are older than 46 and joined after 1990.", "gold_sql": "SELECT count(*) FROM artist WHERE age > 46 AND year_join > 1990", "db_path": "databases/theme_gallery/theme_gallery.sqlite", "schema": "CREATE TABLE \"artist\" (\n\"Artist_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Year_Join\" int,\n\"Age\" int,\nPRIMARY KEY (\"Artist_ID\")\n);\nCREATE TABLE \"exhibition\" (\n\"Exhibition_ID\" int,\n\"Year\" int,\n\"Theme\" text,\n\"Artist_ID\" int,\n\"Ticket_Price\" real,\nPRIMARY KEY (\"Exhibition_ID\"),\nFOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)\n);\nCREATE TABLE \"exhibition_record\" (\n\"Exhibition_ID\" int,\n\"Date\" text,\n\"Attendance\" int,\nPRIMARY KEY (\"Exhibition_ID\",\"Date\"),\nFOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`)\n);"} +{"qid": "pool_0084", "split": "pool", "db_id": "flight_4", "question": "What is the name, city, and country of the airport with the highest elevation?", "gold_sql": "SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1", "db_path": "databases/flight_4/flight_4.sqlite", "schema": "CREATE TABLE airlines (\n alid integer PRIMARY KEY, -- Id of the airline\n name text, -- Name of the airline\n iata varchar(2), -- 2-letter IATA code. empty or null if not assigned/unknown \n icao varchar(3), -- 3-letter ICAO code. empty or null if not assigned\n callsign text, -- Airline callsign\n country text, -- Country or territory where airline is incorporated\n active varchar(2) -- \"Y\" if the airline is or has until recently been operational,\n);\nCREATE TABLE airports (\n apid integer PRIMARY KEY, -- Id of the airport\n name text NOT NULL, -- Name of airport\n city text, -- Main city served by airport\n country text, -- Country or territory where airport is located\n x real, -- Latitude of airport: Decimal degrees, usually to six\n -- significant digits. Negative is South, positive is North\n y real, -- Longitude of airport: Decimal degrees, usually to six \n -- significant digits. Negative is West, positive is East\n elevation bigint, -- Altitude of airport measured in feets\n iata character varchar(3), -- 3-letter IATA code. empty or null if not assigned/unknown\n icao character varchar(4) -- 4-letter ICAO code. empty or null if not assigned\n \n);\nCREATE TABLE routes (\n rid integer PRIMARY KEY,\n dst_apid integer, -- Id of destination airport\n dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport\n src_apid bigint, -- Id of source airport\n src_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the source airport\n alid bigint, -- Id of airline\n airline varchar(4), -- 2-letter (IATA) or 3-letter (ICAO) code of the airline\n codeshare text, -- \"Y\" if this flight is a codeshare (that is, not operated by \n -- Airline, but another carrier), empty otherwise\n FOREIGN KEY(dst_apid) REFERENCES airports(apid),\n FOREIGN KEY(src_apid) REFERENCES airports(apid),\n FOREIGN KEY(alid) REFERENCES airlines(alid)\n);"} +{"qid": "pool_0085", "split": "pool", "db_id": "store_1", "question": "What are the names of the countries and average invoice size of the top countries by size?", "gold_sql": "SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10;", "db_path": "databases/store_1/store_1.sqlite", "schema": "CREATE TABLE albums\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n title VARCHAR(160) NOT NULL,\n artist_id INTEGER NOT NULL,\n FOREIGN KEY (artist_id) REFERENCES artists (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE artists\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE customers\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n first_name VARCHAR(40) NOT NULL,\n last_name VARCHAR(20) NOT NULL,\n company VARCHAR(80),\n address VARCHAR(70),\n city VARCHAR(40),\n state VARCHAR(40),\n country VARCHAR(40),\n postal_code VARCHAR(10),\n phone VARCHAR(24),\n fax VARCHAR(24),\n email VARCHAR(60) NOT NULL,\n support_rep_id INTEGER,\n FOREIGN KEY (support_rep_id) REFERENCES employees (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE employees\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n last_name VARCHAR(20) NOT NULL,\n first_name VARCHAR(20) NOT NULL,\n title VARCHAR(30),\n reports_to INTEGER,\n birth_date TIMESTAMP,\n hire_date TIMESTAMP,\n address VARCHAR(70),\n city VARCHAR(40),\n state VARCHAR(40),\n country VARCHAR(40),\n postal_code VARCHAR(10),\n phone VARCHAR(24),\n fax VARCHAR(24),\n email VARCHAR(60),\n FOREIGN KEY (reports_to) REFERENCES employees (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE genres\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE invoice_lines\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n invoice_id INTEGER NOT NULL,\n track_id INTEGER NOT NULL,\n unit_price NUMERIC(10,2) NOT NULL,\n quantity INTEGER NOT NULL,\n FOREIGN KEY (invoice_id) REFERENCES invoices (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (track_id) REFERENCES tracks (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE invoices\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n customer_id INTEGER NOT NULL,\n invoice_date TIMESTAMP NOT NULL,\n billing_address VARCHAR(70),\n billing_city VARCHAR(40),\n billing_state VARCHAR(40),\n billing_country VARCHAR(40),\n billing_postal_code VARCHAR(10),\n total NUMERIC(10,2) NOT NULL,\n FOREIGN KEY (customer_id) REFERENCES customers (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE media_types\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE playlist_tracks\n(\n playlist_id INTEGER NOT NULL,\n track_id INTEGER NOT NULL,\n CONSTRAINT PK_PlaylistTrack PRIMARY KEY (playlist_id, track_id),\n FOREIGN KEY (playlist_id) REFERENCES playlists (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (track_id) REFERENCES tracks (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE playlists\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE sqlite_sequence(name,seq);\nCREATE TABLE tracks\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(200) NOT NULL,\n album_id INTEGER,\n media_type_id INTEGER NOT NULL,\n genre_id INTEGER,\n composer VARCHAR(220),\n milliseconds INTEGER NOT NULL,\n bytes INTEGER,\n unit_price NUMERIC(10,2) NOT NULL,\n FOREIGN KEY (album_id) REFERENCES albums (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (genre_id) REFERENCES genres (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (media_type_id) REFERENCES media_types (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);"} +{"qid": "pool_0086", "split": "pool", "db_id": "movie_1", "question": "What is the title of the newest movie?", "gold_sql": "SELECT title FROM Movie WHERE YEAR = (SELECT max(YEAR) FROM Movie)", "db_path": "databases/movie_1/movie_1.sqlite", "schema": "CREATE TABLE Movie(\n\tmID int primary key, \n\ttitle text, \n\tyear int, \n\tdirector text\n);\nCREATE TABLE Rating(\n\trID int, \n\tmID int, \n\tstars int, \n\tratingDate date,\n\tFOREIGN KEY (mID) references Movie(mID),\n\tFOREIGN KEY (rID) references Reviewer(rID)\n);\nCREATE TABLE Reviewer(\n\trID int primary key, \n\tname text);"} +{"qid": "pool_0087", "split": "pool", "db_id": "entrepreneur", "question": "Return the investors who have invested in two or more entrepreneurs.", "gold_sql": "SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2", "db_path": "databases/entrepreneur/entrepreneur.sqlite", "schema": "CREATE TABLE \"entrepreneur\" (\n\"Entrepreneur_ID\" int,\n\"People_ID\" int,\n\"Company\" text,\n\"Money_Requested\" real,\n\"Investor\" text,\nPRIMARY KEY (\"Entrepreneur_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Height\" real,\n\"Weight\" real,\n\"Date_of_Birth\" text,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "pool_0088", "split": "pool", "db_id": "cre_Docs_and_Epenses", "question": "Return the ids and details corresponding to projects for which there are more than two documents.", "gold_sql": "SELECT T1.project_id , T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING count(*) > 2", "db_path": "databases/cre_Docs_and_Epenses/cre_Docs_and_Epenses.sqlite", "schema": "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);\nCREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);\nCREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);\nCREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);\nCREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);\nCREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);"} +{"qid": "pool_0089", "split": "pool", "db_id": "election", "question": "Return the names of all counties sorted by county name in descending alphabetical order.", "gold_sql": "SELECT County_name FROM county ORDER BY County_name DESC", "db_path": "databases/election/election.sqlite", "schema": "CREATE TABLE \"county\" (\n\"County_Id\" int,\n\"County_name\" text,\n\"Population\" real,\n\"Zip_code\" text,\nPRIMARY KEY (\"County_Id\")\n);\nCREATE TABLE \"election\" (\n\"Election_ID\" int,\n\"Counties_Represented\" text,\n\"District\" int,\n\"Delegate\" text,\n\"Party\" int,\n\"First_Elected\" real,\n\"Committee\" text,\nPRIMARY KEY (\"Election_ID\"),\nFOREIGN KEY (`Party`) REFERENCES `party`(`Party_ID`),\nFOREIGN KEY (`District`) REFERENCES `county`(`County_Id`)\n);\nCREATE TABLE \"party\" (\n\"Party_ID\" int,\n\"Year\" real,\n\"Party\" text,\n\"Governor\" text,\n\"Lieutenant_Governor\" text,\n\"Comptroller\" text,\n\"Attorney_General\" text,\n\"US_Senate\" text,\nPRIMARY KEY (\"Party_ID\")\n);"} +{"qid": "pool_0090", "split": "pool", "db_id": "assets_maintenance", "question": "List all every engineer's first name, last name, details and coresponding skill description.", "gold_sql": "SELECT T1.first_name , T1.last_name , T1.other_details , T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id", "db_path": "databases/assets_maintenance/assets_maintenance.sqlite", "schema": "CREATE TABLE `Asset_Parts` (\n`asset_id` INTEGER NOT NULL,\n`part_id` INTEGER NOT NULL,\nFOREIGN KEY (`part_id` ) REFERENCES `Parts`(`part_id` ),\nFOREIGN KEY (`asset_id` ) REFERENCES `Assets`(`asset_id` )\n);\nCREATE TABLE `Assets` (\n`asset_id` INTEGER PRIMARY KEY,\n`maintenance_contract_id` INTEGER NOT NULL,\n`supplier_company_id` INTEGER NOT NULL,\n`asset_details` VARCHAR(255),\n`asset_make` VARCHAR(20),\n`asset_model` VARCHAR(20),\n`asset_acquired_date` DATETIME,\n`asset_disposed_date` DATETIME,\n`other_asset_details` VARCHAR(255),\nFOREIGN KEY (`maintenance_contract_id` )\nREFERENCES `Maintenance_Contracts`(`maintenance_contract_id` ),\nFOREIGN KEY (`supplier_company_id` ) REFERENCES `Third_Party_Companies`(`company_id` )\n);\nCREATE TABLE `Engineer_Skills` (\n`engineer_id` INTEGER NOT NULL,\n`skill_id` INTEGER NOT NULL,\nFOREIGN KEY (`engineer_id` ) REFERENCES `Maintenance_Engineers`(`engineer_id` ),\nFOREIGN KEY (`skill_id` ) REFERENCES `Skills`(`skill_id` )\n);\nCREATE TABLE `Engineer_Visits` (\n`engineer_visit_id` INTEGER PRIMARY KEY,\n`contact_staff_id` INTEGER,\n`engineer_id` INTEGER NOT NULL,\n`fault_log_entry_id` INTEGER NOT NULL,\n`fault_status` VARCHAR(10) NOT NULL,\n`visit_start_datetime` DATETIME,\n`visit_end_datetime` DATETIME,\n`other_visit_details` VARCHAR(255),\nFOREIGN KEY (`fault_log_entry_id` ) REFERENCES `Fault_Log`(`fault_log_entry_id` ),\nFOREIGN KEY (`engineer_id` ) REFERENCES `Maintenance_Engineers`(`engineer_id` ),\nFOREIGN KEY (`contact_staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Fault_Log` (\n`fault_log_entry_id` INTEGER PRIMARY KEY,\n`asset_id` INTEGER NOT NULL,\n`recorded_by_staff_id` INTEGER NOT NULL,\n`fault_log_entry_datetime` DATETIME,\n`fault_description` VARCHAR(255),\n`other_fault_details` VARCHAR(255),\nFOREIGN KEY (`asset_id` ) REFERENCES `Assets`(`asset_id` ),\nFOREIGN KEY (`recorded_by_staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Fault_Log_Parts` (\n`fault_log_entry_id` INTEGER NOT NULL,\n`part_fault_id` INTEGER NOT NULL,\n`fault_status` VARCHAR(10) NOT NULL,\nFOREIGN KEY (`part_fault_id` ) REFERENCES `Part_Faults`(`part_fault_id` ),\nFOREIGN KEY (`fault_log_entry_id` ) REFERENCES `Fault_Log`(`fault_log_entry_id` )\n);\nCREATE TABLE `Maintenance_Contracts` (\n`maintenance_contract_id` INTEGER PRIMARY KEY,\n`maintenance_contract_company_id` INTEGER NOT NULL,\n`contract_start_date` DATETIME,\n`contract_end_date` DATETIME,\n`other_contract_details` VARCHAR(255),\nFOREIGN KEY (`maintenance_contract_company_id` ) REFERENCES `Third_Party_Companies`(`company_id` )\n);\nCREATE TABLE `Maintenance_Engineers` (\n`engineer_id` INTEGER PRIMARY KEY,\n`company_id` INTEGER NOT NULL,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`company_id` ) REFERENCES `Third_Party_Companies`(`company_id` )\n);\nCREATE TABLE `Part_Faults` (\n`part_fault_id` INTEGER PRIMARY KEY,\n`part_id` INTEGER NOT NULL,\n`fault_short_name` VARCHAR(20),\n`fault_description` VARCHAR(255),\n`other_fault_details` VARCHAR(255),\nFOREIGN KEY (`part_id` ) REFERENCES `Parts`(`part_id` )\n);\nCREATE TABLE `Parts` (\n`part_id` INTEGER PRIMARY KEY,\n`part_name` VARCHAR(255),\n`chargeable_yn` VARCHAR(1),\n`chargeable_amount` VARCHAR(20),\n`other_part_details` VARCHAR(255)\n);\nCREATE TABLE `Skills` (\n`skill_id` INTEGER PRIMARY KEY,\n`skill_code` VARCHAR(20),\n`skill_description` VARCHAR(255)\n);\nCREATE TABLE `Skills_Required_To_Fix` (\n`part_fault_id` INTEGER NOT NULL,\n`skill_id` INTEGER NOT NULL,\nFOREIGN KEY (`part_fault_id` ) REFERENCES `Part_Faults`(`part_fault_id` ),\nFOREIGN KEY (`skill_id` ) REFERENCES `Skills`(`skill_id` )\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_name` VARCHAR(255),\n`gender` VARCHAR(1),\n`other_staff_details` VARCHAR(255)\n);\nCREATE TABLE `Third_Party_Companies` (\n`company_id` INTEGER PRIMARY KEY ,\n`company_type` VARCHAR(5) NOT NULL,\n`company_name` VARCHAR(255),\n`company_address` VARCHAR(255),\n`other_company_details` VARCHAR(255)\n);"} +{"qid": "pool_0091", "split": "pool", "db_id": "music_1", "question": "What is the average rating of songs produced by female artists?", "gold_sql": "SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = \"Female\"", "db_path": "databases/music_1/music_1.sqlite", "schema": "CREATE TABLE artist(\n\tartist_name varchar2(50) not null,\n\tcountry varchar2(20),\n\tgender varchar2(20),\n\tpreferred_genre varchar2(50),\n\tconstraint a_name primary key(artist_name),\n\tforeign key(preferred_genre) references genre(g_name) ON DELETE CASCADE\n);\nCREATE TABLE files(\n\tf_id number(10) not null,\n\tartist_name varchar2(50),\n\tfile_size varchar2(20),\n\tduration varchar2(20),\n\tformats varchar2(20),\n\tprimary key(f_id),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE\n);\nCREATE TABLE genre(\n\tg_name varchar2(20) not null,\n\trating varchar2(10),\n\tmost_popular_in varchar2(50),\n\tprimary key(g_name)\n);\nCREATE TABLE song(\n\tsong_name varchar2(50),\n\tartist_name varchar2(50),\n\tcountry varchar2(20),\n\tf_id number(10),\n \tgenre_is varchar2(20),\n\trating number(10) check(rating>0 and rating<11),\n\tlanguages varchar2(20),\n\treleasedate Date, \n\tresolution number(10) not null,\n\tconstraint s_name primary key(song_name),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE,\n\tforeign key(f_id) references files(f_id) ON DELETE CASCADE,\n\tforeign key(genre_is) references genre(g_name) ON DELETE CASCADE\n);"} +{"qid": "pool_0092", "split": "pool", "db_id": "theme_gallery", "question": "Show all artist names and the year joined who are not from United States.", "gold_sql": "SELECT name , year_join FROM artist WHERE country != 'United States'", "db_path": "databases/theme_gallery/theme_gallery.sqlite", "schema": "CREATE TABLE \"artist\" (\n\"Artist_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Year_Join\" int,\n\"Age\" int,\nPRIMARY KEY (\"Artist_ID\")\n);\nCREATE TABLE \"exhibition\" (\n\"Exhibition_ID\" int,\n\"Year\" int,\n\"Theme\" text,\n\"Artist_ID\" int,\n\"Ticket_Price\" real,\nPRIMARY KEY (\"Exhibition_ID\"),\nFOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)\n);\nCREATE TABLE \"exhibition_record\" (\n\"Exhibition_ID\" int,\n\"Date\" text,\n\"Attendance\" int,\nPRIMARY KEY (\"Exhibition_ID\",\"Date\"),\nFOREIGN KEY (`Exhibition_ID`) REFERENCES `exhibition`(`Exhibition_ID`)\n);"} +{"qid": "pool_0093", "split": "pool", "db_id": "ship_mission", "question": "Please show the most common type of ships.", "gold_sql": "SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1", "db_path": "databases/ship_mission/ship_mission.sqlite", "schema": "CREATE TABLE \"mission\" (\n\"Mission_ID\" int,\n\"Ship_ID\" int,\n\"Code\" text,\n\"Launched_Year\" int,\n\"Location\" text,\n\"Speed_knots\" int,\n\"Fate\" text,\nPRIMARY KEY (\"Mission_ID\"),\nFOREIGN KEY (\"Ship_ID\") REFERENCES `ship`(\"Ship_ID\")\n);\nCREATE TABLE \"ship\" (\n\"Ship_ID\" int,\n\"Name\" text,\n\"Type\" text,\n\"Nationality\" text,\n\"Tonnage\" int,\nPRIMARY KEY (\"Ship_ID\")\n);"} +{"qid": "pool_0094", "split": "pool", "db_id": "music_2", "question": "How many bands are there?", "gold_sql": "SELECT count(*) FROM Band", "db_path": "databases/music_2/music_2.sqlite", "schema": "CREATE TABLE \"Albums\" ( \n\t\"AId\" INTEGER PRIMARY KEY, \n\t\"Title\" TEXT, \n\t\"Year\" INTEGER, \n\t\"Label\" TEXT, \n\t\"Type\" TEXT );\nCREATE TABLE \"Band\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Firstname\" TEXT, \n\t\"Lastname\" TEXT );\nCREATE TABLE \"Instruments\" ( \n\t\"SongId\" INTEGER, \n\t\"BandmateId\" INTEGER, \n\t\"Instrument\" TEXT ,\n\tPRIMARY KEY(SongId, BandmateId, Instrument),\n\tFOREIGN KEY (SongId) REFERENCES Songs(SongId),\n\tFOREIGN KEY (BandmateId) REFERENCES Band(Id)\n);\nCREATE TABLE \"Performance\" ( \n\t\"SongId\" INTEGER, \n\t\"Bandmate\" INTEGER, \n\t\"StagePosition\" TEXT,\n\tPRIMARY KEY(SongId, Bandmate),\n\tFOREIGN KEY (SongId) REFERENCES Songs(SongId),\n\tFOREIGN KEY (Bandmate) REFERENCES Band(Id)\n);\nCREATE TABLE \"Songs\" ( \n\t\"SongId\" INTEGER PRIMARY KEY, \n\t\"Title\" TEXT \n);\nCREATE TABLE \"Tracklists\" ( \n\t\"AlbumId\" INTEGER, \n\t\"Position\" INTEGER, \n\t\"SongId\" INTEGER ,\n\tPRIMARY KEY(AlbumId, Position),\n\tFOREIGN KEY (SongId) REFERENCES Songs(SongId),\n\tFOREIGN KEY (AlbumId) REFERENCES Albums(AId)\n);\nCREATE TABLE \"Vocals\" ( \n\t\"SongId\" INTEGER, \n\t\"Bandmate\" INTEGER, \n\t\"Type\" TEXT,\n\tPRIMARY KEY(SongId, Bandmate),\n\tFOREIGN KEY (SongId) REFERENCES Songs(SongId),\n\tFOREIGN KEY (Bandmate) REFERENCES Band(Id)\n);"} +{"qid": "pool_0095", "split": "pool", "db_id": "baseball_1", "question": "List all the salary values players received in 2010 and 2001.", "gold_sql": "SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001", "db_path": "databases/baseball_1/baseball_1.sqlite", "schema": "CREATE TABLE all_star (\n player_id TEXT,\n year INTEGER,\n game_num INTEGER,\n game_id TEXT,\n team_id TEXT,\n league_id TEXT,\n gp NUMERIC,\n starting_pos NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE appearances (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n g_all NUMERIC,\n gs NUMERIC,\n g_batting INTEGER,\n g_defense NUMERIC,\n g_p INTEGER,\n g_c INTEGER,\n g_1b INTEGER,\n g_2b INTEGER,\n g_3b INTEGER,\n g_ss INTEGER,\n g_lf INTEGER,\n g_cf INTEGER,\n g_rf INTEGER,\n g_of INTEGER,\n g_dh NUMERIC,\n g_ph NUMERIC,\n g_pr NUMERIC,\n foreign key (team_id) references team(team_id),\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ab NUMERIC,\n r NUMERIC,\n h NUMERIC,\n double NUMERIC,\n triple NUMERIC,\n hr NUMERIC,\n rbi NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n bb NUMERIC,\n so NUMERIC,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC,\nforeign key (player_id) references player(player_id)\n);\nCREATE TABLE batting_postseason (\n year INTEGER,\n round TEXT,\n player_id TEXT,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab INTEGER,\n r INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n rbi INTEGER,\n sb INTEGER,\n cs NUMERIC,\n bb INTEGER,\n so INTEGER,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE college (\n college_id TEXT,\n name_full TEXT,\n city TEXT,\n state TEXT,\n country TEXT);\nCREATE TABLE fielding (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po NUMERIC,\n a NUMERIC,\n e NUMERIC,\n dp NUMERIC,\n pb NUMERIC,\n wp NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n zr NUMERIC,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE fielding_outfield (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n glf NUMERIC,\n gcf NUMERIC,\n grf NUMERIC,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE fielding_postseason (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n round TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po INTEGER,\n a INTEGER,\n e INTEGER,\n dp INTEGER,\n tp INTEGER,\n pb NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (team_id) references player(team_id)\n);\nCREATE TABLE hall_of_fame (\n player_id TEXT,\n yearid INTEGER,\n votedby TEXT,\n ballots NUMERIC,\n needed NUMERIC,\n votes NUMERIC,\n inducted TEXT,\n category TEXT,\n needed_note TEXT,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE home_game (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n park_id TEXT,\n span_first TEXT,\n span_last TEXT,\n games INTEGER,\n openings INTEGER,\n attendance INTEGER,\n\tforeign key (team_id) references team(team_id),\n\tforeign key (park_id) references park(park_id)\n);\nCREATE TABLE manager (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank NUMERIC,\n plyr_mgr TEXT,\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE manager_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE manager_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won INTEGER,\n points_max INTEGER,\n votes_first INTEGER);\nCREATE TABLE manager_half (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n half INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank INTEGER,\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE park (\n park_id TEXT,\n park_name TEXT,\n park_alias TEXT,\n city TEXT,\n state TEXT,\n country TEXT);\nCREATE TABLE pitching (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts NUMERIC,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp NUMERIC,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk INTEGER,\n bfp NUMERIC,\n gf NUMERIC,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC);\nCREATE TABLE pitching_postseason (\n player_id TEXT,\n year INTEGER,\n round TEXT,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp TEXT,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk NUMERIC,\n bfp NUMERIC,\n gf INTEGER,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC);\nCREATE TABLE player (\n player_id TEXT,\n birth_year NUMERIC,\n birth_month NUMERIC,\n birth_day NUMERIC,\n birth_country TEXT,\n birth_state TEXT,\n birth_city TEXT,\n death_year NUMERIC,\n death_month NUMERIC,\n death_day NUMERIC,\n death_country TEXT,\n death_state TEXT,\n death_city TEXT,\n name_first TEXT,\n name_last TEXT,\n name_given TEXT,\n weight NUMERIC,\n height NUMERIC,\n bats TEXT,\n throws TEXT,\n debut TEXT,\n final_game TEXT,\n retro_id TEXT,\n bbref_id TEXT);\nCREATE TABLE player_award ( \n\tplayer_id TEXT, \n\taward_id TEXT, \n\tyear INTEGER, \n\tleague_id TEXT,\n \ttie TEXT,\n \tnotes TEXT,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE player_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won NUMERIC,\n points_max INTEGER,\n votes_first NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE player_college ( player_id TEXT,\n college_id TEXT,\n year INTEGER,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (college_id) references college(college_id)\n);\nCREATE TABLE postseason (\n year INTEGER,\n round TEXT,\n team_id_winner TEXT,\n league_id_winner TEXT,\n team_id_loser TEXT,\n league_id_loser TEXT,\n wins INTEGER,\n losses INTEGER,\n ties INTEGER);\nCREATE TABLE salary (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n salary INTEGER);\nCREATE TABLE team (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n franchise_id TEXT,\n div_id TEXT,\n rank INTEGER,\n g INTEGER,\n ghome NUMERIC,\n w INTEGER,\n l INTEGER,\n div_win TEXT,\n wc_win TEXT,\n lg_win TEXT,\n ws_win TEXT,\n r INTEGER,\n ab INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n bb INTEGER,\n so NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n hbp NUMERIC,\n sf NUMERIC,\n ra INTEGER,\n er INTEGER,\n era NUMERIC,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n ha INTEGER,\n hra INTEGER,\n bba INTEGER,\n soa INTEGER,\n e INTEGER,\n dp NUMERIC,\n fp NUMERIC,\n name TEXT,\n park TEXT,\n attendance NUMERIC,\n bpf INTEGER,\n ppf INTEGER,\n team_id_br TEXT,\n team_id_lahman45 TEXT,\n team_id_retro TEXT);\nCREATE TABLE team_franchise (\n franchise_id TEXT,\n franchise_name TEXT,\n active TEXT,\n na_assoc TEXT);\nCREATE TABLE team_half (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n half INTEGER,\n div_id TEXT,\n div_win TEXT,\n rank INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER);"} +{"qid": "pool_0096", "split": "pool", "db_id": "tracking_grants_for_research", "question": "List the project details of the project both producing patent and paper as outcomes.", "gold_sql": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent'", "db_path": "databases/tracking_grants_for_research/tracking_grants_for_research.sqlite", "schema": "CREATE TABLE `Document_Types` (\n`document_type_code` VARCHAR(10) PRIMARY KEY,\n`document_description` VARCHAR(255) NOT NULL\n);\nCREATE TABLE `Documents` (\n`document_id` INTEGER PRIMARY KEY,\n`document_type_code` VARCHAR(10),\n`grant_id` INTEGER NOT NULL,\n`sent_date` DATETIME NOT NULL,\n`response_received_date` DATETIME NOT NULL,\n`other_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`document_type_code` ) REFERENCES `Document_Types`(`document_type_code` ),\nFOREIGN KEY (`grant_id` ) REFERENCES `Grants`(`grant_id` )\n);\nCREATE TABLE `Grants` (\n`grant_id` INTEGER PRIMARY KEY,\n`organisation_id` INTEGER NOT NULL,\n`grant_amount` DECIMAL(19,4) NOT NULL DEFAULT 0,\n`grant_start_date` DATETIME NOT NULL,\n`grant_end_date` DATETIME NOT NULL,\n`other_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`organisation_id` ) REFERENCES `Organisations`(`organisation_id` )\n);\nCREATE TABLE `Organisation_Types` (\n`organisation_type` VARCHAR(10) PRIMARY KEY,\n`organisation_type_description` VARCHAR(255) NOT NULL\n);\nCREATE TABLE `Organisations` (\n`organisation_id` INTEGER PRIMARY KEY,\n`organisation_type` VARCHAR(10) NOT NULL,\n`organisation_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`organisation_type` ) REFERENCES `Organisation_Types`(`organisation_type` )\n);\nCREATE TABLE `Project_Outcomes` (\n`project_id` INTEGER NOT NULL,\n`outcome_code` VARCHAR(10) NOT NULL,\n`outcome_details` VARCHAR(255),\nFOREIGN KEY (`project_id` ) REFERENCES `Projects`(`project_id` ),FOREIGN KEY (`outcome_code` ) REFERENCES `Research_Outcomes`(`outcome_code` )\n);\nCREATE TABLE `Project_Staff` (\n`staff_id` DOUBLE PRIMARY KEY,\n`project_id` INTEGER NOT NULL,\n`role_code` VARCHAR(10) NOT NULL,\n`date_from` DATETIME,\n`date_to` DATETIME,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`project_id` ) REFERENCES `Projects`(`project_id` ),FOREIGN KEY (`role_code` ) REFERENCES `Staff_Roles`(`role_code` )\n);\nCREATE TABLE `Projects` (\n`project_id` INTEGER PRIMARY KEY,\n`organisation_id` INTEGER NOT NULL,\n`project_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`organisation_id` ) REFERENCES `Organisations`(`organisation_id` )\n);\nCREATE TABLE `Research_Outcomes` (\n`outcome_code` VARCHAR(10) PRIMARY KEY,\n`outcome_description` VARCHAR(255) NOT NULL\n);\nCREATE TABLE `Research_Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`employer_organisation_id` INTEGER NOT NULL,\n`staff_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`employer_organisation_id` ) REFERENCES `Organisations`(`organisation_id` )\n);\nCREATE TABLE `Staff_Roles` (\n`role_code` VARCHAR(10) PRIMARY KEY,\n`role_description` VARCHAR(255) NOT NULL\n);\nCREATE TABLE `Tasks` (\n`task_id` INTEGER PRIMARY KEY,\n`project_id` INTEGER NOT NULL,\n`task_details` VARCHAR(255) NOT NULL,\n`eg Agree Objectives` VARCHAR(1),\nFOREIGN KEY (`project_id` ) REFERENCES `Projects`(`project_id` )\n);"} +{"qid": "pool_0097", "split": "pool", "db_id": "game_injury", "question": "What are the maximum, minimum and average home games each stadium held?", "gold_sql": "SELECT max(home_games) , min(home_games) , avg(home_games) FROM stadium", "db_path": "databases/game_injury/game_injury.sqlite", "schema": "CREATE TABLE \"game\" (\n\"stadium_id\" int,\n\"id\" int,\n\"Season\" int,\n\"Date\" text,\n\"Home_team\" text,\n\"Away_team\" text,\n\"Score\" text,\n\"Competition\" text,\nprimary key (\"id\"),\nforeign key (\"stadium_id\") references `stadium`(\"id\")\n);\nCREATE TABLE \"injury_accident\" (\n\"game_id\" int,\n\"id\" int,\n\"Player\" text,\n\"Injury\" text,\n\"Number_of_matches\" text,\n\"Source\" text,\nprimary key (\"id\"),\nforeign key (\"game_id\") references `game`(\"id\")\n);\nCREATE TABLE \"stadium\" (\n\"id\" int,\n\"name\" text,\n\"Home_Games\" int,\n\"Average_Attendance\" real,\n\"Total_Attendance\" real,\n\"Capacity_Percentage\" real,\nprimary key (\"id\")\n);"} +{"qid": "pool_0098", "split": "pool", "db_id": "department_store", "question": "Return the id of the staff whose Staff Department Assignment was earlier than that of any Clerical Staff.", "gold_sql": "SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT max(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff')", "db_path": "databases/department_store/department_store.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`address_details` VARCHAR(255)\n);\nCREATE TABLE `Customer_Addresses` (\n`customer_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_from` DATETIME NOT NULL,\n`date_to` DATETIME,\nPRIMARY KEY (`customer_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status_code` VARCHAR(10) NOT NULL,\n`order_date` DATETIME NOT NULL,\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`customer_code` VARCHAR(20),\n`customer_name` VARCHAR(80),\n`customer_address` VARCHAR(255),\n`customer_phone` VARCHAR(80),\n`customer_email` VARCHAR(80)\n);\nCREATE TABLE `Department_Store_Chain` (\n`dept_store_chain_id` INTEGER PRIMARY KEY,\n`dept_store_chain_name` VARCHAR(80)\n);\nCREATE TABLE `Department_Stores` (\n`dept_store_id` INTEGER PRIMARY KEY,\n`dept_store_chain_id` INTEGER,\n`store_name` VARCHAR(80),\n`store_address` VARCHAR(255),\n`store_phone` VARCHAR(80),\n`store_email` VARCHAR(80),\nFOREIGN KEY (`dept_store_chain_id` ) REFERENCES `Department_Store_Chain`(`dept_store_chain_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`dept_store_id` INTEGER NOT NULL,\n`department_name` VARCHAR(80),\nFOREIGN KEY (`dept_store_id` ) REFERENCES `Department_Stores`(`dept_store_id` )\n);\nCREATE TABLE `Order_Items` (\n`order_item_id` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\nFOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Product_Suppliers` (\n`product_id` INTEGER NOT NULL,\n`supplier_id` INTEGER NOT NULL,\n`date_supplied_from` DATETIME NOT NULL,\n`date_supplied_to` DATETIME,\n`total_amount_purchased` VARCHAR(80),\n`total_value_purchased` DECIMAL(19,4),\nPRIMARY KEY (`product_id`, `supplier_id`),\nFOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_type_code` VARCHAR(10) NOT NULL,\n`product_name` VARCHAR(80),\n`product_price` DECIMAL(19,4)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_gender` VARCHAR(1),\n`staff_name` VARCHAR(80)\n);\nCREATE TABLE `Staff_Department_Assignments` (\n`staff_id` INTEGER NOT NULL,\n`department_id` INTEGER NOT NULL,\n`date_assigned_from` DATETIME NOT NULL,\n`job_title_code` VARCHAR(10) NOT NULL,\n`date_assigned_to` DATETIME,\nPRIMARY KEY (`staff_id`, `department_id`),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Supplier_Addresses` (\n`supplier_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_from` DATETIME NOT NULL,\n`date_to` DATETIME,\nPRIMARY KEY (`supplier_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` )\n);\nCREATE TABLE `Suppliers` (\n`supplier_id` INTEGER PRIMARY KEY,\n`supplier_name` VARCHAR(80),\n`supplier_phone` VARCHAR(80)\n);"} +{"qid": "pool_0099", "split": "pool", "db_id": "cre_Drama_Workshop_Groups", "question": "Return the the names of the drama workshop groups that are located in Feliciaberg city.", "gold_sql": "SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = \"Feliciaberg\"", "db_path": "databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite", "schema": "CREATE TABLE Addresses (\nAddress_ID VARCHAR(100) NOT NULL,\nLine_1 VARCHAR(255),\nLine_2 VARCHAR(255),\nCity_Town VARCHAR(255),\nState_County VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Address_ID),\nUNIQUE (Address_ID)\n);\nCREATE TABLE Bookings (\nBooking_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nWorkshop_Group_ID VARCHAR(100) NOT NULL,\nStatus_Code CHAR(15) NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Booking_ID),\nUNIQUE (Booking_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Clients (Client_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID)\n);\nCREATE TABLE Bookings_Services (\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Product_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (Product_ID) REFERENCES Services (Service_ID)\n);\nCREATE TABLE Clients (\nClient_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Email_Address VARCHAR(255),\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Client_ID),\nUNIQUE (Client_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Customer_Orders (\nOrder_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Order_ID),\nUNIQUE (Order_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Store_ID) REFERENCES Stores (Store_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Customer_ID),\nUNIQUE (Customer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Drama_Workshop_Groups (\nWorkshop_Group_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCurrency_Code CHAR(15) NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Workshop_Group_ID),\nUNIQUE (Workshop_Group_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Invoice_Items (\nInvoice_Item_ID INTEGER NOT NULL ,\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\nOrder_Item_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity INTEGER,\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Invoice_Item_ID),\nFOREIGN KEY (Order_Item_ID) REFERENCES Order_Items (Order_Item_ID),\nFOREIGN KEY (Invoice_ID) REFERENCES Invoices (Invoice_ID),\nFOREIGN KEY (Order_ID, Product_ID) REFERENCES Bookings_Services (Order_ID,Product_ID)\n);\nCREATE TABLE Invoices (\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\npayment_method_code CHAR(15),\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nOrder_Item_ID INTEGER NOT NULL,\nPRIMARY KEY (Invoice_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (payment_method_code) REFERENCES Ref_Payment_Methods (payment_method_code)\n);\nCREATE TABLE Marketing_Regions (\nMarketing_Region_Code CHAR(15) NOT NULL,\nMarketing_Region_Name VARCHAR(255) NOT NULL,\nMarketing_Region_Descriptrion VARCHAR(255) NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Marketing_Region_Code),\nUNIQUE (Marketing_Region_Code)\n);\nCREATE TABLE Order_Items (\nOrder_Item_ID INTEGER NOT NULL ,\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Order_Item_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Product_ID) REFERENCES Products (Product_ID)\n);\nCREATE TABLE Performers (\nPerformer_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Performer_ID),\nUNIQUE (Performer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Performers_in_Bookings (\nOrder_ID INTEGER NOT NULL,\nPerformer_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Performer_ID),\nFOREIGN KEY (Performer_ID) REFERENCES Performers (Performer_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID)\n);\nCREATE TABLE Products (\nProduct_ID VARCHAR(100) NOT NULL,\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nProduct_Description VARCHAR(255),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Product_ID),\nUNIQUE (Product_ID)\n);\nCREATE TABLE Ref_Payment_Methods (\npayment_method_code CHAR(10) NOT NULL,\npayment_method_description VARCHAR(80),\nPRIMARY KEY (payment_method_code),\nUNIQUE (payment_method_code)\n);\nCREATE TABLE Ref_Service_Types (\nService_Type_Code CHAR(15) NOT NULL,\nParent_Service_Type_Code CHAR(15),\nService_Type_Description VARCHAR(255),\nPRIMARY KEY (Service_Type_Code),\nUNIQUE (Service_Type_Code)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15),\nWorkshop_Group_ID INTEGER NOT NULL,\nProduct_Description VARCHAR(255),\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Service_ID),\nUNIQUE (Service_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID),\nFOREIGN KEY (Service_Type_Code) REFERENCES Ref_Service_Types (Service_Type_Code)\n);\nCREATE TABLE Stores (\nStore_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Store_ID),\nUNIQUE (Store_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID),\nFOREIGN KEY (Marketing_Region_Code) REFERENCES Marketing_Regions (Marketing_Region_Code)\n);"} +{"qid": "pool_0100", "split": "pool", "db_id": "allergy_1", "question": "Find the number of students who are older than 18 and do not have allergy to either food or animal.", "gold_sql": "SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" OR T2.allergytype = \"animal\")", "db_path": "databases/allergy_1/allergy_1.sqlite", "schema": "CREATE TABLE Allergy_Type (\n Allergy \t\t VARCHAR(20) PRIMARY KEY,\n AllergyType \t VARCHAR(20)\n);\nCREATE TABLE Has_Allergy (\n StuID \t\t INTEGER,\n Allergy \t\t VARCHAR(20),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(Allergy) REFERENCES Allergy_Type(Allergy)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0101", "split": "pool", "db_id": "hospital_1", "question": "What is the names of the physicians who prescribe medication Thesisin?", "gold_sql": "SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = \"Thesisin\"", "db_path": "databases/hospital_1/hospital_1.sqlite", "schema": "CREATE TABLE Affiliated_With (\n Physician INTEGER NOT NULL,\n Department INTEGER NOT NULL,\n PrimaryAffiliation BOOLEAN NOT NULL,\n CONSTRAINT fk_Affiliated_With_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Affiliated_With_Department_DepartmentID FOREIGN KEY(Department) REFERENCES Department(DepartmentID),\n PRIMARY KEY(Physician, Department)\n);\nCREATE TABLE Appointment (\n AppointmentID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL, \n PrepNurse INTEGER,\n Physician INTEGER NOT NULL,\n Start DATETIME NOT NULL,\n End DATETIME NOT NULL,\n ExaminationRoom TEXT NOT NULL,\n CONSTRAINT fk_Appointment_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Appointment_Nurse_EmployeeID FOREIGN KEY(PrepNurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_Appointment_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Block (\n BlockFloor INTEGER NOT NULL,\n BlockCode INTEGER NOT NULL,\n PRIMARY KEY(BlockFloor, BlockCode)\n);\nCREATE TABLE Department (\n DepartmentID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Head INTEGER NOT NULL,\n CONSTRAINT pk_Department PRIMARY KEY(DepartmentID),\n CONSTRAINT fk_Department_Physician_EmployeeID FOREIGN KEY(Head) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Medication (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Brand VARCHAR(30) NOT NULL,\n Description VARCHAR(30) NOT NULL\n);\nCREATE TABLE Nurse (\n EmployeeID INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n Registered BOOLEAN NOT NULL,\n SSN INTEGER NOT NULL\n);\nCREATE TABLE On_Call (\n Nurse INTEGER NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL,\n OnCallStart DATETIME NOT NULL,\n OnCallEnd DATETIME NOT NULL,\n PRIMARY KEY(Nurse, BlockFloor, BlockCode, OnCallStart, OnCallEnd),\n CONSTRAINT fk_OnCall_Nurse_EmployeeID FOREIGN KEY(Nurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_OnCall_Block_Floor FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode) \n);\nCREATE TABLE Patient (\n SSN INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Address VARCHAR(30) NOT NULL,\n Phone VARCHAR(30) NOT NULL,\n InsuranceID INTEGER NOT NULL,\n PCP INTEGER NOT NULL,\n CONSTRAINT fk_Patient_Physician_EmployeeID FOREIGN KEY(PCP) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Physician (\n EmployeeID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n SSN INTEGER NOT NULL,\n CONSTRAINT pk_physician PRIMARY KEY(EmployeeID)\n);\nCREATE TABLE Prescribes (\n Physician INTEGER NOT NULL,\n Patient INTEGER NOT NULL, \n Medication INTEGER NOT NULL, \n Date DATETIME NOT NULL,\n Appointment INTEGER, \n Dose VARCHAR(30) NOT NULL,\n PRIMARY KEY(Physician, Patient, Medication, Date),\n CONSTRAINT fk_Prescribes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Prescribes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Prescribes_Medication_Code FOREIGN KEY(Medication) REFERENCES Medication(Code),\n CONSTRAINT fk_Prescribes_Appointment_AppointmentID FOREIGN KEY(Appointment) REFERENCES Appointment(AppointmentID)\n);\nCREATE TABLE Procedures (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Cost REAL NOT NULL\n);\nCREATE TABLE Room (\n RoomNumber INTEGER PRIMARY KEY NOT NULL,\n RoomType VARCHAR(30) NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL, \n Unavailable BOOLEAN NOT NULL,\n CONSTRAINT fk_Room_Block_PK FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode)\n);\nCREATE TABLE Stay (\n StayID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL,\n Room INTEGER NOT NULL,\n StayStart DATETIME NOT NULL,\n StayEnd DATETIME NOT NULL,\n CONSTRAINT fk_Stay_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Stay_Room_Number FOREIGN KEY(Room) REFERENCES Room(RoomNumber)\n);\nCREATE TABLE Trained_In (\n Physician INTEGER NOT NULL,\n Treatment INTEGER NOT NULL,\n CertificationDate DATETIME NOT NULL,\n CertificationExpires DATETIME NOT NULL,\n CONSTRAINT fk_Trained_In_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Trained_In_Procedures_Code FOREIGN KEY(Treatment) REFERENCES Procedures(Code),\n PRIMARY KEY(Physician, Treatment)\n);\nCREATE TABLE Undergoes (\n Patient INTEGER NOT NULL,\n Procedures INTEGER NOT NULL,\n Stay INTEGER NOT NULL,\n DateUndergoes DATETIME NOT NULL,\n Physician INTEGER NOT NULL,\n AssistingNurse INTEGER,\n PRIMARY KEY(Patient, Procedures, Stay, DateUndergoes),\n CONSTRAINT fk_Undergoes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Undergoes_Procedures_Code FOREIGN KEY(Procedures) REFERENCES Procedures(Code),\n CONSTRAINT fk_Undergoes_Stay_StayID FOREIGN KEY(Stay) REFERENCES Stay(StayID),\n CONSTRAINT fk_Undergoes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Undergoes_Nurse_EmployeeID FOREIGN KEY(AssistingNurse) REFERENCES Nurse(EmployeeID)\n);"} +{"qid": "pool_0102", "split": "pool", "db_id": "college_1", "question": "What are the first names of all students taking accoutning and Computer Information Systems classes?", "gold_sql": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'", "db_path": "databases/college_1/college_1.sqlite", "schema": "CREATE TABLE CLASS (\nCLASS_CODE varchar(5) PRIMARY KEY,\nCRS_CODE varchar(10),\nCLASS_SECTION varchar(2),\nCLASS_TIME varchar(20),\nCLASS_ROOM varchar(8),\nPROF_NUM int,\nFOREIGN KEY (CRS_CODE) REFERENCES COURSE(CRS_CODE)\nFOREIGN KEY (PROF_NUM) REFERENCES EMPLOYEE(EMP_NUM)\n);\nCREATE TABLE COURSE (\nCRS_CODE varchar(10) PRIMARY KEY,\nDEPT_CODE varchar(10),\nCRS_DESCRIPTION varchar(35),\nCRS_CREDIT float(8),\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);\nCREATE TABLE DEPARTMENT (\nDEPT_CODE varchar(10) PRIMARY KEY,\nDEPT_NAME varchar(30),\nSCHOOL_CODE varchar(8),\nEMP_NUM int,\nDEPT_ADDRESS varchar(20),\nDEPT_EXTENSION varchar(4),\nFOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM)\n);\nCREATE TABLE EMPLOYEE (\nEMP_NUM int PRIMARY KEY,\nEMP_LNAME varchar(15),\nEMP_FNAME varchar(12),\nEMP_INITIAL varchar(1),\nEMP_JOBCODE varchar(5),\nEMP_HIREDATE datetime,\nEMP_DOB datetime\n);\nCREATE TABLE ENROLL (\nCLASS_CODE varchar(5),\nSTU_NUM int,\nENROLL_GRADE varchar(50),\nFOREIGN KEY (CLASS_CODE) REFERENCES CLASS(CLASS_CODE)\nFOREIGN KEY (STU_NUM) REFERENCES STUDENT(STU_NUM)\n);\nCREATE TABLE PROFESSOR (\nEMP_NUM int,\nDEPT_CODE varchar(10),\nPROF_OFFICE varchar(50),\nPROF_EXTENSION varchar(4),\nPROF_HIGH_DEGREE varchar(5),\nFOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM),\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);\nCREATE TABLE STUDENT (\nSTU_NUM int PRIMARY KEY,\nSTU_LNAME varchar(15),\nSTU_FNAME varchar(15),\nSTU_INIT varchar(1),\nSTU_DOB datetime,\nSTU_HRS int,\nSTU_CLASS varchar(2),\nSTU_GPA float(8),\nSTU_TRANSFER numeric,\nDEPT_CODE varchar(18),\nSTU_PHONE varchar(4),\nPROF_NUM int,\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);"} +{"qid": "pool_0103", "split": "pool", "db_id": "icfp_1", "question": "What is the last name of the author that has published the most papers?", "gold_sql": "SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname , t1.lname ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/icfp_1/icfp_1.sqlite", "schema": "CREATE TABLE Authors (\n authID INTEGER,\n lname TEXT,\n fname TEXT,\n PRIMARY KEY (authID)\n);\nCREATE TABLE Authorship (\n authID INTEGER,\n instID INTEGER,\n paperID INTEGER,\n authOrder INTEGER,\n PRIMARY KEY (authID, instID, paperID),\n FOREIGN KEY (authID) REFERENCES Authors (authID),\n FOREIGN KEY (instID) REFERENCES Inst (instID),\n FOREIGN KEY (paperID) REFERENCES Papers (paperID)\n);\nCREATE TABLE Inst (\n instID INTEGER,\n name TEXT,\n country TEXT, -- the home country of the institution (this is obviously an impoverished model)\n PRIMARY KEY (instID)\n);\nCREATE TABLE Papers (\n paperID INTEGER,\n title TEXT,\n PRIMARY KEY (paperID)\n);"} +{"qid": "pool_0104", "split": "pool", "db_id": "dorm_1", "question": "Find the name of amenities of the dorm where the student with last name Smith is living in.", "gold_sql": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith'", "db_path": "databases/dorm_1/dorm_1.sqlite", "schema": "CREATE TABLE Dorm (\n dormid\t\tINTEGER,\n dorm_name\tVARCHAR(20),\n student_capacity\tINTEGER,\n gender\t\t\tVARCHAR(1)\n);\nCREATE TABLE Dorm_amenity (\n amenid\t\t\tINTEGER,\n amenity_name\t\tVARCHAR(25)\n);\nCREATE TABLE Has_amenity (\n dormid\t\t\tINTEGER,\n amenid\t\t\t\tINTEGER,\n\tFOREIGN KEY (dormid) REFERENCES `Dorm`(dormid),\n\tFOREIGN KEY (amenid) REFERENCES `Dorm_amenity`(amenid)\n);\nCREATE TABLE Lives_in (\n stuid \t INTEGER,\n dormid\t\tINTEGER,\n room_number\tINTEGER,\n\tFOREIGN KEY (stuid) REFERENCES `Student`(StuID),\n FOREIGN KEY (dormid) REFERENCES `Dorm`(dormid)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0105", "split": "pool", "db_id": "browser_web", "question": "Which accelerator name contains substring \"Opera\"?", "gold_sql": "SELECT name FROM web_client_accelerator WHERE name LIKE \"%Opera%\"", "db_path": "databases/browser_web/browser_web.sqlite", "schema": "CREATE TABLE \"Web_client_accelerator\" (\n\"id\" int,\n\"name\" text,\n\"Operating_system\" text,\n\"Client\" text,\n\"Connection\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"accelerator_compatible_browser\" (\n\"accelerator_id\" int,\n\"browser_id\" int,\n\"compatible_since_year\" int,\nprimary key(\"accelerator_id\", \"browser_id\"),\nforeign key (\"accelerator_id\") references `Web_client_accelerator`(\"id\"),\nforeign key (\"browser_id\") references `browser`(\"id\")\n);\nCREATE TABLE \"browser\" (\n\"id\" int,\n\"name\" text,\n\"market_share\" real,\nprimary key(\"id\")\n);"} +{"qid": "pool_0106", "split": "pool", "db_id": "wine_1", "question": "List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.", "gold_sql": "SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name", "db_path": "databases/wine_1/wine_1.sqlite", "schema": "CREATE TABLE \"appellations\" ( \n\t\"No\" INTEGER PRIMARY KEY, \n\t\"Appelation\" TEXT UNIQUE, \n\t\"County\" TEXT, \n\t\"State\" TEXT, \n\t\"Area\" TEXT, \n\t\"isAVA\" TEXT\n);\nCREATE TABLE \"grapes\" ( \n\t\"ID\" INTEGER PRIMARY KEY, \n\t\"Grape\" TEXT UNIQUE, \n\t\"Color\" TEXT \n);\nCREATE TABLE \"wine\" ( \n\t\"No\" INTEGER, \n\t\"Grape\" TEXT, \n\t\"Winery\" TEXT, \n\t\"Appelation\" TEXT, \n\t\"State\" TEXT, \n\t\"Name\" TEXT, \n\t\"Year\" INTEGER, \n\t\"Price\" INTEGER, \n\t\"Score\" INTEGER, \n\t\"Cases\" INTEGER, \n\t\"Drink\" TEXT,\n\tFOREIGN KEY (Grape) REFERENCES grapes(Grape),\n\tFOREIGN KEY (Appelation) REFERENCES appellations(Appelation)\n);"} +{"qid": "pool_0107", "split": "pool", "db_id": "chinook_1", "question": "What is the average unit price of tracks that belong to Jazz genre?", "gold_sql": "SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Jazz\"", "db_path": "databases/chinook_1/chinook_1.sqlite", "schema": "CREATE TABLE `Album` (\n `AlbumId` integer NOT NULL\n, `Title` varchar(160) NOT NULL\n, `ArtistId` integer NOT NULL\n, PRIMARY KEY (`AlbumId`)\n, CONSTRAINT `FK_AlbumArtistId` FOREIGN KEY (`ArtistId`) REFERENCES `Artist` (`ArtistId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Artist` (\n `ArtistId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`ArtistId`)\n);\nCREATE TABLE `Customer` (\n `CustomerId` integer NOT NULL\n, `FirstName` varchar(40) NOT NULL\n, `LastName` varchar(20) NOT NULL\n, `Company` varchar(80) DEFAULT NULL\n, `Address` varchar(70) DEFAULT NULL\n, `City` varchar(40) DEFAULT NULL\n, `State` varchar(40) DEFAULT NULL\n, `Country` varchar(40) DEFAULT NULL\n, `PostalCode` varchar(10) DEFAULT NULL\n, `Phone` varchar(24) DEFAULT NULL\n, `Fax` varchar(24) DEFAULT NULL\n, `Email` varchar(60) NOT NULL\n, `SupportRepId` integer DEFAULT NULL\n, PRIMARY KEY (`CustomerId`)\n, CONSTRAINT `FK_CustomerSupportRepId` FOREIGN KEY (`SupportRepId`) REFERENCES `Employee` (`EmployeeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Employee` (\n `EmployeeId` integer NOT NULL\n, `LastName` varchar(20) NOT NULL\n, `FirstName` varchar(20) NOT NULL\n, `Title` varchar(30) DEFAULT NULL\n, `ReportsTo` integer DEFAULT NULL\n, `BirthDate` datetime DEFAULT NULL\n, `HireDate` datetime DEFAULT NULL\n, `Address` varchar(70) DEFAULT NULL\n, `City` varchar(40) DEFAULT NULL\n, `State` varchar(40) DEFAULT NULL\n, `Country` varchar(40) DEFAULT NULL\n, `PostalCode` varchar(10) DEFAULT NULL\n, `Phone` varchar(24) DEFAULT NULL\n, `Fax` varchar(24) DEFAULT NULL\n, `Email` varchar(60) DEFAULT NULL\n, PRIMARY KEY (`EmployeeId`)\n, CONSTRAINT `FK_EmployeeReportsTo` FOREIGN KEY (`ReportsTo`) REFERENCES `Employee` (`EmployeeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Genre` (\n `GenreId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`GenreId`)\n);\nCREATE TABLE `Invoice` (\n `InvoiceId` integer NOT NULL\n, `CustomerId` integer NOT NULL\n, `InvoiceDate` datetime NOT NULL\n, `BillingAddress` varchar(70) DEFAULT NULL\n, `BillingCity` varchar(40) DEFAULT NULL\n, `BillingState` varchar(40) DEFAULT NULL\n, `BillingCountry` varchar(40) DEFAULT NULL\n, `BillingPostalCode` varchar(10) DEFAULT NULL\n, `Total` decimal(10,2) NOT NULL\n, PRIMARY KEY (`InvoiceId`)\n, CONSTRAINT `FK_InvoiceCustomerId` FOREIGN KEY (`CustomerId`) REFERENCES `Customer` (`CustomerId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `InvoiceLine` (\n `InvoiceLineId` integer NOT NULL\n, `InvoiceId` integer NOT NULL\n, `TrackId` integer NOT NULL\n, `UnitPrice` decimal(10,2) NOT NULL\n, `Quantity` integer NOT NULL\n, PRIMARY KEY (`InvoiceLineId`)\n, CONSTRAINT `FK_InvoiceLineInvoiceId` FOREIGN KEY (`InvoiceId`) REFERENCES `Invoice` (`InvoiceId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_InvoiceLineTrackId` FOREIGN KEY (`TrackId`) REFERENCES `Track` (`TrackId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `MediaType` (\n `MediaTypeId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`MediaTypeId`)\n);\nCREATE TABLE `Playlist` (\n `PlaylistId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`PlaylistId`)\n);\nCREATE TABLE `PlaylistTrack` (\n `PlaylistId` integer NOT NULL\n, `TrackId` integer NOT NULL\n, PRIMARY KEY (`PlaylistId`,`TrackId`)\n, CONSTRAINT `FK_PlaylistTrackPlaylistId` FOREIGN KEY (`PlaylistId`) REFERENCES `Playlist` (`PlaylistId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_PlaylistTrackTrackId` FOREIGN KEY (`TrackId`) REFERENCES `Track` (`TrackId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Track` (\n `TrackId` integer NOT NULL\n, `Name` varchar(200) NOT NULL\n, `AlbumId` integer DEFAULT NULL\n, `MediaTypeId` integer NOT NULL\n, `GenreId` integer DEFAULT NULL\n, `Composer` varchar(220) DEFAULT NULL\n, `Milliseconds` integer NOT NULL\n, `Bytes` integer DEFAULT NULL\n, `UnitPrice` decimal(10,2) NOT NULL\n, PRIMARY KEY (`TrackId`)\n, CONSTRAINT `FK_TrackAlbumId` FOREIGN KEY (`AlbumId`) REFERENCES `Album` (`AlbumId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_TrackGenreId` FOREIGN KEY (`GenreId`) REFERENCES `Genre` (`GenreId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_TrackMediaTypeId` FOREIGN KEY (`MediaTypeId`) REFERENCES `MediaType` (`MediaTypeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);"} +{"qid": "pool_0108", "split": "pool", "db_id": "flight_1", "question": "What is the aircraft name for the flight with number 99", "gold_sql": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99", "db_path": "databases/flight_1/flight_1.sqlite", "schema": "CREATE TABLE aircraft(\n\taid number(9,0) primary key,\n\tname varchar2(30),\n\tdistance number(6,0));\nCREATE TABLE certificate(\n\teid number(9,0),\n\taid number(9,0),\n\tprimary key(eid,aid),\n\tforeign key(\"eid\") references `employee`(\"eid\"),\n\tforeign key(\"aid\") references `aircraft`(\"aid\"));\nCREATE TABLE employee(\n\teid number(9,0) primary key,\n\tname varchar2(30),\n\tsalary number(10,2));\nCREATE TABLE flight(\n\tflno number(4,0) primary key,\n\torigin varchar2(20),\n\tdestination varchar2(20),\n\tdistance number(6,0),\n\tdeparture_date date,\n\tarrival_date date,\n\tprice number(7,2),\n aid number(9,0),\n foreign key(\"aid\") references `aircraft`(\"aid\"));"} +{"qid": "pool_0109", "split": "pool", "db_id": "e_learning", "question": "Return the login names of the students whose family name is \"Ward\".", "gold_sql": "SELECT login_name FROM Students WHERE family_name = \"Ward\"", "db_path": "databases/e_learning/e_learning.sqlite", "schema": "CREATE TABLE `Course_Authors_and_Tutors` (\n`author_id` INTEGER PRIMARY KEY,\n`author_tutor_ATB` VARCHAR(3),\n`login_name` VARCHAR(40),\n`password` VARCHAR(40),\n`personal_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`family_name` VARCHAR(80),\n`gender_mf` VARCHAR(1),\n`address_line_1` VARCHAR(80)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`author_id` INTEGER NOT NULL,\n`subject_id` INTEGER NOT NULL,\n`course_name` VARCHAR(120),\n`course_description` VARCHAR(255),\nFOREIGN KEY (`author_id` ) REFERENCES `Course_Authors_and_Tutors`(`author_id` ),\nFOREIGN KEY (`subject_id` ) REFERENCES `Subjects`(`subject_id` )\n);\nCREATE TABLE `Student_Course_Enrolment` (\n`registration_id` INTEGER PRIMARY KEY,\n`student_id` INTEGER NOT NULL,\n`course_id` INTEGER NOT NULL,\n`date_of_enrolment` DATETIME NOT NULL,\n`date_of_completion` DATETIME NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Tests_Taken` (\n`registration_id` INTEGER NOT NULL,\n`date_test_taken` DATETIME NOT NULL,\n`test_result` VARCHAR(255),\nFOREIGN KEY (`registration_id` ) REFERENCES `Student_Course_Enrolment`(`registration_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`date_of_registration` DATETIME,\n`date_of_latest_logon` DATETIME,\n`login_name` VARCHAR(40),\n`password` VARCHAR(10),\n`personal_name` VARCHAR(40),\n`middle_name` VARCHAR(40),\n`family_name` VARCHAR(40)\n);\nCREATE TABLE `Subjects` (\n`subject_id` INTEGER PRIMARY KEY,\n`subject_name` VARCHAR(120)\n);"} +{"qid": "pool_0110", "split": "pool", "db_id": "activity_1", "question": "What is the total number of faculty members?", "gold_sql": "SELECT count(*) FROM Faculty", "db_path": "databases/activity_1/activity_1.sqlite", "schema": "CREATE TABLE Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);\nCREATE TABLE Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0111", "split": "pool", "db_id": "store_1", "question": "What are the names of all playlists that have more than 100 tracks?", "gold_sql": "SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id) > 100;", "db_path": "databases/store_1/store_1.sqlite", "schema": "CREATE TABLE albums\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n title VARCHAR(160) NOT NULL,\n artist_id INTEGER NOT NULL,\n FOREIGN KEY (artist_id) REFERENCES artists (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE artists\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE customers\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n first_name VARCHAR(40) NOT NULL,\n last_name VARCHAR(20) NOT NULL,\n company VARCHAR(80),\n address VARCHAR(70),\n city VARCHAR(40),\n state VARCHAR(40),\n country VARCHAR(40),\n postal_code VARCHAR(10),\n phone VARCHAR(24),\n fax VARCHAR(24),\n email VARCHAR(60) NOT NULL,\n support_rep_id INTEGER,\n FOREIGN KEY (support_rep_id) REFERENCES employees (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE employees\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n last_name VARCHAR(20) NOT NULL,\n first_name VARCHAR(20) NOT NULL,\n title VARCHAR(30),\n reports_to INTEGER,\n birth_date TIMESTAMP,\n hire_date TIMESTAMP,\n address VARCHAR(70),\n city VARCHAR(40),\n state VARCHAR(40),\n country VARCHAR(40),\n postal_code VARCHAR(10),\n phone VARCHAR(24),\n fax VARCHAR(24),\n email VARCHAR(60),\n FOREIGN KEY (reports_to) REFERENCES employees (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE genres\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE invoice_lines\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n invoice_id INTEGER NOT NULL,\n track_id INTEGER NOT NULL,\n unit_price NUMERIC(10,2) NOT NULL,\n quantity INTEGER NOT NULL,\n FOREIGN KEY (invoice_id) REFERENCES invoices (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (track_id) REFERENCES tracks (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE invoices\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n customer_id INTEGER NOT NULL,\n invoice_date TIMESTAMP NOT NULL,\n billing_address VARCHAR(70),\n billing_city VARCHAR(40),\n billing_state VARCHAR(40),\n billing_country VARCHAR(40),\n billing_postal_code VARCHAR(10),\n total NUMERIC(10,2) NOT NULL,\n FOREIGN KEY (customer_id) REFERENCES customers (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE media_types\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE playlist_tracks\n(\n playlist_id INTEGER NOT NULL,\n track_id INTEGER NOT NULL,\n CONSTRAINT PK_PlaylistTrack PRIMARY KEY (playlist_id, track_id),\n FOREIGN KEY (playlist_id) REFERENCES playlists (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (track_id) REFERENCES tracks (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE playlists\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE sqlite_sequence(name,seq);\nCREATE TABLE tracks\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(200) NOT NULL,\n album_id INTEGER,\n media_type_id INTEGER NOT NULL,\n genre_id INTEGER,\n composer VARCHAR(220),\n milliseconds INTEGER NOT NULL,\n bytes INTEGER,\n unit_price NUMERIC(10,2) NOT NULL,\n FOREIGN KEY (album_id) REFERENCES albums (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (genre_id) REFERENCES genres (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (media_type_id) REFERENCES media_types (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);"} +{"qid": "pool_0112", "split": "pool", "db_id": "insurance_and_eClaims", "question": "List the names of all the customers in alphabetical order.", "gold_sql": "SELECT customer_details FROM customers ORDER BY customer_details", "db_path": "databases/insurance_and_eClaims/insurance_and_eClaims.sqlite", "schema": "CREATE TABLE Claim_Headers (\nClaim_Header_ID INTEGER NOT NULL,\nClaim_Status_Code CHAR(15) NOT NULL,\nClaim_Type_Code CHAR(15) NOT NULL,\nPolicy_ID INTEGER NOT NULL,\nDate_of_Claim DATETIME,\nDate_of_Settlement DATETIME,\nAmount_Claimed DECIMAL(20,4),\nAmount_Piad DECIMAL(20,4),\nPRIMARY KEY (Claim_Header_ID),\nFOREIGN KEY (Policy_ID) REFERENCES Policies (Policy_ID)\n);\nCREATE TABLE Claims_Documents (\nClaim_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nCreated_by_Staff_ID INTEGER,\nCreated_Date INTEGER,\nPRIMARY KEY (Claim_ID, Document_Type_Code),\nFOREIGN KEY (Claim_ID) REFERENCES Claim_Headers (Claim_Header_ID),\nFOREIGN KEY (Created_by_Staff_ID) REFERENCES Staff (Staff_ID)\n);\nCREATE TABLE Claims_Processing (\nClaim_Processing_ID INTEGER NOT NULL,\nClaim_ID INTEGER NOT NULL,\nClaim_Outcome_Code CHAR(15) NOT NULL,\nClaim_Stage_ID INTEGER NOT NULL,\nStaff_ID INTEGER,\nPRIMARY KEY (Claim_Processing_ID),\nFOREIGN KEY (Claim_ID) REFERENCES Claim_Headers (Claim_Header_ID),\nFOREIGN KEY (Staff_ID) REFERENCES Staff (Staff_ID)\n);\nCREATE TABLE Claims_Processing_Stages (\nClaim_Stage_ID INTEGER NOT NULL,\nNext_Claim_Stage_ID INTEGER,\nClaim_Status_Name VARCHAR(255) NOT NULL,\nClaim_Status_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Claim_Stage_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID INTEGER NOT NULL,\nCustomer_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Customer_ID)\n);\nCREATE TABLE Policies (\nPolicy_ID INTEGER NOT NULL,\nCustomer_ID INTEGER NOT NULL,\nPolicy_Type_Code CHAR(15) NOT NULL,\nStart_Date DATETIME,\nEnd_Date DATETIME,\nPRIMARY KEY (Policy_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID)\n);\nCREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nStaff_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Staff_ID)\n);"} +{"qid": "pool_0113", "split": "pool", "db_id": "aircraft", "question": "What are the total number of Domestic Passengers of airports that contain the word \"London\".", "gold_sql": "SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE \"%London%\"", "db_path": "databases/aircraft/aircraft.sqlite", "schema": "CREATE TABLE `aircraft` (\n \"Aircraft_ID\" int(11) NOT NULL,\n \"Aircraft\" varchar(50) NOT NULL,\n \"Description\" varchar(50) NOT NULL,\n \"Max_Gross_Weight\" varchar(50) NOT NULL,\n \"Total_disk_area\" varchar(50) NOT NULL,\n \"Max_disk_Loading\" varchar(50) NOT NULL,\n PRIMARY KEY (`Aircraft_ID`)\n);\nCREATE TABLE `airport` (\n\"Airport_ID\" int,\n\"Airport_Name\" text,\n\"Total_Passengers\" real,\n\"%_Change_2007\" text,\n\"International_Passengers\" real,\n\"Domestic_Passengers\" real,\n\"Transit_Passengers\" real,\n\"Aircraft_Movements\" real,\n\"Freight_Metric_Tonnes\" real,\nPRIMARY KEY (\"Airport_ID\")\n);\nCREATE TABLE `airport_aircraft` (\n\"ID\" int,\n\"Airport_ID\" int,\n\"Aircraft_ID\" int,\nPRIMARY KEY (\"Airport_ID\",\"Aircraft_ID\"),\nFOREIGN KEY (\"Airport_ID\") REFERENCES `airport`(`Airport_ID`),\nFOREIGN KEY (\"Aircraft_ID\") REFERENCES `aircraft`(`Aircraft_ID`)\n);\nCREATE TABLE `match` (\n\"Round\" real,\n\"Location\" text,\n\"Country\" text,\n\"Date\" text,\n\"Fastest_Qualifying\" text,\n\"Winning_Pilot\" text,\n\"Winning_Aircraft\" text,\nPRIMARY KEY (\"Round\"),\nFOREIGN KEY (`Winning_Aircraft`) REFERENCES `aircraft`(`Aircraft_ID`),\nFOREIGN KEY (`Winning_Pilot`) REFERENCES `pilot`(`Pilot_Id`)\n);\nCREATE TABLE `pilot` (\n `Pilot_Id` int(11) NOT NULL,\n `Name` varchar(50) NOT NULL,\n `Age` int(11) NOT NULL,\n PRIMARY KEY (`Pilot_Id`)\n);"} +{"qid": "pool_0114", "split": "pool", "db_id": "cre_Drama_Workshop_Groups", "question": "Check the invoices record and compute the average quantities ordered with the payment method \"MasterCard\".", "gold_sql": "SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = \"MasterCard\"", "db_path": "databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite", "schema": "CREATE TABLE Addresses (\nAddress_ID VARCHAR(100) NOT NULL,\nLine_1 VARCHAR(255),\nLine_2 VARCHAR(255),\nCity_Town VARCHAR(255),\nState_County VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Address_ID),\nUNIQUE (Address_ID)\n);\nCREATE TABLE Bookings (\nBooking_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nWorkshop_Group_ID VARCHAR(100) NOT NULL,\nStatus_Code CHAR(15) NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Booking_ID),\nUNIQUE (Booking_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Clients (Client_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID)\n);\nCREATE TABLE Bookings_Services (\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Product_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (Product_ID) REFERENCES Services (Service_ID)\n);\nCREATE TABLE Clients (\nClient_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Email_Address VARCHAR(255),\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Client_ID),\nUNIQUE (Client_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Customer_Orders (\nOrder_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Order_ID),\nUNIQUE (Order_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Store_ID) REFERENCES Stores (Store_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Customer_ID),\nUNIQUE (Customer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Drama_Workshop_Groups (\nWorkshop_Group_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCurrency_Code CHAR(15) NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Workshop_Group_ID),\nUNIQUE (Workshop_Group_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Invoice_Items (\nInvoice_Item_ID INTEGER NOT NULL ,\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\nOrder_Item_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity INTEGER,\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Invoice_Item_ID),\nFOREIGN KEY (Order_Item_ID) REFERENCES Order_Items (Order_Item_ID),\nFOREIGN KEY (Invoice_ID) REFERENCES Invoices (Invoice_ID),\nFOREIGN KEY (Order_ID, Product_ID) REFERENCES Bookings_Services (Order_ID,Product_ID)\n);\nCREATE TABLE Invoices (\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\npayment_method_code CHAR(15),\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nOrder_Item_ID INTEGER NOT NULL,\nPRIMARY KEY (Invoice_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (payment_method_code) REFERENCES Ref_Payment_Methods (payment_method_code)\n);\nCREATE TABLE Marketing_Regions (\nMarketing_Region_Code CHAR(15) NOT NULL,\nMarketing_Region_Name VARCHAR(255) NOT NULL,\nMarketing_Region_Descriptrion VARCHAR(255) NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Marketing_Region_Code),\nUNIQUE (Marketing_Region_Code)\n);\nCREATE TABLE Order_Items (\nOrder_Item_ID INTEGER NOT NULL ,\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Order_Item_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Product_ID) REFERENCES Products (Product_ID)\n);\nCREATE TABLE Performers (\nPerformer_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Performer_ID),\nUNIQUE (Performer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Performers_in_Bookings (\nOrder_ID INTEGER NOT NULL,\nPerformer_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Performer_ID),\nFOREIGN KEY (Performer_ID) REFERENCES Performers (Performer_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID)\n);\nCREATE TABLE Products (\nProduct_ID VARCHAR(100) NOT NULL,\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nProduct_Description VARCHAR(255),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Product_ID),\nUNIQUE (Product_ID)\n);\nCREATE TABLE Ref_Payment_Methods (\npayment_method_code CHAR(10) NOT NULL,\npayment_method_description VARCHAR(80),\nPRIMARY KEY (payment_method_code),\nUNIQUE (payment_method_code)\n);\nCREATE TABLE Ref_Service_Types (\nService_Type_Code CHAR(15) NOT NULL,\nParent_Service_Type_Code CHAR(15),\nService_Type_Description VARCHAR(255),\nPRIMARY KEY (Service_Type_Code),\nUNIQUE (Service_Type_Code)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15),\nWorkshop_Group_ID INTEGER NOT NULL,\nProduct_Description VARCHAR(255),\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Service_ID),\nUNIQUE (Service_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID),\nFOREIGN KEY (Service_Type_Code) REFERENCES Ref_Service_Types (Service_Type_Code)\n);\nCREATE TABLE Stores (\nStore_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Store_ID),\nUNIQUE (Store_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID),\nFOREIGN KEY (Marketing_Region_Code) REFERENCES Marketing_Regions (Marketing_Region_Code)\n);"} +{"qid": "pool_0115", "split": "pool", "db_id": "bike_1", "question": "What is the average bike availablility for stations not in Palo Alto?", "gold_sql": "SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city = \"Palo Alto\")", "db_path": "databases/bike_1/bike_1.sqlite", "schema": "CREATE TABLE station (\n id INTEGER PRIMARY KEY,\n name TEXT,\n lat NUMERIC,\n long NUMERIC,\n dock_count INTEGER,\n city TEXT,\n installation_date TEXT);\nCREATE TABLE status (\n station_id INTEGER,\n bikes_available INTEGER,\n docks_available INTEGER,\n time TEXT,\n FOREIGN KEY (station_id) REFERENCES station(id)\n);\nCREATE TABLE trip (\n id INTEGER PRIMARY KEY,\n duration INTEGER,\n start_date TEXT,\n start_station_name TEXT, -- this should be removed\n start_station_id INTEGER,\n end_date TEXT,\n end_station_name TEXT, -- this should be removed\n end_station_id INTEGER,\n bike_id INTEGER,\n subscription_type TEXT,\n zip_code INTEGER);\nCREATE TABLE weather (\n date TEXT,\n max_temperature_f INTEGER,\n mean_temperature_f INTEGER,\n min_temperature_f INTEGER,\n max_dew_point_f INTEGER,\n mean_dew_point_f INTEGER,\n min_dew_point_f INTEGER,\n max_humidity INTEGER,\n mean_humidity INTEGER,\n min_humidity INTEGER,\n max_sea_level_pressure_inches NUMERIC,\n mean_sea_level_pressure_inches NUMERIC,\n min_sea_level_pressure_inches NUMERIC,\n max_visibility_miles INTEGER,\n mean_visibility_miles INTEGER,\n min_visibility_miles INTEGER,\n max_wind_Speed_mph INTEGER,\n mean_wind_speed_mph INTEGER,\n max_gust_speed_mph INTEGER,\n precipitation_inches INTEGER,\n cloud_cover INTEGER,\n events TEXT,\n wind_dir_degrees INTEGER,\n zip_code INTEGER);"} +{"qid": "pool_0116", "split": "pool", "db_id": "tracking_software_problems", "question": "Which staff members are assigned to the problem with id 1? Give me their first and last names.", "gold_sql": "SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1", "db_path": "databases/tracking_software_problems/tracking_software_problems.sqlite", "schema": "CREATE TABLE `Problem_Category_Codes` (\n`problem_category_code` VARCHAR(20) PRIMARY KEY,\n`problem_category_description` VARCHAR(80)\n);\nCREATE TABLE `Problem_Log` (\n`problem_log_id` INTEGER PRIMARY KEY,\n`assigned_to_staff_id` INTEGER NOT NULL,\n`problem_id` INTEGER NOT NULL,\n`problem_category_code` VARCHAR(20) NOT NULL,\n`problem_status_code` VARCHAR(20) NOT NULL,\n`log_entry_date` DATETIME,\n`log_entry_description` VARCHAR(255),\n`log_entry_fix` VARCHAR(255),\n`other_log_details` VARCHAR(255),\nFOREIGN KEY (`problem_category_code` ) REFERENCES `Problem_Category_Codes`(`problem_category_code` ),FOREIGN KEY (`assigned_to_staff_id` ) REFERENCES `Staff`(`staff_id` ),FOREIGN KEY (`problem_id` ) REFERENCES `Problems`(`problem_id` ),FOREIGN KEY (`problem_status_code` ) REFERENCES `Problem_Status_Codes`(`problem_status_code` )\n);\nCREATE TABLE `Problem_Status_Codes` (\n`problem_status_code` VARCHAR(20) PRIMARY KEY,\n`problem_status_description` VARCHAR(80)\n);\nCREATE TABLE `Problems` (\n`problem_id` INTEGER PRIMARY KEY,\n`product_id` INTEGER NOT NULL,\n`closure_authorised_by_staff_id` INTEGER NOT NULL,\n`reported_by_staff_id` INTEGER NOT NULL,\n`date_problem_reported` DATETIME NOT NULL,\n`date_problem_closed` DATETIME,\n`problem_description` VARCHAR(255),\n`other_problem_details` VARCHAR(255),\nFOREIGN KEY (`closure_authorised_by_staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Product`(`product_id` ),\nFOREIGN KEY (`reported_by_staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Product` (\n`product_id` INTEGER PRIMARY KEY,\n`product_name` VARCHAR(80),\n`product_details` VARCHAR(255)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_first_name` VARCHAR(80),\n`staff_last_name` VARCHAR(80),\n`other_staff_details` VARCHAR(255)\n);"} +{"qid": "pool_0117", "split": "pool", "db_id": "activity_1", "question": "What is the name of the activity that has the most faculty members involved in?", "gold_sql": "SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/activity_1/activity_1.sqlite", "schema": "CREATE TABLE Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);\nCREATE TABLE Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0118", "split": "pool", "db_id": "aircraft", "question": "What is the location and name of the winning aircraft?", "gold_sql": "SELECT T2.Location , T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft", "db_path": "databases/aircraft/aircraft.sqlite", "schema": "CREATE TABLE `aircraft` (\n \"Aircraft_ID\" int(11) NOT NULL,\n \"Aircraft\" varchar(50) NOT NULL,\n \"Description\" varchar(50) NOT NULL,\n \"Max_Gross_Weight\" varchar(50) NOT NULL,\n \"Total_disk_area\" varchar(50) NOT NULL,\n \"Max_disk_Loading\" varchar(50) NOT NULL,\n PRIMARY KEY (`Aircraft_ID`)\n);\nCREATE TABLE `airport` (\n\"Airport_ID\" int,\n\"Airport_Name\" text,\n\"Total_Passengers\" real,\n\"%_Change_2007\" text,\n\"International_Passengers\" real,\n\"Domestic_Passengers\" real,\n\"Transit_Passengers\" real,\n\"Aircraft_Movements\" real,\n\"Freight_Metric_Tonnes\" real,\nPRIMARY KEY (\"Airport_ID\")\n);\nCREATE TABLE `airport_aircraft` (\n\"ID\" int,\n\"Airport_ID\" int,\n\"Aircraft_ID\" int,\nPRIMARY KEY (\"Airport_ID\",\"Aircraft_ID\"),\nFOREIGN KEY (\"Airport_ID\") REFERENCES `airport`(`Airport_ID`),\nFOREIGN KEY (\"Aircraft_ID\") REFERENCES `aircraft`(`Aircraft_ID`)\n);\nCREATE TABLE `match` (\n\"Round\" real,\n\"Location\" text,\n\"Country\" text,\n\"Date\" text,\n\"Fastest_Qualifying\" text,\n\"Winning_Pilot\" text,\n\"Winning_Aircraft\" text,\nPRIMARY KEY (\"Round\"),\nFOREIGN KEY (`Winning_Aircraft`) REFERENCES `aircraft`(`Aircraft_ID`),\nFOREIGN KEY (`Winning_Pilot`) REFERENCES `pilot`(`Pilot_Id`)\n);\nCREATE TABLE `pilot` (\n `Pilot_Id` int(11) NOT NULL,\n `Name` varchar(50) NOT NULL,\n `Age` int(11) NOT NULL,\n PRIMARY KEY (`Pilot_Id`)\n);"} +{"qid": "pool_0119", "split": "pool", "db_id": "college_3", "question": "List all names of courses with 1 credit?", "gold_sql": "SELECT CName FROM COURSE WHERE Credits = 1", "db_path": "databases/college_3/college_3.sqlite", "schema": "CREATE TABLE Course (\n CID \t \tVARCHAR(7) PRIMARY KEY,\n CName\t\tVARCHAR(40),\n Credits\t\tINTEGER,\n Instructor\tINTEGER,\n Days\t\tVARCHAR(5),\n Hours\t\tVARCHAR(11),\n DNO\t\tINTEGER,\n FOREIGN KEY(Instructor) REFERENCES Faculty(FacID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Department (\n DNO \t\tINTEGER PRIMARY KEY,\n Division\t\tVARCHAR(2),\n DName\t\tVARCHAR(25),\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13),\n DPhone\t\tINTEGER\n);\nCREATE TABLE Enrolled_in (\n StuID \t\t INTEGER,\n CID\t\tVARCHAR(7),\n Grade\t\tVARCHAR(2),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(CID) REFERENCES Course(CID),\n FOREIGN KEY(Grade) REFERENCES Gradeconversion(lettergrade)\n);\nCREATE TABLE Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);\nCREATE TABLE Gradeconversion (\n lettergrade\t VARCHAR(2) PRIMARY KEY,\n gradepoint\t FLOAT\n);\nCREATE TABLE Member_of (\n FacID \t INTEGER,\n DNO\t INTEGER,\n Appt_Type VARCHAR(15),\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Minor_in (\n StuID \t INTEGER,\n DNO\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0120", "split": "pool", "db_id": "match_season", "question": "What are the different positions for match season?", "gold_sql": "SELECT DISTINCT POSITION FROM match_season", "db_path": "databases/match_season/match_season.sqlite", "schema": "CREATE TABLE \"country\" (\n \"Country_id\" int,\n \"Country_name\" text,\n \"Capital\" text,\n \"Official_native_language\" text,\n PRIMARY KEY (\"Country_id\")\n);\nCREATE TABLE \"match_season\" (\n \"Season\" real,\n \"Player\" text,\n \"Position\" text,\n \"Country\" int,\n \"Team\" int,\n \"Draft_Pick_Number\" int,\n \"Draft_Class\" text,\n \"College\" text,\n PRIMARY KEY (\"Season\"),\n FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE \"player\" (\n \"Player_ID\" int,\n \"Player\" text,\n \"Years_Played\" text,\n \"Total_WL\" text,\n \"Singles_WL\" text,\n \"Doubles_WL\" text,\n \"Team\" int,\n PRIMARY KEY (\"Player_ID\"),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE `team` (\n `Team_id` int,\n `Name` text,\n PRIMARY KEY (`Team_id`)\n);"} +{"qid": "pool_0121", "split": "pool", "db_id": "cre_Drama_Workshop_Groups", "question": "List the actual delivery date for all the orders with quantity 1", "gold_sql": "SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1", "db_path": "databases/cre_Drama_Workshop_Groups/cre_Drama_Workshop_Groups.sqlite", "schema": "CREATE TABLE Addresses (\nAddress_ID VARCHAR(100) NOT NULL,\nLine_1 VARCHAR(255),\nLine_2 VARCHAR(255),\nCity_Town VARCHAR(255),\nState_County VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Address_ID),\nUNIQUE (Address_ID)\n);\nCREATE TABLE Bookings (\nBooking_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nWorkshop_Group_ID VARCHAR(100) NOT NULL,\nStatus_Code CHAR(15) NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Booking_ID),\nUNIQUE (Booking_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Clients (Client_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID)\n);\nCREATE TABLE Bookings_Services (\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Product_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (Product_ID) REFERENCES Services (Service_ID)\n);\nCREATE TABLE Clients (\nClient_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Email_Address VARCHAR(255),\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Client_ID),\nUNIQUE (Client_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Customer_Orders (\nOrder_ID INTEGER NOT NULL ,\nCustomer_ID INTEGER NOT NULL,\nStore_ID INTEGER NOT NULL,\nOrder_Date DATETIME NOT NULL,\nPlanned_Delivery_Date DATETIME NOT NULL,\nActual_Delivery_Date DATETIME NOT NULL,\nOther_Order_Details VARCHAR(255),\nPRIMARY KEY (Order_ID),\nUNIQUE (Order_ID),\nFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),\nFOREIGN KEY (Store_ID) REFERENCES Stores (Store_ID)\n);\nCREATE TABLE Customers (\nCustomer_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Customer_ID),\nUNIQUE (Customer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Drama_Workshop_Groups (\nWorkshop_Group_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCurrency_Code CHAR(15) NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Workshop_Group_ID),\nUNIQUE (Workshop_Group_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Invoice_Items (\nInvoice_Item_ID INTEGER NOT NULL ,\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\nOrder_Item_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity INTEGER,\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Invoice_Item_ID),\nFOREIGN KEY (Order_Item_ID) REFERENCES Order_Items (Order_Item_ID),\nFOREIGN KEY (Invoice_ID) REFERENCES Invoices (Invoice_ID),\nFOREIGN KEY (Order_ID, Product_ID) REFERENCES Bookings_Services (Order_ID,Product_ID)\n);\nCREATE TABLE Invoices (\nInvoice_ID INTEGER NOT NULL,\nOrder_ID INTEGER NOT NULL,\npayment_method_code CHAR(15),\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nOrder_Item_ID INTEGER NOT NULL,\nPRIMARY KEY (Invoice_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID),\nFOREIGN KEY (payment_method_code) REFERENCES Ref_Payment_Methods (payment_method_code)\n);\nCREATE TABLE Marketing_Regions (\nMarketing_Region_Code CHAR(15) NOT NULL,\nMarketing_Region_Name VARCHAR(255) NOT NULL,\nMarketing_Region_Descriptrion VARCHAR(255) NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Marketing_Region_Code),\nUNIQUE (Marketing_Region_Code)\n);\nCREATE TABLE Order_Items (\nOrder_Item_ID INTEGER NOT NULL ,\nOrder_ID INTEGER NOT NULL,\nProduct_ID INTEGER NOT NULL,\nOrder_Quantity VARCHAR(288),\nOther_Item_Details VARCHAR(255),\nPRIMARY KEY (Order_Item_ID),\nFOREIGN KEY (Order_ID) REFERENCES Customer_Orders (Order_ID),\nFOREIGN KEY (Product_ID) REFERENCES Products (Product_ID)\n);\nCREATE TABLE Performers (\nPerformer_ID INTEGER NOT NULL,\nAddress_ID INTEGER NOT NULL,\nCustomer_Name VARCHAR(255),\nCustomer_Phone VARCHAR(255),\nCustomer_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Performer_ID),\nUNIQUE (Performer_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID)\n);\nCREATE TABLE Performers_in_Bookings (\nOrder_ID INTEGER NOT NULL,\nPerformer_ID INTEGER NOT NULL,\nPRIMARY KEY (Order_ID, Performer_ID),\nFOREIGN KEY (Performer_ID) REFERENCES Performers (Performer_ID),\nFOREIGN KEY (Order_ID) REFERENCES Bookings (Booking_ID)\n);\nCREATE TABLE Products (\nProduct_ID VARCHAR(100) NOT NULL,\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nProduct_Description VARCHAR(255),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Product_ID),\nUNIQUE (Product_ID)\n);\nCREATE TABLE Ref_Payment_Methods (\npayment_method_code CHAR(10) NOT NULL,\npayment_method_description VARCHAR(80),\nPRIMARY KEY (payment_method_code),\nUNIQUE (payment_method_code)\n);\nCREATE TABLE Ref_Service_Types (\nService_Type_Code CHAR(15) NOT NULL,\nParent_Service_Type_Code CHAR(15),\nService_Type_Description VARCHAR(255),\nPRIMARY KEY (Service_Type_Code),\nUNIQUE (Service_Type_Code)\n);\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15),\nWorkshop_Group_ID INTEGER NOT NULL,\nProduct_Description VARCHAR(255),\nProduct_Name VARCHAR(255),\nProduct_Price DECIMAL(20,4),\nOther_Product_Service_Details VARCHAR(255),\nPRIMARY KEY (Service_ID),\nUNIQUE (Service_ID),\nFOREIGN KEY (Workshop_Group_ID) REFERENCES Drama_Workshop_Groups (Workshop_Group_ID),\nFOREIGN KEY (Service_Type_Code) REFERENCES Ref_Service_Types (Service_Type_Code)\n);\nCREATE TABLE Stores (\nStore_ID VARCHAR(100) NOT NULL,\nAddress_ID INTEGER NOT NULL,\nMarketing_Region_Code CHAR(15) NOT NULL,\nStore_Name VARCHAR(255),\nStore_Phone VARCHAR(255),\nStore_Email_Address VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Store_ID),\nUNIQUE (Store_ID),\nFOREIGN KEY (Address_ID) REFERENCES Addresses (Address_ID),\nFOREIGN KEY (Marketing_Region_Code) REFERENCES Marketing_Regions (Marketing_Region_Code)\n);"} +{"qid": "pool_0122", "split": "pool", "db_id": "hospital_1", "question": "What are the names of patients who are staying in room 111 and have an undergoing treatment?", "gold_sql": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111", "db_path": "databases/hospital_1/hospital_1.sqlite", "schema": "CREATE TABLE Affiliated_With (\n Physician INTEGER NOT NULL,\n Department INTEGER NOT NULL,\n PrimaryAffiliation BOOLEAN NOT NULL,\n CONSTRAINT fk_Affiliated_With_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Affiliated_With_Department_DepartmentID FOREIGN KEY(Department) REFERENCES Department(DepartmentID),\n PRIMARY KEY(Physician, Department)\n);\nCREATE TABLE Appointment (\n AppointmentID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL, \n PrepNurse INTEGER,\n Physician INTEGER NOT NULL,\n Start DATETIME NOT NULL,\n End DATETIME NOT NULL,\n ExaminationRoom TEXT NOT NULL,\n CONSTRAINT fk_Appointment_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Appointment_Nurse_EmployeeID FOREIGN KEY(PrepNurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_Appointment_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Block (\n BlockFloor INTEGER NOT NULL,\n BlockCode INTEGER NOT NULL,\n PRIMARY KEY(BlockFloor, BlockCode)\n);\nCREATE TABLE Department (\n DepartmentID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Head INTEGER NOT NULL,\n CONSTRAINT pk_Department PRIMARY KEY(DepartmentID),\n CONSTRAINT fk_Department_Physician_EmployeeID FOREIGN KEY(Head) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Medication (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Brand VARCHAR(30) NOT NULL,\n Description VARCHAR(30) NOT NULL\n);\nCREATE TABLE Nurse (\n EmployeeID INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n Registered BOOLEAN NOT NULL,\n SSN INTEGER NOT NULL\n);\nCREATE TABLE On_Call (\n Nurse INTEGER NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL,\n OnCallStart DATETIME NOT NULL,\n OnCallEnd DATETIME NOT NULL,\n PRIMARY KEY(Nurse, BlockFloor, BlockCode, OnCallStart, OnCallEnd),\n CONSTRAINT fk_OnCall_Nurse_EmployeeID FOREIGN KEY(Nurse) REFERENCES Nurse(EmployeeID),\n CONSTRAINT fk_OnCall_Block_Floor FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode) \n);\nCREATE TABLE Patient (\n SSN INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Address VARCHAR(30) NOT NULL,\n Phone VARCHAR(30) NOT NULL,\n InsuranceID INTEGER NOT NULL,\n PCP INTEGER NOT NULL,\n CONSTRAINT fk_Patient_Physician_EmployeeID FOREIGN KEY(PCP) REFERENCES Physician(EmployeeID)\n);\nCREATE TABLE Physician (\n EmployeeID INTEGER NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Position VARCHAR(30) NOT NULL,\n SSN INTEGER NOT NULL,\n CONSTRAINT pk_physician PRIMARY KEY(EmployeeID)\n);\nCREATE TABLE Prescribes (\n Physician INTEGER NOT NULL,\n Patient INTEGER NOT NULL, \n Medication INTEGER NOT NULL, \n Date DATETIME NOT NULL,\n Appointment INTEGER, \n Dose VARCHAR(30) NOT NULL,\n PRIMARY KEY(Physician, Patient, Medication, Date),\n CONSTRAINT fk_Prescribes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Prescribes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Prescribes_Medication_Code FOREIGN KEY(Medication) REFERENCES Medication(Code),\n CONSTRAINT fk_Prescribes_Appointment_AppointmentID FOREIGN KEY(Appointment) REFERENCES Appointment(AppointmentID)\n);\nCREATE TABLE Procedures (\n Code INTEGER PRIMARY KEY NOT NULL,\n Name VARCHAR(30) NOT NULL,\n Cost REAL NOT NULL\n);\nCREATE TABLE Room (\n RoomNumber INTEGER PRIMARY KEY NOT NULL,\n RoomType VARCHAR(30) NOT NULL,\n BlockFloor INTEGER NOT NULL, \n BlockCode INTEGER NOT NULL, \n Unavailable BOOLEAN NOT NULL,\n CONSTRAINT fk_Room_Block_PK FOREIGN KEY(BlockFloor, BlockCode) REFERENCES Block(BlockFloor, BlockCode)\n);\nCREATE TABLE Stay (\n StayID INTEGER PRIMARY KEY NOT NULL,\n Patient INTEGER NOT NULL,\n Room INTEGER NOT NULL,\n StayStart DATETIME NOT NULL,\n StayEnd DATETIME NOT NULL,\n CONSTRAINT fk_Stay_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Stay_Room_Number FOREIGN KEY(Room) REFERENCES Room(RoomNumber)\n);\nCREATE TABLE Trained_In (\n Physician INTEGER NOT NULL,\n Treatment INTEGER NOT NULL,\n CertificationDate DATETIME NOT NULL,\n CertificationExpires DATETIME NOT NULL,\n CONSTRAINT fk_Trained_In_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Trained_In_Procedures_Code FOREIGN KEY(Treatment) REFERENCES Procedures(Code),\n PRIMARY KEY(Physician, Treatment)\n);\nCREATE TABLE Undergoes (\n Patient INTEGER NOT NULL,\n Procedures INTEGER NOT NULL,\n Stay INTEGER NOT NULL,\n DateUndergoes DATETIME NOT NULL,\n Physician INTEGER NOT NULL,\n AssistingNurse INTEGER,\n PRIMARY KEY(Patient, Procedures, Stay, DateUndergoes),\n CONSTRAINT fk_Undergoes_Patient_SSN FOREIGN KEY(Patient) REFERENCES Patient(SSN),\n CONSTRAINT fk_Undergoes_Procedures_Code FOREIGN KEY(Procedures) REFERENCES Procedures(Code),\n CONSTRAINT fk_Undergoes_Stay_StayID FOREIGN KEY(Stay) REFERENCES Stay(StayID),\n CONSTRAINT fk_Undergoes_Physician_EmployeeID FOREIGN KEY(Physician) REFERENCES Physician(EmployeeID),\n CONSTRAINT fk_Undergoes_Nurse_EmployeeID FOREIGN KEY(AssistingNurse) REFERENCES Nurse(EmployeeID)\n);"} +{"qid": "pool_0123", "split": "pool", "db_id": "loan_1", "question": "Find the name and credit score of the customers who have some loans.", "gold_sql": "SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id", "db_path": "databases/loan_1/loan_1.sqlite", "schema": "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));\nCREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));\nCREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));"} +{"qid": "pool_0124", "split": "pool", "db_id": "decoration_competition", "question": "Which countries have more than two members?", "gold_sql": "SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2", "db_path": "databases/decoration_competition/decoration_competition.sqlite", "schema": "CREATE TABLE \"college\" (\n\"College_ID\" int,\n\"Name\" text,\n\"Leader_Name\" text,\n\"College_Location\" text,\nPRIMARY KEY (\"College_ID\")\n);\nCREATE TABLE \"member\" (\n\"Member_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"College_ID\" int,\nPRIMARY KEY (\"Member_ID\"),\nFOREIGN KEY (\"College_ID\") REFERENCES `college`(\"College_ID\")\n);\nCREATE TABLE \"round\" (\n\"Round_ID\" int,\n\"Member_ID\" int,\n\"Decoration_Theme\" text,\n\"Rank_in_Round\" int,\nPRIMARY KEY (\"Member_ID\",\"Round_ID\"),\nFOREIGN KEY (\"Member_ID\") REFERENCES \"member\"(\"Member_ID\")\n);"} +{"qid": "pool_0125", "split": "pool", "db_id": "e_learning", "question": "Find the names and descriptions of courses that belong to the subject named \"Computer Science\".", "gold_sql": "SELECT T1.course_name , T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = \"Computer Science\"", "db_path": "databases/e_learning/e_learning.sqlite", "schema": "CREATE TABLE `Course_Authors_and_Tutors` (\n`author_id` INTEGER PRIMARY KEY,\n`author_tutor_ATB` VARCHAR(3),\n`login_name` VARCHAR(40),\n`password` VARCHAR(40),\n`personal_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`family_name` VARCHAR(80),\n`gender_mf` VARCHAR(1),\n`address_line_1` VARCHAR(80)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`author_id` INTEGER NOT NULL,\n`subject_id` INTEGER NOT NULL,\n`course_name` VARCHAR(120),\n`course_description` VARCHAR(255),\nFOREIGN KEY (`author_id` ) REFERENCES `Course_Authors_and_Tutors`(`author_id` ),\nFOREIGN KEY (`subject_id` ) REFERENCES `Subjects`(`subject_id` )\n);\nCREATE TABLE `Student_Course_Enrolment` (\n`registration_id` INTEGER PRIMARY KEY,\n`student_id` INTEGER NOT NULL,\n`course_id` INTEGER NOT NULL,\n`date_of_enrolment` DATETIME NOT NULL,\n`date_of_completion` DATETIME NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Tests_Taken` (\n`registration_id` INTEGER NOT NULL,\n`date_test_taken` DATETIME NOT NULL,\n`test_result` VARCHAR(255),\nFOREIGN KEY (`registration_id` ) REFERENCES `Student_Course_Enrolment`(`registration_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`date_of_registration` DATETIME,\n`date_of_latest_logon` DATETIME,\n`login_name` VARCHAR(40),\n`password` VARCHAR(10),\n`personal_name` VARCHAR(40),\n`middle_name` VARCHAR(40),\n`family_name` VARCHAR(40)\n);\nCREATE TABLE `Subjects` (\n`subject_id` INTEGER PRIMARY KEY,\n`subject_name` VARCHAR(120)\n);"} +{"qid": "pool_0126", "split": "pool", "db_id": "products_gen_characteristics", "question": "Count the products that have the color description \"white\" or have the characteristic name \"hot\".", "gold_sql": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = \"white\" OR t3.characteristic_name = \"hot\"", "db_path": "databases/products_gen_characteristics/products_gen_characteristics.sqlite", "schema": "CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);\nCREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);\nCREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);\nCREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);\nCREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);"} +{"qid": "pool_0127", "split": "pool", "db_id": "e_government", "question": "Find the name of the most popular party form.", "gold_sql": "SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/e_government/e_government.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);\nCREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);\nCREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);\nCREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);\nCREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);\nCREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);\nCREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);\nCREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);\nCREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);\nCREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);"} +{"qid": "pool_0128", "split": "pool", "db_id": "customers_campaigns_ecommerce", "question": "Show all distinct product categories along with the number of mailshots in each category.", "gold_sql": "SELECT product_category , count(*) FROM mailshot_campaigns GROUP BY product_category", "db_path": "databases/customers_campaigns_ecommerce/customers_campaigns_ecommerce.sqlite", "schema": "CREATE TABLE `Customer_Addresses` (\n`customer_id` INTEGER NOT NULL,\n`premise_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nFOREIGN KEY (`premise_id` ) REFERENCES `Premises`(`premise_id` )\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status_code` VARCHAR(15) NOT NULL,\n`shipping_method_code` VARCHAR(15) NOT NULL,\n`order_placed_datetime` DATETIME NOT NULL,\n`order_delivered_datetime` DATETIME,\n`order_shipping_charges` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`payment_method` VARCHAR(15) NOT NULL,\n`customer_name` VARCHAR(80),\n`customer_phone` VARCHAR(80),\n`customer_email` VARCHAR(80),\n`customer_address` VARCHAR(255),\n`customer_login` VARCHAR(80),\n`customer_password` VARCHAR(10)\n);\nCREATE TABLE `Mailshot_Campaigns` (\n`mailshot_id` INTEGER PRIMARY KEY,\n`product_category` VARCHAR(15),\n`mailshot_name` VARCHAR(80),\n`mailshot_start_date` DATETIME,\n`mailshot_end_date` DATETIME\n);\nCREATE TABLE `Mailshot_Customers` (\n`mailshot_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`outcome_code` VARCHAR(15) NOT NULL,\n`mailshot_customer_date` DATETIME,\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` ),\nFOREIGN KEY (`mailshot_id` ) REFERENCES `Mailshot_Campaigns`(`mailshot_id` )\n);\nCREATE TABLE `Order_Items` (\n`item_id` INTEGER NOT NULL ,\n`order_item_status_code` VARCHAR(15) NOT NULL,\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\n`item_status_code` VARCHAR(15),\n`item_delivered_datetime` DATETIME,\n`item_order_quantity` VARCHAR(80),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` )\n);\nCREATE TABLE `Premises` (\n`premise_id` INTEGER PRIMARY KEY,\n`premises_type` VARCHAR(15) NOT NULL,\n`premise_details` VARCHAR(255)\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_category` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80)\n);"} +{"qid": "pool_0129", "split": "pool", "db_id": "gas_company", "question": "What are the locations of all the gas stations ordered by opening year?", "gold_sql": "SELECT LOCATION FROM gas_station ORDER BY open_year", "db_path": "databases/gas_company/gas_company.sqlite", "schema": "CREATE TABLE \"company\" (\n\"Company_ID\" int,\n\"Rank\" int,\n\"Company\" text,\n\"Headquarters\" text,\n\"Main_Industry\" text,\n\"Sales_billion\" real,\n\"Profits_billion\" real,\n\"Assets_billion\" real,\n\"Market_Value\" real,\nPRIMARY KEY (\"Company_ID\")\n);\nCREATE TABLE \"gas_station\" (\n\"Station_ID\" int,\n\"Open_Year\" int,\n\"Location\" text,\n\"Manager_Name\" text,\n\"Vice_Manager_Name\" text,\n\"Representative_Name\" text,\nPRIMARY KEY (\"Station_ID\")\n);\nCREATE TABLE \"station_company\" (\n\"Station_ID\" int,\n\"Company_ID\" int,\n\"Rank_of_the_Year\" int,\nPRIMARY KEY (\"Station_ID\",\"Company_ID\"),\nFOREIGN KEY (`Station_ID`) REFERENCES `gas_station`(`Station_ID`),\nFOREIGN KEY (`Company_ID`) REFERENCES `company`(`Company_ID`)\n);"} +{"qid": "pool_0130", "split": "pool", "db_id": "bike_1", "question": "For each end station id, what is its name, latitude, and minimum duration for trips ended there?", "gold_sql": "SELECT T1.name , T1.lat , min(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id", "db_path": "databases/bike_1/bike_1.sqlite", "schema": "CREATE TABLE station (\n id INTEGER PRIMARY KEY,\n name TEXT,\n lat NUMERIC,\n long NUMERIC,\n dock_count INTEGER,\n city TEXT,\n installation_date TEXT);\nCREATE TABLE status (\n station_id INTEGER,\n bikes_available INTEGER,\n docks_available INTEGER,\n time TEXT,\n FOREIGN KEY (station_id) REFERENCES station(id)\n);\nCREATE TABLE trip (\n id INTEGER PRIMARY KEY,\n duration INTEGER,\n start_date TEXT,\n start_station_name TEXT, -- this should be removed\n start_station_id INTEGER,\n end_date TEXT,\n end_station_name TEXT, -- this should be removed\n end_station_id INTEGER,\n bike_id INTEGER,\n subscription_type TEXT,\n zip_code INTEGER);\nCREATE TABLE weather (\n date TEXT,\n max_temperature_f INTEGER,\n mean_temperature_f INTEGER,\n min_temperature_f INTEGER,\n max_dew_point_f INTEGER,\n mean_dew_point_f INTEGER,\n min_dew_point_f INTEGER,\n max_humidity INTEGER,\n mean_humidity INTEGER,\n min_humidity INTEGER,\n max_sea_level_pressure_inches NUMERIC,\n mean_sea_level_pressure_inches NUMERIC,\n min_sea_level_pressure_inches NUMERIC,\n max_visibility_miles INTEGER,\n mean_visibility_miles INTEGER,\n min_visibility_miles INTEGER,\n max_wind_Speed_mph INTEGER,\n mean_wind_speed_mph INTEGER,\n max_gust_speed_mph INTEGER,\n precipitation_inches INTEGER,\n cloud_cover INTEGER,\n events TEXT,\n wind_dir_degrees INTEGER,\n zip_code INTEGER);"} +{"qid": "pool_0131", "split": "pool", "db_id": "local_govt_and_lot", "question": "List the customer event id and the corresponding move in date and property id.", "gold_sql": "SELECT customer_event_id , date_moved_in , property_id FROM customer_events", "db_path": "databases/local_govt_and_lot/local_govt_and_lot.sqlite", "schema": "CREATE TABLE Customer_Event_Notes (\nCustomer_Event_Note_ID INTEGER NOT NULL,\nCustomer_Event_ID INTEGER NOT NULL,\nservice_type_code CHAR(15) NOT NULL,\nresident_id INTEGER NOT NULL,\nproperty_id INTEGER NOT NULL,\ndate_moved_in DATETIME NOT NULL,\nPRIMARY KEY (Customer_Event_Note_ID),\nFOREIGN KEY (Customer_Event_ID) REFERENCES Customer_Events (Customer_Event_ID)\n);\nCREATE TABLE Customer_Events (\nCustomer_Event_ID INTEGER NOT NULL,\ncustomer_id INTEGER,\ndate_moved_in DATETIME,\nproperty_id INTEGER,\nresident_id INTEGER,\nthing_id INTEGER NOT NULL,\nPRIMARY KEY (Customer_Event_ID),\nFOREIGN KEY (thing_id) REFERENCES Things (thing_id),\nFOREIGN KEY (customer_id) REFERENCES Customers (customer_id),\nFOREIGN KEY (resident_id, property_id, date_moved_in) REFERENCES Residents (resident_id,property_id,date_moved_in)\n);\nCREATE TABLE Customers (\ncustomer_id INTEGER NOT NULL,\ncustomer_details VARCHAR(255),\nPRIMARY KEY (customer_id)\n);\nCREATE TABLE Organizations (\norganization_id INTEGER NOT NULL,\nparent_organization_id INTEGER,\norganization_details VARCHAR(255),\nPRIMARY KEY (organization_id)\n);\nCREATE TABLE Properties (\nproperty_id INTEGER NOT NULL,\nproperty_type_code CHAR(15) NOT NULL,\nproperty_address VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (property_id)\n);\nCREATE TABLE Residents (\nresident_id INTEGER NOT NULL,\nproperty_id INTEGER NOT NULL,\ndate_moved_in DATETIME NOT NULL,\ndate_moved_out DATETIME NOT NULL,\nother_details VARCHAR(255),\nPRIMARY KEY (resident_id, property_id, date_moved_in),\nFOREIGN KEY (property_id) REFERENCES Properties (property_id)\n);\nCREATE TABLE Residents_Services (\nresident_id INTEGER NOT NULL,\nservice_id INTEGER NOT NULL,\ndate_moved_in DATETIME,\nproperty_id INTEGER,\ndate_requested DATETIME,\ndate_provided DATETIME,\nother_details VARCHAR(255),\nPRIMARY KEY (resident_id, service_id),\nFOREIGN KEY (service_id) REFERENCES Services (service_id),\nFOREIGN KEY (resident_id, property_id, date_moved_in) REFERENCES Residents (resident_id,property_id,date_moved_in)\n);\nCREATE TABLE Services (\nservice_id INTEGER NOT NULL,\norganization_id INTEGER NOT NULL,\nservice_type_code CHAR(15) NOT NULL,\nservice_details VARCHAR(255),\nPRIMARY KEY (service_id),\nFOREIGN KEY (organization_id) REFERENCES Organizations (organization_id)\n);\nCREATE TABLE Things (\nthing_id INTEGER NOT NULL,\norganization_id INTEGER NOT NULL,\nType_of_Thing_Code CHAR(15) NOT NULL,\nservice_type_code CHAR(10) NOT NULL,\nservice_details VARCHAR(255),\nPRIMARY KEY (thing_id),\nFOREIGN KEY (organization_id) REFERENCES Organizations (organization_id)\n);\nCREATE TABLE Timed_Locations_of_Things (\nthing_id INTEGER NOT NULL,\nDate_and_Time DATETIME NOT NULL,\nLocation_Code CHAR(15) NOT NULL,\nPRIMARY KEY (thing_id, Date_and_Time, Location_Code),\nFOREIGN KEY (thing_id) REFERENCES Things (thing_id));\nCREATE TABLE Timed_Status_of_Things (\nthing_id INTEGER NOT NULL,\nDate_and_Date DATETIME NOT NULL,\nStatus_of_Thing_Code CHAR(15) NOT NULL,\nPRIMARY KEY (thing_id, Date_and_Date, Status_of_Thing_Code),\nFOREIGN KEY (thing_id) REFERENCES Things (thing_id)\n);"} +{"qid": "pool_0132", "split": "pool", "db_id": "soccer_2", "question": "What are the names of players whose training hours is between 500 and 1500?", "gold_sql": "SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500", "db_path": "databases/soccer_2/soccer_2.sqlite", "schema": "CREATE TABLE College \n ( cName \tvarchar(20) NOT NULL,\n state \tvarchar(2),\n enr \tnumeric(5,0),\n PRIMARY KEY (cName)\n );\nCREATE TABLE Player\n ( pID\t\t\tnumeric(5,0) NOT NULL,\n \tpName \tvarchar(20),\n yCard \tvarchar(3),\n HS \tnumeric(5,0),\n PRIMARY KEY (pID)\n );\nCREATE TABLE Tryout\n ( pID\t\t\tnumeric(5,0),\n \tcName \tvarchar(20),\n pPos \tvarchar(8),\n decision varchar(3),\n PRIMARY KEY (pID, cName),\n FOREIGN KEY (pID) REFERENCES Player(pID),\n FOREIGN KEY (cName) REFERENCES College(cName)\n );"} +{"qid": "pool_0133", "split": "pool", "db_id": "student_assessment", "question": "What are all details of the students who registered but did not attend any course?", "gold_sql": "SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)", "db_path": "databases/student_assessment/student_assessment.sqlite", "schema": "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\nline_1 VARCHAR(80),\nline_2 VARCHAR(80),\ncity VARCHAR(50),\nzip_postcode CHAR(20),\nstate_province_county VARCHAR(50),\ncountry VARCHAR(50),\nPRIMARY KEY (address_id)\n);\nCREATE TABLE Candidate_Assessments (\ncandidate_id INTEGER NOT NULL,\nqualification CHAR(15) NOT NULL,\nassessment_date DATETIME NOT NULL,\nasessment_outcome_code CHAR(15) NOT NULL,\nPRIMARY KEY (candidate_id, qualification),\nFOREIGN KEY (candidate_id) REFERENCES Candidates (candidate_id)\n);\nCREATE TABLE Candidates (\ncandidate_id INTEGER NOT NULL ,\ncandidate_details VARCHAR(255),\nPRIMARY KEY (candidate_id),\nFOREIGN KEY (candidate_id) REFERENCES People (person_id)\n);\nCREATE TABLE Courses (\ncourse_id VARCHAR(100) NOT NULL,\ncourse_name VARCHAR(120),\ncourse_description VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (course_id)\n);\nCREATE TABLE People (\nperson_id INTEGER NOT NULL,\nfirst_name VARCHAR(255),\nmiddle_name VARCHAR(255),\nlast_name VARCHAR(255),\ncell_mobile_number VARCHAR(40),\nemail_address VARCHAR(40),\nlogin_name VARCHAR(40),\npassword VARCHAR(40),\nPRIMARY KEY (person_id)\n);\nCREATE TABLE People_Addresses (\nperson_address_id INTEGER NOT NULL,\nperson_id INTEGER NOT NULL,\naddress_id INTEGER NOT NULL,\ndate_from DATETIME,\ndate_to DATETIME,\nPRIMARY KEY (person_address_id),\nFOREIGN KEY (person_id) REFERENCES People (person_id),\nFOREIGN KEY (address_id) REFERENCES Addresses (address_id)\n);\nCREATE TABLE Student_Course_Attendance (\nstudent_id INTEGER NOT NULL,\ncourse_id INTEGER NOT NULL,\ndate_of_attendance DATETIME NOT NULL,\nPRIMARY KEY (student_id, course_id),\nFOREIGN KEY (student_id, course_id) REFERENCES Student_Course_Registrations (student_id,course_id)\n);\nCREATE TABLE Student_Course_Registrations (\nstudent_id INTEGER NOT NULL,\ncourse_id INTEGER NOT NULL,\nregistration_date DATETIME NOT NULL,\nPRIMARY KEY (student_id, course_id),\nFOREIGN KEY (student_id) REFERENCES Students (student_id),\nFOREIGN KEY (course_id) REFERENCES Courses (course_id)\n);\nCREATE TABLE Students (\nstudent_id INTEGER NOT NULL,\nstudent_details VARCHAR(255),\nPRIMARY KEY (student_id),\nFOREIGN KEY (student_id) REFERENCES People (person_id)\n);"} +{"qid": "pool_0134", "split": "pool", "db_id": "tracking_software_problems", "question": "Find the oldest log id and its corresponding problem id.", "gold_sql": "SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1", "db_path": "databases/tracking_software_problems/tracking_software_problems.sqlite", "schema": "CREATE TABLE `Problem_Category_Codes` (\n`problem_category_code` VARCHAR(20) PRIMARY KEY,\n`problem_category_description` VARCHAR(80)\n);\nCREATE TABLE `Problem_Log` (\n`problem_log_id` INTEGER PRIMARY KEY,\n`assigned_to_staff_id` INTEGER NOT NULL,\n`problem_id` INTEGER NOT NULL,\n`problem_category_code` VARCHAR(20) NOT NULL,\n`problem_status_code` VARCHAR(20) NOT NULL,\n`log_entry_date` DATETIME,\n`log_entry_description` VARCHAR(255),\n`log_entry_fix` VARCHAR(255),\n`other_log_details` VARCHAR(255),\nFOREIGN KEY (`problem_category_code` ) REFERENCES `Problem_Category_Codes`(`problem_category_code` ),FOREIGN KEY (`assigned_to_staff_id` ) REFERENCES `Staff`(`staff_id` ),FOREIGN KEY (`problem_id` ) REFERENCES `Problems`(`problem_id` ),FOREIGN KEY (`problem_status_code` ) REFERENCES `Problem_Status_Codes`(`problem_status_code` )\n);\nCREATE TABLE `Problem_Status_Codes` (\n`problem_status_code` VARCHAR(20) PRIMARY KEY,\n`problem_status_description` VARCHAR(80)\n);\nCREATE TABLE `Problems` (\n`problem_id` INTEGER PRIMARY KEY,\n`product_id` INTEGER NOT NULL,\n`closure_authorised_by_staff_id` INTEGER NOT NULL,\n`reported_by_staff_id` INTEGER NOT NULL,\n`date_problem_reported` DATETIME NOT NULL,\n`date_problem_closed` DATETIME,\n`problem_description` VARCHAR(255),\n`other_problem_details` VARCHAR(255),\nFOREIGN KEY (`closure_authorised_by_staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Product`(`product_id` ),\nFOREIGN KEY (`reported_by_staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Product` (\n`product_id` INTEGER PRIMARY KEY,\n`product_name` VARCHAR(80),\n`product_details` VARCHAR(255)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_first_name` VARCHAR(80),\n`staff_last_name` VARCHAR(80),\n`other_staff_details` VARCHAR(255)\n);"} +{"qid": "pool_0135", "split": "pool", "db_id": "protein_institute", "question": "How many institutions do not have an associated protein in our record?", "gold_sql": "SELECT count(*) FROM institution WHERE institution_id NOT IN (SELECT institution_id FROM protein)", "db_path": "databases/protein_institute/protein_institute.sqlite", "schema": "CREATE TABLE \"Institution\" (\n\"Institution_id\" text,\n\"Institution\" text,\n\"Location\" text,\n\"Founded\" real,\n\"Type\" text,\n\"Enrollment\" int,\n\"Team\" text,\n\"Primary_Conference\" text,\n\"building_id\" text,\nPRIMARY KEY(\"Institution_id\"),\nFOREIGN KEY (\"building_id\") REFERENCES \"building\"(\"building_id\")\n);\nCREATE TABLE \"building\" (\n\"building_id\" text,\n\"Name\" text,\n\"Street_address\" text,\n\"Years_as_tallest\" text,\n\"Height_feet\" int,\n\"Floors\" int,\nPRIMARY KEY(\"building_id\")\n);\nCREATE TABLE \"protein\" (\n\"common_name\" text,\n\"protein_name\" text,\n\"divergence_from_human_lineage\" real,\n\"accession_number\" text,\n\"sequence_length\" real,\n\"sequence_identity_to_human_protein\" text,\n\"Institution_id\" text,\nPRIMARY KEY(\"common_name\"),\nFOREIGN KEY(\"Institution_id\") REFERENCES \"Institution\"(\"Institution_id\")\n);"} +{"qid": "pool_0136", "split": "pool", "db_id": "e_learning", "question": "Which student are enrolled in at least two courses? Give me the student ID and personal name.", "gold_sql": "SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2", "db_path": "databases/e_learning/e_learning.sqlite", "schema": "CREATE TABLE `Course_Authors_and_Tutors` (\n`author_id` INTEGER PRIMARY KEY,\n`author_tutor_ATB` VARCHAR(3),\n`login_name` VARCHAR(40),\n`password` VARCHAR(40),\n`personal_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`family_name` VARCHAR(80),\n`gender_mf` VARCHAR(1),\n`address_line_1` VARCHAR(80)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`author_id` INTEGER NOT NULL,\n`subject_id` INTEGER NOT NULL,\n`course_name` VARCHAR(120),\n`course_description` VARCHAR(255),\nFOREIGN KEY (`author_id` ) REFERENCES `Course_Authors_and_Tutors`(`author_id` ),\nFOREIGN KEY (`subject_id` ) REFERENCES `Subjects`(`subject_id` )\n);\nCREATE TABLE `Student_Course_Enrolment` (\n`registration_id` INTEGER PRIMARY KEY,\n`student_id` INTEGER NOT NULL,\n`course_id` INTEGER NOT NULL,\n`date_of_enrolment` DATETIME NOT NULL,\n`date_of_completion` DATETIME NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Tests_Taken` (\n`registration_id` INTEGER NOT NULL,\n`date_test_taken` DATETIME NOT NULL,\n`test_result` VARCHAR(255),\nFOREIGN KEY (`registration_id` ) REFERENCES `Student_Course_Enrolment`(`registration_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`date_of_registration` DATETIME,\n`date_of_latest_logon` DATETIME,\n`login_name` VARCHAR(40),\n`password` VARCHAR(10),\n`personal_name` VARCHAR(40),\n`middle_name` VARCHAR(40),\n`family_name` VARCHAR(40)\n);\nCREATE TABLE `Subjects` (\n`subject_id` INTEGER PRIMARY KEY,\n`subject_name` VARCHAR(120)\n);"} +{"qid": "pool_0137", "split": "pool", "db_id": "gymnast", "question": "List the total points of gymnasts in descending order.", "gold_sql": "SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC", "db_path": "databases/gymnast/gymnast.sqlite", "schema": "CREATE TABLE \"gymnast\" (\n\"Gymnast_ID\" int,\n\"Floor_Exercise_Points\" real,\n\"Pommel_Horse_Points\" real,\n\"Rings_Points\" real,\n\"Vault_Points\" real,\n\"Parallel_Bars_Points\" real,\n\"Horizontal_Bar_Points\" real,\n\"Total_Points\" real,\nPRIMARY KEY (\"Gymnast_ID\"),\nFOREIGN KEY (\"Gymnast_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Age\" real,\n\"Height\" real,\n\"Hometown\" text,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "pool_0138", "split": "pool", "db_id": "department_store", "question": "Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.", "gold_sql": "SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(total_amount_purchased) > 50000 OR avg(total_amount_purchased) < 30000", "db_path": "databases/department_store/department_store.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`address_details` VARCHAR(255)\n);\nCREATE TABLE `Customer_Addresses` (\n`customer_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_from` DATETIME NOT NULL,\n`date_to` DATETIME,\nPRIMARY KEY (`customer_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status_code` VARCHAR(10) NOT NULL,\n`order_date` DATETIME NOT NULL,\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`customer_code` VARCHAR(20),\n`customer_name` VARCHAR(80),\n`customer_address` VARCHAR(255),\n`customer_phone` VARCHAR(80),\n`customer_email` VARCHAR(80)\n);\nCREATE TABLE `Department_Store_Chain` (\n`dept_store_chain_id` INTEGER PRIMARY KEY,\n`dept_store_chain_name` VARCHAR(80)\n);\nCREATE TABLE `Department_Stores` (\n`dept_store_id` INTEGER PRIMARY KEY,\n`dept_store_chain_id` INTEGER,\n`store_name` VARCHAR(80),\n`store_address` VARCHAR(255),\n`store_phone` VARCHAR(80),\n`store_email` VARCHAR(80),\nFOREIGN KEY (`dept_store_chain_id` ) REFERENCES `Department_Store_Chain`(`dept_store_chain_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`dept_store_id` INTEGER NOT NULL,\n`department_name` VARCHAR(80),\nFOREIGN KEY (`dept_store_id` ) REFERENCES `Department_Stores`(`dept_store_id` )\n);\nCREATE TABLE `Order_Items` (\n`order_item_id` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\nFOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Product_Suppliers` (\n`product_id` INTEGER NOT NULL,\n`supplier_id` INTEGER NOT NULL,\n`date_supplied_from` DATETIME NOT NULL,\n`date_supplied_to` DATETIME,\n`total_amount_purchased` VARCHAR(80),\n`total_value_purchased` DECIMAL(19,4),\nPRIMARY KEY (`product_id`, `supplier_id`),\nFOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_type_code` VARCHAR(10) NOT NULL,\n`product_name` VARCHAR(80),\n`product_price` DECIMAL(19,4)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_gender` VARCHAR(1),\n`staff_name` VARCHAR(80)\n);\nCREATE TABLE `Staff_Department_Assignments` (\n`staff_id` INTEGER NOT NULL,\n`department_id` INTEGER NOT NULL,\n`date_assigned_from` DATETIME NOT NULL,\n`job_title_code` VARCHAR(10) NOT NULL,\n`date_assigned_to` DATETIME,\nPRIMARY KEY (`staff_id`, `department_id`),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Supplier_Addresses` (\n`supplier_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_from` DATETIME NOT NULL,\n`date_to` DATETIME,\nPRIMARY KEY (`supplier_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` )\n);\nCREATE TABLE `Suppliers` (\n`supplier_id` INTEGER PRIMARY KEY,\n`supplier_name` VARCHAR(80),\n`supplier_phone` VARCHAR(80)\n);"} +{"qid": "pool_0139", "split": "pool", "db_id": "e_learning", "question": "Return the descriptions and names of the courses that have more than two students enrolled in.", "gold_sql": "SELECT T1.course_description , T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2", "db_path": "databases/e_learning/e_learning.sqlite", "schema": "CREATE TABLE `Course_Authors_and_Tutors` (\n`author_id` INTEGER PRIMARY KEY,\n`author_tutor_ATB` VARCHAR(3),\n`login_name` VARCHAR(40),\n`password` VARCHAR(40),\n`personal_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`family_name` VARCHAR(80),\n`gender_mf` VARCHAR(1),\n`address_line_1` VARCHAR(80)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`author_id` INTEGER NOT NULL,\n`subject_id` INTEGER NOT NULL,\n`course_name` VARCHAR(120),\n`course_description` VARCHAR(255),\nFOREIGN KEY (`author_id` ) REFERENCES `Course_Authors_and_Tutors`(`author_id` ),\nFOREIGN KEY (`subject_id` ) REFERENCES `Subjects`(`subject_id` )\n);\nCREATE TABLE `Student_Course_Enrolment` (\n`registration_id` INTEGER PRIMARY KEY,\n`student_id` INTEGER NOT NULL,\n`course_id` INTEGER NOT NULL,\n`date_of_enrolment` DATETIME NOT NULL,\n`date_of_completion` DATETIME NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Tests_Taken` (\n`registration_id` INTEGER NOT NULL,\n`date_test_taken` DATETIME NOT NULL,\n`test_result` VARCHAR(255),\nFOREIGN KEY (`registration_id` ) REFERENCES `Student_Course_Enrolment`(`registration_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`date_of_registration` DATETIME,\n`date_of_latest_logon` DATETIME,\n`login_name` VARCHAR(40),\n`password` VARCHAR(10),\n`personal_name` VARCHAR(40),\n`middle_name` VARCHAR(40),\n`family_name` VARCHAR(40)\n);\nCREATE TABLE `Subjects` (\n`subject_id` INTEGER PRIMARY KEY,\n`subject_name` VARCHAR(120)\n);"} +{"qid": "pool_0140", "split": "pool", "db_id": "flight_4", "question": "What is the number of different different airports that are destinations for American Airlines?", "gold_sql": "SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'", "db_path": "databases/flight_4/flight_4.sqlite", "schema": "CREATE TABLE airlines (\n alid integer PRIMARY KEY, -- Id of the airline\n name text, -- Name of the airline\n iata varchar(2), -- 2-letter IATA code. empty or null if not assigned/unknown \n icao varchar(3), -- 3-letter ICAO code. empty or null if not assigned\n callsign text, -- Airline callsign\n country text, -- Country or territory where airline is incorporated\n active varchar(2) -- \"Y\" if the airline is or has until recently been operational,\n);\nCREATE TABLE airports (\n apid integer PRIMARY KEY, -- Id of the airport\n name text NOT NULL, -- Name of airport\n city text, -- Main city served by airport\n country text, -- Country or territory where airport is located\n x real, -- Latitude of airport: Decimal degrees, usually to six\n -- significant digits. Negative is South, positive is North\n y real, -- Longitude of airport: Decimal degrees, usually to six \n -- significant digits. Negative is West, positive is East\n elevation bigint, -- Altitude of airport measured in feets\n iata character varchar(3), -- 3-letter IATA code. empty or null if not assigned/unknown\n icao character varchar(4) -- 4-letter ICAO code. empty or null if not assigned\n \n);\nCREATE TABLE routes (\n rid integer PRIMARY KEY,\n dst_apid integer, -- Id of destination airport\n dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport\n src_apid bigint, -- Id of source airport\n src_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the source airport\n alid bigint, -- Id of airline\n airline varchar(4), -- 2-letter (IATA) or 3-letter (ICAO) code of the airline\n codeshare text, -- \"Y\" if this flight is a codeshare (that is, not operated by \n -- Airline, but another carrier), empty otherwise\n FOREIGN KEY(dst_apid) REFERENCES airports(apid),\n FOREIGN KEY(src_apid) REFERENCES airports(apid),\n FOREIGN KEY(alid) REFERENCES airlines(alid)\n);"} +{"qid": "pool_0141", "split": "pool", "db_id": "cre_Doc_Tracking_DB", "question": "List all role codes, role names, and role descriptions.", "gold_sql": "SELECT role_code , role_name , role_description FROM ROLES", "db_path": "databases/cre_Doc_Tracking_DB/cre_Doc_Tracking_DB.sqlite", "schema": "CREATE TABLE All_Documents (\nDocument_ID INTEGER NOT NULL,\nDate_Stored DATETIME,\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Name CHAR(255),\nDocument_Description CHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Date_Stored) REFERENCES Ref_Calendar (Calendar_Date)\n);\nCREATE TABLE Document_Locations (\nDocument_ID INTEGER NOT NULL,\nLocation_Code CHAR(15) NOT NULL,\nDate_in_Location_From DATETIME NOT NULL,\nDate_in_Locaton_To DATETIME,\nPRIMARY KEY (Document_ID, Location_Code, Date_in_Location_From),\nFOREIGN KEY (Location_Code) REFERENCES Ref_Locations (Location_Code),\nFOREIGN KEY (Date_in_Location_From) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Date_in_Locaton_To) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)\n);\nCREATE TABLE Documents_to_be_Destroyed (\nDocument_ID INTEGER NOT NULL,\nDestruction_Authorised_by_Employee_ID INTEGER,\nDestroyed_by_Employee_ID INTEGER,\nPlanned_Destruction_Date DATETIME,\nActual_Destruction_Date DATETIME,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Destroyed_by_Employee_ID) REFERENCES Employees (Employee_ID),\nFOREIGN KEY (Destruction_Authorised_by_Employee_ID) REFERENCES Employees (Employee_ID),\nFOREIGN KEY (Planned_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Actual_Destruction_Date) REFERENCES Ref_Calendar (Calendar_Date),\nFOREIGN KEY (Document_ID) REFERENCES All_Documents (Document_ID)\n);\nCREATE TABLE Employees (\nEmployee_ID INTEGER NOT NULL,\nRole_Code CHAR(15) NOT NULL,\nEmployee_Name VARCHAR(255),\nGender_MFU CHAR(1) NOT NULL,\nDate_of_Birth DATETIME NOT NULL,\nOther_Details VARCHAR(255),\nPRIMARY KEY (Employee_ID),\nFOREIGN KEY (Role_Code) REFERENCES Roles (Role_Code)\n);\nCREATE TABLE Ref_Calendar (\nCalendar_Date DATETIME NOT NULL,\nDay_Number INTEGER,\nPRIMARY KEY (Calendar_Date)\n);\nCREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);\nCREATE TABLE Ref_Locations (\nLocation_Code CHAR(15) NOT NULL,\nLocation_Name VARCHAR(255) NOT NULL,\nLocation_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Location_Code)\n);\nCREATE TABLE Roles (\nRole_Code CHAR(15) NOT NULL,\nRole_Name VARCHAR(255),\nRole_Description VARCHAR(255),\nPRIMARY KEY (Role_Code)\n);"} +{"qid": "pool_0142", "split": "pool", "db_id": "music_1", "question": "How many artists are from Bangladesh?", "gold_sql": "SELECT count(*) FROM artist WHERE country = \"Bangladesh\"", "db_path": "databases/music_1/music_1.sqlite", "schema": "CREATE TABLE artist(\n\tartist_name varchar2(50) not null,\n\tcountry varchar2(20),\n\tgender varchar2(20),\n\tpreferred_genre varchar2(50),\n\tconstraint a_name primary key(artist_name),\n\tforeign key(preferred_genre) references genre(g_name) ON DELETE CASCADE\n);\nCREATE TABLE files(\n\tf_id number(10) not null,\n\tartist_name varchar2(50),\n\tfile_size varchar2(20),\n\tduration varchar2(20),\n\tformats varchar2(20),\n\tprimary key(f_id),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE\n);\nCREATE TABLE genre(\n\tg_name varchar2(20) not null,\n\trating varchar2(10),\n\tmost_popular_in varchar2(50),\n\tprimary key(g_name)\n);\nCREATE TABLE song(\n\tsong_name varchar2(50),\n\tartist_name varchar2(50),\n\tcountry varchar2(20),\n\tf_id number(10),\n \tgenre_is varchar2(20),\n\trating number(10) check(rating>0 and rating<11),\n\tlanguages varchar2(20),\n\treleasedate Date, \n\tresolution number(10) not null,\n\tconstraint s_name primary key(song_name),\n\tforeign key(artist_name) references artist(artist_name) ON DELETE CASCADE,\n\tforeign key(f_id) references files(f_id) ON DELETE CASCADE,\n\tforeign key(genre_is) references genre(g_name) ON DELETE CASCADE\n);"} +{"qid": "pool_0143", "split": "pool", "db_id": "cre_Docs_and_Epenses", "question": "What is the id of the project with least number of documents?", "gold_sql": "SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1", "db_path": "databases/cre_Docs_and_Epenses/cre_Docs_and_Epenses.sqlite", "schema": "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);\nCREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);\nCREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);\nCREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);\nCREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);\nCREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);"} +{"qid": "pool_0144", "split": "pool", "db_id": "loan_1", "question": "Find the city and state of the bank branch named morningside.", "gold_sql": "SELECT city , state FROM bank WHERE bname = 'morningside'", "db_path": "databases/loan_1/loan_1.sqlite", "schema": "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));\nCREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));\nCREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));"} +{"qid": "pool_0145", "split": "pool", "db_id": "apartment_rentals", "question": "Show the short names of the buildings managed by \"Emma\".", "gold_sql": "SELECT building_short_name FROM Apartment_Buildings WHERE building_manager\t = \"Emma\"", "db_path": "databases/apartment_rentals/apartment_rentals.sqlite", "schema": "CREATE TABLE Apartment_Bookings (\napt_booking_id INTEGER NOT NULL,\napt_id INTEGER,\nguest_id INTEGER NOT NULL,\nbooking_status_code CHAR(15) NOT NULL,\nbooking_start_date DATETIME,\nbooking_end_date DATETIME,\nPRIMARY KEY (apt_booking_id),\nUNIQUE (apt_booking_id),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (guest_id) REFERENCES Guests (guest_id)\n);\nCREATE TABLE Apartment_Buildings (\nbuilding_id INTEGER NOT NULL,\nbuilding_short_name CHAR(15),\nbuilding_full_name VARCHAR(80),\nbuilding_description VARCHAR(255),\nbuilding_address VARCHAR(255),\nbuilding_manager VARCHAR(50),\nbuilding_phone VARCHAR(80),\nPRIMARY KEY (building_id),\nUNIQUE (building_id)\n);\nCREATE TABLE Apartment_Facilities (\napt_id INTEGER NOT NULL,\nfacility_code CHAR(15) NOT NULL,\nPRIMARY KEY (apt_id, facility_code),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id)\n);\nCREATE TABLE Apartments (\napt_id INTEGER NOT NULL ,\nbuilding_id INTEGER NOT NULL,\napt_type_code CHAR(15),\napt_number CHAR(10),\nbathroom_count INTEGER,\nbedroom_count INTEGER,\nroom_count CHAR(5),\nPRIMARY KEY (apt_id),\nUNIQUE (apt_id),\nFOREIGN KEY (building_id) REFERENCES Apartment_Buildings (building_id)\n);\nCREATE TABLE Guests (\nguest_id INTEGER NOT NULL ,\ngender_code CHAR(1),\nguest_first_name VARCHAR(80),\nguest_last_name VARCHAR(80),\ndate_of_birth DATETIME,\nPRIMARY KEY (guest_id),\nUNIQUE (guest_id)\n);\nCREATE TABLE View_Unit_Status (\napt_id INTEGER,\napt_booking_id INTEGER,\nstatus_date DATETIME NOT NULL,\navailable_yn BIT,\nPRIMARY KEY (status_date),\nFOREIGN KEY (apt_id) REFERENCES Apartments (apt_id),\nFOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings (apt_booking_id)\n);"} +{"qid": "pool_0146", "split": "pool", "db_id": "phone_market", "question": "List the names of phones in ascending order of price.", "gold_sql": "SELECT Name FROM phone ORDER BY Price ASC", "db_path": "databases/phone_market/phone_market.sqlite", "schema": "CREATE TABLE \"market\" (\n\"Market_ID\" int,\n\"District\" text,\n\"Num_of_employees\" int,\n\"Num_of_shops\" real,\n\"Ranking\" int,\nPRIMARY KEY (\"Market_ID\")\n);\nCREATE TABLE \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\n\"Memory_in_G\" int,\n\"Carrier\" text,\n\"Price\" real,\nPRIMARY KEY (\"Phone_ID\")\n);\nCREATE TABLE \"phone_market\" (\n\"Market_ID\" int,\n\"Phone_ID\" text,\n\"Num_of_stock\" int,\nPRIMARY KEY (\"Market_ID\",\"Phone_ID\"),\nFOREIGN KEY (\"Market_ID\") REFERENCES `market`(\"Market_ID\"),\nFOREIGN KEY (\"Phone_ID\") REFERENCES `phone`(\"Phone_ID\")\n);"} +{"qid": "pool_0147", "split": "pool", "db_id": "e_government", "question": "Which state can address \"6862 Kaitlyn Knolls\" possibly be in?", "gold_sql": "SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE \"%6862 Kaitlyn Knolls%\"", "db_path": "databases/e_government/e_government.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);\nCREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);\nCREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);\nCREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);\nCREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);\nCREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);\nCREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);\nCREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);\nCREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);\nCREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);"} +{"qid": "pool_0148", "split": "pool", "db_id": "climbing", "question": "What is the maximum point for climbers whose country is United Kingdom?", "gold_sql": "SELECT max(Points) FROM climber WHERE Country = \"United Kingdom\"", "db_path": "databases/climbing/climbing.sqlite", "schema": "CREATE TABLE \"climber\" (\n\"Climber_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Time\" text,\n\"Points\" real,\n\"Mountain_ID\" int,\nPRIMARY KEY (\"Climber_ID\"),\nFOREIGN KEY (\"Mountain_ID\") REFERENCES \"mountain\"(\"Mountain_ID\")\n);\nCREATE TABLE \"mountain\" (\n\"Mountain_ID\" int,\n\"Name\" text,\n\"Height\" real,\n\"Prominence\" real,\n\"Range\" text,\n\"Country\" text,\nPRIMARY KEY (\"Mountain_ID\")\n);"} +{"qid": "pool_0149", "split": "pool", "db_id": "flight_1", "question": "Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.", "gold_sql": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5", "db_path": "databases/flight_1/flight_1.sqlite", "schema": "CREATE TABLE aircraft(\n\taid number(9,0) primary key,\n\tname varchar2(30),\n\tdistance number(6,0));\nCREATE TABLE certificate(\n\teid number(9,0),\n\taid number(9,0),\n\tprimary key(eid,aid),\n\tforeign key(\"eid\") references `employee`(\"eid\"),\n\tforeign key(\"aid\") references `aircraft`(\"aid\"));\nCREATE TABLE employee(\n\teid number(9,0) primary key,\n\tname varchar2(30),\n\tsalary number(10,2));\nCREATE TABLE flight(\n\tflno number(4,0) primary key,\n\torigin varchar2(20),\n\tdestination varchar2(20),\n\tdistance number(6,0),\n\tdeparture_date date,\n\tarrival_date date,\n\tprice number(7,2),\n aid number(9,0),\n foreign key(\"aid\") references `aircraft`(\"aid\"));"} +{"qid": "pool_0150", "split": "pool", "db_id": "college_3", "question": "Find the first names of students whose first names contain letter \"a\".", "gold_sql": "SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'", "db_path": "databases/college_3/college_3.sqlite", "schema": "CREATE TABLE Course (\n CID \t \tVARCHAR(7) PRIMARY KEY,\n CName\t\tVARCHAR(40),\n Credits\t\tINTEGER,\n Instructor\tINTEGER,\n Days\t\tVARCHAR(5),\n Hours\t\tVARCHAR(11),\n DNO\t\tINTEGER,\n FOREIGN KEY(Instructor) REFERENCES Faculty(FacID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Department (\n DNO \t\tINTEGER PRIMARY KEY,\n Division\t\tVARCHAR(2),\n DName\t\tVARCHAR(25),\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13),\n DPhone\t\tINTEGER\n);\nCREATE TABLE Enrolled_in (\n StuID \t\t INTEGER,\n CID\t\tVARCHAR(7),\n Grade\t\tVARCHAR(2),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(CID) REFERENCES Course(CID),\n FOREIGN KEY(Grade) REFERENCES Gradeconversion(lettergrade)\n);\nCREATE TABLE Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);\nCREATE TABLE Gradeconversion (\n lettergrade\t VARCHAR(2) PRIMARY KEY,\n gradepoint\t FLOAT\n);\nCREATE TABLE Member_of (\n FacID \t INTEGER,\n DNO\t INTEGER,\n Appt_Type VARCHAR(15),\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Minor_in (\n StuID \t INTEGER,\n DNO\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0151", "split": "pool", "db_id": "soccer_2", "question": "How many colleges has more than 15000 students?", "gold_sql": "SELECT count(*) FROM College WHERE enr > 15000", "db_path": "databases/soccer_2/soccer_2.sqlite", "schema": "CREATE TABLE College \n ( cName \tvarchar(20) NOT NULL,\n state \tvarchar(2),\n enr \tnumeric(5,0),\n PRIMARY KEY (cName)\n );\nCREATE TABLE Player\n ( pID\t\t\tnumeric(5,0) NOT NULL,\n \tpName \tvarchar(20),\n yCard \tvarchar(3),\n HS \tnumeric(5,0),\n PRIMARY KEY (pID)\n );\nCREATE TABLE Tryout\n ( pID\t\t\tnumeric(5,0),\n \tcName \tvarchar(20),\n pPos \tvarchar(8),\n decision varchar(3),\n PRIMARY KEY (pID, cName),\n FOREIGN KEY (pID) REFERENCES Player(pID),\n FOREIGN KEY (cName) REFERENCES College(cName)\n );"} +{"qid": "pool_0152", "split": "pool", "db_id": "soccer_2", "question": "How many hours do the players train on average?", "gold_sql": "SELECT avg(HS) FROM Player", "db_path": "databases/soccer_2/soccer_2.sqlite", "schema": "CREATE TABLE College \n ( cName \tvarchar(20) NOT NULL,\n state \tvarchar(2),\n enr \tnumeric(5,0),\n PRIMARY KEY (cName)\n );\nCREATE TABLE Player\n ( pID\t\t\tnumeric(5,0) NOT NULL,\n \tpName \tvarchar(20),\n yCard \tvarchar(3),\n HS \tnumeric(5,0),\n PRIMARY KEY (pID)\n );\nCREATE TABLE Tryout\n ( pID\t\t\tnumeric(5,0),\n \tcName \tvarchar(20),\n pPos \tvarchar(8),\n decision varchar(3),\n PRIMARY KEY (pID, cName),\n FOREIGN KEY (pID) REFERENCES Player(pID),\n FOREIGN KEY (cName) REFERENCES College(cName)\n );"} +{"qid": "pool_0153", "split": "pool", "db_id": "cre_Theme_park", "question": "Which tourist attractions does the visitor with detail 'Vincent' visit?", "gold_sql": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = \"Vincent\"", "db_path": "databases/cre_Theme_park/cre_Theme_park.sqlite", "schema": "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);\nCREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);\nCREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);\nCREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);\nCREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);\nCREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);\nCREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);\nCREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);\nCREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);\nCREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);"} +{"qid": "pool_0154", "split": "pool", "db_id": "e_learning", "question": "What are all the dates of enrollment and completion in record?", "gold_sql": "SELECT date_of_enrolment , date_of_completion FROM Student_Course_Enrolment", "db_path": "databases/e_learning/e_learning.sqlite", "schema": "CREATE TABLE `Course_Authors_and_Tutors` (\n`author_id` INTEGER PRIMARY KEY,\n`author_tutor_ATB` VARCHAR(3),\n`login_name` VARCHAR(40),\n`password` VARCHAR(40),\n`personal_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`family_name` VARCHAR(80),\n`gender_mf` VARCHAR(1),\n`address_line_1` VARCHAR(80)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`author_id` INTEGER NOT NULL,\n`subject_id` INTEGER NOT NULL,\n`course_name` VARCHAR(120),\n`course_description` VARCHAR(255),\nFOREIGN KEY (`author_id` ) REFERENCES `Course_Authors_and_Tutors`(`author_id` ),\nFOREIGN KEY (`subject_id` ) REFERENCES `Subjects`(`subject_id` )\n);\nCREATE TABLE `Student_Course_Enrolment` (\n`registration_id` INTEGER PRIMARY KEY,\n`student_id` INTEGER NOT NULL,\n`course_id` INTEGER NOT NULL,\n`date_of_enrolment` DATETIME NOT NULL,\n`date_of_completion` DATETIME NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Tests_Taken` (\n`registration_id` INTEGER NOT NULL,\n`date_test_taken` DATETIME NOT NULL,\n`test_result` VARCHAR(255),\nFOREIGN KEY (`registration_id` ) REFERENCES `Student_Course_Enrolment`(`registration_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`date_of_registration` DATETIME,\n`date_of_latest_logon` DATETIME,\n`login_name` VARCHAR(40),\n`password` VARCHAR(10),\n`personal_name` VARCHAR(40),\n`middle_name` VARCHAR(40),\n`family_name` VARCHAR(40)\n);\nCREATE TABLE `Subjects` (\n`subject_id` INTEGER PRIMARY KEY,\n`subject_name` VARCHAR(120)\n);"} +{"qid": "pool_0155", "split": "pool", "db_id": "store_1", "question": "What is Astrid Gruber's email and phone number?", "gold_sql": "SELECT email , phone FROM customers WHERE first_name = \"Astrid\" AND last_name = \"Gruber\";", "db_path": "databases/store_1/store_1.sqlite", "schema": "CREATE TABLE albums\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n title VARCHAR(160) NOT NULL,\n artist_id INTEGER NOT NULL,\n FOREIGN KEY (artist_id) REFERENCES artists (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE artists\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE customers\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n first_name VARCHAR(40) NOT NULL,\n last_name VARCHAR(20) NOT NULL,\n company VARCHAR(80),\n address VARCHAR(70),\n city VARCHAR(40),\n state VARCHAR(40),\n country VARCHAR(40),\n postal_code VARCHAR(10),\n phone VARCHAR(24),\n fax VARCHAR(24),\n email VARCHAR(60) NOT NULL,\n support_rep_id INTEGER,\n FOREIGN KEY (support_rep_id) REFERENCES employees (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE employees\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n last_name VARCHAR(20) NOT NULL,\n first_name VARCHAR(20) NOT NULL,\n title VARCHAR(30),\n reports_to INTEGER,\n birth_date TIMESTAMP,\n hire_date TIMESTAMP,\n address VARCHAR(70),\n city VARCHAR(40),\n state VARCHAR(40),\n country VARCHAR(40),\n postal_code VARCHAR(10),\n phone VARCHAR(24),\n fax VARCHAR(24),\n email VARCHAR(60),\n FOREIGN KEY (reports_to) REFERENCES employees (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE genres\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE invoice_lines\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n invoice_id INTEGER NOT NULL,\n track_id INTEGER NOT NULL,\n unit_price NUMERIC(10,2) NOT NULL,\n quantity INTEGER NOT NULL,\n FOREIGN KEY (invoice_id) REFERENCES invoices (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (track_id) REFERENCES tracks (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE invoices\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n customer_id INTEGER NOT NULL,\n invoice_date TIMESTAMP NOT NULL,\n billing_address VARCHAR(70),\n billing_city VARCHAR(40),\n billing_state VARCHAR(40),\n billing_country VARCHAR(40),\n billing_postal_code VARCHAR(10),\n total NUMERIC(10,2) NOT NULL,\n FOREIGN KEY (customer_id) REFERENCES customers (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE media_types\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE playlist_tracks\n(\n playlist_id INTEGER NOT NULL,\n track_id INTEGER NOT NULL,\n CONSTRAINT PK_PlaylistTrack PRIMARY KEY (playlist_id, track_id),\n FOREIGN KEY (playlist_id) REFERENCES playlists (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (track_id) REFERENCES tracks (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE playlists\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE sqlite_sequence(name,seq);\nCREATE TABLE tracks\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(200) NOT NULL,\n album_id INTEGER,\n media_type_id INTEGER NOT NULL,\n genre_id INTEGER,\n composer VARCHAR(220),\n milliseconds INTEGER NOT NULL,\n bytes INTEGER,\n unit_price NUMERIC(10,2) NOT NULL,\n FOREIGN KEY (album_id) REFERENCES albums (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (genre_id) REFERENCES genres (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (media_type_id) REFERENCES media_types (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);"} +{"qid": "pool_0156", "split": "pool", "db_id": "dorm_1", "question": "What is the name and capacity of the dorm with the fewest amount of amenities?", "gold_sql": "SELECT T1.dorm_name , T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY count(*) LIMIT 1", "db_path": "databases/dorm_1/dorm_1.sqlite", "schema": "CREATE TABLE Dorm (\n dormid\t\tINTEGER,\n dorm_name\tVARCHAR(20),\n student_capacity\tINTEGER,\n gender\t\t\tVARCHAR(1)\n);\nCREATE TABLE Dorm_amenity (\n amenid\t\t\tINTEGER,\n amenity_name\t\tVARCHAR(25)\n);\nCREATE TABLE Has_amenity (\n dormid\t\t\tINTEGER,\n amenid\t\t\t\tINTEGER,\n\tFOREIGN KEY (dormid) REFERENCES `Dorm`(dormid),\n\tFOREIGN KEY (amenid) REFERENCES `Dorm_amenity`(amenid)\n);\nCREATE TABLE Lives_in (\n stuid \t INTEGER,\n dormid\t\tINTEGER,\n room_number\tINTEGER,\n\tFOREIGN KEY (stuid) REFERENCES `Student`(StuID),\n FOREIGN KEY (dormid) REFERENCES `Dorm`(dormid)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0157", "split": "pool", "db_id": "aircraft", "question": "What is the number of aircraft?", "gold_sql": "SELECT count(*) FROM aircraft", "db_path": "databases/aircraft/aircraft.sqlite", "schema": "CREATE TABLE `aircraft` (\n \"Aircraft_ID\" int(11) NOT NULL,\n \"Aircraft\" varchar(50) NOT NULL,\n \"Description\" varchar(50) NOT NULL,\n \"Max_Gross_Weight\" varchar(50) NOT NULL,\n \"Total_disk_area\" varchar(50) NOT NULL,\n \"Max_disk_Loading\" varchar(50) NOT NULL,\n PRIMARY KEY (`Aircraft_ID`)\n);\nCREATE TABLE `airport` (\n\"Airport_ID\" int,\n\"Airport_Name\" text,\n\"Total_Passengers\" real,\n\"%_Change_2007\" text,\n\"International_Passengers\" real,\n\"Domestic_Passengers\" real,\n\"Transit_Passengers\" real,\n\"Aircraft_Movements\" real,\n\"Freight_Metric_Tonnes\" real,\nPRIMARY KEY (\"Airport_ID\")\n);\nCREATE TABLE `airport_aircraft` (\n\"ID\" int,\n\"Airport_ID\" int,\n\"Aircraft_ID\" int,\nPRIMARY KEY (\"Airport_ID\",\"Aircraft_ID\"),\nFOREIGN KEY (\"Airport_ID\") REFERENCES `airport`(`Airport_ID`),\nFOREIGN KEY (\"Aircraft_ID\") REFERENCES `aircraft`(`Aircraft_ID`)\n);\nCREATE TABLE `match` (\n\"Round\" real,\n\"Location\" text,\n\"Country\" text,\n\"Date\" text,\n\"Fastest_Qualifying\" text,\n\"Winning_Pilot\" text,\n\"Winning_Aircraft\" text,\nPRIMARY KEY (\"Round\"),\nFOREIGN KEY (`Winning_Aircraft`) REFERENCES `aircraft`(`Aircraft_ID`),\nFOREIGN KEY (`Winning_Pilot`) REFERENCES `pilot`(`Pilot_Id`)\n);\nCREATE TABLE `pilot` (\n `Pilot_Id` int(11) NOT NULL,\n `Name` varchar(50) NOT NULL,\n `Age` int(11) NOT NULL,\n PRIMARY KEY (`Pilot_Id`)\n);"} +{"qid": "pool_0158", "split": "pool", "db_id": "entrepreneur", "question": "List the companies of entrepreneurs in descending order of money requested.", "gold_sql": "SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC", "db_path": "databases/entrepreneur/entrepreneur.sqlite", "schema": "CREATE TABLE \"entrepreneur\" (\n\"Entrepreneur_ID\" int,\n\"People_ID\" int,\n\"Company\" text,\n\"Money_Requested\" real,\n\"Investor\" text,\nPRIMARY KEY (\"Entrepreneur_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Height\" real,\n\"Weight\" real,\n\"Date_of_Birth\" text,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "pool_0159", "split": "pool", "db_id": "gas_company", "question": "How many gas companies are there?", "gold_sql": "SELECT count(*) FROM company", "db_path": "databases/gas_company/gas_company.sqlite", "schema": "CREATE TABLE \"company\" (\n\"Company_ID\" int,\n\"Rank\" int,\n\"Company\" text,\n\"Headquarters\" text,\n\"Main_Industry\" text,\n\"Sales_billion\" real,\n\"Profits_billion\" real,\n\"Assets_billion\" real,\n\"Market_Value\" real,\nPRIMARY KEY (\"Company_ID\")\n);\nCREATE TABLE \"gas_station\" (\n\"Station_ID\" int,\n\"Open_Year\" int,\n\"Location\" text,\n\"Manager_Name\" text,\n\"Vice_Manager_Name\" text,\n\"Representative_Name\" text,\nPRIMARY KEY (\"Station_ID\")\n);\nCREATE TABLE \"station_company\" (\n\"Station_ID\" int,\n\"Company_ID\" int,\n\"Rank_of_the_Year\" int,\nPRIMARY KEY (\"Station_ID\",\"Company_ID\"),\nFOREIGN KEY (`Station_ID`) REFERENCES `gas_station`(`Station_ID`),\nFOREIGN KEY (`Company_ID`) REFERENCES `company`(`Company_ID`)\n);"} +{"qid": "pool_0160", "split": "pool", "db_id": "college_3", "question": "What are the department name and room for the course INTRODUCTION TO COMPUTER SCIENCE?", "gold_sql": "SELECT T2.Dname , T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = \"INTRODUCTION TO COMPUTER SCIENCE\"", "db_path": "databases/college_3/college_3.sqlite", "schema": "CREATE TABLE Course (\n CID \t \tVARCHAR(7) PRIMARY KEY,\n CName\t\tVARCHAR(40),\n Credits\t\tINTEGER,\n Instructor\tINTEGER,\n Days\t\tVARCHAR(5),\n Hours\t\tVARCHAR(11),\n DNO\t\tINTEGER,\n FOREIGN KEY(Instructor) REFERENCES Faculty(FacID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Department (\n DNO \t\tINTEGER PRIMARY KEY,\n Division\t\tVARCHAR(2),\n DName\t\tVARCHAR(25),\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13),\n DPhone\t\tINTEGER\n);\nCREATE TABLE Enrolled_in (\n StuID \t\t INTEGER,\n CID\t\tVARCHAR(7),\n Grade\t\tVARCHAR(2),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(CID) REFERENCES Course(CID),\n FOREIGN KEY(Grade) REFERENCES Gradeconversion(lettergrade)\n);\nCREATE TABLE Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);\nCREATE TABLE Gradeconversion (\n lettergrade\t VARCHAR(2) PRIMARY KEY,\n gradepoint\t FLOAT\n);\nCREATE TABLE Member_of (\n FacID \t INTEGER,\n DNO\t INTEGER,\n Appt_Type VARCHAR(15),\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Minor_in (\n StuID \t INTEGER,\n DNO\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(DNO) REFERENCES Department(DNO)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0161", "split": "pool", "db_id": "music_4", "question": "What is the famous release date of the artist with the oldest age?", "gold_sql": "SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1", "db_path": "databases/music_4/music_4.sqlite", "schema": "CREATE TABLE \"artist\" (\n \"Artist_ID\" int,\n \"Artist\" text,\n \"Age\" int,\n \"Famous_Title\" text,\n \"Famous_Release_date\" text,\n PRIMARY KEY (\"Artist_ID\")\n);\nCREATE TABLE \"music_festival\" (\n \"ID\" int,\n \"Music_Festival\" text,\n \"Date_of_ceremony\" text,\n \"Category\" text,\n \"Volume\" int,\n \"Result\" text,\n PRIMARY KEY (`ID`),\n FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)\n);\nCREATE TABLE \"volume\" (\n \"Volume_ID\" int,\n \"Volume_Issue\" text,\n \"Issue_Date\" text,\n \"Weeks_on_Top\" real,\n \"Song\" text,\n \"Artist_ID\" int,\n PRIMARY KEY (\"Volume_ID\"),\n FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)\n);"} +{"qid": "pool_0162", "split": "pool", "db_id": "icfp_1", "question": "Find the number of papers published by the institution \"University of Pennsylvania\".", "gold_sql": "SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = \"University of Pennsylvania\"", "db_path": "databases/icfp_1/icfp_1.sqlite", "schema": "CREATE TABLE Authors (\n authID INTEGER,\n lname TEXT,\n fname TEXT,\n PRIMARY KEY (authID)\n);\nCREATE TABLE Authorship (\n authID INTEGER,\n instID INTEGER,\n paperID INTEGER,\n authOrder INTEGER,\n PRIMARY KEY (authID, instID, paperID),\n FOREIGN KEY (authID) REFERENCES Authors (authID),\n FOREIGN KEY (instID) REFERENCES Inst (instID),\n FOREIGN KEY (paperID) REFERENCES Papers (paperID)\n);\nCREATE TABLE Inst (\n instID INTEGER,\n name TEXT,\n country TEXT, -- the home country of the institution (this is obviously an impoverished model)\n PRIMARY KEY (instID)\n);\nCREATE TABLE Papers (\n paperID INTEGER,\n title TEXT,\n PRIMARY KEY (paperID)\n);"} +{"qid": "pool_0163", "split": "pool", "db_id": "college_2", "question": "What are the building, room number, semester and year of courses in the Psychology department, sorted using course title?", "gold_sql": "SELECT T2.building , T2.room_number , T2.semester , T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title", "db_path": "databases/college_2/college_2.sqlite", "schema": "CREATE TABLE advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);\nCREATE TABLE course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );\nCREATE TABLE department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);\nCREATE TABLE instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);\nCREATE TABLE section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);\nCREATE TABLE student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);\nCREATE TABLE takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);\nCREATE TABLE time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);"} +{"qid": "pool_0164", "split": "pool", "db_id": "e_government", "question": "What are the names of all cities and states?", "gold_sql": "SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses", "db_path": "databases/e_government/e_government.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);\nCREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);\nCREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);\nCREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);\nCREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);\nCREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);\nCREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);\nCREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);\nCREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);\nCREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);"} +{"qid": "pool_0165", "split": "pool", "db_id": "news_report", "question": "What is the nationality of the journalist with the largest number of years working?", "gold_sql": "SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1", "db_path": "databases/news_report/news_report.sqlite", "schema": "CREATE TABLE \"event\" (\n \"Event_ID\" int,\n \"Date\" text,\n \"Venue\" text,\n \"Name\" text,\n \"Event_Attendance\" int,\n PRIMARY KEY (\"Event_ID\")\n);\nCREATE TABLE \"journalist\" (\n \"journalist_ID\" int,\n \"Name\" text,\n \"Nationality\" text,\n \"Age\" text,\n \"Years_working\" int,\n PRIMARY KEY (\"journalist_ID\")\n);\nCREATE TABLE \"news_report\" (\n \"journalist_ID\" int,\n \"Event_ID\" int,\n \"Work_Type\" text,\n PRIMARY KEY (\"journalist_ID\",\"Event_ID\"),\n FOREIGN KEY (\"journalist_ID\") REFERENCES `journalist`(\"journalist_ID\"),\n FOREIGN KEY (\"Event_ID\") REFERENCES `event`(\"Event_ID\")\n);"} +{"qid": "pool_0166", "split": "pool", "db_id": "customers_and_invoices", "question": "Show the id, the account name, and other account details for all accounts by the customer with first name 'Meaghan'.", "gold_sql": "SELECT T1.account_id , T1.date_account_opened , T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan'", "db_path": "databases/customers_and_invoices/customers_and_invoices.sqlite", "schema": "CREATE TABLE `Accounts` (\n`account_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`date_account_opened` DATETIME,\n`account_name` VARCHAR(50),\n`other_account_details` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_first_name` VARCHAR(50),\n`customer_middle_initial` VARCHAR(1),\n`customer_last_name` VARCHAR(50),\n`gender` VARCHAR(1),\n`email_address` VARCHAR(255),\n`login_name` VARCHAR(80),\n`login_password` VARCHAR(20),\n`phone_number` VARCHAR(255),\n`town_city` VARCHAR(50),\n`state_county_province` VARCHAR(50),\n`country` VARCHAR(50)\n);\nCREATE TABLE `Financial_Transactions` (\n`transaction_id` INTEGER NOT NULL ,\n`account_id` INTEGER NOT NULL,\n`invoice_number` INTEGER,\n`transaction_type` VARCHAR(15) NOT NULL,\n`transaction_date` DATETIME,\n`transaction_amount` DECIMAL(19,4),\n`transaction_comment` VARCHAR(255),\n`other_transaction_details` VARCHAR(255),\nFOREIGN KEY (`invoice_number` ) REFERENCES `Invoices`(`invoice_number` ),\nFOREIGN KEY (`account_id` ) REFERENCES `Accounts`(`account_id` )\n);\nCREATE TABLE `Invoice_Line_Items` (\n`order_item_id` INTEGER NOT NULL,\n`invoice_number` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\n`product_title` VARCHAR(80),\n`product_quantity` VARCHAR(50),\n`product_price` DECIMAL(19,4),\n`derived_product_cost` DECIMAL(19,4),\n`derived_vat_payable` DECIMAL(19,4),\n`derived_total_cost` DECIMAL(19,4),\nFOREIGN KEY (`order_item_id` ) REFERENCES `Order_Items`(`order_item_id` ),\nFOREIGN KEY (`invoice_number` ) REFERENCES `Invoices`(`invoice_number` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Invoices` (\n`invoice_number` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`invoice_date` DATETIME,\nFOREIGN KEY (`order_id` ) REFERENCES `Orders`(`order_id` )\n);\nCREATE TABLE `Order_Items` (\n`order_item_id` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\n`product_quantity` VARCHAR(50),\n`other_order_item_details` VARCHAR(255),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`order_id` ) REFERENCES `Orders`(`order_id` )\n);\nCREATE TABLE `Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`date_order_placed` DATETIME NOT NULL,\n`order_details` VARCHAR(255),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Product_Categories` (\n`production_type_code` VARCHAR(15) PRIMARY KEY,\n`product_type_description` VARCHAR(80),\n`vat_rating` DECIMAL(19,4)\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`production_type_code` VARCHAR(15) NOT NULL,\n`unit_price` DECIMAL(19,4),\n`product_name` VARCHAR(80),\n`product_color` VARCHAR(20),\n`product_size` VARCHAR(20),\nFOREIGN KEY (`production_type_code` ) REFERENCES `Product_Categories`(`production_type_code` )\n);"} +{"qid": "pool_0167", "split": "pool", "db_id": "voter_2", "question": "Find the first names of students with age above 22.", "gold_sql": "SELECT Fname FROM STUDENT WHERE Age > 22", "db_path": "databases/voter_2/voter_2.sqlite", "schema": "CREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );\nCREATE TABLE Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"} +{"qid": "pool_0168", "split": "pool", "db_id": "flight_company", "question": "which pilot is in charge of the most number of flights?", "gold_sql": "SELECT pilot FROM flight GROUP BY pilot ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/flight_company/flight_company.sqlite", "schema": "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);\nCREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);"} +{"qid": "pool_0169", "split": "pool", "db_id": "city_record", "question": "Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?", "gold_sql": "SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct", "db_path": "databases/city_record/city_record.sqlite", "schema": "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);\nCREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);\nCREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);\nCREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);"} +{"qid": "pool_0170", "split": "pool", "db_id": "sports_competition", "question": "What are the names of all players that got more than the average number of points?", "gold_sql": "SELECT name FROM player WHERE points > (SELECT avg(points) FROM player)", "db_path": "databases/sports_competition/sports_competition.sqlite", "schema": "CREATE TABLE \"club\" (\n\"Club_ID\" int,\n\"name\" text,\n\"Region\" text,\n\"Start_year\" text,\nPRIMARY KEY (\"Club_ID\")\n);\nCREATE TABLE \"club_rank\" (\n\"Rank\" real,\n\"Club_ID\" int,\n\"Gold\" real,\n\"Silver\" real,\n\"Bronze\" real,\n\"Total\" real,\nPRIMARY KEY (\"Rank\",\"Club_ID\")\nFOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`)\n);\nCREATE TABLE \"competition\" (\n\"Competition_ID\" int,\n\"Year\" real,\n\"Competition_type\" text,\n\"Country\" text,\nPRIMARY KEY (\"Competition_ID\")\n);\nCREATE TABLE \"competition_result\" (\n\"Competition_ID\" int,\n\"Club_ID_1\" int,\n\"Club_ID_2\" int,\n\"Score\" text,\nPRIMARY KEY (\"Competition_ID\",\"Club_ID_1\",\"Club_ID_2\"),\nFOREIGN KEY (`Club_ID_1`) REFERENCES `club`(`Club_ID`),\nFOREIGN KEY (`Club_ID_2`) REFERENCES `club`(`Club_ID`),\nFOREIGN KEY (`Competition_ID`) REFERENCES `competition`(`Competition_ID`)\n);\nCREATE TABLE \"player\" (\n\"Player_ID\" int,\n\"name\" text,\n\"Position\" text,\n\"Club_ID\" int,\n\"Apps\" real,\n\"Tries\" real,\n\"Goals\" text,\n\"Points\" real,\nPRIMARY KEY (\"Player_ID\"),\nFOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`)\n);"} +{"qid": "pool_0171", "split": "pool", "db_id": "college_1", "question": "Which department has the most professors with a Ph.D.?", "gold_sql": "SELECT T2.dept_name , T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/college_1/college_1.sqlite", "schema": "CREATE TABLE CLASS (\nCLASS_CODE varchar(5) PRIMARY KEY,\nCRS_CODE varchar(10),\nCLASS_SECTION varchar(2),\nCLASS_TIME varchar(20),\nCLASS_ROOM varchar(8),\nPROF_NUM int,\nFOREIGN KEY (CRS_CODE) REFERENCES COURSE(CRS_CODE)\nFOREIGN KEY (PROF_NUM) REFERENCES EMPLOYEE(EMP_NUM)\n);\nCREATE TABLE COURSE (\nCRS_CODE varchar(10) PRIMARY KEY,\nDEPT_CODE varchar(10),\nCRS_DESCRIPTION varchar(35),\nCRS_CREDIT float(8),\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);\nCREATE TABLE DEPARTMENT (\nDEPT_CODE varchar(10) PRIMARY KEY,\nDEPT_NAME varchar(30),\nSCHOOL_CODE varchar(8),\nEMP_NUM int,\nDEPT_ADDRESS varchar(20),\nDEPT_EXTENSION varchar(4),\nFOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM)\n);\nCREATE TABLE EMPLOYEE (\nEMP_NUM int PRIMARY KEY,\nEMP_LNAME varchar(15),\nEMP_FNAME varchar(12),\nEMP_INITIAL varchar(1),\nEMP_JOBCODE varchar(5),\nEMP_HIREDATE datetime,\nEMP_DOB datetime\n);\nCREATE TABLE ENROLL (\nCLASS_CODE varchar(5),\nSTU_NUM int,\nENROLL_GRADE varchar(50),\nFOREIGN KEY (CLASS_CODE) REFERENCES CLASS(CLASS_CODE)\nFOREIGN KEY (STU_NUM) REFERENCES STUDENT(STU_NUM)\n);\nCREATE TABLE PROFESSOR (\nEMP_NUM int,\nDEPT_CODE varchar(10),\nPROF_OFFICE varchar(50),\nPROF_EXTENSION varchar(4),\nPROF_HIGH_DEGREE varchar(5),\nFOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM),\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);\nCREATE TABLE STUDENT (\nSTU_NUM int PRIMARY KEY,\nSTU_LNAME varchar(15),\nSTU_FNAME varchar(15),\nSTU_INIT varchar(1),\nSTU_DOB datetime,\nSTU_HRS int,\nSTU_CLASS varchar(2),\nSTU_GPA float(8),\nSTU_TRANSFER numeric,\nDEPT_CODE varchar(18),\nSTU_PHONE varchar(4),\nPROF_NUM int,\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);"} +{"qid": "pool_0172", "split": "pool", "db_id": "activity_1", "question": "What is the first and last name of the student participating in the most activities?", "gold_sql": "SELECT T1.fname , T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/activity_1/activity_1.sqlite", "schema": "CREATE TABLE Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);\nCREATE TABLE Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} +{"qid": "pool_0173", "split": "pool", "db_id": "student_assessment", "question": "Find the cell mobile number of the candidates whose assessment code is \"Fail\"?", "gold_sql": "SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = \"Fail\"", "db_path": "databases/student_assessment/student_assessment.sqlite", "schema": "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\nline_1 VARCHAR(80),\nline_2 VARCHAR(80),\ncity VARCHAR(50),\nzip_postcode CHAR(20),\nstate_province_county VARCHAR(50),\ncountry VARCHAR(50),\nPRIMARY KEY (address_id)\n);\nCREATE TABLE Candidate_Assessments (\ncandidate_id INTEGER NOT NULL,\nqualification CHAR(15) NOT NULL,\nassessment_date DATETIME NOT NULL,\nasessment_outcome_code CHAR(15) NOT NULL,\nPRIMARY KEY (candidate_id, qualification),\nFOREIGN KEY (candidate_id) REFERENCES Candidates (candidate_id)\n);\nCREATE TABLE Candidates (\ncandidate_id INTEGER NOT NULL ,\ncandidate_details VARCHAR(255),\nPRIMARY KEY (candidate_id),\nFOREIGN KEY (candidate_id) REFERENCES People (person_id)\n);\nCREATE TABLE Courses (\ncourse_id VARCHAR(100) NOT NULL,\ncourse_name VARCHAR(120),\ncourse_description VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (course_id)\n);\nCREATE TABLE People (\nperson_id INTEGER NOT NULL,\nfirst_name VARCHAR(255),\nmiddle_name VARCHAR(255),\nlast_name VARCHAR(255),\ncell_mobile_number VARCHAR(40),\nemail_address VARCHAR(40),\nlogin_name VARCHAR(40),\npassword VARCHAR(40),\nPRIMARY KEY (person_id)\n);\nCREATE TABLE People_Addresses (\nperson_address_id INTEGER NOT NULL,\nperson_id INTEGER NOT NULL,\naddress_id INTEGER NOT NULL,\ndate_from DATETIME,\ndate_to DATETIME,\nPRIMARY KEY (person_address_id),\nFOREIGN KEY (person_id) REFERENCES People (person_id),\nFOREIGN KEY (address_id) REFERENCES Addresses (address_id)\n);\nCREATE TABLE Student_Course_Attendance (\nstudent_id INTEGER NOT NULL,\ncourse_id INTEGER NOT NULL,\ndate_of_attendance DATETIME NOT NULL,\nPRIMARY KEY (student_id, course_id),\nFOREIGN KEY (student_id, course_id) REFERENCES Student_Course_Registrations (student_id,course_id)\n);\nCREATE TABLE Student_Course_Registrations (\nstudent_id INTEGER NOT NULL,\ncourse_id INTEGER NOT NULL,\nregistration_date DATETIME NOT NULL,\nPRIMARY KEY (student_id, course_id),\nFOREIGN KEY (student_id) REFERENCES Students (student_id),\nFOREIGN KEY (course_id) REFERENCES Courses (course_id)\n);\nCREATE TABLE Students (\nstudent_id INTEGER NOT NULL,\nstudent_details VARCHAR(255),\nPRIMARY KEY (student_id),\nFOREIGN KEY (student_id) REFERENCES People (person_id)\n);"} +{"qid": "pool_0174", "split": "pool", "db_id": "swimming", "question": "Find the names of swimmers who has a result of \"win\".", "gold_sql": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'", "db_path": "databases/swimming/swimming.sqlite", "schema": "CREATE TABLE \"event\" (\n\"ID\" int,\n\"Name\" text,\n\"Stadium_ID\" int,\n\"Year\" text,\nPRIMARY KEY (\"ID\"),\nFOREIGN KEY (`Stadium_ID`) REFERENCES `stadium`(`ID`)\n);\nCREATE TABLE \"record\" (\n\"ID\" int,\n\"Result\" text,\n\"Swimmer_ID\" int,\n\"Event_ID\" int,\nPRIMARY KEY (\"Swimmer_ID\",\"Event_ID\"),\nFOREIGN KEY (`Event_ID`) REFERENCES `event`(`ID`),\nFOREIGN KEY (`Swimmer_ID`) REFERENCES `swimmer`(`ID`)\n);\nCREATE TABLE \"stadium\" (\n\"ID\" int,\n\"name\" text,\n\"Capacity\" int,\n\"City\" text,\n\"Country\" text,\n\"Opening_year\" int,\nPRIMARY KEY (\"ID\")\n);\nCREATE TABLE \"swimmer\" (\n\"ID\" int,\n\"name\" text,\n\"Nationality\" text,\n\"meter_100\" real,\n\"meter_200\" text,\n\"meter_300\" text,\n\"meter_400\" text,\n\"meter_500\" text,\n\"meter_600\" text,\n\"meter_700\" text,\n\"Time\" text,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "pool_0175", "split": "pool", "db_id": "music_4", "question": "Return the number of music festivals of each category.", "gold_sql": "SELECT Category , COUNT(*) FROM music_festival GROUP BY Category", "db_path": "databases/music_4/music_4.sqlite", "schema": "CREATE TABLE \"artist\" (\n \"Artist_ID\" int,\n \"Artist\" text,\n \"Age\" int,\n \"Famous_Title\" text,\n \"Famous_Release_date\" text,\n PRIMARY KEY (\"Artist_ID\")\n);\nCREATE TABLE \"music_festival\" (\n \"ID\" int,\n \"Music_Festival\" text,\n \"Date_of_ceremony\" text,\n \"Category\" text,\n \"Volume\" int,\n \"Result\" text,\n PRIMARY KEY (`ID`),\n FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)\n);\nCREATE TABLE \"volume\" (\n \"Volume_ID\" int,\n \"Volume_Issue\" text,\n \"Issue_Date\" text,\n \"Weeks_on_Top\" real,\n \"Song\" text,\n \"Artist_ID\" int,\n PRIMARY KEY (\"Volume_ID\"),\n FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)\n);"} +{"qid": "pool_0176", "split": "pool", "db_id": "cre_Docs_and_Epenses", "question": "Show all statement id and the number of accounts for each statement.", "gold_sql": "SELECT STATEMENT_ID , count(*) FROM Accounts GROUP BY STATEMENT_ID", "db_path": "databases/cre_Docs_and_Epenses/cre_Docs_and_Epenses.sqlite", "schema": "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);\nCREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);\nCREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);\nCREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);\nCREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);\nCREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);"} +{"qid": "pool_0177", "split": "pool", "db_id": "tracking_software_problems", "question": "Which problem id and log id are assigned to the staff named Rylan Homenick?", "gold_sql": "SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = \"Rylan\" AND T1.staff_last_name = \"Homenick\"", "db_path": "databases/tracking_software_problems/tracking_software_problems.sqlite", "schema": "CREATE TABLE `Problem_Category_Codes` (\n`problem_category_code` VARCHAR(20) PRIMARY KEY,\n`problem_category_description` VARCHAR(80)\n);\nCREATE TABLE `Problem_Log` (\n`problem_log_id` INTEGER PRIMARY KEY,\n`assigned_to_staff_id` INTEGER NOT NULL,\n`problem_id` INTEGER NOT NULL,\n`problem_category_code` VARCHAR(20) NOT NULL,\n`problem_status_code` VARCHAR(20) NOT NULL,\n`log_entry_date` DATETIME,\n`log_entry_description` VARCHAR(255),\n`log_entry_fix` VARCHAR(255),\n`other_log_details` VARCHAR(255),\nFOREIGN KEY (`problem_category_code` ) REFERENCES `Problem_Category_Codes`(`problem_category_code` ),FOREIGN KEY (`assigned_to_staff_id` ) REFERENCES `Staff`(`staff_id` ),FOREIGN KEY (`problem_id` ) REFERENCES `Problems`(`problem_id` ),FOREIGN KEY (`problem_status_code` ) REFERENCES `Problem_Status_Codes`(`problem_status_code` )\n);\nCREATE TABLE `Problem_Status_Codes` (\n`problem_status_code` VARCHAR(20) PRIMARY KEY,\n`problem_status_description` VARCHAR(80)\n);\nCREATE TABLE `Problems` (\n`problem_id` INTEGER PRIMARY KEY,\n`product_id` INTEGER NOT NULL,\n`closure_authorised_by_staff_id` INTEGER NOT NULL,\n`reported_by_staff_id` INTEGER NOT NULL,\n`date_problem_reported` DATETIME NOT NULL,\n`date_problem_closed` DATETIME,\n`problem_description` VARCHAR(255),\n`other_problem_details` VARCHAR(255),\nFOREIGN KEY (`closure_authorised_by_staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Product`(`product_id` ),\nFOREIGN KEY (`reported_by_staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Product` (\n`product_id` INTEGER PRIMARY KEY,\n`product_name` VARCHAR(80),\n`product_details` VARCHAR(255)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_first_name` VARCHAR(80),\n`staff_last_name` VARCHAR(80),\n`other_staff_details` VARCHAR(255)\n);"} +{"qid": "pool_0178", "split": "pool", "db_id": "store_1", "question": "A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size.", "gold_sql": "SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;", "db_path": "databases/store_1/store_1.sqlite", "schema": "CREATE TABLE albums\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n title VARCHAR(160) NOT NULL,\n artist_id INTEGER NOT NULL,\n FOREIGN KEY (artist_id) REFERENCES artists (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE artists\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE customers\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n first_name VARCHAR(40) NOT NULL,\n last_name VARCHAR(20) NOT NULL,\n company VARCHAR(80),\n address VARCHAR(70),\n city VARCHAR(40),\n state VARCHAR(40),\n country VARCHAR(40),\n postal_code VARCHAR(10),\n phone VARCHAR(24),\n fax VARCHAR(24),\n email VARCHAR(60) NOT NULL,\n support_rep_id INTEGER,\n FOREIGN KEY (support_rep_id) REFERENCES employees (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE employees\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n last_name VARCHAR(20) NOT NULL,\n first_name VARCHAR(20) NOT NULL,\n title VARCHAR(30),\n reports_to INTEGER,\n birth_date TIMESTAMP,\n hire_date TIMESTAMP,\n address VARCHAR(70),\n city VARCHAR(40),\n state VARCHAR(40),\n country VARCHAR(40),\n postal_code VARCHAR(10),\n phone VARCHAR(24),\n fax VARCHAR(24),\n email VARCHAR(60),\n FOREIGN KEY (reports_to) REFERENCES employees (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE genres\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE invoice_lines\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n invoice_id INTEGER NOT NULL,\n track_id INTEGER NOT NULL,\n unit_price NUMERIC(10,2) NOT NULL,\n quantity INTEGER NOT NULL,\n FOREIGN KEY (invoice_id) REFERENCES invoices (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (track_id) REFERENCES tracks (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE invoices\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n customer_id INTEGER NOT NULL,\n invoice_date TIMESTAMP NOT NULL,\n billing_address VARCHAR(70),\n billing_city VARCHAR(40),\n billing_state VARCHAR(40),\n billing_country VARCHAR(40),\n billing_postal_code VARCHAR(10),\n total NUMERIC(10,2) NOT NULL,\n FOREIGN KEY (customer_id) REFERENCES customers (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE media_types\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE playlist_tracks\n(\n playlist_id INTEGER NOT NULL,\n track_id INTEGER NOT NULL,\n CONSTRAINT PK_PlaylistTrack PRIMARY KEY (playlist_id, track_id),\n FOREIGN KEY (playlist_id) REFERENCES playlists (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (track_id) REFERENCES tracks (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE playlists\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(120)\n);\nCREATE TABLE sqlite_sequence(name,seq);\nCREATE TABLE tracks\n(\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name VARCHAR(200) NOT NULL,\n album_id INTEGER,\n media_type_id INTEGER NOT NULL,\n genre_id INTEGER,\n composer VARCHAR(220),\n milliseconds INTEGER NOT NULL,\n bytes INTEGER,\n unit_price NUMERIC(10,2) NOT NULL,\n FOREIGN KEY (album_id) REFERENCES albums (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (genre_id) REFERENCES genres (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION,\n FOREIGN KEY (media_type_id) REFERENCES media_types (id)\n ON DELETE NO ACTION ON UPDATE NO ACTION\n);"} +{"qid": "pool_0179", "split": "pool", "db_id": "gymnast", "question": "Give the different hometowns of gymnasts that have a total point score of above 57.5.", "gold_sql": "SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5", "db_path": "databases/gymnast/gymnast.sqlite", "schema": "CREATE TABLE \"gymnast\" (\n\"Gymnast_ID\" int,\n\"Floor_Exercise_Points\" real,\n\"Pommel_Horse_Points\" real,\n\"Rings_Points\" real,\n\"Vault_Points\" real,\n\"Parallel_Bars_Points\" real,\n\"Horizontal_Bar_Points\" real,\n\"Total_Points\" real,\nPRIMARY KEY (\"Gymnast_ID\"),\nFOREIGN KEY (\"Gymnast_ID\") REFERENCES \"people\"(\"People_ID\")\n);\nCREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Name\" text,\n\"Age\" real,\n\"Height\" real,\n\"Hometown\" text,\nPRIMARY KEY (\"People_ID\")\n);"} +{"qid": "pool_0180", "split": "pool", "db_id": "college_1", "question": "What are the first names of all students who got a grade C in a class?", "gold_sql": "SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'", "db_path": "databases/college_1/college_1.sqlite", "schema": "CREATE TABLE CLASS (\nCLASS_CODE varchar(5) PRIMARY KEY,\nCRS_CODE varchar(10),\nCLASS_SECTION varchar(2),\nCLASS_TIME varchar(20),\nCLASS_ROOM varchar(8),\nPROF_NUM int,\nFOREIGN KEY (CRS_CODE) REFERENCES COURSE(CRS_CODE)\nFOREIGN KEY (PROF_NUM) REFERENCES EMPLOYEE(EMP_NUM)\n);\nCREATE TABLE COURSE (\nCRS_CODE varchar(10) PRIMARY KEY,\nDEPT_CODE varchar(10),\nCRS_DESCRIPTION varchar(35),\nCRS_CREDIT float(8),\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);\nCREATE TABLE DEPARTMENT (\nDEPT_CODE varchar(10) PRIMARY KEY,\nDEPT_NAME varchar(30),\nSCHOOL_CODE varchar(8),\nEMP_NUM int,\nDEPT_ADDRESS varchar(20),\nDEPT_EXTENSION varchar(4),\nFOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM)\n);\nCREATE TABLE EMPLOYEE (\nEMP_NUM int PRIMARY KEY,\nEMP_LNAME varchar(15),\nEMP_FNAME varchar(12),\nEMP_INITIAL varchar(1),\nEMP_JOBCODE varchar(5),\nEMP_HIREDATE datetime,\nEMP_DOB datetime\n);\nCREATE TABLE ENROLL (\nCLASS_CODE varchar(5),\nSTU_NUM int,\nENROLL_GRADE varchar(50),\nFOREIGN KEY (CLASS_CODE) REFERENCES CLASS(CLASS_CODE)\nFOREIGN KEY (STU_NUM) REFERENCES STUDENT(STU_NUM)\n);\nCREATE TABLE PROFESSOR (\nEMP_NUM int,\nDEPT_CODE varchar(10),\nPROF_OFFICE varchar(50),\nPROF_EXTENSION varchar(4),\nPROF_HIGH_DEGREE varchar(5),\nFOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM),\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);\nCREATE TABLE STUDENT (\nSTU_NUM int PRIMARY KEY,\nSTU_LNAME varchar(15),\nSTU_FNAME varchar(15),\nSTU_INIT varchar(1),\nSTU_DOB datetime,\nSTU_HRS int,\nSTU_CLASS varchar(2),\nSTU_GPA float(8),\nSTU_TRANSFER numeric,\nDEPT_CODE varchar(18),\nSTU_PHONE varchar(4),\nPROF_NUM int,\nFOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE)\n);"} +{"qid": "pool_0181", "split": "pool", "db_id": "program_share", "question": "Show me the owner of the channel with the highest rating.", "gold_sql": "SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1", "db_path": "databases/program_share/program_share.sqlite", "schema": "CREATE TABLE \"broadcast\" (\n\"Channel_ID\" int,\n\"Program_ID\" int,\n\"Time_of_day\" text,\nPRIMARY KEY (\"Channel_ID\",\"Program_ID\"),\nFOREIGN KEY (`Channel_ID`) REFERENCES `channel`(`Channel_ID`),\nFOREIGN KEY (`Program_ID`) REFERENCES `program`(`Program_ID`)\n);\nCREATE TABLE \"broadcast_share\" (\n\"Channel_ID\" int,\n\"Program_ID\" int,\n\"Date\" text,\n\"Share_in_percent\" real,\nPRIMARY KEY (\"Channel_ID\",\"Program_ID\"),\nFOREIGN KEY (`Channel_ID`) REFERENCES `channel`(`Channel_ID`),\nFOREIGN KEY (`Program_ID`) REFERENCES `program`(`Program_ID`)\n);\nCREATE TABLE \"channel\" (\n\"Channel_ID\" int,\n\"Name\" text,\n\"Owner\" text,\n\"Share_in_percent\" real,\n\"Rating_in_percent\" real,\nPRIMARY KEY (\"Channel_ID\")\n);\nCREATE TABLE \"program\" (\n\"Program_ID\" int,\n\"Name\" text,\n\"Origin\" text,\n\"Launch\" real,\n\"Owner\" text,\nPRIMARY KEY (\"Program_ID\")\n);"} +{"qid": "pool_0182", "split": "pool", "db_id": "device", "question": "What are the carriers of devices that are not in stock anywhere?", "gold_sql": "SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)", "db_path": "databases/device/device.sqlite", "schema": "CREATE TABLE \"device\" (\n\"Device_ID\" int,\n\"Device\" text,\n\"Carrier\" text,\n\"Package_Version\" text,\n\"Applications\" text,\n\"Software_Platform\" text,\nPRIMARY KEY (\"Device_ID\")\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Shop_Name\" text,\n\"Location\" text,\n\"Open_Date\" text,\n\"Open_Year\" int,\nPRIMARY KEY (\"Shop_ID\")\n);\nCREATE TABLE \"stock\" (\n\"Shop_ID\" int,\n\"Device_ID\" int,\n\"Quantity\" int,\nPRIMARY KEY (\"Shop_ID\",\"Device_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Device_ID`) REFERENCES `device`(`Device_ID`)\n);"} +{"qid": "pool_0183", "split": "pool", "db_id": "bike_1", "question": "What are the days that had the smallest temperature range, and what was that range?", "gold_sql": "SELECT date , max_temperature_f - min_temperature_f FROM weather ORDER BY max_temperature_f - min_temperature_f LIMIT 1", "db_path": "databases/bike_1/bike_1.sqlite", "schema": "CREATE TABLE station (\n id INTEGER PRIMARY KEY,\n name TEXT,\n lat NUMERIC,\n long NUMERIC,\n dock_count INTEGER,\n city TEXT,\n installation_date TEXT);\nCREATE TABLE status (\n station_id INTEGER,\n bikes_available INTEGER,\n docks_available INTEGER,\n time TEXT,\n FOREIGN KEY (station_id) REFERENCES station(id)\n);\nCREATE TABLE trip (\n id INTEGER PRIMARY KEY,\n duration INTEGER,\n start_date TEXT,\n start_station_name TEXT, -- this should be removed\n start_station_id INTEGER,\n end_date TEXT,\n end_station_name TEXT, -- this should be removed\n end_station_id INTEGER,\n bike_id INTEGER,\n subscription_type TEXT,\n zip_code INTEGER);\nCREATE TABLE weather (\n date TEXT,\n max_temperature_f INTEGER,\n mean_temperature_f INTEGER,\n min_temperature_f INTEGER,\n max_dew_point_f INTEGER,\n mean_dew_point_f INTEGER,\n min_dew_point_f INTEGER,\n max_humidity INTEGER,\n mean_humidity INTEGER,\n min_humidity INTEGER,\n max_sea_level_pressure_inches NUMERIC,\n mean_sea_level_pressure_inches NUMERIC,\n min_sea_level_pressure_inches NUMERIC,\n max_visibility_miles INTEGER,\n mean_visibility_miles INTEGER,\n min_visibility_miles INTEGER,\n max_wind_Speed_mph INTEGER,\n mean_wind_speed_mph INTEGER,\n max_gust_speed_mph INTEGER,\n precipitation_inches INTEGER,\n cloud_cover INTEGER,\n events TEXT,\n wind_dir_degrees INTEGER,\n zip_code INTEGER);"} +{"qid": "pool_0184", "split": "pool", "db_id": "department_store", "question": "What are the ids of products from the supplier with id 2, which are more expensive than the average price across all products?", "gold_sql": "SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT avg(product_price) FROM products)", "db_path": "databases/department_store/department_store.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`address_details` VARCHAR(255)\n);\nCREATE TABLE `Customer_Addresses` (\n`customer_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_from` DATETIME NOT NULL,\n`date_to` DATETIME,\nPRIMARY KEY (`customer_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status_code` VARCHAR(10) NOT NULL,\n`order_date` DATETIME NOT NULL,\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`customer_code` VARCHAR(20),\n`customer_name` VARCHAR(80),\n`customer_address` VARCHAR(255),\n`customer_phone` VARCHAR(80),\n`customer_email` VARCHAR(80)\n);\nCREATE TABLE `Department_Store_Chain` (\n`dept_store_chain_id` INTEGER PRIMARY KEY,\n`dept_store_chain_name` VARCHAR(80)\n);\nCREATE TABLE `Department_Stores` (\n`dept_store_id` INTEGER PRIMARY KEY,\n`dept_store_chain_id` INTEGER,\n`store_name` VARCHAR(80),\n`store_address` VARCHAR(255),\n`store_phone` VARCHAR(80),\n`store_email` VARCHAR(80),\nFOREIGN KEY (`dept_store_chain_id` ) REFERENCES `Department_Store_Chain`(`dept_store_chain_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`dept_store_id` INTEGER NOT NULL,\n`department_name` VARCHAR(80),\nFOREIGN KEY (`dept_store_id` ) REFERENCES `Department_Stores`(`dept_store_id` )\n);\nCREATE TABLE `Order_Items` (\n`order_item_id` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\nFOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Product_Suppliers` (\n`product_id` INTEGER NOT NULL,\n`supplier_id` INTEGER NOT NULL,\n`date_supplied_from` DATETIME NOT NULL,\n`date_supplied_to` DATETIME,\n`total_amount_purchased` VARCHAR(80),\n`total_value_purchased` DECIMAL(19,4),\nPRIMARY KEY (`product_id`, `supplier_id`),\nFOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_type_code` VARCHAR(10) NOT NULL,\n`product_name` VARCHAR(80),\n`product_price` DECIMAL(19,4)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_gender` VARCHAR(1),\n`staff_name` VARCHAR(80)\n);\nCREATE TABLE `Staff_Department_Assignments` (\n`staff_id` INTEGER NOT NULL,\n`department_id` INTEGER NOT NULL,\n`date_assigned_from` DATETIME NOT NULL,\n`job_title_code` VARCHAR(10) NOT NULL,\n`date_assigned_to` DATETIME,\nPRIMARY KEY (`staff_id`, `department_id`),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Supplier_Addresses` (\n`supplier_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_from` DATETIME NOT NULL,\n`date_to` DATETIME,\nPRIMARY KEY (`supplier_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` )\n);\nCREATE TABLE `Suppliers` (\n`supplier_id` INTEGER PRIMARY KEY,\n`supplier_name` VARCHAR(80),\n`supplier_phone` VARCHAR(80)\n);"} +{"qid": "pool_0185", "split": "pool", "db_id": "election_representative", "question": "What are the life spans of representatives from New York state or Indiana state?", "gold_sql": "SELECT Lifespan FROM representative WHERE State = \"New York\" OR State = \"Indiana\"", "db_path": "databases/election_representative/election_representative.sqlite", "schema": "CREATE TABLE \"election\" (\n\"Election_ID\" int,\n\"Representative_ID\" int,\n\"Date\" text,\n\"Votes\" real,\n\"Vote_Percent\" real,\n\"Seats\" real,\n\"Place\" real,\nPRIMARY KEY (\"Election_ID\"),\nFOREIGN KEY (\"Representative_ID\") REFERENCES `representative`(\"Representative_ID\")\n);\nCREATE TABLE \"representative\" (\n\"Representative_ID\" int,\n\"Name\" text,\n\"State\" text,\n\"Party\" text,\n\"Lifespan\" text,\nPRIMARY KEY (\"Representative_ID\")\n);"} +{"qid": "pool_0186", "split": "pool", "db_id": "soccer_2", "question": "Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.", "gold_sql": "SELECT cName FROM College WHERE enr < 13000 AND state = \"AZ\" UNION SELECT cName FROM College WHERE enr > 15000 AND state = \"LA\"", "db_path": "databases/soccer_2/soccer_2.sqlite", "schema": "CREATE TABLE College \n ( cName \tvarchar(20) NOT NULL,\n state \tvarchar(2),\n enr \tnumeric(5,0),\n PRIMARY KEY (cName)\n );\nCREATE TABLE Player\n ( pID\t\t\tnumeric(5,0) NOT NULL,\n \tpName \tvarchar(20),\n yCard \tvarchar(3),\n HS \tnumeric(5,0),\n PRIMARY KEY (pID)\n );\nCREATE TABLE Tryout\n ( pID\t\t\tnumeric(5,0),\n \tcName \tvarchar(20),\n pPos \tvarchar(8),\n decision varchar(3),\n PRIMARY KEY (pID, cName),\n FOREIGN KEY (pID) REFERENCES Player(pID),\n FOREIGN KEY (cName) REFERENCES College(cName)\n );"} +{"qid": "pool_0187", "split": "pool", "db_id": "workshop_paper", "question": "Find the author for each submission and list them in ascending order of submission score.", "gold_sql": "SELECT Author FROM submission ORDER BY Scores ASC", "db_path": "databases/workshop_paper/workshop_paper.sqlite", "schema": "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);\nCREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);\nCREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);"} +{"qid": "pool_0188", "split": "pool", "db_id": "wine_1", "question": "Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.", "gold_sql": "SELECT max(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = \"Central Coast\" AND T2.year < 2005", "db_path": "databases/wine_1/wine_1.sqlite", "schema": "CREATE TABLE \"appellations\" ( \n\t\"No\" INTEGER PRIMARY KEY, \n\t\"Appelation\" TEXT UNIQUE, \n\t\"County\" TEXT, \n\t\"State\" TEXT, \n\t\"Area\" TEXT, \n\t\"isAVA\" TEXT\n);\nCREATE TABLE \"grapes\" ( \n\t\"ID\" INTEGER PRIMARY KEY, \n\t\"Grape\" TEXT UNIQUE, \n\t\"Color\" TEXT \n);\nCREATE TABLE \"wine\" ( \n\t\"No\" INTEGER, \n\t\"Grape\" TEXT, \n\t\"Winery\" TEXT, \n\t\"Appelation\" TEXT, \n\t\"State\" TEXT, \n\t\"Name\" TEXT, \n\t\"Year\" INTEGER, \n\t\"Price\" INTEGER, \n\t\"Score\" INTEGER, \n\t\"Cases\" INTEGER, \n\t\"Drink\" TEXT,\n\tFOREIGN KEY (Grape) REFERENCES grapes(Grape),\n\tFOREIGN KEY (Appelation) REFERENCES appellations(Appelation)\n);"} +{"qid": "pool_0189", "split": "pool", "db_id": "sports_competition", "question": "what is the name of the country that participated in the most tournament competitions?", "gold_sql": "SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/sports_competition/sports_competition.sqlite", "schema": "CREATE TABLE \"club\" (\n\"Club_ID\" int,\n\"name\" text,\n\"Region\" text,\n\"Start_year\" text,\nPRIMARY KEY (\"Club_ID\")\n);\nCREATE TABLE \"club_rank\" (\n\"Rank\" real,\n\"Club_ID\" int,\n\"Gold\" real,\n\"Silver\" real,\n\"Bronze\" real,\n\"Total\" real,\nPRIMARY KEY (\"Rank\",\"Club_ID\")\nFOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`)\n);\nCREATE TABLE \"competition\" (\n\"Competition_ID\" int,\n\"Year\" real,\n\"Competition_type\" text,\n\"Country\" text,\nPRIMARY KEY (\"Competition_ID\")\n);\nCREATE TABLE \"competition_result\" (\n\"Competition_ID\" int,\n\"Club_ID_1\" int,\n\"Club_ID_2\" int,\n\"Score\" text,\nPRIMARY KEY (\"Competition_ID\",\"Club_ID_1\",\"Club_ID_2\"),\nFOREIGN KEY (`Club_ID_1`) REFERENCES `club`(`Club_ID`),\nFOREIGN KEY (`Club_ID_2`) REFERENCES `club`(`Club_ID`),\nFOREIGN KEY (`Competition_ID`) REFERENCES `competition`(`Competition_ID`)\n);\nCREATE TABLE \"player\" (\n\"Player_ID\" int,\n\"name\" text,\n\"Position\" text,\n\"Club_ID\" int,\n\"Apps\" real,\n\"Tries\" real,\n\"Goals\" text,\n\"Points\" real,\nPRIMARY KEY (\"Player_ID\"),\nFOREIGN KEY (`Club_ID`) REFERENCES `club`(`Club_ID`)\n);"} +{"qid": "pool_0190", "split": "pool", "db_id": "browser_web", "question": "List the ids, names and market shares of all browsers.", "gold_sql": "SELECT id , name , market_share FROM browser", "db_path": "databases/browser_web/browser_web.sqlite", "schema": "CREATE TABLE \"Web_client_accelerator\" (\n\"id\" int,\n\"name\" text,\n\"Operating_system\" text,\n\"Client\" text,\n\"Connection\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"accelerator_compatible_browser\" (\n\"accelerator_id\" int,\n\"browser_id\" int,\n\"compatible_since_year\" int,\nprimary key(\"accelerator_id\", \"browser_id\"),\nforeign key (\"accelerator_id\") references `Web_client_accelerator`(\"id\"),\nforeign key (\"browser_id\") references `browser`(\"id\")\n);\nCREATE TABLE \"browser\" (\n\"id\" int,\n\"name\" text,\n\"market_share\" real,\nprimary key(\"id\")\n);"} +{"qid": "pool_0191", "split": "pool", "db_id": "match_season", "question": "Show the positions of the players from the team with name \"Ryley Goldner\".", "gold_sql": "SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = \"Ryley Goldner\"", "db_path": "databases/match_season/match_season.sqlite", "schema": "CREATE TABLE \"country\" (\n \"Country_id\" int,\n \"Country_name\" text,\n \"Capital\" text,\n \"Official_native_language\" text,\n PRIMARY KEY (\"Country_id\")\n);\nCREATE TABLE \"match_season\" (\n \"Season\" real,\n \"Player\" text,\n \"Position\" text,\n \"Country\" int,\n \"Team\" int,\n \"Draft_Pick_Number\" int,\n \"Draft_Class\" text,\n \"College\" text,\n PRIMARY KEY (\"Season\"),\n FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE \"player\" (\n \"Player_ID\" int,\n \"Player\" text,\n \"Years_Played\" text,\n \"Total_WL\" text,\n \"Singles_WL\" text,\n \"Doubles_WL\" text,\n \"Team\" int,\n PRIMARY KEY (\"Player_ID\"),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE `team` (\n `Team_id` int,\n `Name` text,\n PRIMARY KEY (`Team_id`)\n);"} +{"qid": "pool_0192", "split": "pool", "db_id": "baseball_1", "question": "Which park had most attendances in 2008?", "gold_sql": "SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1;", "db_path": "databases/baseball_1/baseball_1.sqlite", "schema": "CREATE TABLE all_star (\n player_id TEXT,\n year INTEGER,\n game_num INTEGER,\n game_id TEXT,\n team_id TEXT,\n league_id TEXT,\n gp NUMERIC,\n starting_pos NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE appearances (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n g_all NUMERIC,\n gs NUMERIC,\n g_batting INTEGER,\n g_defense NUMERIC,\n g_p INTEGER,\n g_c INTEGER,\n g_1b INTEGER,\n g_2b INTEGER,\n g_3b INTEGER,\n g_ss INTEGER,\n g_lf INTEGER,\n g_cf INTEGER,\n g_rf INTEGER,\n g_of INTEGER,\n g_dh NUMERIC,\n g_ph NUMERIC,\n g_pr NUMERIC,\n foreign key (team_id) references team(team_id),\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ab NUMERIC,\n r NUMERIC,\n h NUMERIC,\n double NUMERIC,\n triple NUMERIC,\n hr NUMERIC,\n rbi NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n bb NUMERIC,\n so NUMERIC,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC,\nforeign key (player_id) references player(player_id)\n);\nCREATE TABLE batting_postseason (\n year INTEGER,\n round TEXT,\n player_id TEXT,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab INTEGER,\n r INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n rbi INTEGER,\n sb INTEGER,\n cs NUMERIC,\n bb INTEGER,\n so INTEGER,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE college (\n college_id TEXT,\n name_full TEXT,\n city TEXT,\n state TEXT,\n country TEXT);\nCREATE TABLE fielding (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po NUMERIC,\n a NUMERIC,\n e NUMERIC,\n dp NUMERIC,\n pb NUMERIC,\n wp NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n zr NUMERIC,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE fielding_outfield (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n glf NUMERIC,\n gcf NUMERIC,\n grf NUMERIC,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE fielding_postseason (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n round TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po INTEGER,\n a INTEGER,\n e INTEGER,\n dp INTEGER,\n tp INTEGER,\n pb NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (team_id) references player(team_id)\n);\nCREATE TABLE hall_of_fame (\n player_id TEXT,\n yearid INTEGER,\n votedby TEXT,\n ballots NUMERIC,\n needed NUMERIC,\n votes NUMERIC,\n inducted TEXT,\n category TEXT,\n needed_note TEXT,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE home_game (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n park_id TEXT,\n span_first TEXT,\n span_last TEXT,\n games INTEGER,\n openings INTEGER,\n attendance INTEGER,\n\tforeign key (team_id) references team(team_id),\n\tforeign key (park_id) references park(park_id)\n);\nCREATE TABLE manager (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank NUMERIC,\n plyr_mgr TEXT,\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE manager_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE manager_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won INTEGER,\n points_max INTEGER,\n votes_first INTEGER);\nCREATE TABLE manager_half (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n half INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank INTEGER,\n\tforeign key (team_id) references team(team_id)\n);\nCREATE TABLE park (\n park_id TEXT,\n park_name TEXT,\n park_alias TEXT,\n city TEXT,\n state TEXT,\n country TEXT);\nCREATE TABLE pitching (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts NUMERIC,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp NUMERIC,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk INTEGER,\n bfp NUMERIC,\n gf NUMERIC,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC);\nCREATE TABLE pitching_postseason (\n player_id TEXT,\n year INTEGER,\n round TEXT,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp TEXT,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk NUMERIC,\n bfp NUMERIC,\n gf INTEGER,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC);\nCREATE TABLE player (\n player_id TEXT,\n birth_year NUMERIC,\n birth_month NUMERIC,\n birth_day NUMERIC,\n birth_country TEXT,\n birth_state TEXT,\n birth_city TEXT,\n death_year NUMERIC,\n death_month NUMERIC,\n death_day NUMERIC,\n death_country TEXT,\n death_state TEXT,\n death_city TEXT,\n name_first TEXT,\n name_last TEXT,\n name_given TEXT,\n weight NUMERIC,\n height NUMERIC,\n bats TEXT,\n throws TEXT,\n debut TEXT,\n final_game TEXT,\n retro_id TEXT,\n bbref_id TEXT);\nCREATE TABLE player_award ( \n\tplayer_id TEXT, \n\taward_id TEXT, \n\tyear INTEGER, \n\tleague_id TEXT,\n \ttie TEXT,\n \tnotes TEXT,\n\tforeign key (player_id) references player(player_id)\n);\nCREATE TABLE player_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won NUMERIC,\n points_max INTEGER,\n votes_first NUMERIC,\n foreign key (player_id) references player(player_id)\n);\nCREATE TABLE player_college ( player_id TEXT,\n college_id TEXT,\n year INTEGER,\n\tforeign key (player_id) references player(player_id),\n\tforeign key (college_id) references college(college_id)\n);\nCREATE TABLE postseason (\n year INTEGER,\n round TEXT,\n team_id_winner TEXT,\n league_id_winner TEXT,\n team_id_loser TEXT,\n league_id_loser TEXT,\n wins INTEGER,\n losses INTEGER,\n ties INTEGER);\nCREATE TABLE salary (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n salary INTEGER);\nCREATE TABLE team (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n franchise_id TEXT,\n div_id TEXT,\n rank INTEGER,\n g INTEGER,\n ghome NUMERIC,\n w INTEGER,\n l INTEGER,\n div_win TEXT,\n wc_win TEXT,\n lg_win TEXT,\n ws_win TEXT,\n r INTEGER,\n ab INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n bb INTEGER,\n so NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n hbp NUMERIC,\n sf NUMERIC,\n ra INTEGER,\n er INTEGER,\n era NUMERIC,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n ha INTEGER,\n hra INTEGER,\n bba INTEGER,\n soa INTEGER,\n e INTEGER,\n dp NUMERIC,\n fp NUMERIC,\n name TEXT,\n park TEXT,\n attendance NUMERIC,\n bpf INTEGER,\n ppf INTEGER,\n team_id_br TEXT,\n team_id_lahman45 TEXT,\n team_id_retro TEXT);\nCREATE TABLE team_franchise (\n franchise_id TEXT,\n franchise_name TEXT,\n active TEXT,\n na_assoc TEXT);\nCREATE TABLE team_half (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n half INTEGER,\n div_id TEXT,\n div_win TEXT,\n rank INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER);"} +{"qid": "pool_0193", "split": "pool", "db_id": "e_government", "question": "Find the payment method code used by more than 3 parties.", "gold_sql": "SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*) > 3", "db_path": "databases/e_government/e_government.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);\nCREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);\nCREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);\nCREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);\nCREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);\nCREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);\nCREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);\nCREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);\nCREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);\nCREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);"} +{"qid": "pool_0194", "split": "pool", "db_id": "chinook_1", "question": "Find the average millisecond length of Latin and Pop tracks.", "gold_sql": "SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = \"Latin\" OR T1.Name = \"Pop\"", "db_path": "databases/chinook_1/chinook_1.sqlite", "schema": "CREATE TABLE `Album` (\n `AlbumId` integer NOT NULL\n, `Title` varchar(160) NOT NULL\n, `ArtistId` integer NOT NULL\n, PRIMARY KEY (`AlbumId`)\n, CONSTRAINT `FK_AlbumArtistId` FOREIGN KEY (`ArtistId`) REFERENCES `Artist` (`ArtistId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Artist` (\n `ArtistId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`ArtistId`)\n);\nCREATE TABLE `Customer` (\n `CustomerId` integer NOT NULL\n, `FirstName` varchar(40) NOT NULL\n, `LastName` varchar(20) NOT NULL\n, `Company` varchar(80) DEFAULT NULL\n, `Address` varchar(70) DEFAULT NULL\n, `City` varchar(40) DEFAULT NULL\n, `State` varchar(40) DEFAULT NULL\n, `Country` varchar(40) DEFAULT NULL\n, `PostalCode` varchar(10) DEFAULT NULL\n, `Phone` varchar(24) DEFAULT NULL\n, `Fax` varchar(24) DEFAULT NULL\n, `Email` varchar(60) NOT NULL\n, `SupportRepId` integer DEFAULT NULL\n, PRIMARY KEY (`CustomerId`)\n, CONSTRAINT `FK_CustomerSupportRepId` FOREIGN KEY (`SupportRepId`) REFERENCES `Employee` (`EmployeeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Employee` (\n `EmployeeId` integer NOT NULL\n, `LastName` varchar(20) NOT NULL\n, `FirstName` varchar(20) NOT NULL\n, `Title` varchar(30) DEFAULT NULL\n, `ReportsTo` integer DEFAULT NULL\n, `BirthDate` datetime DEFAULT NULL\n, `HireDate` datetime DEFAULT NULL\n, `Address` varchar(70) DEFAULT NULL\n, `City` varchar(40) DEFAULT NULL\n, `State` varchar(40) DEFAULT NULL\n, `Country` varchar(40) DEFAULT NULL\n, `PostalCode` varchar(10) DEFAULT NULL\n, `Phone` varchar(24) DEFAULT NULL\n, `Fax` varchar(24) DEFAULT NULL\n, `Email` varchar(60) DEFAULT NULL\n, PRIMARY KEY (`EmployeeId`)\n, CONSTRAINT `FK_EmployeeReportsTo` FOREIGN KEY (`ReportsTo`) REFERENCES `Employee` (`EmployeeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Genre` (\n `GenreId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`GenreId`)\n);\nCREATE TABLE `Invoice` (\n `InvoiceId` integer NOT NULL\n, `CustomerId` integer NOT NULL\n, `InvoiceDate` datetime NOT NULL\n, `BillingAddress` varchar(70) DEFAULT NULL\n, `BillingCity` varchar(40) DEFAULT NULL\n, `BillingState` varchar(40) DEFAULT NULL\n, `BillingCountry` varchar(40) DEFAULT NULL\n, `BillingPostalCode` varchar(10) DEFAULT NULL\n, `Total` decimal(10,2) NOT NULL\n, PRIMARY KEY (`InvoiceId`)\n, CONSTRAINT `FK_InvoiceCustomerId` FOREIGN KEY (`CustomerId`) REFERENCES `Customer` (`CustomerId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `InvoiceLine` (\n `InvoiceLineId` integer NOT NULL\n, `InvoiceId` integer NOT NULL\n, `TrackId` integer NOT NULL\n, `UnitPrice` decimal(10,2) NOT NULL\n, `Quantity` integer NOT NULL\n, PRIMARY KEY (`InvoiceLineId`)\n, CONSTRAINT `FK_InvoiceLineInvoiceId` FOREIGN KEY (`InvoiceId`) REFERENCES `Invoice` (`InvoiceId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_InvoiceLineTrackId` FOREIGN KEY (`TrackId`) REFERENCES `Track` (`TrackId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `MediaType` (\n `MediaTypeId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`MediaTypeId`)\n);\nCREATE TABLE `Playlist` (\n `PlaylistId` integer NOT NULL\n, `Name` varchar(120) DEFAULT NULL\n, PRIMARY KEY (`PlaylistId`)\n);\nCREATE TABLE `PlaylistTrack` (\n `PlaylistId` integer NOT NULL\n, `TrackId` integer NOT NULL\n, PRIMARY KEY (`PlaylistId`,`TrackId`)\n, CONSTRAINT `FK_PlaylistTrackPlaylistId` FOREIGN KEY (`PlaylistId`) REFERENCES `Playlist` (`PlaylistId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_PlaylistTrackTrackId` FOREIGN KEY (`TrackId`) REFERENCES `Track` (`TrackId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);\nCREATE TABLE `Track` (\n `TrackId` integer NOT NULL\n, `Name` varchar(200) NOT NULL\n, `AlbumId` integer DEFAULT NULL\n, `MediaTypeId` integer NOT NULL\n, `GenreId` integer DEFAULT NULL\n, `Composer` varchar(220) DEFAULT NULL\n, `Milliseconds` integer NOT NULL\n, `Bytes` integer DEFAULT NULL\n, `UnitPrice` decimal(10,2) NOT NULL\n, PRIMARY KEY (`TrackId`)\n, CONSTRAINT `FK_TrackAlbumId` FOREIGN KEY (`AlbumId`) REFERENCES `Album` (`AlbumId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_TrackGenreId` FOREIGN KEY (`GenreId`) REFERENCES `Genre` (`GenreId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n, CONSTRAINT `FK_TrackMediaTypeId` FOREIGN KEY (`MediaTypeId`) REFERENCES `MediaType` (`MediaTypeId`) ON DELETE NO ACTION ON UPDATE NO ACTION\n);"} +{"qid": "pool_0195", "split": "pool", "db_id": "match_season", "question": "Show the season, the player, and the name of the country that player belongs to.", "gold_sql": "SELECT T2.Season , T2.Player , T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country", "db_path": "databases/match_season/match_season.sqlite", "schema": "CREATE TABLE \"country\" (\n \"Country_id\" int,\n \"Country_name\" text,\n \"Capital\" text,\n \"Official_native_language\" text,\n PRIMARY KEY (\"Country_id\")\n);\nCREATE TABLE \"match_season\" (\n \"Season\" real,\n \"Player\" text,\n \"Position\" text,\n \"Country\" int,\n \"Team\" int,\n \"Draft_Pick_Number\" int,\n \"Draft_Class\" text,\n \"College\" text,\n PRIMARY KEY (\"Season\"),\n FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE \"player\" (\n \"Player_ID\" int,\n \"Player\" text,\n \"Years_Played\" text,\n \"Total_WL\" text,\n \"Singles_WL\" text,\n \"Doubles_WL\" text,\n \"Team\" int,\n PRIMARY KEY (\"Player_ID\"),\n FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`)\n);\nCREATE TABLE `team` (\n `Team_id` int,\n `Name` text,\n PRIMARY KEY (`Team_id`)\n);"} +{"qid": "pool_0196", "split": "pool", "db_id": "department_store", "question": "What are the phone numbers of all customers and suppliers.", "gold_sql": "SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers", "db_path": "databases/department_store/department_store.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`address_details` VARCHAR(255)\n);\nCREATE TABLE `Customer_Addresses` (\n`customer_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_from` DATETIME NOT NULL,\n`date_to` DATETIME,\nPRIMARY KEY (`customer_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customer_Orders` (\n`order_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`order_status_code` VARCHAR(10) NOT NULL,\n`order_date` DATETIME NOT NULL,\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);\nCREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`customer_code` VARCHAR(20),\n`customer_name` VARCHAR(80),\n`customer_address` VARCHAR(255),\n`customer_phone` VARCHAR(80),\n`customer_email` VARCHAR(80)\n);\nCREATE TABLE `Department_Store_Chain` (\n`dept_store_chain_id` INTEGER PRIMARY KEY,\n`dept_store_chain_name` VARCHAR(80)\n);\nCREATE TABLE `Department_Stores` (\n`dept_store_id` INTEGER PRIMARY KEY,\n`dept_store_chain_id` INTEGER,\n`store_name` VARCHAR(80),\n`store_address` VARCHAR(255),\n`store_phone` VARCHAR(80),\n`store_email` VARCHAR(80),\nFOREIGN KEY (`dept_store_chain_id` ) REFERENCES `Department_Store_Chain`(`dept_store_chain_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`dept_store_id` INTEGER NOT NULL,\n`department_name` VARCHAR(80),\nFOREIGN KEY (`dept_store_id` ) REFERENCES `Department_Stores`(`dept_store_id` )\n);\nCREATE TABLE `Order_Items` (\n`order_item_id` INTEGER PRIMARY KEY,\n`order_id` INTEGER NOT NULL,\n`product_id` INTEGER NOT NULL,\nFOREIGN KEY (`order_id` ) REFERENCES `Customer_Orders`(`order_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Product_Suppliers` (\n`product_id` INTEGER NOT NULL,\n`supplier_id` INTEGER NOT NULL,\n`date_supplied_from` DATETIME NOT NULL,\n`date_supplied_to` DATETIME,\n`total_amount_purchased` VARCHAR(80),\n`total_value_purchased` DECIMAL(19,4),\nPRIMARY KEY (`product_id`, `supplier_id`),\nFOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);\nCREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`product_type_code` VARCHAR(10) NOT NULL,\n`product_name` VARCHAR(80),\n`product_price` DECIMAL(19,4)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_gender` VARCHAR(1),\n`staff_name` VARCHAR(80)\n);\nCREATE TABLE `Staff_Department_Assignments` (\n`staff_id` INTEGER NOT NULL,\n`department_id` INTEGER NOT NULL,\n`date_assigned_from` DATETIME NOT NULL,\n`job_title_code` VARCHAR(10) NOT NULL,\n`date_assigned_to` DATETIME,\nPRIMARY KEY (`staff_id`, `department_id`),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Supplier_Addresses` (\n`supplier_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_from` DATETIME NOT NULL,\n`date_to` DATETIME,\nPRIMARY KEY (`supplier_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`supplier_id` ) REFERENCES `Suppliers`(`supplier_id` )\n);\nCREATE TABLE `Suppliers` (\n`supplier_id` INTEGER PRIMARY KEY,\n`supplier_name` VARCHAR(80),\n`supplier_phone` VARCHAR(80)\n);"} +{"qid": "pool_0197", "split": "pool", "db_id": "company_office", "question": "What is the stories of highest building?", "gold_sql": "SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1", "db_path": "databases/company_office/company_office.sqlite", "schema": "CREATE TABLE \"Companies\" (\n\"id\" int,\n\"name\" text,\n\"Headquarters\" text,\n\"Industry\" text,\n\"Sales_billion\" real,\n\"Profits_billion\" real,\n\"Assets_billion\" real,\n\"Market_Value_billion\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"Office_locations\" (\n\"building_id\" int,\n\"company_id\" int,\n\"move_in_year\" int,\nPRIMARY KEY (\"building_id\", \"company_id\"),\nFOREIGN KEY (\"building_id\") REFERENCES \"buildings\"(\"id\"),\nFOREIGN KEY (\"company_id\") REFERENCES \"Companies\"(\"id\")\n);\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"City\" text,\n\"Height\" int,\n\"Stories\" int,\n\"Status\" text,\nPRIMARY KEY(\"id\")\n);"} +{"qid": "pool_0198", "split": "pool", "db_id": "tracking_software_problems", "question": "What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?", "gold_sql": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\" AND T2.staff_last_name = \"Berge\" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Ashley\" AND T2.staff_last_name = \"Medhurst\"", "db_path": "databases/tracking_software_problems/tracking_software_problems.sqlite", "schema": "CREATE TABLE `Problem_Category_Codes` (\n`problem_category_code` VARCHAR(20) PRIMARY KEY,\n`problem_category_description` VARCHAR(80)\n);\nCREATE TABLE `Problem_Log` (\n`problem_log_id` INTEGER PRIMARY KEY,\n`assigned_to_staff_id` INTEGER NOT NULL,\n`problem_id` INTEGER NOT NULL,\n`problem_category_code` VARCHAR(20) NOT NULL,\n`problem_status_code` VARCHAR(20) NOT NULL,\n`log_entry_date` DATETIME,\n`log_entry_description` VARCHAR(255),\n`log_entry_fix` VARCHAR(255),\n`other_log_details` VARCHAR(255),\nFOREIGN KEY (`problem_category_code` ) REFERENCES `Problem_Category_Codes`(`problem_category_code` ),FOREIGN KEY (`assigned_to_staff_id` ) REFERENCES `Staff`(`staff_id` ),FOREIGN KEY (`problem_id` ) REFERENCES `Problems`(`problem_id` ),FOREIGN KEY (`problem_status_code` ) REFERENCES `Problem_Status_Codes`(`problem_status_code` )\n);\nCREATE TABLE `Problem_Status_Codes` (\n`problem_status_code` VARCHAR(20) PRIMARY KEY,\n`problem_status_description` VARCHAR(80)\n);\nCREATE TABLE `Problems` (\n`problem_id` INTEGER PRIMARY KEY,\n`product_id` INTEGER NOT NULL,\n`closure_authorised_by_staff_id` INTEGER NOT NULL,\n`reported_by_staff_id` INTEGER NOT NULL,\n`date_problem_reported` DATETIME NOT NULL,\n`date_problem_closed` DATETIME,\n`problem_description` VARCHAR(255),\n`other_problem_details` VARCHAR(255),\nFOREIGN KEY (`closure_authorised_by_staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Product`(`product_id` ),\nFOREIGN KEY (`reported_by_staff_id` ) REFERENCES `Staff`(`staff_id` )\n);\nCREATE TABLE `Product` (\n`product_id` INTEGER PRIMARY KEY,\n`product_name` VARCHAR(80),\n`product_details` VARCHAR(255)\n);\nCREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_first_name` VARCHAR(80),\n`staff_last_name` VARCHAR(80),\n`other_staff_details` VARCHAR(255)\n);"} +{"qid": "pool_0199", "split": "pool", "db_id": "allergy_1", "question": "Provide the last name of the youngest student.", "gold_sql": "SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)", "db_path": "databases/allergy_1/allergy_1.sqlite", "schema": "CREATE TABLE Allergy_Type (\n Allergy \t\t VARCHAR(20) PRIMARY KEY,\n AllergyType \t VARCHAR(20)\n);\nCREATE TABLE Has_Allergy (\n StuID \t\t INTEGER,\n Allergy \t\t VARCHAR(20),\n FOREIGN KEY(StuID) REFERENCES Student(StuID),\n FOREIGN KEY(Allergy) REFERENCES Allergy_Type(Allergy)\n);\nCREATE TABLE Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );"} diff --git a/splits/test.jsonl b/splits/test.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..715b85a4b623ee512e3e2f7f05ac43e66777b26c --- /dev/null +++ b/splits/test.jsonl @@ -0,0 +1,500 @@ +{"qid": "test_0000", "split": "test", "db_id": "orchestra", "question": "Return the maximum and minimum shares for performances that do not have the type \"Live final\".", "gold_sql": "SELECT max(SHARE) , min(SHARE) FROM performance WHERE TYPE != \"Live final\"", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0001", "split": "test", "db_id": "network_1", "question": "Return the grade that has the greatest number of high schoolers.", "gold_sql": "SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0002", "split": "test", "db_id": "car_1", "question": "Find the make and production time of the cars that were produced in the earliest year?", "gold_sql": "SELECT T2.Make , T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Year = (SELECT min(YEAR) FROM CARS_DATA);", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0003", "split": "test", "db_id": "world_1", "question": "What are the regions that use English or Dutch?", "gold_sql": "SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" OR T2.Language = \"Dutch\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0004", "split": "test", "db_id": "tvshow", "question": "What are all of the episodes ordered by ratings?", "gold_sql": "SELECT Episode FROM TV_series ORDER BY rating", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0005", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the different document ids along with the number of paragraphs corresponding to each, ordered by id.", "gold_sql": "SELECT document_id , count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0006", "split": "test", "db_id": "flight_2", "question": "What country is Jetblue Airways affiliated with?", "gold_sql": "SELECT Country FROM AIRLINES WHERE Airline = \"JetBlue Airways\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0007", "split": "test", "db_id": "poker_player", "question": "What are the names of people who do not play poker?", "gold_sql": "SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM poker_player)", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0008", "split": "test", "db_id": "world_1", "question": "Which languages are spoken by only one country in republic governments?", "gold_sql": "SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = \"Republic\" GROUP BY T2.Language HAVING COUNT(*) = 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0009", "split": "test", "db_id": "student_transcripts_tracking", "question": "Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id.", "gold_sql": "SELECT T1.first_name , T1.middle_name , T1.last_name , T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) = 2", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0010", "split": "test", "db_id": "network_1", "question": "Find the average grade of all students who have some friends.", "gold_sql": "SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id)", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0011", "split": "test", "db_id": "dog_kennels", "question": "Which first names are used for professionals or owners but are not used as dog names?", "gold_sql": "SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0012", "split": "test", "db_id": "orchestra", "question": "What is the average attendance of shows?", "gold_sql": "SELECT avg(Attendance) FROM SHOW", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0013", "split": "test", "db_id": "museum_visit", "question": "What are the opening year and staff number of the museum named Plaza Museum?", "gold_sql": "SELECT Num_of_Staff , Open_Year FROM museum WHERE name = 'Plaza Museum'", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0014", "split": "test", "db_id": "car_1", "question": "What are the names and ids of all countries with at least one car maker?", "gold_sql": "SELECT T1.CountryName , T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.CountryId HAVING count(*) >= 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0015", "split": "test", "db_id": "dog_kennels", "question": "Tell me the owner id and last name of the owner who spent the most on treatments of his or her dogs.", "gold_sql": "SELECT T1.owner_id , T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0016", "split": "test", "db_id": "car_1", "question": "What model has the most different versions?", "gold_sql": "SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY count(*) DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0017", "split": "test", "db_id": "tvshow", "question": "find the package option of the tv channel that do not have any cartoon directed by Ben Jones.", "gold_sql": "SELECT package_option FROM TV_Channel WHERE id NOT IN (SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones')", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0018", "split": "test", "db_id": "car_1", "question": "What is the smallest weight of the car produced with 8 cylinders on 1974 ?", "gold_sql": "select min(weight) from cars_data where cylinders = 8 and year = 1974", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0019", "split": "test", "db_id": "dog_kennels", "question": "Find the distinct breed type and size type combinations for dogs.", "gold_sql": "SELECT DISTINCT breed_code , size_code FROM dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0020", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Count the number of documents.", "gold_sql": "SELECT count(*) FROM Documents", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0021", "split": "test", "db_id": "employee_hire_evaluation", "question": "How many employees are there?", "gold_sql": "SELECT count(*) FROM employee", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0022", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the type codes and descriptions for all template types?", "gold_sql": "SELECT template_type_code , template_type_description FROM Ref_template_types", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0023", "split": "test", "db_id": "dog_kennels", "question": "Which professionals live in a city containing the substring 'West'? List his or her role, street, city and state.", "gold_sql": "SELECT role_code , street , city , state FROM professionals WHERE city LIKE '%West%'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0024", "split": "test", "db_id": "wta_1", "question": "How many players are there for each hand type?", "gold_sql": "SELECT count(*) , hand FROM players GROUP BY hand", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0025", "split": "test", "db_id": "poker_player", "question": "Return the nationalities for which there are two or more people.", "gold_sql": "SELECT Nationality FROM people GROUP BY Nationality HAVING COUNT(*) >= 2", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0026", "split": "test", "db_id": "flight_2", "question": "Find all airlines that have at least 10 flights.", "gold_sql": "SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0027", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers whose courses have not been arranged?", "gold_sql": "SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0028", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show ids for all templates not used by any document.", "gold_sql": "SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0029", "split": "test", "db_id": "pets_1", "question": "Find the weight of the youngest dog.", "gold_sql": "SELECT weight FROM pets ORDER BY pet_age LIMIT 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0030", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the first, middle, and last name, along with the id and number of enrollments, for the student who enrolled the most in any program?", "gold_sql": "SELECT T1.student_id , T1.first_name , T1.middle_name , T1.last_name , count(*) , T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0031", "split": "test", "db_id": "course_teach", "question": "List the names of teachers in ascending order of age.", "gold_sql": "SELECT Name FROM teacher ORDER BY Age ASC", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0032", "split": "test", "db_id": "tvshow", "question": "What is the produdction code and channel of the most recent cartoon ?", "gold_sql": "select production_code , channel from cartoon order by original_air_date desc limit 1", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0033", "split": "test", "db_id": "employee_hire_evaluation", "question": "find the minimum and maximum number of products of all stores.", "gold_sql": "SELECT min(Number_products) , max(Number_products) FROM shop", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0034", "split": "test", "db_id": "car_1", "question": "What is the model for the car with a weight smaller than the average?", "gold_sql": "SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Weight < (SELECT avg(Weight) FROM CARS_DATA)", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0035", "split": "test", "db_id": "world_1", "question": "How many people live in countries that do not speak English?", "gold_sql": "SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0036", "split": "test", "db_id": "course_teach", "question": "Show names of teachers and the number of courses they teach.", "gold_sql": "SELECT T2.Name , COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0037", "split": "test", "db_id": "orchestra", "question": "How many different nationalities do conductors have?", "gold_sql": "SELECT count(DISTINCT Nationality) FROM conductor", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0038", "split": "test", "db_id": "world_1", "question": "Give the names of the nations that were founded after 1950.", "gold_sql": "SELECT Name FROM country WHERE IndepYear > 1950", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0039", "split": "test", "db_id": "course_teach", "question": "Show the name of teachers aged either 32 or 33?", "gold_sql": "SELECT Name FROM teacher WHERE Age = 32 OR Age = 33", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0040", "split": "test", "db_id": "world_1", "question": "Which continent speaks the most languages?", "gold_sql": "SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0041", "split": "test", "db_id": "student_transcripts_tracking", "question": "Who is enrolled in a Bachelor degree program? List the first name, middle name, last name.", "gold_sql": "SELECT DISTINCT T1.first_name , T1.middle_name , T1.last_name FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id JOIN Degree_Programs AS T3 ON T2.degree_program_id = T3.degree_program_id WHERE T3.degree_summary_name = 'Bachelor'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0042", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the average transcript date?", "gold_sql": "SELECT avg(transcript_date) FROM Transcripts", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0043", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the names and descriptions of all the sections?", "gold_sql": "SELECT section_name , section_description FROM Sections", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0044", "split": "test", "db_id": "concert_singer", "question": "Show name, country, age for all singers ordered by age from the oldest to the youngest.", "gold_sql": "SELECT name , country , age FROM singer ORDER BY age DESC", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0045", "split": "test", "db_id": "car_1", "question": "Which are the car makers which produce at least 2 models and more than 3 car makers ? List the id and the maker .", "gold_sql": "select t1.id , t1.maker from car_makers as t1 join model_list as t2 on t1.id = t2.maker group by t1.id having count(*) >= 2 intersect select t1.id , t1.maker from car_makers as t1 join model_list as t2 on t1.id = t2.maker join car_names as t3 on t2.model = t3.model group by t1.id having count(*) > 3;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0046", "split": "test", "db_id": "world_1", "question": "Give the name, population, and head of state for the country that has the largest area.", "gold_sql": "SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0047", "split": "test", "db_id": "car_1", "question": "What are the name of the countries where there is not a single car maker?", "gold_sql": "SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId = T2.Country;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0048", "split": "test", "db_id": "dog_kennels", "question": "How much does each charge type costs? List both charge type and amount.", "gold_sql": "SELECT charge_type , charge_amount FROM Charges", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0049", "split": "test", "db_id": "world_1", "question": "Give the total surface area covered by countries in Asia or Europe.", "gold_sql": "SELECT sum(SurfaceArea) FROM country WHERE Continent = \"Asia\" OR Continent = \"Europe\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0050", "split": "test", "db_id": "tvshow", "question": "What is Weekly Rank of TV series with Episode \"A Love of a Lifetime\"?", "gold_sql": "SELECT Weekly_Rank FROM TV_series WHERE Episode = \"A Love of a Lifetime\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0051", "split": "test", "db_id": "orchestra", "question": "Show the names of conductors and the orchestras they have conducted.", "gold_sql": "SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0052", "split": "test", "db_id": "wta_1", "question": "What are the average ages of losers and winners across matches?", "gold_sql": "SELECT avg(loser_age) , avg(winner_age) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0053", "split": "test", "db_id": "network_1", "question": "Count the number of high schoolers in grades 9 or 10.", "gold_sql": "SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0054", "split": "test", "db_id": "course_teach", "question": "List the names of teachers who have not been arranged to teach courses.", "gold_sql": "SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0055", "split": "test", "db_id": "battle_death", "question": "How many ships ended up being 'Captured'?", "gold_sql": "SELECT count(*) FROM ship WHERE disposition_of_ship = 'Captured'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0056", "split": "test", "db_id": "student_transcripts_tracking", "question": "Find the program which most number of students are enrolled in. List both the id and the summary.", "gold_sql": "SELECT T1.degree_program_id , T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0057", "split": "test", "db_id": "dog_kennels", "question": "How many professionals have performed any treatment to dogs?", "gold_sql": "SELECT count(DISTINCT professional_id) FROM Treatments", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0058", "split": "test", "db_id": "pets_1", "question": "How many dog pets are raised by female students?", "gold_sql": "SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0059", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What is the document id and name with greatest number of paragraphs?", "gold_sql": "SELECT T1.document_id , T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0060", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many courses are there?", "gold_sql": "SELECT count(*) FROM Courses", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0061", "split": "test", "db_id": "tvshow", "question": "Find the production code and channel of the most recently aired cartoon .", "gold_sql": "select production_code , channel from cartoon order by original_air_date desc limit 1", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0062", "split": "test", "db_id": "network_1", "question": "How many likes correspond to each student id?", "gold_sql": "SELECT student_id , count(*) FROM Likes GROUP BY student_id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0063", "split": "test", "db_id": "orchestra", "question": "Show the name of the conductor that has conducted the most number of orchestras.", "gold_sql": "SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0064", "split": "test", "db_id": "tvshow", "question": "What are the names of all cartoons directed by Ben Jones?", "gold_sql": "SELECT Title FROM Cartoon WHERE Directed_by = \"Ben Jones\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0065", "split": "test", "db_id": "world_1", "question": "Return the country codes for countries that do not speak English.", "gold_sql": "SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0066", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the names of all courses that have some students enrolled?", "gold_sql": "SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0067", "split": "test", "db_id": "car_1", "question": "Which distinct car models are the produced after 1980?", "gold_sql": "SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0068", "split": "test", "db_id": "orchestra", "question": "Please show the different record companies and the corresponding number of orchestras.", "gold_sql": "SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0069", "split": "test", "db_id": "poker_player", "question": "Count the number of poker players.", "gold_sql": "SELECT count(*) FROM poker_player", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0070", "split": "test", "db_id": "car_1", "question": "How many car models were produced by the maker with full name American Motor Company?", "gold_sql": "SELECT count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker WHERE T1.FullName = 'American Motor Company';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0071", "split": "test", "db_id": "flight_2", "question": "What are flight numbers of Airline \"United Airlines\"?", "gold_sql": "SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = \"United Airlines\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0072", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many transcripts are listed?", "gold_sql": "SELECT count(*) FROM Transcripts", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0073", "split": "test", "db_id": "battle_death", "question": "What are the distinct battle names which are between bulgarian commander 'Kaloyan' and latin commander 'Baldwin I'?", "gold_sql": "SELECT name FROM battle WHERE bulgarian_commander = 'Kaloyan' AND latin_commander = 'Baldwin I'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0074", "split": "test", "db_id": "wta_1", "question": "Find the name of the winner who has the highest rank points and participated in the Australian Open tourney.", "gold_sql": "SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0075", "split": "test", "db_id": "network_1", "question": "What are the ids of high school students who do not have friends?", "gold_sql": "SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0076", "split": "test", "db_id": "dog_kennels", "question": "What is the average age of all the dogs?", "gold_sql": "SELECT avg(age) FROM Dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0077", "split": "test", "db_id": "car_1", "question": "What is the number of continents?", "gold_sql": "SELECT count(*) FROM CONTINENTS;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0078", "split": "test", "db_id": "tvshow", "question": "List the language used least number of TV Channel. List language and number of TV Channel.", "gold_sql": "SELECT LANGUAGE , count(*) FROM TV_Channel GROUP BY LANGUAGE ORDER BY count(*) ASC LIMIT 1;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0079", "split": "test", "db_id": "wta_1", "question": "How many total tours were there for each ranking date?", "gold_sql": "SELECT sum(tours) , ranking_date FROM rankings GROUP BY ranking_date", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0080", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Count the number of templates of the type CV.", "gold_sql": "SELECT count(*) FROM Templates WHERE template_type_code = \"CV\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0081", "split": "test", "db_id": "orchestra", "question": "What are the major record formats of orchestras, sorted by their frequency?", "gold_sql": "SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0082", "split": "test", "db_id": "flight_2", "question": "What is the airport name for airport 'AKO'?", "gold_sql": "SELECT AirportName FROM AIRPORTS WHERE AirportCode = \"AKO\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0083", "split": "test", "db_id": "car_1", "question": "How many countries are listed?", "gold_sql": "SELECT count(*) FROM COUNTRIES;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0084", "split": "test", "db_id": "concert_singer", "question": "Show the name and the release year of the song by the youngest singer.", "gold_sql": "SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0085", "split": "test", "db_id": "tvshow", "question": "List the Episode of all TV series showed on TV Channel with series name \"Sky Radio\".", "gold_sql": "SELECT T2.Episode FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T1.series_name = \"Sky Radio\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0086", "split": "test", "db_id": "museum_visit", "question": "Find the name and membership level of the visitors whose membership level is higher than 4, and sort by their age from old to young.", "gold_sql": "SELECT name , Level_of_membership FROM visitor WHERE Level_of_membership > 4 ORDER BY age DESC", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0087", "split": "test", "db_id": "orchestra", "question": "Please show the record formats of orchestras in ascending order of count.", "gold_sql": "SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0088", "split": "test", "db_id": "orchestra", "question": "Return the names of conductors that do not have the nationality \"USA\".", "gold_sql": "SELECT Name FROM conductor WHERE Nationality != 'USA'", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0089", "split": "test", "db_id": "singer", "question": "What are the citizenships that are shared by singers with a birth year before 1945 and after 1955?", "gold_sql": "SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0090", "split": "test", "db_id": "flight_2", "question": "How many United Airlines flights go to City 'Aberdeen'?", "gold_sql": "SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRLINES AS T3 ON T3.uid = T1.Airline WHERE T2.City = \"Aberdeen\" AND T3.Airline = \"United Airlines\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0091", "split": "test", "db_id": "car_1", "question": "What is the number of the cars with horsepower more than 150?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE horsepower > 150;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0092", "split": "test", "db_id": "network_1", "question": "What is the grade of each high schooler?", "gold_sql": "SELECT grade FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0093", "split": "test", "db_id": "voter_1", "question": "What are the create dates, states, and phone numbers of the votes that were for the contestant named 'Tabatha Gehling'?", "gold_sql": "SELECT T2.created , T2.state , T2.phone_number FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number WHERE T1.contestant_name = 'Tabatha Gehling'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0094", "split": "test", "db_id": "car_1", "question": "How many cars has over 6 cylinders?", "gold_sql": "SELECT COUNT(*) FROM CARS_DATA WHERE Cylinders > 6;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0095", "split": "test", "db_id": "flight_2", "question": "Find the name of airports which do not have any flight in and out.", "gold_sql": "SELECT AirportName FROM Airports WHERE AirportCode NOT IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights)", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0096", "split": "test", "db_id": "pets_1", "question": "Find the average and maximum age for each type of pet.", "gold_sql": "SELECT avg(pet_age) , max(pet_age) , pettype FROM pets GROUP BY pettype", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0097", "split": "test", "db_id": "car_1", "question": "What is the maximum accelerate for all the different cylinders?", "gold_sql": "SELECT max(Accelerate) , Cylinders FROM CARS_DATA GROUP BY Cylinders;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0098", "split": "test", "db_id": "network_1", "question": "What are the names of high schoolers who both have friends and are liked?", "gold_sql": "SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id = T2.id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0099", "split": "test", "db_id": "world_1", "question": "Return the codes of countries that do not speak English and do not have Republics for governments.", "gold_sql": "SELECT Code FROM country WHERE GovernmentForm != \"Republic\" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0100", "split": "test", "db_id": "world_1", "question": "What are the different continents and the total popuation and average life expectancy corresponding to each, for continents that have an average life expectancy less than 72?", "gold_sql": "SELECT sum(Population) , avg(LifeExpectancy) , Continent FROM country GROUP BY Continent HAVING avg(LifeExpectancy) < 72", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0101", "split": "test", "db_id": "battle_death", "question": "List the name, date and result of each battle.", "gold_sql": "SELECT name , date FROM battle", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0102", "split": "test", "db_id": "flight_2", "question": "Which airlines have at least 10 flights?", "gold_sql": "SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0103", "split": "test", "db_id": "pets_1", "question": "How many pets have a greater weight than 10?", "gold_sql": "SELECT count(*) FROM pets WHERE weight > 10", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0104", "split": "test", "db_id": "car_1", "question": "What are the different models wthat are lighter than 3500 but were not built by the Ford Motor Company?", "gold_sql": "SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.Model = T2.Model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.Id JOIN CAR_MAKERS AS T4 ON T1.Maker = T4.Id WHERE T3.weight < 3500 AND T4.FullName != 'Ford Motor Company';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0105", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the maximum number of times that a course shows up in different transcripts and what is that course's enrollment id?", "gold_sql": "SELECT count(*) , student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0106", "split": "test", "db_id": "tvshow", "question": "What is the content of the series Sky Radio?", "gold_sql": "SELECT Content FROM TV_Channel WHERE series_name = \"Sky Radio\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0107", "split": "test", "db_id": "poker_player", "question": "What is the most common nationality of people?", "gold_sql": "SELECT Nationality FROM people GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0108", "split": "test", "db_id": "student_transcripts_tracking", "question": "Describe the section h.", "gold_sql": "SELECT section_description FROM Sections WHERE section_name = 'h'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0109", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers who are aged either 32 or 33?", "gold_sql": "SELECT Name FROM teacher WHERE Age = 32 OR Age = 33", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0110", "split": "test", "db_id": "wta_1", "question": "What are the names of tournaments that have more than 10 matches?", "gold_sql": "SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*) > 10", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0111", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers and how many courses do they teach?", "gold_sql": "SELECT T2.Name , COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0112", "split": "test", "db_id": "tvshow", "question": "What are the countries that are not playing cartoons written by Todd Casey?", "gold_sql": "SELECT country FROM TV_Channel EXCEPT SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0113", "split": "test", "db_id": "tvshow", "question": "List all cartoon directed by \"Ben Jones\".", "gold_sql": "SELECT Title FROM Cartoon WHERE Directed_by = \"Ben Jones\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0114", "split": "test", "db_id": "employee_hire_evaluation", "question": "Find the number of employees hired in each shop; show the shop name as well.", "gold_sql": "SELECT count(*) , t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0115", "split": "test", "db_id": "poker_player", "question": "Return the money rank of the player with the greatest earnings.", "gold_sql": "SELECT Money_Rank FROM poker_player ORDER BY Earnings DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0116", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all paragraph ids and texts for the document with name 'Welcome to NY'.", "gold_sql": "SELECT T1.paragraph_id , T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY'", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0117", "split": "test", "db_id": "voter_1", "question": "Return the names of the contestants whose names contain the substring 'Al' .", "gold_sql": "select contestant_name from contestants where contestant_name like \"%al%\"", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0118", "split": "test", "db_id": "wta_1", "question": "What is the name of the winner with the most rank points who participated in the Australian Open tournament?", "gold_sql": "SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0119", "split": "test", "db_id": "network_1", "question": "Show ids of all students who do not have any friends.", "gold_sql": "SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0120", "split": "test", "db_id": "network_1", "question": "Show the names of students who have a grade higher than 5 and have at least 2 friends.", "gold_sql": "SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING count(*) >= 2", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0121", "split": "test", "db_id": "car_1", "question": "What is the number of car models that are produced by each maker and what is the id and full name of each maker?", "gold_sql": "SELECT Count(*) , T2.FullName , T2.id FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id GROUP BY T2.id;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0122", "split": "test", "db_id": "flight_2", "question": "How many airlines are from USA?", "gold_sql": "SELECT count(*) FROM AIRLINES WHERE Country = \"USA\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0123", "split": "test", "db_id": "dog_kennels", "question": "How many dogs have an age below the average?", "gold_sql": "SELECT count(*) FROM Dogs WHERE age < ( SELECT avg(age) FROM Dogs )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0124", "split": "test", "db_id": "voter_1", "question": "What are the distinct states and create time of all votes?", "gold_sql": "SELECT DISTINCT state , created FROM votes", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0125", "split": "test", "db_id": "dog_kennels", "question": "What are all the possible breed type and size type combinations?", "gold_sql": "SELECT DISTINCT breed_code , size_code FROM dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0126", "split": "test", "db_id": "tvshow", "question": "What are the package options of all tv channels that are not playing any cartoons directed by Ben Jones?", "gold_sql": "SELECT package_option FROM TV_Channel WHERE id NOT IN (SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones')", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0127", "split": "test", "db_id": "world_1", "question": "What are the names and areas of countries with the top 5 largest area?", "gold_sql": "SELECT Name , SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0128", "split": "test", "db_id": "network_1", "question": "Give the name of the student with the most likes.", "gold_sql": "SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0129", "split": "test", "db_id": "network_1", "question": "Show name of all students who have some friends and also are liked by someone else.", "gold_sql": "SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id = T2.id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0130", "split": "test", "db_id": "employee_hire_evaluation", "question": "find the name of employee who was awarded the most times in the evaluation.", "gold_sql": "SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0131", "split": "test", "db_id": "wta_1", "question": "How many players are there?", "gold_sql": "SELECT count(*) FROM players", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0132", "split": "test", "db_id": "world_1", "question": "Which language is the most popular in Aruba?", "gold_sql": "SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = \"Aruba\" ORDER BY Percentage DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0133", "split": "test", "db_id": "car_1", "question": "How many cars have more than 4 cylinders?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE Cylinders > 4;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0134", "split": "test", "db_id": "dog_kennels", "question": "What are the emails of the professionals living in either the state of Hawaii or the state of Wisconsin?", "gold_sql": "SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0135", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What the smallest version number and its template type code?", "gold_sql": "SELECT min(Version_Number) , template_type_code FROM Templates", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0136", "split": "test", "db_id": "car_1", "question": "What is the number of cars with a horsepower greater than 150?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE horsepower > 150;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0137", "split": "test", "db_id": "singer", "question": "Show different citizenship of singers and the number of singers of each citizenship.", "gold_sql": "SELECT Citizenship , COUNT(*) FROM singer GROUP BY Citizenship", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0138", "split": "test", "db_id": "employee_hire_evaluation", "question": "How many shops are there in each location?", "gold_sql": "SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0139", "split": "test", "db_id": "world_1", "question": "What are the names of nations where both English and French are official languages?", "gold_sql": "SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" AND T2.IsOfficial = \"T\" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"French\" AND T2.IsOfficial = \"T\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0140", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers who teach at least two courses?", "gold_sql": "SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*) >= 2", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0141", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the ids of templates that have the code PP or PPT.", "gold_sql": "SELECT template_id FROM Templates WHERE template_type_code = \"PP\" OR template_type_code = \"PPT\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0142", "split": "test", "db_id": "singer", "question": "List the name of singers that do not have any song.", "gold_sql": "SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song)", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0143", "split": "test", "db_id": "tvshow", "question": "What is the pixel aspect ratio and country of origin for all TV channels that do not use English?", "gold_sql": "SELECT Pixel_aspect_ratio_PAR , country FROM tv_channel WHERE LANGUAGE != 'English'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0144", "split": "test", "db_id": "dog_kennels", "question": "What are each owner's first name and their dogs's name?", "gold_sql": "SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0145", "split": "test", "db_id": "world_1", "question": "What is the total population and maximum GNP in Asia?", "gold_sql": "SELECT sum(Population) , max(GNP) FROM country WHERE Continent = \"Asia\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0146", "split": "test", "db_id": "singer", "question": "What is the most common singer citizenship ?", "gold_sql": "select citizenship from singer group by citizenship order by count(*) desc limit 1", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0147", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "How many paragraphs in total?", "gold_sql": "SELECT count(*) FROM Paragraphs", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0148", "split": "test", "db_id": "tvshow", "question": "Find the series name and country of the tv channel that is playing some cartoons directed by Ben Jones and Michael Chang?", "gold_sql": "SELECT T1.series_name , T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Michael Chang' INTERSECT SELECT T1.series_name , T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Ben Jones'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0149", "split": "test", "db_id": "battle_death", "question": "List the name and tonnage ordered by in descending alphaetical order for the names.", "gold_sql": "SELECT name , tonnage FROM ship ORDER BY name DESC", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0150", "split": "test", "db_id": "world_1", "question": "What are the countries that have greater surface area than any country in Europe?", "gold_sql": "SELECT Name FROM country WHERE SurfaceArea > (SELECT min(SurfaceArea) FROM country WHERE Continent = \"Europe\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0151", "split": "test", "db_id": "wta_1", "question": "Find the codes of countries that have more than 50 players.", "gold_sql": "SELECT country_code FROM players GROUP BY country_code HAVING count(*) > 50", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0152", "split": "test", "db_id": "concert_singer", "question": "How many concerts occurred in 2014 or 2015?", "gold_sql": "SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0153", "split": "test", "db_id": "poker_player", "question": "What are the names of poker players in descending order of earnings?", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0154", "split": "test", "db_id": "car_1", "question": "In 1980, how many cars were made?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE YEAR = 1980;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0155", "split": "test", "db_id": "world_1", "question": "Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages.", "gold_sql": "SELECT COUNT(T2.Language) , T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0156", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show template ids, version numbers, and template type codes for all templates.", "gold_sql": "SELECT template_id , version_number , template_type_code FROM Templates", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0157", "split": "test", "db_id": "flight_2", "question": "Give the number of Jetblue Airways flights.", "gold_sql": "SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = \"JetBlue Airways\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0158", "split": "test", "db_id": "network_1", "question": "Show names of all high school students who do not have any friends.", "gold_sql": "SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0159", "split": "test", "db_id": "concert_singer", "question": "What is the average, minimum, and maximum age of all singers from France?", "gold_sql": "SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0160", "split": "test", "db_id": "student_transcripts_tracking", "question": "List the section_name in reversed lexicographical order.", "gold_sql": "SELECT section_name FROM Sections ORDER BY section_name DESC", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0161", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are all the course names of the courses which ever have students enrolled in?", "gold_sql": "SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0162", "split": "test", "db_id": "pets_1", "question": "Find the number of pets whose weight is heavier than 10.", "gold_sql": "SELECT count(*) FROM pets WHERE weight > 10", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0163", "split": "test", "db_id": "world_1", "question": "how many countries are in Asia?", "gold_sql": "SELECT count(*) FROM country WHERE continent = \"Asia\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0164", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many different degrees are offered?", "gold_sql": "SELECT count(DISTINCT degree_summary_name) FROM Degree_Programs", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0165", "split": "test", "db_id": "wta_1", "question": "find the number of distinct country codes of all players.", "gold_sql": "SELECT count(DISTINCT country_code) FROM players", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0166", "split": "test", "db_id": "car_1", "question": "What is the largest amount of horsepower for the models with 3 cylinders and what make is it?", "gold_sql": "SELECT T2.horsepower , T1.Make FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.cylinders = 3 ORDER BY T2.horsepower DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0167", "split": "test", "db_id": "orchestra", "question": "What is the name of the conductor who has worked the greatest number of years?", "gold_sql": "SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0168", "split": "test", "db_id": "world_1", "question": "What are the cities whose population is between 160000 and 900000?", "gold_sql": "SELECT name FROM city WHERE Population BETWEEN 160000 AND 900000", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0169", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all distinct template type codes for all templates.", "gold_sql": "SELECT DISTINCT template_type_code FROM Templates", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0170", "split": "test", "db_id": "poker_player", "question": "How many distinct nationalities are there?", "gold_sql": "SELECT count(DISTINCT Nationality) FROM people", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0171", "split": "test", "db_id": "poker_player", "question": "What are the names of poker players?", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0172", "split": "test", "db_id": "employee_hire_evaluation", "question": "Find the cities that have more than one employee under age 30.", "gold_sql": "SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING count(*) > 1", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0173", "split": "test", "db_id": "pets_1", "question": "What major is every student who does not own a cat as a pet, and also how old are they?", "gold_sql": "SELECT major , age FROM student WHERE stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0174", "split": "test", "db_id": "world_1", "question": "What are the country codes of the different countries, and what are the languages spoken by the greatest percentage of people for each?", "gold_sql": "SELECT LANGUAGE , CountryCode , max(Percentage) FROM countrylanguage GROUP BY CountryCode", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0175", "split": "test", "db_id": "real_estate_properties", "question": "What are the names of properties that are either houses or apartments with more than 1 room?", "gold_sql": "SELECT property_name FROM Properties WHERE property_type_code = \"House\" UNION SELECT property_name FROM Properties WHERE property_type_code = \"Apartment\" AND room_count > 1", "db_path": "databases/real_estate_properties/real_estate_properties.sqlite", "schema": "CREATE TABLE `Other_Available_Features` (\n`feature_id` INTEGER PRIMARY KEY,\n`feature_type_code` VARCHAR(20) NOT NULL,\n`feature_name` VARCHAR(80),\n`feature_description` VARCHAR(80),\nFOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` )\n);\nCREATE TABLE `Other_Property_Features` (\n`property_id` INTEGER NOT NULL,\n`feature_id` INTEGER NOT NULL,\n`property_feature_description` VARCHAR(80),\nFOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ),\nFOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` )\n);\nCREATE TABLE `Properties` (\n`property_id` INTEGER PRIMARY KEY,\n`property_type_code` VARCHAR(20) NOT NULL,\n`date_on_market` DATETIME,\n`date_sold` DATETIME,\n`property_name` VARCHAR(80),\n`property_address` VARCHAR(255),\n`room_count` INTEGER,\n`vendor_requested_price` DECIMAL(19,4),\n`buyer_offered_price` DECIMAL(19,4),\n`agreed_selling_price` DECIMAL(19,4),\n`apt_feature_1` VARCHAR(255),\n`apt_feature_2` VARCHAR(255),\n`apt_feature_3` VARCHAR(255),\n`fld_feature_1` VARCHAR(255),\n`fld_feature_2` VARCHAR(255),\n`fld_feature_3` VARCHAR(255),\n`hse_feature_1` VARCHAR(255),\n`hse_feature_2` VARCHAR(255),\n`hse_feature_3` VARCHAR(255),\n`oth_feature_1` VARCHAR(255),\n`oth_feature_2` VARCHAR(255),\n`oth_feature_3` VARCHAR(255),\n`shp_feature_1` VARCHAR(255),\n`shp_feature_2` VARCHAR(255),\n`shp_feature_3` VARCHAR(255),\n`other_property_details` VARCHAR(255),\nFOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` )\n);\nCREATE TABLE `Ref_Feature_Types` (\n`feature_type_code` VARCHAR(20) PRIMARY KEY,\n`feature_type_name` VARCHAR(80)\n);\nCREATE TABLE `Ref_Property_Types` (\n`property_type_code` VARCHAR(20) PRIMARY KEY,\n`property_type_description` VARCHAR(80)\n);"} +{"qid": "test_0176", "split": "test", "db_id": "employee_hire_evaluation", "question": "What is all the information about hiring?", "gold_sql": "SELECT * FROM hiring", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0177", "split": "test", "db_id": "employee_hire_evaluation", "question": "What are the names of the employees who never received any evaluation?", "gold_sql": "SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation)", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0178", "split": "test", "db_id": "world_1", "question": "What is the total surface area of the countries in the Caribbean region?", "gold_sql": "SELECT sum(SurfaceArea) FROM country WHERE Region = \"Caribbean\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0179", "split": "test", "db_id": "network_1", "question": "How many high schoolers are in each grade?", "gold_sql": "SELECT grade , count(*) FROM Highschooler GROUP BY grade", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0180", "split": "test", "db_id": "pets_1", "question": "What is the average and maximum age for each pet type?", "gold_sql": "SELECT avg(pet_age) , max(pet_age) , pettype FROM pets GROUP BY pettype", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0181", "split": "test", "db_id": "world_1", "question": "Return the different names of cities that are in Asia and for which Chinese is the official language.", "gold_sql": "SELECT DISTINCT T3.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode JOIN city AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' AND T2.Language = 'Chinese' AND T1.Continent = \"Asia\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0182", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the different descriptions for templates that have been used in a document.", "gold_sql": "SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID = T3.template_ID", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0183", "split": "test", "db_id": "concert_singer", "question": "What is the year that had the most concerts?", "gold_sql": "SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0184", "split": "test", "db_id": "singer", "question": "What are the names of the singers who are not French citizens?", "gold_sql": "SELECT Name FROM singer WHERE Citizenship != \"France\"", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0185", "split": "test", "db_id": "singer", "question": "What is the name of the singer who is worth the most?", "gold_sql": "SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0186", "split": "test", "db_id": "world_1", "question": "Give the language that is spoken in the most countries.", "gold_sql": "SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0187", "split": "test", "db_id": "dog_kennels", "question": "What is the description of the treatment type that costs the least money in total?", "gold_sql": "SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY sum(cost_of_treatment) ASC LIMIT 1", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0188", "split": "test", "db_id": "world_1", "question": "What languages are only used by a single country with a republic government?", "gold_sql": "SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = \"Republic\" GROUP BY T2.Language HAVING COUNT(*) = 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0189", "split": "test", "db_id": "museum_visit", "question": "Find the id and name of the museum that has the most staff members?", "gold_sql": "SELECT museum_id , name FROM museum ORDER BY num_of_staff DESC LIMIT 1", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0190", "split": "test", "db_id": "voter_1", "question": "What are the number of votes from state 'NY' or 'CA'?", "gold_sql": "SELECT count(*) FROM votes WHERE state = 'NY' OR state = 'CA'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0191", "split": "test", "db_id": "world_1", "question": "What are the names of countries that speak more than 2 languages, as well as how many languages they speak?", "gold_sql": "SELECT COUNT(T2.Language) , T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0192", "split": "test", "db_id": "poker_player", "question": "Return the names of poker players sorted by their earnings descending.", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0193", "split": "test", "db_id": "battle_death", "question": "What is the average number of injuries caused each time?", "gold_sql": "SELECT avg(injured) FROM death", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0194", "split": "test", "db_id": "concert_singer", "question": "Show names for all stadiums except for stadiums having a concert in year 2014.", "gold_sql": "SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0195", "split": "test", "db_id": "tvshow", "question": "What is the content of TV Channel with serial name \"Sky Radio\"?", "gold_sql": "SELECT Content FROM TV_Channel WHERE series_name = \"Sky Radio\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0196", "split": "test", "db_id": "student_transcripts_tracking", "question": "List all the student details in reversed lexicographical order.", "gold_sql": "SELECT other_student_details FROM Students ORDER BY other_student_details DESC", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0197", "split": "test", "db_id": "pets_1", "question": "For students who have pets , how many pets does each student have ? list their ids instead of names .", "gold_sql": "select count(*) , t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid group by t1.stuid", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0198", "split": "test", "db_id": "world_1", "question": "Return the codes of countries for which Spanish is the predominantly spoken language.", "gold_sql": "SELECT CountryCode , max(Percentage) FROM countrylanguage WHERE LANGUAGE = \"Spanish\" GROUP BY CountryCode", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0199", "split": "test", "db_id": "network_1", "question": "What is Kyle's id?", "gold_sql": "SELECT ID FROM Highschooler WHERE name = \"Kyle\"", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0200", "split": "test", "db_id": "car_1", "question": "What is the full name of each car maker, along with its id and how many models it produces?", "gold_sql": "SELECT T1.FullName , T1.Id , count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0201", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What is the document id, template id and description for document named \"Robbin CV\"?", "gold_sql": "SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = \"Robbin CV\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0202", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all paragraph texts for the document \"Customer reviews\".", "gold_sql": "SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = \"Customer reviews\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0203", "split": "test", "db_id": "employee_hire_evaluation", "question": "Find the name of the shops that do not hire any employee.", "gold_sql": "SELECT name FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM hiring)", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0204", "split": "test", "db_id": "course_teach", "question": "What are the age and hometown of teachers?", "gold_sql": "SELECT Age , Hometown FROM teacher", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0205", "split": "test", "db_id": "world_1", "question": "For the countries founded before 1930, what is the total number of distinct official languages?", "gold_sql": "SELECT count(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE IndepYear < 1930 AND T2.IsOfficial = \"T\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0206", "split": "test", "db_id": "pets_1", "question": "Find the number of distinct type of pets.", "gold_sql": "SELECT count(DISTINCT pettype) FROM pets", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0207", "split": "test", "db_id": "tvshow", "question": "List the title of all cartoons in alphabetical order.", "gold_sql": "SELECT Title FROM Cartoon ORDER BY title", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0208", "split": "test", "db_id": "pets_1", "question": "Find the id of students who do not have a cat pet.", "gold_sql": "SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0209", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all document ids, names and the number of paragraphs in each document.", "gold_sql": "SELECT T1.document_id , T2.document_name , count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0210", "split": "test", "db_id": "concert_singer", "question": "Show all countries and the number of singers in each country.", "gold_sql": "SELECT country , count(*) FROM singer GROUP BY country", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0211", "split": "test", "db_id": "car_1", "question": "For all of the 4 cylinder cars, which model has the most horsepower?", "gold_sql": "SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Cylinders = 4 ORDER BY T2.horsepower DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0212", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many degrees does the engineering department have?", "gold_sql": "SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0213", "split": "test", "db_id": "network_1", "question": "Show all the grades of the high schoolers.", "gold_sql": "SELECT grade FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0214", "split": "test", "db_id": "singer", "question": "What is the count of singers?", "gold_sql": "SELECT count(*) FROM singer", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0215", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the earliest date of a transcript release, and what details can you tell me?", "gold_sql": "SELECT transcript_date , other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0216", "split": "test", "db_id": "world_1", "question": "Which language is spoken by the largest number of countries?", "gold_sql": "SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0217", "split": "test", "db_id": "employee_hire_evaluation", "question": "Find the names of employees who never won any award in the evaluation.", "gold_sql": "SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation)", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0218", "split": "test", "db_id": "world_1", "question": "What is the total number of people living in the nations that do not use English?", "gold_sql": "SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0219", "split": "test", "db_id": "world_1", "question": "Find the government form name and total population for each government form whose average life expectancy is longer than 72.", "gold_sql": "SELECT sum(Population) , GovernmentForm FROM country GROUP BY GovernmentForm HAVING avg(LifeExpectancy) > 72", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0220", "split": "test", "db_id": "flight_2", "question": "How many airports do we have?", "gold_sql": "SELECT count(*) FROM AIRPORTS", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0221", "split": "test", "db_id": "world_1", "question": "What are the codes of the countries that do not speak English and whose government forms are not Republic?", "gold_sql": "SELECT Code FROM country WHERE GovernmentForm != \"Republic\" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0222", "split": "test", "db_id": "wta_1", "question": "What are the first names of all players, and their average rankings?", "gold_sql": "SELECT avg(ranking) , T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0223", "split": "test", "db_id": "world_1", "question": "What are the region and population of Angola?", "gold_sql": "SELECT Population , Region FROM country WHERE Name = \"Angola\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0224", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the ids and names of each document, as well as the number of paragraphs in each?", "gold_sql": "SELECT T1.document_id , T2.document_name , count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0225", "split": "test", "db_id": "voter_1", "question": "What are the names of the contestants whose names are not 'Jessie Alloway'", "gold_sql": "SELECT contestant_name FROM contestants WHERE contestant_name != 'Jessie Alloway'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0226", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Which template type code has most number of templates?", "gold_sql": "SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0227", "split": "test", "db_id": "car_1", "question": "What is the average weight and year for each year?", "gold_sql": "SELECT avg(Weight) , YEAR FROM CARS_DATA GROUP BY YEAR;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0228", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the descriptions for all the math courses?", "gold_sql": "SELECT course_description FROM Courses WHERE course_name = 'math'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0229", "split": "test", "db_id": "voter_1", "question": "What are the maximum and minimum values of area codes?", "gold_sql": "SELECT max(area_code) , min(area_code) FROM area_code_state", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0230", "split": "test", "db_id": "battle_death", "question": "List the name and date the battle that has lost the ship named 'Lettice' and the ship named 'HMS Atalanta'", "gold_sql": "SELECT T1.name , T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'Lettice' INTERSECT SELECT T1.name , T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'HMS Atalanta'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0231", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the last transcript release date?", "gold_sql": "SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0232", "split": "test", "db_id": "museum_visit", "question": "What is the name of the museum that had no visitor yet?", "gold_sql": "SELECT name FROM museum WHERE Museum_ID NOT IN (SELECT museum_id FROM visit)", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0233", "split": "test", "db_id": "flight_2", "question": "How many 'United Airlines' flights depart from Airport 'AHD'?", "gold_sql": "SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = \"United Airlines\" AND T2.SourceAirport = \"AHD\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0234", "split": "test", "db_id": "wta_1", "question": "Find the average age of losers and winners of all matches.", "gold_sql": "SELECT avg(loser_age) , avg(winner_age) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0235", "split": "test", "db_id": "dog_kennels", "question": "What are the id, role, and first name of the professionals who have performed two or more treatments?", "gold_sql": "SELECT T1.professional_id , T1.role_code , T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0236", "split": "test", "db_id": "battle_death", "question": "What are the name and results of the battles when the bulgarian commander is not 'Boril'", "gold_sql": "SELECT name , RESULT FROM battle WHERE bulgarian_commander != 'Boril'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0237", "split": "test", "db_id": "pets_1", "question": "What are the first names of every student who has a cat or dog as a pet?", "gold_sql": "SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0238", "split": "test", "db_id": "dog_kennels", "question": "How many owners temporarily do not have any dogs?", "gold_sql": "SELECT count(*) FROM Owners WHERE owner_id NOT IN ( SELECT owner_id FROM Dogs )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0239", "split": "test", "db_id": "concert_singer", "question": "What are the names of the singers and number of concerts for each person?", "gold_sql": "SELECT T2.name , count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0240", "split": "test", "db_id": "car_1", "question": "What are the id and names of the countries which have more than 3 car makers or produce the 'fiat' model?", "gold_sql": "SELECT T1.countryId , T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.countryId HAVING count(*) > 3 UNION SELECT T1.countryId , T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country JOIN MODEL_LIST AS T3 ON T2.Id = T3.Maker WHERE T3.Model = 'fiat';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0241", "split": "test", "db_id": "car_1", "question": "What is the maker of the carr produced in the earliest year and what year was it?", "gold_sql": "SELECT T2.Make , T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Year = (SELECT min(YEAR) FROM CARS_DATA);", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0242", "split": "test", "db_id": "car_1", "question": "What is the horsepower of the car with the greatest accelerate?", "gold_sql": "SELECT T1.horsepower FROM CARS_DATA AS T1 ORDER BY T1.accelerate DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0243", "split": "test", "db_id": "voter_1", "question": "What is last date created of votes from the state 'CA'?", "gold_sql": "SELECT max(created) FROM votes WHERE state = 'CA'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0244", "split": "test", "db_id": "concert_singer", "question": "What is the average, minimum, and maximum age for all French singers?", "gold_sql": "SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0245", "split": "test", "db_id": "singer", "question": "Show titles of songs and names of singers.", "gold_sql": "SELECT T2.Title , T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0246", "split": "test", "db_id": "dog_kennels", "question": "What are the dog name, age and weight of the dogs that were abandoned? Note that 1 stands for yes, and 0 stands for no in the tables.", "gold_sql": "SELECT name , age , weight FROM Dogs WHERE abandoned_yn = 1", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0247", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many different addresses do the students currently live?", "gold_sql": "SELECT count(DISTINCT current_address_id) FROM Students", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0248", "split": "test", "db_id": "world_1", "question": "What are the names of cities in Europe for which English is not the official language?", "gold_sql": "SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode = T1.Code WHERE T1.Continent = 'Europe' AND T1.Name NOT IN (SELECT T3.Name FROM country AS T3 JOIN countrylanguage AS T4 ON T3.Code = T4.CountryCode WHERE T4.IsOfficial = 'T' AND T4.Language = 'English')", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0249", "split": "test", "db_id": "museum_visit", "question": "What are the id, name and membership level of visitors who have spent the largest amount of money in total in all museum tickets?", "gold_sql": "SELECT t2.visitor_id , t1.name , t1.Level_of_membership FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id GROUP BY t2.visitor_id ORDER BY sum(t2.Total_spent) DESC LIMIT 1", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0250", "split": "test", "db_id": "poker_player", "question": "What is the maximum number of final tables made among poker players with earnings less than 200000?", "gold_sql": "SELECT max(Final_Table_Made) FROM poker_player WHERE Earnings < 200000", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0251", "split": "test", "db_id": "wta_1", "question": "What is the code of the country with the most players?", "gold_sql": "SELECT country_code FROM players GROUP BY country_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0252", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the different template type codes, and how many documents use each type?", "gold_sql": "SELECT T1.template_type_code , count(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0253", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the first, middle, and last name of the earliest school graduate?", "gold_sql": "SELECT first_name , middle_name , last_name FROM Students ORDER BY date_left ASC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0254", "split": "test", "db_id": "poker_player", "question": "How many poker players are there?", "gold_sql": "SELECT count(*) FROM poker_player", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0255", "split": "test", "db_id": "world_1", "question": "What are the African countries that have a population less than any country in Asia?", "gold_sql": "SELECT Name FROM country WHERE Continent = \"Africa\" AND population < (SELECT max(population) FROM country WHERE Continent = \"Asia\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0256", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the department description for the one whose name has the word computer?", "gold_sql": "SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0257", "split": "test", "db_id": "dog_kennels", "question": "Which professionals live in the state of Indiana or have done treatment on more than 2 treatments? List his or her id, last name and cell phone.", "gold_sql": "SELECT professional_id , last_name , cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id , T1.last_name , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) > 2", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0258", "split": "test", "db_id": "tvshow", "question": "What are 3 most highly rated episodes in the TV series table and what were those ratings?", "gold_sql": "SELECT Episode , Rating FROM TV_series ORDER BY Rating DESC LIMIT 3;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0259", "split": "test", "db_id": "car_1", "question": "How many cars have a larger accelerate than the car with the largest horsepower?", "gold_sql": "SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate > ( SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1 );", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0260", "split": "test", "db_id": "course_teach", "question": "Show names of teachers that teach at least two courses.", "gold_sql": "SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*) >= 2", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0261", "split": "test", "db_id": "poker_player", "question": "What are the nationalities that are shared by at least two people?", "gold_sql": "SELECT Nationality FROM people GROUP BY Nationality HAVING COUNT(*) >= 2", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0262", "split": "test", "db_id": "world_1", "question": "Give the mean life expectancy of countries in which English is not the official language.", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" AND T2.IsOfficial = \"T\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0263", "split": "test", "db_id": "battle_death", "question": "What are the notes of the death events which has substring 'East'?", "gold_sql": "SELECT note FROM death WHERE note LIKE '%East%'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0264", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the template type code of the template that is used by a document named Data base.", "gold_sql": "SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = \"Data base\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0265", "split": "test", "db_id": "student_transcripts_tracking", "question": "When is the first transcript released? List the date and details.", "gold_sql": "SELECT transcript_date , other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0266", "split": "test", "db_id": "orchestra", "question": "Return the average attendance across all shows.", "gold_sql": "SELECT avg(Attendance) FROM SHOW", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0267", "split": "test", "db_id": "dog_kennels", "question": "Which dogs are owned by someone who lives in Virginia? List the owner's first name and the dog's name.", "gold_sql": "SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0268", "split": "test", "db_id": "student_transcripts_tracking", "question": "Show the date of the transcript which shows the least number of results, also list the id.", "gold_sql": "SELECT T2.transcript_date , T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id ORDER BY count(*) ASC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0269", "split": "test", "db_id": "wta_1", "question": "find the number of players for each country.", "gold_sql": "SELECT count(*) , country_code FROM players GROUP BY country_code", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0270", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all template ids and number of documents using each template.", "gold_sql": "SELECT template_id , count(*) FROM Documents GROUP BY template_id", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0271", "split": "test", "db_id": "tvshow", "question": "What are the ids of the TV channels that do not have any cartoons directed by Ben Jones?", "gold_sql": "SELECT id FROM TV_Channel EXCEPT SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0272", "split": "test", "db_id": "car_1", "question": "What are the names and ids of all makers with more than 3 models?", "gold_sql": "SELECT T1.FullName , T1.Id FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id HAVING count(*) > 3;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0273", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the codes of template types that are not used for any document?", "gold_sql": "SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0274", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the type code of the template type with the description \"Book\".", "gold_sql": "SELECT template_type_code FROM Ref_template_types WHERE template_type_description = \"Book\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0275", "split": "test", "db_id": "dog_kennels", "question": "Which breed do the most dogs have? Give me the breed name.", "gold_sql": "SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0276", "split": "test", "db_id": "world_1", "question": "What is the language that is used by the largest number of Asian nations?", "gold_sql": "SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = \"Asia\" GROUP BY T2.Language ORDER BY COUNT (*) DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0277", "split": "test", "db_id": "concert_singer", "question": "Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.", "gold_sql": "SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0278", "split": "test", "db_id": "poker_player", "question": "What are the names of people who are not from Russia?", "gold_sql": "SELECT Name FROM people WHERE Nationality != \"Russia\"", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0279", "split": "test", "db_id": "network_1", "question": "What are the names of students who have no friends?", "gold_sql": "SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0280", "split": "test", "db_id": "wta_1", "question": "Find the first name and country code of the player who did the most number of tours.", "gold_sql": "SELECT T1.country_code , T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id ORDER BY T2.tours DESC LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0281", "split": "test", "db_id": "pets_1", "question": "What is the id and weight of every pet who is older than 1?", "gold_sql": "SELECT petid , weight FROM pets WHERE pet_age > 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0282", "split": "test", "db_id": "dog_kennels", "question": "Which states have both owners and professionals living there?", "gold_sql": "SELECT state FROM Owners INTERSECT SELECT state FROM Professionals", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0283", "split": "test", "db_id": "orchestra", "question": "What are the names of conductors as well as the corresonding orchestras that they have conducted?", "gold_sql": "SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0284", "split": "test", "db_id": "dog_kennels", "question": "Tell me the number of dogs that have not received any treatment .", "gold_sql": "select count(*) from dogs where dog_id not in ( select dog_id from treatments )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0285", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Which template type code is used by most number of documents?", "gold_sql": "SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0286", "split": "test", "db_id": "orchestra", "question": "List the names of orchestras that have no performance.", "gold_sql": "SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0287", "split": "test", "db_id": "poker_player", "question": "Give the names of poker players who have earnings above 300000.", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0288", "split": "test", "db_id": "student_transcripts_tracking", "question": "What's the name of the course with most number of enrollments?", "gold_sql": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0289", "split": "test", "db_id": "course_teach", "question": "For each hometown, how many teachers are there?", "gold_sql": "SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0290", "split": "test", "db_id": "poker_player", "question": "List the names of poker players ordered by the final tables made in ascending order.", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Final_Table_Made", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0291", "split": "test", "db_id": "pets_1", "question": "What type of pet is the youngest animal, and how much does it weigh?", "gold_sql": "SELECT pettype , weight FROM pets ORDER BY pet_age LIMIT 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0292", "split": "test", "db_id": "world_1", "question": "Which Asian countries have a population that is larger than any country in Africa?", "gold_sql": "SELECT Name FROM country WHERE Continent = \"Asia\" AND population > (SELECT max(population) FROM country WHERE Continent = \"Africa\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0293", "split": "test", "db_id": "dog_kennels", "question": "Which professionals have operated a treatment that costs less than the average? Give me theor first names and last names.", "gold_sql": "SELECT DISTINCT T1.first_name , T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 WHERE cost_of_treatment < ( SELECT avg(cost_of_treatment) FROM Treatments )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0294", "split": "test", "db_id": "dog_kennels", "question": "What are the cost and treatment type description of each treatment?", "gold_sql": "SELECT T1.cost_of_treatment , T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0295", "split": "test", "db_id": "concert_singer", "question": "what is the name and nation of the singer who have a song having 'Hey' in its name?", "gold_sql": "SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0296", "split": "test", "db_id": "network_1", "question": "Return the number of likes that the high schooler named Kyle has.", "gold_sql": "SELECT count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = \"Kyle\"", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0297", "split": "test", "db_id": "concert_singer", "question": "Show the stadium names without any concert.", "gold_sql": "SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0298", "split": "test", "db_id": "orchestra", "question": "What are the record companies of orchestras in descending order of years in which they were founded?", "gold_sql": "SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0299", "split": "test", "db_id": "world_1", "question": "What are the name, population, and life expectancy of the largest Asian country by land?", "gold_sql": "SELECT Name , Population , LifeExpectancy FROM country WHERE Continent = \"Asia\" ORDER BY SurfaceArea DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0300", "split": "test", "db_id": "tvshow", "question": "List the Episode of all TV series sorted by rating.", "gold_sql": "SELECT Episode FROM TV_series ORDER BY rating", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0301", "split": "test", "db_id": "dog_kennels", "question": "Compute the average age of all the dogs.", "gold_sql": "SELECT avg(age) FROM Dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0302", "split": "test", "db_id": "dog_kennels", "question": "Which dogs are of the rarest breed? Show their names and treatment dates.", "gold_sql": "SELECT T1.name , T2.date_of_treatment FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id WHERE T1.breed_code = ( SELECT breed_code FROM Dogs GROUP BY breed_code ORDER BY count(*) ASC LIMIT 1 )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0303", "split": "test", "db_id": "singer", "question": "What are the birth years and citizenships of the singers?", "gold_sql": "SELECT Birth_Year , Citizenship FROM singer", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0304", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the description for the section named h?", "gold_sql": "SELECT section_description FROM Sections WHERE section_name = 'h'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0305", "split": "test", "db_id": "student_transcripts_tracking", "question": "Which student has enrolled for the most times in any program? List the id, first name, middle name, last name, the number of enrollments and student id.", "gold_sql": "SELECT T1.student_id , T1.first_name , T1.middle_name , T1.last_name , count(*) , T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0306", "split": "test", "db_id": "car_1", "question": "What is the number of car models created by the car maker American Motor Company?", "gold_sql": "SELECT count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker WHERE T1.FullName = 'American Motor Company';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0307", "split": "test", "db_id": "tvshow", "question": "What is the name and directors of all the cartoons that are ordered by air date?", "gold_sql": "SELECT title , Directed_by FROM Cartoon ORDER BY Original_air_date", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0308", "split": "test", "db_id": "world_1", "question": "How many countries have a republic as their form of government?", "gold_sql": "SELECT count(*) FROM country WHERE GovernmentForm = \"Republic\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0309", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many courses in total are listed?", "gold_sql": "SELECT count(*) FROM Courses", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0310", "split": "test", "db_id": "poker_player", "question": "How many people are there of each nationality?", "gold_sql": "SELECT Nationality , COUNT(*) FROM people GROUP BY Nationality", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0311", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the semester which most student registered in? Show both the name and the id.", "gold_sql": "SELECT T1.semester_name , T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0312", "split": "test", "db_id": "voter_1", "question": "Of all the contestants who got voted, what is the contestant number and name of the contestant who got least votes?", "gold_sql": "SELECT T1.contestant_number , T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number GROUP BY T1.contestant_number ORDER BY count(*) ASC LIMIT 1", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0313", "split": "test", "db_id": "voter_1", "question": "List the area codes in which voters voted both for the contestant 'Tabatha Gehling' and the contestant 'Kelly Clauss'.", "gold_sql": "SELECT T3.area_code FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number JOIN area_code_state AS T3 ON T2.state = T3.state WHERE T1.contestant_name = 'Tabatha Gehling' INTERSECT SELECT T3.area_code FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number JOIN area_code_state AS T3 ON T2.state = T3.state WHERE T1.contestant_name = 'Kelly Clauss'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0314", "split": "test", "db_id": "car_1", "question": "What are the countries having at least one car maker? List name and id.", "gold_sql": "SELECT T1.CountryName , T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.CountryId HAVING count(*) >= 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0315", "split": "test", "db_id": "flight_2", "question": "How many airlines do we have?", "gold_sql": "SELECT count(*) FROM AIRLINES", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0316", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all template type codes that are not used by any document.", "gold_sql": "SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0317", "split": "test", "db_id": "employee_hire_evaluation", "question": "What are the minimum and maximum number of products across all the shops?", "gold_sql": "SELECT min(Number_products) , max(Number_products) FROM shop", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0318", "split": "test", "db_id": "poker_player", "question": "What are the names of poker players whose earnings is higher than 300000?", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0319", "split": "test", "db_id": "concert_singer", "question": "What are all distinct countries where singers above age 20 are from?", "gold_sql": "SELECT DISTINCT country FROM singer WHERE age > 20", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0320", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Give the ids of documents that have between one and two paragraphs.", "gold_sql": "SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0321", "split": "test", "db_id": "world_1", "question": "What is the number of nations that use English and Dutch?", "gold_sql": "SELECT COUNT(*) FROM (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"Dutch\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0322", "split": "test", "db_id": "flight_2", "question": "Count the number of United Airlines flights that arrive in Aberdeen.", "gold_sql": "SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRLINES AS T3 ON T3.uid = T1.Airline WHERE T2.City = \"Aberdeen\" AND T3.Airline = \"United Airlines\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0323", "split": "test", "db_id": "poker_player", "question": "Return the maximum final tables made across all poker players who have earnings below 200000.", "gold_sql": "SELECT max(Final_Table_Made) FROM poker_player WHERE Earnings < 200000", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0324", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What is the document name and template id for document with description with the letter 'w' in it?", "gold_sql": "SELECT document_name , template_id FROM Documents WHERE Document_Description LIKE \"%w%\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0325", "split": "test", "db_id": "car_1", "question": "What is the number of countries with more than 2 car makers ?", "gold_sql": "select count(*) from countries as t1 join car_makers as t2 on t1.countryid = t2.country group by t1.countryid having count(*) > 2", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0326", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What is the version number and template type code for the template with version number later than 5?", "gold_sql": "SELECT version_number , template_type_code FROM Templates WHERE version_number > 5", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0327", "split": "test", "db_id": "dog_kennels", "question": "How many dogs went through any treatments?", "gold_sql": "SELECT count(DISTINCT dog_id) FROM Treatments", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0328", "split": "test", "db_id": "course_teach", "question": "What is the hometown of the youngest teacher?", "gold_sql": "SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0329", "split": "test", "db_id": "world_1", "question": "Give the total population and average surface area corresponding to countries in North America that have a surface area greater than 3000 .", "gold_sql": "select sum(population) , avg(surfacearea) from country where continent = \"north america\" and surfacearea > 3000", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0330", "split": "test", "db_id": "flight_2", "question": "How many flights depart from City Aberdeen?", "gold_sql": "SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = \"Aberdeen\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0331", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "How many templates have template type code CV?", "gold_sql": "SELECT count(*) FROM Templates WHERE template_type_code = \"CV\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0332", "split": "test", "db_id": "poker_player", "question": "What is the money rank of the poker player with the highest earnings?", "gold_sql": "SELECT Money_Rank FROM poker_player ORDER BY Earnings DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0333", "split": "test", "db_id": "car_1", "question": "For the cars with 4 cylinders, which model has the largest horsepower?", "gold_sql": "SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Cylinders = 4 ORDER BY T2.horsepower DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0334", "split": "test", "db_id": "poker_player", "question": "What are the earnings of poker players, ordered descending by value?", "gold_sql": "SELECT Earnings FROM poker_player ORDER BY Earnings DESC", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0335", "split": "test", "db_id": "employee_hire_evaluation", "question": "What is total bonus given in all evaluations?", "gold_sql": "SELECT sum(bonus) FROM evaluation", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0336", "split": "test", "db_id": "car_1", "question": "Among the cars that do not have the minimum horsepower , what are the make ids and names of all those with less than 4 cylinders ?", "gold_sql": "select t2.makeid , t2.make from cars_data as t1 join car_names as t2 on t1.id = t2.makeid where t1.horsepower > (select min(horsepower) from cars_data) and t1.cylinders < 4;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0337", "split": "test", "db_id": "student_transcripts_tracking", "question": "For each semester, what is the name and id of the one with the most students registered?", "gold_sql": "SELECT T1.semester_name , T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0338", "split": "test", "db_id": "battle_death", "question": "Show names, results and bulgarian commanders of the battles with no ships lost in the 'English Channel'.", "gold_sql": "SELECT name , RESULT , bulgarian_commander FROM battle EXCEPT SELECT T1.name , T1.result , T1.bulgarian_commander FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.location = 'English Channel'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0339", "split": "test", "db_id": "world_1", "question": "Which region is the city Kabul located in?", "gold_sql": "SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = \"Kabul\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0340", "split": "test", "db_id": "dog_kennels", "question": "Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email.", "gold_sql": "SELECT first_name , last_name , email_address FROM Owners WHERE state LIKE '%North%'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0341", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many different degree names are offered?", "gold_sql": "SELECT count(DISTINCT degree_summary_name) FROM Degree_Programs", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0342", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "How many documents are using the template with type code 'PPT'?", "gold_sql": "SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT'", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0343", "split": "test", "db_id": "dog_kennels", "question": "List the emails of the professionals who live in the state of Hawaii or the state of Wisconsin.", "gold_sql": "SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0344", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Count the number of paragraphs in the document named 'Summer Show'.", "gold_sql": "SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show'", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0345", "split": "test", "db_id": "car_1", "question": "What are all the makers and models?", "gold_sql": "SELECT Maker , Model FROM MODEL_LIST;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0346", "split": "test", "db_id": "concert_singer", "question": "What are all the song names by singers who are older than average?", "gold_sql": "SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0347", "split": "test", "db_id": "pets_1", "question": "What is the first name of every student who has a dog but does not have a cat?", "gold_sql": "SELECT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND T1.stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0348", "split": "test", "db_id": "network_1", "question": "What is the name of the high schooler who has the greatest number of likes?", "gold_sql": "SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0349", "split": "test", "db_id": "orchestra", "question": "List names of conductors in descending order of years of work.", "gold_sql": "SELECT Name FROM conductor ORDER BY Year_of_Work DESC", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0350", "split": "test", "db_id": "network_1", "question": "What are the names of all high schoolers in grade 10?", "gold_sql": "SELECT name FROM Highschooler WHERE grade = 10", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0351", "split": "test", "db_id": "concert_singer", "question": "Show countries where a singer above age 40 and a singer below 30 are from.", "gold_sql": "SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0352", "split": "test", "db_id": "car_1", "question": "How many countries exist?", "gold_sql": "SELECT count(*) FROM COUNTRIES;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0353", "split": "test", "db_id": "museum_visit", "question": "How many museums were opened after 2013 or before 2008?", "gold_sql": "SELECT count(*) FROM museum WHERE open_year > 2013 OR open_year < 2008", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0354", "split": "test", "db_id": "world_1", "question": "What are the names of the nations with the 3 lowest populations?", "gold_sql": "SELECT Name FROM country ORDER BY Population ASC LIMIT 3", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0355", "split": "test", "db_id": "car_1", "question": "How many car models are produced in the usa?", "gold_sql": "SELECT count(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id JOIN COUNTRIES AS T3 ON T2.Country = T3.CountryId WHERE T3.CountryName = 'usa';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0356", "split": "test", "db_id": "world_1", "question": "What are the population and life expectancies in Brazil?", "gold_sql": "SELECT Population , LifeExpectancy FROM country WHERE Name = \"Brazil\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0357", "split": "test", "db_id": "pets_1", "question": "Find the id of the pet owned by student whose last name is ‘Smith’.", "gold_sql": "SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0358", "split": "test", "db_id": "wta_1", "question": "Find the highest rank of losers in all matches.", "gold_sql": "SELECT min(loser_rank) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0359", "split": "test", "db_id": "concert_singer", "question": "What are the number of concerts that occurred in the stadium with the largest capacity ?", "gold_sql": "select count(*) from concert where stadium_id = (select stadium_id from stadium order by capacity desc limit 1)", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0360", "split": "test", "db_id": "tvshow", "question": "Which country has the most of TV Channels? List the country and number of TV Channels it has.", "gold_sql": "SELECT Country , count(*) FROM TV_Channel GROUP BY Country ORDER BY count(*) DESC LIMIT 1;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0361", "split": "test", "db_id": "wta_1", "question": "Find the total ranking points for each player and their first name.", "gold_sql": "SELECT sum(ranking_points) , T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0362", "split": "test", "db_id": "tvshow", "question": "When did the episode \"A Love of a Lifetime\" air?", "gold_sql": "SELECT Air_Date FROM TV_series WHERE Episode = \"A Love of a Lifetime\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0363", "split": "test", "db_id": "network_1", "question": "What are the ids of students who both have friends and are liked?", "gold_sql": "SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0364", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the degree summary name that has the most number of students enrolled?", "gold_sql": "SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0365", "split": "test", "db_id": "battle_death", "question": "What is the ship id and name that caused most total injuries?", "gold_sql": "SELECT T2.id , T2.name FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} +{"qid": "test_0366", "split": "test", "db_id": "employee_hire_evaluation", "question": "Count the number of employees for each city.", "gold_sql": "SELECT count(*) , city FROM employee GROUP BY city", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0367", "split": "test", "db_id": "world_1", "question": "How many type of governments are in Africa?", "gold_sql": "SELECT count(DISTINCT GovernmentForm) FROM country WHERE Continent = \"Africa\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0368", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the id of the semester that had both Masters and Bachelors students enrolled?", "gold_sql": "SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Bachelor'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0369", "split": "test", "db_id": "car_1", "question": "What are the different years in which there were cars produced that weighed less than 4000 and also cars that weighted more than 3000 ?", "gold_sql": "select distinct year from cars_data where weight between 3000 and 4000;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0370", "split": "test", "db_id": "world_1", "question": "Which regions speak Dutch or English?", "gold_sql": "SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" OR T2.Language = \"Dutch\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0371", "split": "test", "db_id": "network_1", "question": "Show the number of high schoolers for each grade.", "gold_sql": "SELECT grade , count(*) FROM Highschooler GROUP BY grade", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0372", "split": "test", "db_id": "network_1", "question": "Which grades have 4 or more high schoolers?", "gold_sql": "SELECT grade FROM Highschooler GROUP BY grade HAVING count(*) >= 4", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0373", "split": "test", "db_id": "world_1", "question": "What are the country codes for countries that do not speak English?", "gold_sql": "SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0374", "split": "test", "db_id": "car_1", "question": "What are the different models for the cards produced after 1980?", "gold_sql": "SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0375", "split": "test", "db_id": "voter_1", "question": "How many contestants did not get voted?", "gold_sql": "SELECT count(*) FROM contestants WHERE contestant_number NOT IN ( SELECT contestant_number FROM votes )", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0376", "split": "test", "db_id": "network_1", "question": "Which grade has the most high schoolers?", "gold_sql": "SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0377", "split": "test", "db_id": "dog_kennels", "question": "Find the id, last name and cell phone of the professionals who live in the state of Indiana or have performed more than two treatments.", "gold_sql": "SELECT professional_id , last_name , cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id , T1.last_name , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) > 2", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0378", "split": "test", "db_id": "flight_2", "question": "Return the number of airports.", "gold_sql": "SELECT count(*) FROM AIRPORTS", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0379", "split": "test", "db_id": "employee_hire_evaluation", "question": "Which employee received the most awards in evaluations? Give me the employee name.", "gold_sql": "SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0380", "split": "test", "db_id": "car_1", "question": "Find the name of the makers that produced some cars in the year of 1970?", "gold_sql": "SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker JOIN CAR_NAMES AS T3 ON T2.model = T3.model JOIN CARS_DATA AS T4 ON T3.MakeId = T4.id WHERE T4.year = '1970';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0381", "split": "test", "db_id": "orchestra", "question": "Show the record companies shared by orchestras founded before 2003 and after 2003.", "gold_sql": "SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0382", "split": "test", "db_id": "world_1", "question": "What are the name, independence year, and surface area of the country with the smallest population?", "gold_sql": "SELECT Name , SurfaceArea , IndepYear FROM country ORDER BY Population LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0383", "split": "test", "db_id": "concert_singer", "question": "For each stadium, how many concerts play there?", "gold_sql": "SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0384", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the names and descriptions for all the sections?", "gold_sql": "SELECT section_name , section_description FROM Sections", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0385", "split": "test", "db_id": "car_1", "question": "What is the minimum weight of the car with 8 cylinders produced in 1974 ?", "gold_sql": "select min(weight) from cars_data where cylinders = 8 and year = 1974", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0386", "split": "test", "db_id": "poker_player", "question": "What are the names of poker players, ordered ascending by the number of final tables they have made?", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Final_Table_Made", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0387", "split": "test", "db_id": "car_1", "question": "How many car makers are there in france?", "gold_sql": "SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId WHERE T2.CountryName = 'france';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0388", "split": "test", "db_id": "museum_visit", "question": "What is the total ticket expense of the visitors whose membership level is 1?", "gold_sql": "SELECT sum(t2.Total_spent) FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id WHERE t1.Level_of_membership = 1", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0389", "split": "test", "db_id": "network_1", "question": "Count the number of high schoolers.", "gold_sql": "SELECT count(*) FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0390", "split": "test", "db_id": "tvshow", "question": "What is the country with the most number of TV Channels and how many does it have?", "gold_sql": "SELECT Country , count(*) FROM TV_Channel GROUP BY Country ORDER BY count(*) DESC LIMIT 1;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0391", "split": "test", "db_id": "car_1", "question": "What are the ids and names of all countries that either have more than 3 car makers or produce fiat model ?", "gold_sql": "select t1.countryid , t1.countryname from countries as t1 join car_makers as t2 on t1.countryid = t2.country group by t1.countryid having count(*) > 3 union select t1.countryid , t1.countryname from countries as t1 join car_makers as t2 on t1.countryid = t2.country join model_list as t3 on t2.id = t3.maker where t3.model = 'fiat';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0392", "split": "test", "db_id": "world_1", "question": "How many languages are spoken in Aruba?", "gold_sql": "SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = \"Aruba\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0393", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the first, middle, and last names, along with the ids, of all students who enrolled in 2 degree programs in one semester?", "gold_sql": "SELECT T1.first_name , T1.middle_name , T1.last_name , T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) = 2", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0394", "split": "test", "db_id": "pets_1", "question": "Find the first name and age of students who have a dog but do not have a cat as a pet.", "gold_sql": "SELECT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND T1.stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0395", "split": "test", "db_id": "car_1", "question": "Which model has the most version(make) of cars?", "gold_sql": "SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY count(*) DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0396", "split": "test", "db_id": "tvshow", "question": "List the number of different series names and contents in the TV Channel table.", "gold_sql": "SELECT count(DISTINCT series_name) , count(DISTINCT content) FROM TV_Channel;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0397", "split": "test", "db_id": "dog_kennels", "question": "Find the first names that are used for professionals or owners but are not used as dog names.", "gold_sql": "SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0398", "split": "test", "db_id": "world_1", "question": "What is the most populace city that speaks English?", "gold_sql": "SELECT T1.Name , T1.Population FROM city AS T1 JOIN countrylanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Language = \"English\" ORDER BY T1.Population DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0399", "split": "test", "db_id": "orchestra", "question": "What are the orchestras that do not have any performances?", "gold_sql": "SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0400", "split": "test", "db_id": "pets_1", "question": "Find the first name of students who have cat or dog pet.", "gold_sql": "SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0401", "split": "test", "db_id": "wta_1", "question": "How many matches were played in each year?", "gold_sql": "SELECT count(*) , YEAR FROM matches GROUP BY YEAR", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0402", "split": "test", "db_id": "poker_player", "question": "Give the nationality that is most common across all people.", "gold_sql": "SELECT Nationality FROM people GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0403", "split": "test", "db_id": "world_1", "question": "What are the population, name and leader of the country with the largest area?", "gold_sql": "SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0404", "split": "test", "db_id": "car_1", "question": "Which models are lighter than 3500 but not built by the 'Ford Motor Company'?", "gold_sql": "SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.Model = T2.Model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.Id JOIN CAR_MAKERS AS T4 ON T1.Maker = T4.Id WHERE T3.weight < 3500 AND T4.FullName != 'Ford Motor Company';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0405", "split": "test", "db_id": "dog_kennels", "question": "Count the number of dogs of an age below the average.", "gold_sql": "SELECT count(*) FROM Dogs WHERE age < ( SELECT avg(age) FROM Dogs )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0406", "split": "test", "db_id": "world_1", "question": "How long is the people’s average life expectancy in Central Africa?", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Region = \"Central Africa\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0407", "split": "test", "db_id": "course_teach", "question": "Show different hometown of teachers and the number of teachers from each hometown.", "gold_sql": "SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0408", "split": "test", "db_id": "world_1", "question": "Return the names of the 3 countries with the fewest people.", "gold_sql": "SELECT Name FROM country ORDER BY Population ASC LIMIT 3", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0409", "split": "test", "db_id": "flight_2", "question": "How many flights land in Aberdeen or Abilene?", "gold_sql": "SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = \"Aberdeen\" OR T2.city = \"Abilene\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0410", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the codes of template types that have fewer than 3 templates?", "gold_sql": "SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING count(*) < 3", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0411", "split": "test", "db_id": "wta_1", "question": "What is the first name and country code of the oldest player?", "gold_sql": "SELECT first_name , country_code FROM players ORDER BY birth_date LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0412", "split": "test", "db_id": "wta_1", "question": "What are the first names and country codes for players who won both the WTA Championships and the Australian Open?", "gold_sql": "SELECT T1.country_code , T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'WTA Championships' INTERSECT SELECT T1.country_code , T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'Australian Open'", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0413", "split": "test", "db_id": "orchestra", "question": "How many orchestras does each record company manage?", "gold_sql": "SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} +{"qid": "test_0414", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers and the courses they teach in ascending alphabetical order by the name of the teacher?", "gold_sql": "SELECT T3.Name , T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID ORDER BY T3.Name", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0415", "split": "test", "db_id": "pets_1", "question": "Find the id and weight of all pets whose age is older than 1.", "gold_sql": "SELECT petid , weight FROM pets WHERE pet_age > 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0416", "split": "test", "db_id": "student_transcripts_tracking", "question": "Find the last name of the students who currently live in the state of North Carolina but have not registered in any degree program.", "gold_sql": "SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id = T4.student_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0417", "split": "test", "db_id": "poker_player", "question": "List the final tables made and the best finishes of poker players.", "gold_sql": "SELECT Final_Table_Made , Best_Finish FROM poker_player", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0418", "split": "test", "db_id": "student_transcripts_tracking", "question": "Whose permanent address is different from his or her current address? List his or her first name.", "gold_sql": "SELECT first_name FROM Students WHERE current_address_id != permanent_address_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0419", "split": "test", "db_id": "wta_1", "question": "Find the name of tourney that has more than 10 matches.", "gold_sql": "SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*) > 10", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0420", "split": "test", "db_id": "car_1", "question": "What is the number of cars with more than 4 cylinders?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE Cylinders > 4;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0421", "split": "test", "db_id": "tvshow", "question": "Find the package choice and series name of the TV channel that has high definition TV.", "gold_sql": "SELECT package_option , series_name FROM TV_Channel WHERE hight_definition_TV = \"yes\"", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0422", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the id of the document with the fewest paragraphs.", "gold_sql": "SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0423", "split": "test", "db_id": "dog_kennels", "question": "Who owns the youngest dog? Give me his or her last name.", "gold_sql": "SELECT T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.age = ( SELECT max(age) FROM Dogs )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0424", "split": "test", "db_id": "world_1", "question": "How many unique languages are spoken in the world?", "gold_sql": "SELECT count(DISTINCT LANGUAGE) FROM countrylanguage", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0425", "split": "test", "db_id": "museum_visit", "question": "Find the average number of staff working for the museums that were open before 2009.", "gold_sql": "SELECT avg(num_of_staff) FROM museum WHERE open_year < 2009", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0426", "split": "test", "db_id": "network_1", "question": "What are the names of the high schoolers and how many friends does each have?", "gold_sql": "SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0427", "split": "test", "db_id": "singer", "question": "What is the sname of every sing that does not have any song?", "gold_sql": "SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song)", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0428", "split": "test", "db_id": "employee_hire_evaluation", "question": "Return the name, location and district of all shops in descending order of number of products.", "gold_sql": "SELECT name , LOCATION , district FROM shop ORDER BY number_products DESC", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0429", "split": "test", "db_id": "dog_kennels", "question": "Which dogs have not cost their owner more than 1000 for treatment ? List the dog names .", "gold_sql": "select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment) > 1000 )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0430", "split": "test", "db_id": "wta_1", "question": "List the number of all matches who played in years of 2013 or 2016.", "gold_sql": "SELECT count(*) FROM matches WHERE YEAR = 2013 OR YEAR = 2016", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0431", "split": "test", "db_id": "car_1", "question": "What is the number of cars with a greater accelerate than the one with the most horsepower?", "gold_sql": "SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate > ( SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1 );", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0432", "split": "test", "db_id": "flight_2", "question": "Return the number of airlines in the USA.", "gold_sql": "SELECT count(*) FROM AIRLINES WHERE Country = \"USA\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0433", "split": "test", "db_id": "museum_visit", "question": "What are the id and name of the museum visited most times?", "gold_sql": "SELECT t2.Museum_ID , t1.name FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID = t2.Museum_ID GROUP BY t2.Museum_ID ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0434", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the name and id of the department with the most number of degrees ?", "gold_sql": "select t2.department_name , t1.department_id from degree_programs as t1 join departments as t2 on t1.department_id = t2.department_id group by t1.department_id order by count(*) desc limit 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0435", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Count the number of documents that use the PPT template type.", "gold_sql": "SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT'", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0436", "split": "test", "db_id": "wta_1", "question": "How many different loser names are there?", "gold_sql": "SELECT count(DISTINCT loser_name) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0437", "split": "test", "db_id": "pets_1", "question": "What is the last name of the student who has a cat that is 3 years old?", "gold_sql": "SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pet_age = 3 AND T3.pettype = 'cat'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0438", "split": "test", "db_id": "network_1", "question": "What are the names and grades for each high schooler?", "gold_sql": "SELECT name , grade FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0439", "split": "test", "db_id": "course_teach", "question": "Show names of teachers and the courses they are arranged to teach in ascending alphabetical order of the teacher's name.", "gold_sql": "SELECT T3.Name , T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID ORDER BY T3.Name", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0440", "split": "test", "db_id": "wta_1", "question": "Find the total number of matches.", "gold_sql": "SELECT count(*) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0441", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the template ids with template type description \"Presentation\".", "gold_sql": "SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = \"Presentation\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0442", "split": "test", "db_id": "world_1", "question": "Count the number of countries for which Spanish is the predominantly spoken language.", "gold_sql": "SELECT count(*) , max(Percentage) FROM countrylanguage WHERE LANGUAGE = \"Spanish\" GROUP BY CountryCode", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0443", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers ordered by ascending age?", "gold_sql": "SELECT Name FROM teacher ORDER BY Age ASC", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} +{"qid": "test_0444", "split": "test", "db_id": "car_1", "question": "What is the maximum miles per gallon of the car with 8 cylinders or produced before 1980 ?", "gold_sql": "select max(mpg) from cars_data where cylinders = 8 or year < 1980", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0445", "split": "test", "db_id": "world_1", "question": "Return the names of the 3 most populated countries.", "gold_sql": "SELECT Name FROM country ORDER BY Population DESC LIMIT 3", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0446", "split": "test", "db_id": "tvshow", "question": "What are the countries that have cartoons on TV that were written by Todd Casey?", "gold_sql": "SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0447", "split": "test", "db_id": "world_1", "question": "What region is Kabul in?", "gold_sql": "SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = \"Kabul\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0448", "split": "test", "db_id": "pets_1", "question": "How many pets are owned by students that have an age greater than 20?", "gold_sql": "SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0449", "split": "test", "db_id": "student_transcripts_tracking", "question": "Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 .", "gold_sql": "select t1.first_name from students as t1 join addresses as t2 on t1.permanent_address_id = t2.address_id where t2.country = 'haiti' or t1.cell_mobile_number = '09700166582'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0450", "split": "test", "db_id": "wta_1", "question": "List the first name and birth date of all players from the country with code USA.", "gold_sql": "SELECT first_name , birth_date FROM players WHERE country_code = 'USA'", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0451", "split": "test", "db_id": "dog_kennels", "question": "Find the first names of owners living in Virginia and the names of dogs they own.", "gold_sql": "SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0452", "split": "test", "db_id": "network_1", "question": "Return the name of the high school student with the most friends.", "gold_sql": "SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0453", "split": "test", "db_id": "concert_singer", "question": "How many singers are from each country?", "gold_sql": "SELECT country , count(*) FROM singer GROUP BY country", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0454", "split": "test", "db_id": "dog_kennels", "question": "Find the number of professionals who have not treated any dogs.", "gold_sql": "SELECT count(*) FROM Professionals WHERE professional_id NOT IN ( SELECT professional_id FROM Treatments )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0455", "split": "test", "db_id": "car_1", "question": "What is the maximum accelerate for different number of cylinders?", "gold_sql": "SELECT max(Accelerate) , Cylinders FROM CARS_DATA GROUP BY Cylinders;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0456", "split": "test", "db_id": "concert_singer", "question": "What is the maximum capacity and the average of all stadiums ?", "gold_sql": "select max(capacity), average from stadium", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} +{"qid": "test_0457", "split": "test", "db_id": "museum_visit", "question": "find the names of museums which have more staff than the minimum staff number of all museums opened after 2010.", "gold_sql": "SELECT name FROM museum WHERE num_of_staff > (SELECT min(num_of_staff) FROM museum WHERE open_year > 2010)", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} +{"qid": "test_0458", "split": "test", "db_id": "tvshow", "question": "List each language and the number of TV Channels using it.", "gold_sql": "SELECT LANGUAGE , count(*) FROM TV_Channel GROUP BY LANGUAGE", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0459", "split": "test", "db_id": "dog_kennels", "question": "Find the states where both owners and professionals live.", "gold_sql": "SELECT state FROM Owners INTERSECT SELECT state FROM Professionals", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0460", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the program id and the summary of the degree that has the most students enrolled?", "gold_sql": "SELECT T1.degree_program_id , T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0461", "split": "test", "db_id": "dog_kennels", "question": "How much does the most recent treatment cost?", "gold_sql": "SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} +{"qid": "test_0462", "split": "test", "db_id": "wta_1", "question": "Find the name and rank of the 3 youngest winners across all matches.", "gold_sql": "SELECT DISTINCT winner_name , winner_rank FROM matches ORDER BY winner_age LIMIT 3", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0463", "split": "test", "db_id": "world_1", "question": "Which language is the most popular on the Asian continent?", "gold_sql": "SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = \"Asia\" GROUP BY T2.Language ORDER BY COUNT (*) DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0464", "split": "test", "db_id": "car_1", "question": "How many countries does each continent have? List the continent id, continent name and the number of countries.", "gold_sql": "SELECT T1.ContId , T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} +{"qid": "test_0465", "split": "test", "db_id": "world_1", "question": "What are the names of nations speak both English and French?", "gold_sql": "SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"French\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0466", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "How many different templates do all document use?", "gold_sql": "SELECT count(DISTINCT template_id) FROM Documents", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0467", "split": "test", "db_id": "poker_player", "question": "What is the money rank of the tallest poker player?", "gold_sql": "SELECT T2.Money_Rank FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0468", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many degrees does the engineering department offer?", "gold_sql": "SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0469", "split": "test", "db_id": "world_1", "question": "Count the number of countries in Asia.", "gold_sql": "SELECT count(*) FROM country WHERE continent = \"Asia\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0470", "split": "test", "db_id": "wta_1", "question": "How many distinct countries do players come from?", "gold_sql": "SELECT count(DISTINCT country_code) FROM players", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0471", "split": "test", "db_id": "tvshow", "question": "List the title of all Cartoons showed on TV Channel with series name \"Sky Radio\".", "gold_sql": "SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = \"Sky Radio\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0472", "split": "test", "db_id": "voter_1", "question": "How many states are there?", "gold_sql": "SELECT count(*) FROM area_code_state", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} +{"qid": "test_0473", "split": "test", "db_id": "world_1", "question": "Give the names of nations that speak both English and French.", "gold_sql": "SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"French\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0474", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the id, line 1, and line 2 of the address with the most students?", "gold_sql": "SELECT T1.address_id , T1.line_1 , T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.current_address_id GROUP BY T1.address_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0475", "split": "test", "db_id": "network_1", "question": "What is the name of the high schooler who has the greatest number of friends?", "gold_sql": "SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0476", "split": "test", "db_id": "employee_hire_evaluation", "question": "Give me all the information about hiring.", "gold_sql": "SELECT * FROM hiring", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} +{"qid": "test_0477", "split": "test", "db_id": "singer", "question": "For each citizenship, what is the maximum net worth?", "gold_sql": "SELECT Citizenship , max(Net_Worth_Millions) FROM singer GROUP BY Citizenship", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} +{"qid": "test_0478", "split": "test", "db_id": "world_1", "question": "What is the average expected life expectancy for countries in the region of Central Africa?", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Region = \"Central Africa\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0479", "split": "test", "db_id": "poker_player", "question": "What is the average earnings of poker players with height higher than 200?", "gold_sql": "SELECT avg(T2.Earnings) FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 200", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} +{"qid": "test_0480", "split": "test", "db_id": "world_1", "question": "How many continents speak Chinese?", "gold_sql": "SELECT COUNT( DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"Chinese\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0481", "split": "test", "db_id": "network_1", "question": "Show the names of high school students and their corresponding number of friends.", "gold_sql": "SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0482", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the ids of documents that have 2 or more paragraphs?", "gold_sql": "SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) >= 2", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0483", "split": "test", "db_id": "world_1", "question": "What are the different government forms and what is the total population of each for government forms that have an average life expectancy greater than 72?", "gold_sql": "SELECT sum(Population) , GovernmentForm FROM country GROUP BY GovernmentForm HAVING avg(LifeExpectancy) > 72", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0484", "split": "test", "db_id": "world_1", "question": "What is the average life expectancy in African countries that are republics?", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Continent = \"Africa\" AND GovernmentForm = \"Republic\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0485", "split": "test", "db_id": "flight_2", "question": "Return the number of flights.", "gold_sql": "SELECT count(*) FROM FLIGHTS", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} +{"qid": "test_0486", "split": "test", "db_id": "world_1", "question": "What is average life expectancy in the countries where English is not the official language?", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\" AND T2.IsOfficial = \"T\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0487", "split": "test", "db_id": "pets_1", "question": "Find the type and weight of the youngest pet.", "gold_sql": "SELECT pettype , weight FROM pets ORDER BY pet_age LIMIT 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} +{"qid": "test_0488", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all template type codes and descriptions.", "gold_sql": "SELECT template_type_code , template_type_description FROM Ref_template_types", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0489", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the first name of the student whose permanent address is different from his or her current one?", "gold_sql": "SELECT first_name FROM Students WHERE current_address_id != permanent_address_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0490", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the description of the department whose name has the substring the computer?", "gold_sql": "SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} +{"qid": "test_0491", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the type code of the template type that the most templates belong to.", "gold_sql": "SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0492", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the ids corresponding to templates with the description 'Presentation'.", "gold_sql": "SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = \"Presentation\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} +{"qid": "test_0493", "split": "test", "db_id": "network_1", "question": "What are the names of high schoolers who have likes, and how many likes does each have?", "gold_sql": "SELECT T2.name , count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0494", "split": "test", "db_id": "wta_1", "question": "What is the best rank of losers across all matches?", "gold_sql": "SELECT min(loser_rank) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} +{"qid": "test_0495", "split": "test", "db_id": "network_1", "question": "Show the names and grades of each high schooler.", "gold_sql": "SELECT name , grade FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} +{"qid": "test_0496", "split": "test", "db_id": "world_1", "question": "Give the country codes for countries in which people speak langauges that are not English.", "gold_sql": "SELECT DISTINCT CountryCode FROM countrylanguage WHERE LANGUAGE != \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} +{"qid": "test_0497", "split": "test", "db_id": "tvshow", "question": "What are the ids of all tv channels that have more than 2 TV channels?", "gold_sql": "SELECT id FROM tv_channel GROUP BY country HAVING count(*) > 2", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0498", "split": "test", "db_id": "tvshow", "question": "list all cartoon titles and their directors ordered by their air date", "gold_sql": "SELECT title , Directed_by FROM Cartoon ORDER BY Original_air_date", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} +{"qid": "test_0499", "split": "test", "db_id": "car_1", "question": "What is the average edispl for all volvos?", "gold_sql": "SELECT avg(T2.edispl) FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T1.Model = 'volvo';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"}