instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_39175 ( "Team" text, "Copa Libertadores 1999" text, "Copa Mercosur 1999" text, "Copa CONMEBOL 1999" text, "Intercontinental Cup 1999" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Copa Libertadores 1999 result for tea...
SELECT "Copa Libertadores 1999" FROM table_39175 WHERE "Copa Mercosur 1999" = 'group stage' AND "Team" = 'vasco'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_name_74 ( total INTEGER, rank VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Total ranking 9 and a Gold more than 6
SELECT SUM(total) FROM table_name_74 WHERE rank = "9" AND gold > 6
sql_create_context
CREATE TABLE table_7047 ( "English country name" text, "Arabic romanised country name" text, "Arabic country name" text, "English capital name" text, "Arabic romanised capital name" text, "Arabic capital name" text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT "English country name" FROM table_7047 WHERE "English capital name" = 'ramallah'
wikisql
CREATE TABLE table_name_86 ( overall VARCHAR, school_club_team VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was Arizona the team and the round was bigger than 11?
SELECT COUNT(overall) FROM table_name_86 WHERE school_club_team = "arizona" AND round > 11
sql_create_context
CREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ab NUMERIC, r NUMERIC, h NUMERIC, double NUMERIC, triple NUMERIC, hr NUMERIC, rbi NUMERIC, sb NUMERIC, cs NUMERIC, bb NUMERIC, so NUMERIC, ...
SELECT year, COUNT(year) FROM home_game
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 88409 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( ...
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn' AND d_i...
mimic_iii
CREATE TABLE table_name_62 ( rally_hq VARCHAR, rally_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was adac rally deutschland's rally HQ?
SELECT rally_hq FROM table_name_62 WHERE rally_name = "adac rally deutschland"
sql_create_context
CREATE TABLE table_name_98 ( bronze VARCHAR, silver INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of bronze medals for teams with less than 0 silver?
SELECT COUNT(bronze) FROM table_name_98 WHERE silver < 0
sql_create_context
CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_value_billion text ) CREATE TABLE buildings ( id number, name text, city text, height number, stories number, ...
SELECT headquarters FROM companies GROUP BY headquarters HAVING COUNT(*) > 2
spider
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '95304552' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Subjects ( subject_id INTEGER, subje...
SELECT author_id, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_25747 ( "#" text, "Original title" text, "Directed by" text, "Written by" text, "Original air dates" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the original air date for prod code 201
SELECT "Original air dates" FROM table_25747 WHERE "Prod. code" = '201'
wikisql
CREATE TABLE table_name_24 ( points_for VARCHAR, points VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Points, when Points is 60, and when Club is Bedwas RFC?
SELECT points_for FROM table_name_24 WHERE points = "60" AND club = "bedwas rfc"
sql_create_context
CREATE TABLE table_name_27 ( year INTEGER, inglewood INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year that had a value less than 2,575 in Inglewood?
SELECT AVG(year) FROM table_name_27 WHERE inglewood < 2 OFFSET 575
sql_create_context
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) -- Using valid SQLite, answer...
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location
nvbench
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 prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "AMID200"
mimicsql_data
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info...
css
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY County
nvbench
CREATE TABLE table_74529 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Time" text, "Grade" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which trainer had a time of 1:10.09 with a year less than 2009?
SELECT "Trainer" FROM table_74529 WHERE "Year" < '2009' AND "Time" = '1:10.09'
wikisql
CREATE TABLE table_name_31 ( games VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the F. Goals for games of 22 22 and points of 012 12
SELECT F.goals FROM table_name_31 WHERE games = "22 22" AND points = "012 12"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abn find-stool contents') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TI...
mimic_iii
CREATE TABLE table_name_43 ( points INTEGER, record VARCHAR, game__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of points of the game less than number 17 with an 11-6-0 record?
SELECT SUM(points) FROM table_name_43 WHERE record = "11-6-0" AND game__number < 17
sql_create_context
CREATE TABLE table_21415 ( "Departure" text, "Going to" text, "Calling at" text, "Arrival" text, "Operator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of going to for thurlby, braceborough spa at departure being 16.50
SELECT COUNT("Going to") FROM table_21415 WHERE "Calling at" = 'Thurlby, Braceborough Spa' AND "Departure" = '16.50'
wikisql
CREATE TABLE table_72891 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who di...
SELECT "High assists" FROM table_72891 WHERE "High rebounds" = 'Matt Barnes (11)'
wikisql
CREATE TABLE table_14137 ( "Date" text, "Opponent" text, "Score" text, "Record" text, "Arena" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what arena was the September 21 game?
SELECT "Arena" FROM table_14137 WHERE "Date" = 'september 21'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, pati...
SELECT AVG(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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'anticonvulsant - lamotrigine')) AND STRFTIME...
eicu
CREATE TABLE table_10121127_1 ( australian_role VARCHAR, un_operation_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Australia's role in the UN operation Unama?
SELECT australian_role FROM table_10121127_1 WHERE un_operation_name = "UNAMA"
sql_create_context
CREATE TABLE station ( LOCATION VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the location with most number of train stations.
SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '30242405141'
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '杨星波' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3838.71)
css
CREATE TABLE table_50505 ( "Year" real, "Show" text, "Season" text, "Episode" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Episode number of Ernest Dickerson in 2009 when the show was dexter?
SELECT "Episode" FROM table_50505 WHERE "Year" = '2009' AND "Show" = 'dexter'
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 jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '03617073061'
css
CREATE TABLE table_33644 ( "Season" real, "Series Name" text, "Champion" text, "Races \u2020" text, "Pole Positions" text, "Wins" text, "Podiums" text, "Fastest Laps" text, "Points" text, "Margin (pts)" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT "Fastest Laps" FROM table_33644 WHERE "Season" < '1979'
wikisql
CREATE TABLE table_name_27 ( gold INTEGER, total VARCHAR, rank VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many gold medals for a nation with rank less than 5, more than 0 silvers and a total of 2 medals?
SELECT AVG(gold) FROM table_name_27 WHERE rank < 5 AND silver > 0 AND total = 2
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
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 '%Kristina Daugirdas%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering...
advising
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32606) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(C...
mimic_iii
CREATE TABLE table_27713030_3 ( game INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game was played on October 13?
SELECT MAX(game) FROM table_27713030_3 WHERE date = "October 13"
sql_create_context
CREATE TABLE table_name_89 ( type VARCHAR, transfer_window VARCHAR, moving_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type if the transfer window is summer and the moving from category is free agent?
SELECT type FROM table_name_89 WHERE transfer_window = "summer" AND moving_from = "free agent"
sql_create_context
CREATE TABLE table_name_20 ( games VARCHAR, goals VARCHAR, assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games have 5 goals and less than 8 assists?
SELECT COUNT(games) FROM table_name_20 WHERE goals = 5 AND assists < 8
sql_create_context
CREATE TABLE table_204_838 ( id number, "year" number, "award" text, "category" text, "nominated work" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of awards that he has won ?
SELECT COUNT("award") FROM table_204_838 WHERE "result" = 'won'
squall
CREATE TABLE table_57589 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points were there in a year earlier than 1977, a Cosworth V8 engine, and an entry from HB Bewakin...
SELECT "Points" FROM table_57589 WHERE "Year" < '1977' AND "Engine" = 'cosworth v8' AND "Entrant" = 'hb bewaking alarm systems'
wikisql
CREATE TABLE table_51110 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Silver which has a Bronze of 19, and a Total larger than 58?
SELECT MIN("Silver") FROM table_51110 WHERE "Bronze" = '19' AND "Total" > '58'
wikisql
CREATE TABLE table_22801 ( "Year" text, "League" text, "Reg. Season" text, "Playoffs" text, "Owner(s)" text, "Avg. Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what playoffs the league was in the semifinals
SELECT "League" FROM table_22801 WHERE "Playoffs" = 'Semifinals'
wikisql
CREATE TABLE table_204_64 ( id number, "place" text, "code" number, "area (km2)" number, "population" number, "most spoken language" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least population listed in the table ?
SELECT MIN("population") FROM table_204_64
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2179"
mimicsql_data
CREATE TABLE table_203_201 ( id number, "class" text, "type" text, "ships" text, "displacement" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which weights more a ut507 salvage tug or a ut515 salvage tug ?
SELECT "class" FROM table_203_201 WHERE "class" IN ('ut507 class', 'ut515 class') ORDER BY "displacement" DESC LIMIT 1
squall
CREATE TABLE table_name_96 ( location VARCHAR, year VARCHAR, competition VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location did the team win before 1998 in the europe/africa zone, group i, round robin?
SELECT location FROM table_name_96 WHERE competition = "europe/africa zone, group i, round robin" AND result = "win" AND year < 1998
sql_create_context
CREATE TABLE table_2610582_2 ( branding VARCHAR, power_kw__erp_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many brandings are there where the Power kW (ERP) is 1kW (29.94kW ERP)?
SELECT COUNT(branding) FROM table_2610582_2 WHERE power_kw__erp_ = "1kW (29.94kW ERP)"
sql_create_context
CREATE TABLE table_204_979 ( id number, "place" number, "nation" text, "5 hoops" text, "3 balls,\n2 ribbons" text, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell me the only country to schore below 38 total points .
SELECT "nation" FROM table_204_979 WHERE "total" < 38
squall
CREATE TABLE table_50814 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the opponent when norway is against?
SELECT "Opponent" FROM table_50814 WHERE "Against" = 'norway'
wikisql
CREATE TABLE table_name_67 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2012 value with a 1.3 in 2010 and a 3.6 in 2008?
SELECT 2012 FROM table_name_67 WHERE 2010 = "1.3" AND 2008 = "3.6"
sql_create_context
CREATE TABLE table_23441 ( "Episode" text, "First broadcast" text, "Rufus guest" text, "Marcus guest" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the episode 2x10 aired for the first time?
SELECT "First broadcast" FROM table_23441 WHERE "Episode" = '2x10'
wikisql
CREATE TABLE table_30961 ( "Episode" text, "First broadcast" text, "Andrew and Georgies guest Lee Mack replaced Andrew Flintoff as team captain for one week in series 4, episode 2." text, "Jamie and Johns guest" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "First broadcast" FROM table_30961 WHERE "Jamie and Johns guest" = 'Mark Webber'
wikisql
CREATE TABLE church ( organized_by VARCHAR, name VARCHAR, open_date INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the organizer and name for churches that opened between 1830 and 1840.
SELECT organized_by, name FROM church WHERE open_date BETWEEN 1830 AND 1840
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) DESC
nvbench
CREATE TABLE table_77081 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHich Score has a To par of 3, and a Country of united states?
SELECT "Score" FROM table_77081 WHERE "To par" = '–3' AND "Country" = 'united states'
wikisql
CREATE TABLE table_17529 ( "Number" real, "Name" text, "Titles" text, "Date" text, "Opponent" text, "Result" text, "Defenses" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was pernell whitaker an opponent?
SELECT COUNT("Date") FROM table_17529 WHERE "Opponent" = 'Pernell Whitaker'
wikisql
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 diagnoses ( ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.language = "CAPE" AND demographic.diagnosis = "COMPLETE HEART BLOCK"
mimicsql_data
CREATE TABLE addresses ( address_id number, address_details text ) CREATE TABLE documents_mailed ( document_id number, mailed_to_address_id number, mailing_date time ) CREATE TABLE ref_shipping_agents ( shipping_agent_code text, shipping_agent_name text, shipping_agent_description text...
SELECT shipping_agent_code FROM ref_shipping_agents WHERE shipping_agent_name = "UPS"
spider
CREATE TABLE table_name_39 ( lost INTEGER, goals_for INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest lost entry for a team with fewer than 21 goals for?
SELECT MIN(lost) FROM table_name_39 WHERE goals_for < 21
sql_create_context
CREATE TABLE table_29321 ( "Team" text, "Outgoing head coach" text, "Manner of departure" text, "Date of vacancy" text, "Position in table" text, "Incoming head coach" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT "Date of vacancy" FROM table_29321 WHERE "Manner of departure" = 'Resigned' AND "Position in table" = '10th'
wikisql
CREATE TABLE table_11960944_4 ( high_assists VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high assists on the date December 12?
SELECT high_assists FROM table_11960944_4 WHERE date = "December 12"
sql_create_context
CREATE TABLE table_name_82 ( transfer_fee VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Odjidja-Ofoe's transfer fee?
SELECT transfer_fee FROM table_name_82 WHERE name = "odjidja-ofoe"
sql_create_context
CREATE TABLE table_name_12 ( game INTEGER, march VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the game when march is 15?
SELECT SUM(game) FROM table_name_12 WHERE march = 15
sql_create_context
CREATE TABLE table_train_149 ( "id" int, "prostate_specific_antigen_psa" float, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "fasting_serum_glucose" int, "vitamin_d" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- pros...
SELECT * FROM table_train_149 WHERE prostate_specific_antigen_psa > 4
criteria2sql
CREATE TABLE table_12304 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Tie no of the game with a Score of 1 1?
SELECT "Tie no" FROM table_12304 WHERE "Score" = '1–1'
wikisql
CREATE TABLE table_train_243 ( "id" int, "c_peptide_level" float, "finger_stick_measurements" bool, "diabetic" string, "fasting_blood_glucose_fbg" float, "hypoglycemia" bool, "insulin_requirement" float, "triglyceride_tg" float, "a1c" float, "age" float, "NOUSE" float ) -- ...
SELECT * FROM table_train_243 WHERE hypoglycemia = 1
criteria2sql
CREATE TABLE STUDENT ( Major VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Report all majors that have less than 3 students.
SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49141 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1
mimic_iii
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2110"
mimicsql_data
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82132 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_63751 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Australia's time in the heat more than 4?
SELECT "Time" FROM table_63751 WHERE "Heat" > '4' AND "Nationality" = 'australia'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar...
SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester...
advising
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 jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '98041595425'
css
CREATE TABLE table_79629 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Loss of the game at Nationwide Arena ...
SELECT "Loss" FROM table_79629 WHERE "Score" = '4–3' AND "Arena" = 'nationwide arena'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "51214"
mimicsql_data
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime tim...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8204 ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_21 ( date VARCHAR, status VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has a status of 1995 rugby world cup and an against of 20?
SELECT date FROM table_name_21 WHERE status = "1995 rugby world cup" AND against = 20
sql_create_context
CREATE TABLE table_name_98 ( total VARCHAR, silver VARCHAR, bronze VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total for the team with fewer than 2 bronze, ranked less than 4 and fewer than 1 silver?
SELECT COUNT(total) FROM table_name_98 WHERE bronze < 2 AND rank < 4 AND silver < 1
sql_create_context
CREATE TABLE table_53229 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What company built the car driven by Tony Brooks?
SELECT "Constructor" FROM table_53229 WHERE "Driver" = 'tony brooks'
wikisql
CREATE TABLE table_203_519 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which canadian driver finishe...
SELECT "driver" FROM table_203_519 WHERE "driver" IN ('alex tagliani', 'paul tracy') ORDER BY "pos" LIMIT 1
squall
CREATE TABLE table_51657 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text, "Construction completed" text, "Partially deleted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ID of marshall landfill o...
SELECT "CERCLIS ID" FROM table_51657 WHERE "Listed" = '09/08/1983' AND "Name" = 'marshall landfill'
wikisql
CREATE TABLE table_204_792 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total ...
SELECT COUNT("date") FROM table_204_792
squall
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1489)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) >= '2102-07-28') - (SELE...
mimic_iii
CREATE TABLE table_65283 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Total Apps" text, "Total Goals" real ) -- Usin...
SELECT "Total Apps" FROM table_65283 WHERE "League Apps" = '4 (2)'
wikisql
CREATE TABLE table_14903627_1 ( mixed_doubles VARCHAR, womens_singles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE NAME OF THE MIXED DOUBLES PLAYER WHEN THE WOMENS SINGLE PLAYER IS KAIRI VIILUP?
SELECT mixed_doubles FROM table_14903627_1 WHERE womens_singles = "Kairi Viilup"
sql_create_context
CREATE TABLE table_name_71 ( score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the gte northwest classic with the score of 207 (-9), what is the average 1st prize ($)
SELECT AVG(1 AS st_prize__) AS $__ FROM table_name_71 WHERE score = "207 (-9)" AND tournament = "gte northwest classic"
sql_create_context
CREATE TABLE table_name_17 ( csa_4_16_09 VARCHAR, opinionway_4_17_09 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the csa 4/16/09 for opinionway being 4/17/09 of 12%
SELECT csa_4_16_09 FROM table_name_17 WHERE opinionway_4_17_09 = "12%"
sql_create_context
CREATE TABLE table_18095719_2 ( winning_team VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winning team on the circuit Zolder?
SELECT winning_team FROM table_18095719_2 WHERE circuit = "Zolder"
sql_create_context
CREATE TABLE table_name_74 ( singapore_gross VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Singapore Gross with a Title that is 2000?
SELECT singapore_gross FROM table_name_74 WHERE title = "2000"
sql_create_context
CREATE TABLE table_25342713_5 ( blocks INTEGER, steals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the Steals are 20, what are the blocks?
SELECT MAX(blocks) FROM table_25342713_5 WHERE steals = 20
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-695...
eicu
CREATE TABLE WINE ( Name VARCHAR, YEAR INTEGER, Winery VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of wines whose production year are before the year of all wines by Brander winery?
SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = "Brander")
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varcha...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
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 jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '78981064' AND jybgb.BGRQ BETWEEN '2018-02-11' AND '2018-06-08' UNI...
css
CREATE TABLE zyb ( 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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '苗星河' AND t_kc22.STA_DATE BETWEEN '2000-07-11' AND '2017-06-02' AND qtb.MED_SER_ORG_NO = '0680435' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLIN...
css
CREATE TABLE table_name_31 ( nation VARCHAR, gold VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nation that had more than 1 gold medal and a total of 62 medals?
SELECT nation FROM table_name_31 WHERE gold > 1 AND total = 62
sql_create_context