instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_49 ( e_score VARCHAR, total VARCHAR, a_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of E scores when the total score was 19.7 and the A score was more than 6?
SELECT COUNT(e_score) FROM table_name_49 WHERE total = 19.7 AND a_score > 6
sql_create_context
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '云莹琇' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.P...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.icd9_code = "5732"
mimicsql_data
CREATE TABLE table_1292 ( "Airline" text, "ICAO" text, "IATA" text, "Callsign" text, "Commenced operations" real, "Fleet size" real, "Headquarters" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year did the Angeles City based airline ...
SELECT "Commenced operations" FROM table_1292 WHERE "Headquarters" = 'Angeles City'
wikisql
CREATE TABLE table_1341865_37 ( party VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- To which party does Frank T. Bow belong?
SELECT party FROM table_1341865_37 WHERE incumbent = "Frank T. Bow"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Metronidazole"
mimicsql_data
CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) -- Using valid SQLite, answer the following questio...
SELECT investor, COUNT(*) FROM entrepreneur GROUP BY investor
spider
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-77873')) AND diagnosis.diagnosisname = 'hypertension' AND DAT...
eicu
CREATE TABLE table_name_66 ( score VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match with an attendance of 2248?
SELECT score FROM table_name_66 WHERE attendance = 2248
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Sebouh Aslanian%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id...
advising
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_ID = '69380544' AND t_kc21.MED_SER_ORG_NO = '2426455' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%眼外伤%'
css
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Openning_year, COUNT(Openning_year) FROM cinema GROUP BY Openning_year ORDER BY Openning_year
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '0869256' AND t_kc24.t_kc21_OUT_DIAG_DIS_NM = '急性支气管炎')
css
CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHAR(255) ) CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Assets ( Asset_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID INTEGER, address_details VARCHAR(255)...
SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY Product_Name DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj...
css
CREATE TABLE table_name_96 ( floors INTEGER, rank VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest floors with rank greater than 1 in Conrad Dubai?
SELECT MAX(floors) FROM table_name_96 WHERE rank > 1 AND name = "conrad dubai"
sql_create_context
CREATE TABLE cast ( id int, msid int, aid int, role text ) CREATE TABLE director ( did int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE producer ( pid int, gender text, name text, nationality text, birth_city text...
SELECT COUNT(DISTINCT (movie.title)), movie.release_year FROM actor, cast, movie WHERE actor.name = 'Brad Pitt' AND cast.aid = actor.aid AND movie.mid = cast.msid GROUP BY movie.release_year
imdb
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'lower gi bleeding - diverticular')) AND DATE...
eicu
CREATE TABLE table_15335 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Representative has a Presentation of Credentials o...
SELECT "Representative" FROM table_15335 WHERE "Presentation of Credentials" = 'september 8, 2005'
wikisql
CREATE TABLE table_103084_4 ( year INTEGER, bbc_two_total_viewing VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the BBC two total viewing 7,530,000?
SELECT MIN(year) FROM table_103084_4 WHERE bbc_two_total_viewing = "7,530,000"
sql_create_context
CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE airport ( airport_id number, airport_name text, total_passengers number, %_change_2007 text, international_passengers number, domestic_passengers number, transit_passengers number, aircraft_movements ...
SELECT AVG(international_passengers) FROM airport
spider
CREATE TABLE table_71771 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won Women's doubles when Nikhil Kanetkar won M...
SELECT "Women's doubles" FROM table_71771 WHERE "Men's singles" = 'nikhil kanetkar'
wikisql
CREATE TABLE table_name_42 ( country VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country had a t4 place and scored 66-73=139?
SELECT country FROM table_name_42 WHERE place = "t4" AND score = 66 - 73 = 139
sql_create_context
CREATE TABLE table_3448 ( "Country" text, "Population in 2011 (In thousands)" real, "GDP (nominal) in 2011 ( USD millions)" real, "GDP (nominal) per capita" real, "GDP (PPP) in 2011 ( USD millions)" real, "GDP (PPP) per capita" real, "Merchandise exports ($ billions), 2011" text, "Mercha...
SELECT MIN("GDP (PPP) in 2011 ( USD millions)") FROM table_3448 WHERE "Imports from Mercosur (% of each, 2010)" = '48.8'
wikisql
CREATE TABLE table_60983 ( "Date" text, "Opponent#" text, "Rank #" text, "Site" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT RANK HAD A RESULT OF W13-3?
SELECT "Rank #" FROM table_60983 WHERE "Result" = 'w13-3'
wikisql
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( ...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
scholar
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.label = "MCV"
mimicsql_data
CREATE TABLE table_15975 ( "#" real, "City" text, "1981 Census" real, "1991 Census" real, "2001 Census" real, "2010 Est." real, "Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 2001 census of the region of Abruzzo where the...
SELECT MIN("2001 Census") FROM table_15975 WHERE "Region" = 'Abruzzo' AND "1981 Census" > '51092.0'
wikisql
CREATE TABLE table_204_297 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who had more gold medals , russia or georgia ?
SELECT "nation" FROM table_204_297 WHERE "nation" IN ('russia', 'georgia') ORDER BY "gold" DESC LIMIT 1
squall
CREATE TABLE table_8128 ( "Year" real, "Number" real, "Team" text, "Co-driver" text, "Position" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the co-driver for the 6th position and more than 159 laps?
SELECT "Co-driver" FROM table_8128 WHERE "Position" = '6th' AND "Laps" > '159'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '50996847123' AND NOT t_kc22.MED_ORG_DEPT_NM LIKE '%五官科%'
css
CREATE TABLE table_5184 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Location of boston garden, and a Record of 58-23 involved what opponent?
SELECT "Opponent" FROM table_5184 WHERE "Location" = 'boston garden' AND "Record" = '58-23'
wikisql
CREATE TABLE table_52308 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the call sign for a class of A?
SELECT "Call sign" FROM table_52308 WHERE "Class" = 'a'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE table_4002 ( "District" text, "Incumbent" text, "Cook" text, "Rothenberg" text, "CQ Politics" text, "Crystal Ball" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many incumbents are in district la-1?
SELECT COUNT("Incumbent") FROM table_4002 WHERE "District" = 'LA-1'
wikisql
CREATE TABLE table_15390 ( "Round" real, "Selection" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the player that went to notre dame
SELECT "Player" FROM table_15390 WHERE "College" = 'notre dame'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '63...
css
CREATE TABLE table_70611 ( "Poll" text, "Pre- season" text, "Mar. 3" text, "May 5" text, "May 12" text, "May 19" text, "May 26" text, "Final Poll" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which March 3 has a Poll of baseball americ...
SELECT "Mar. 3" FROM table_70611 WHERE "Poll" = 'baseball america (top 25)'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "25013" AND prescriptions.route = "DWELL"
mimicsql_data
CREATE TABLE table_name_33 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue of the game on 27 April 1964?
SELECT venue FROM table_name_33 WHERE date = "27 april 1964"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2057')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURREN...
eicu
CREATE TABLE table_43349 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest gold when bronze is 1, and rank is 5?
SELECT MAX("Gold") FROM table_43349 WHERE "Bronze" = '1' AND "Rank" = '5'
wikisql
CREATE TABLE table_60459 ( "Member" text, "Party" text, "Electorate" text, "State" text, "First elected" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Member has an Electorate of southern melbourne?
SELECT "Member" FROM table_60459 WHERE "Electorate" = 'southern melbourne'
wikisql
CREATE TABLE table_name_45 ( class VARCHAR, machine VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class has nsr250 as the machine, with points greater than 97?
SELECT class FROM table_name_45 WHERE machine = "nsr250" AND points > 97
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136854' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "HYPOXIA"
mimicsql_data
CREATE TABLE table_26961951_4 ( directed_by VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes were written by Alison McDonald?
SELECT COUNT(directed_by) FROM table_26961951_4 WHERE written_by = "Alison McDonald"
sql_create_context
CREATE TABLE table_16034882_4 ( wins VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins did the team with 42 points get?
SELECT wins FROM table_16034882_4 WHERE points = 42
sql_create_context
CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizontal_bar_points number, total_points number ) CREATE TABLE people ( people_id number, name text, a...
SELECT age FROM people ORDER BY height DESC LIMIT 1
spider
CREATE TABLE table_204_265 ( id number, "no." number, "title (latin)" text, "title (english translation)" text, "subject" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how often was an encyclical sent in january ?
SELECT COUNT(*) FROM table_204_265 WHERE "date" = 1
squall
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY COUNT(Sex) DESC
nvbench
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREA...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw...
advising
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate ti...
SELECT u.Id AS "user_link", COUNT(*) AS Total, COUNT(CASE WHEN b.Class = 1 THEN 1 ELSE NULL END) AS Gold, COUNT(CASE WHEN b.Class = 2 THEN 1 ELSE NULL END) AS Silver, COUNT(CASE WHEN b.Class = 3 THEN 1 ELSE NULL END) AS Bronze, COUNT(CASE WHEN b.TagBased = 1 THEN 1 ELSE NULL END) AS "total_(tags)", COUNT(CASE WHEN b.Ta...
sede
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '9714739' AND RYDJSJ BETWEEN '2003-11-25' AND '2010-12-20' AND DATEDIFF(CYSJ, RYSJ) > 17
css
CREATE TABLE table_11695215_1 ( written_by VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes did David Jackson write and direct?
SELECT COUNT(written_by) FROM table_11695215_1 WHERE directed_by = "David Jackson"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
mimic_iii
CREATE TABLE table_46189 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver who ha...
SELECT "Driver" FROM table_46189 WHERE "Fin. Pos" = '14'
wikisql
CREATE TABLE table_203_707 ( id number, "rank" number, "npc" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the difference in gold medals between russia and china ?
SELECT (SELECT "gold" FROM table_203_707 WHERE "npc" = 'china') - (SELECT "gold" FROM table_203_707 WHERE "npc" = 'russia')
squall
CREATE TABLE table_26919_7 ( proto_semitic VARCHAR, english VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If in English it's house, what is it in proto-semitic?
SELECT proto_semitic FROM table_26919_7 WHERE english = "house"
sql_create_context
CREATE TABLE table_name_90 ( pl_gp INTEGER, pick__number VARCHAR, reg_gp VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Pl GP when the pick number is 199 and the Reg GP is bigger than 0?
SELECT SUM(pl_gp) FROM table_name_90 WHERE pick__number = 199 AND reg_gp > 0
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32592 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.route = 'pb' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_name_17 ( census_ranking VARCHAR, area_km_2 INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What census ranking has an area greater than 578.28 km2?
SELECT census_ranking FROM table_name_17 WHERE area_km_2 > 578.28
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Id AS "post_link" FROM Posts WHERE (Body LIKE '%</blockquote>%<p>No.</p>%' OR Body LIKE '%</blockquote>%<p>Yes.</p>%') AND OwnerUserId = '##UserId##' ORDER BY LENGTH(Body)
sede
CREATE TABLE table_15463188_1 ( school_club_team VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the school/club for guard
SELECT school_club_team FROM table_15463188_1 WHERE position = "Guard"
sql_create_context
CREATE TABLE table_53274 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the away team score for geelong away team
SELECT "Away team score" FROM table_53274 WHERE "Away team" = 'geelong'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2060" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" ORDER BY COUNT(date_of_enrolment) DESC
nvbench
CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, regional_population number, gdp number ) CREATE TABLE temperature ( city_id number, jan number, feb number, mar number, apr number, jun number, jul number, aug number, sep number, ...
SELECT match_id FROM match WHERE competition = "1994 FIFA World Cup qualification"
spider
CREATE TABLE table_name_99 ( location VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location for Belshina?
SELECT location FROM table_name_99 WHERE team = "belshina"
sql_create_context
CREATE TABLE table_44089 ( "Year" real, "Champion" text, "Country" text, "Score" real, "To par" text, "Tournament Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Joanne Carner's average score in Canadian Women's Open games that ...
SELECT AVG("Score") FROM table_44089 WHERE "Champion" = 'joanne carner'
wikisql
CREATE TABLE table_name_6 ( runner_up VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What runner-up has 1925 as the year?
SELECT runner_up FROM table_name_6 WHERE year = "1925"
sql_create_context
CREATE TABLE table_name_86 ( owner VARCHAR, time VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which owner has the time of 2:02.20 and the year of 1957?
SELECT owner FROM table_name_86 WHERE time = "2:02.20" AND year = "1957"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationD...
SELECT PostId AS "post_link", * FROM Comments WHERE UserId = '##UserId##' AND Text LIKE '%what happens%'
sede
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Chinbo Chong%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe...
advising
CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE writes ( aid...
SELECT COUNT(DISTINCT (publication.title)) FROM author, keyword, publication, publication_keyword, writes WHERE author.name = 'H. V. Jagadish' AND keyword.keyword = 'User Study' AND publication_keyword.kid = keyword.kid AND publication.pid = publication_keyword.pid AND writes.aid = author.aid AND writes.pid = publicati...
academic
CREATE TABLE table_71590 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what day was the score of 1 6 6 1 3 6 achieved?
SELECT "Date" FROM table_71590 WHERE "Score" = '1–6 6–1 3–6'
wikisql
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover)
nvbench
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT COUNT(*) FROM Posts WHERE OwnerUserId = 5140781 AND PostTypeId = 2 AND CreationDate BETWEEN '2017-07-01' AND '2017-07-31'
sede
CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE business ( bid int, business_id varchar, name v...
SELECT SUM(business.review_count) FROM business, neighborhood WHERE neighborhood.business_id = business.business_id AND neighborhood.neighborhood_name = 'South Summerlin'
yelp
CREATE TABLE table_72350 ( "Institution" text, "Team" text, "City" text, "Province" text, "First season" real, "Head coach" text, "Enrollment" real, "Endowment" text, "Football stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables...
SELECT COUNT("City") FROM table_72350 WHERE "Enrollment" = '19082'
wikisql
CREATE TABLE table_64115 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In week 7, what was the average attendance?
SELECT AVG("Attendance") FROM table_64115 WHERE "Week" = '7'
wikisql
CREATE TABLE table_2701851_5 ( written_by VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode in the series 46b?
SELECT written_by FROM table_2701851_5 WHERE no_in_series = "46b"
sql_create_context
CREATE TABLE table_name_21 ( class VARCHAR, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Class has an ERP W of 222?
SELECT class FROM table_name_21 WHERE erp_w = 222
sql_create_context
CREATE TABLE table_54614 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many grids have less than 41 laps and a Driver of pedro de la rosa?
SELECT COUNT("Grid") FROM table_54614 WHERE "Laps" < '41' AND "Driver" = 'pedro de la rosa'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_39319 ( "Region served" text, "ch 1" text, "On-air date" text, "Analogue Power" text, "Digital Power" text, "Analogue HAAT" text, "Digital HAAT" text, "Transmitter Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "ch 1" FROM table_39319 WHERE "Region served" = 'central tablelands'
wikisql
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
SELECT Years_Played, COUNT(Years_Played) FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" GROUP BY Years_Played ORDER BY COUNT(Years_Played)
nvbench
CREATE TABLE table_16497 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest of balmoor/
SELECT "Highest" FROM table_16497 WHERE "Stadium" = 'Balmoor'
wikisql
CREATE TABLE table_34772 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the second for the curling team which has alternate Margarita Fomina?
SELECT "Second" FROM table_34772 WHERE "Alternate" = 'margarita fomina'
wikisql
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY COUNT(local_authority)
nvbench
CREATE TABLE Product ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Problem_Category_Codes ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80) ) CREATE TABLE Staff ( staff_id INTEGER, staff_first_name VARCHAR(80), s...
SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY log_entry_description DESC
nvbench
CREATE TABLE table_name_38 ( longitude VARCHAR, latitude VARCHAR, geo_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the longitude with a latitude of 48.930222 with a Geo ID smaller than 3806755660?
SELECT COUNT(longitude) FROM table_name_38 WHERE latitude = 48.930222 AND geo_id < 3806755660
sql_create_context
CREATE TABLE table_name_55 ( round INTEGER, position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the latest round with a running back from a California college?
SELECT MAX(round) FROM table_name_55 WHERE position = "running back" AND college = "california"
sql_create_context
CREATE TABLE table_63309 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest enrollment in Lagrange where the mascot is panthers?...
SELECT MAX("Enrollment") FROM table_63309 WHERE "Location" = 'lagrange' AND "Mascot" = 'panthers'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjybgb.SQRGH, zyjybgb.SQRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '52715047918' GROUP BY zyjybgb.SQRGH HAVING COUNT(*) > 16 UNION SELECT mzjybgb.SQRGH, mzjybgb.SQRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '52715047918' GROUP BY mzjybgb.SQRGH HAVING COUNT(*) > 16
css
CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE stock ( Shop_ID int, Device...
SELECT Location, COUNT(Location) FROM shop GROUP BY Location ORDER BY Location DESC
nvbench
CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE club ( Club_ID int, ...
SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country DESC
nvbench
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW t...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_67647 ( "Year" real, "Winner" text, "Winning Hand" text, "Prize Money" text, "Entrants" real, "Runner-Up" text, "Losing Hand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many entrants were there in 2011?
SELECT COUNT("Entrants") FROM table_67647 WHERE "Year" = '2011'
wikisql