instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_48641 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Saint-Basile has what status?
SELECT "Status" FROM table_48641 WHERE "Official Name" = 'saint-basile'
wikisql
CREATE TABLE table_35651 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What games have more than 1 draw?
SELECT AVG("Games") FROM table_35651 WHERE "Drawn" > '1'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id n...
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16329)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temp...
mimic_iii
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id n...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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_i...
mimic_iii
CREATE TABLE table_204_47 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the date of the la...
SELECT "date" FROM table_204_47 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_10751 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds have a chassis of thl2?
SELECT "Rounds" FROM table_10751 WHERE "Chassis" = 'thl2'
wikisql
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "2080"
mimicsql_data
CREATE TABLE table_23292220_13 ( jons_team VARCHAR, seans_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was on Jon's team when Sean's team had Matthew Crosby and Kimberly Wyatt?
SELECT jons_team FROM table_23292220_13 WHERE seans_team = "Matthew Crosby and Kimberly Wyatt"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
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(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_31126 ( "#" real, "Name" text, "Position" text, "Height" text, "Weight" real, "Year" text, "Former school" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the former school of the player from De...
SELECT "Former school" FROM table_31126 WHERE "Hometown" = 'Detroit, MI'
wikisql
CREATE TABLE table_2668264_8 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district(s) did henry clay represent?
SELECT district FROM table_2668264_8 WHERE incumbent = "Henry Clay"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid tex...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anxiety') AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.di...
eicu
CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE team ( team_id number, name text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_numb...
SELECT official_native_language FROM country WHERE official_native_language LIKE "%English%"
spider
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7841691' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-04-23' AND '2010-08-18' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 2085.24) AS T
css
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE team ( Team_id int, ...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position
nvbench
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) 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 re...
SELECT Name, Height FROM people ORDER BY Height DESC
nvbench
CREATE TABLE table_75196 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of points for players with less than 2 touchdowns and 0 extra po...
SELECT MAX("Points") FROM table_75196 WHERE "Extra points" = '0' AND "Touchdowns" < '2'
wikisql
CREATE TABLE table_27620 ( "Letters" text, "Organization" text, "Nickname" text, "Founding Date" text, "Founding University" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many letters were given to the organization with a found...
SELECT COUNT("Letters") FROM table_27620 WHERE "Founding Date" = '1997-12-12'
wikisql
CREATE TABLE table_27969432_2 ( title VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the episode written by alison cross?
SELECT title FROM table_27969432_2 WHERE written_by = "Alison Cross"
sql_create_context
CREATE TABLE table_67810 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the engine with entrant of larrousse f1
SELECT "Engine" FROM table_67810 WHERE "Entrant" = 'larrousse f1'
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 COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '2152272' AND zyjybgb.BGRQ BETWEEN '2008-07-27' AND '2012-07-13' GROUP BY zyjybgb.KSBM HAVING COUNT(*) < 2 UNION SELECT mzjybgb.KSBM FROM mzjzjl...
css
CREATE TABLE table_11803648_20 ( nationality VARCHAR, club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nationality when the club team is Peterborough Petes (OHL)?
SELECT nationality FROM table_11803648_20 WHERE club_team = "Peterborough Petes (OHL)"
sql_create_context
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit 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.short_title = "Adv eff antifung antbiot" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId ...
SELECT Posts.*, Question.Tags FROM Posts INNER JOIN Posts AS Question ON Question.Id = Posts.ParentId WHERE Posts.PostTypeId = 2 AND NOT Posts.Body LIKE '%http%' AND NOT Posts.Body LIKE '%blockquote%'
sede
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 COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJ...
css
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT JZKSBM, JZKSMC FROM mzjzjlb WHERE JZLSH = '06908223301'
css
CREATE TABLE table_77894 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest crowd with Away team score o...
SELECT MAX("Crowd") FROM table_77894 WHERE "Away team score" = '13.16 (94)'
wikisql
CREATE TABLE table_204_866 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last name on the list ?
SELECT "name" FROM table_204_866 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_203_875 ( id number, "#" number, "name" text, "birth and death" text, "office started" text, "office ended" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who served longer , helgi thordersen or geir vidalin ?
SELECT "name" FROM table_203_875 WHERE "name" IN ('helgi thordersen', 'geir vidalin') ORDER BY "office ended" - "office started" DESC LIMIT 1
squall
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Grape, Winery ORDER BY Winery DESC
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'analg...
eicu
CREATE TABLE table_2585 ( "Position" text, "Horse" text, "Jockey" text, "Age" real, "Handicap (st-lb)" text, "SP" text, "Distance" text, "Prize money" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the distance when the handicap...
SELECT "Distance" FROM table_2585 WHERE "Handicap (st-lb)" = '11-2'
wikisql
CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE bridge ( architect_id int, id int, name text, location text, length_meters real, length_feet real ) CREATE TABLE mill ( architect_id int, id int, location text, name text, ...
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.name DESC
nvbench
CREATE TABLE table_32418 ( "Year" real, "Location" text, "Fans' Choice Award" text, "Male Artist of the Year" text, "Female Artist of the Year" text, "Group or Duo of the Year" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Carolyn Daw...
SELECT "Location" FROM table_32418 WHERE "Female Artist of the Year" = 'carolyn dawn johnson' AND "Male Artist of the Year" = 'paul brandt'
wikisql
CREATE TABLE table_5461 ( "s Car plate (starting 1937)" text, "Voivodeship or city" text, "Capital" text, "Area (1930) in 1,000skm 2" text, "Population (1931) in 1,000s" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Population (1931) in 1,000s of 2...
SELECT "s Car plate (starting 1937)" FROM table_5461 WHERE "Population (1931) in 1,000s" = '2,460.9'
wikisql
CREATE TABLE table_56581 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How big is the Venue of Brunswick Street Oval?
SELECT SUM("Crowd") FROM table_56581 WHERE "Venue" = 'brunswick street oval'
wikisql
CREATE TABLE table_name_99 ( tyre VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tyre with a 56 chassis?
SELECT tyre FROM table_name_99 WHERE chassis = "56"
sql_create_context
CREATE TABLE table_17910 ( "Year" real, "Delaware" text, "Maryland" text, "New Jersey" text, "New York" text, "Pennsylvania" text, "Washington, D.C." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played in Maryland the same year that Ne...
SELECT "Maryland" FROM table_17910 WHERE "New Jersey" = 'Somerset Hills LL Bernardsville'
wikisql
CREATE TABLE table_204_41 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which swimmer was previous to brazil 's contestant ?
SELECT "name" FROM table_204_41 WHERE id = (SELECT id FROM table_204_41 WHERE "nationality" = 'brazil') - 1
squall
CREATE TABLE table_21934 ( "Name or route" text, "type" text, "elevation groundstation" real, "elevation mountainstation" real, "slope length" real, "capacity in persons/hour" real, "construction year(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "Name or route" FROM table_21934 WHERE "slope length" = '336'
wikisql
CREATE TABLE table_30699 ( "Constellation" text, "IAU abbreviation" text, "Other abbreviation" text, "Genitive" text, "Family" text, "Origin" text, "Meaning" text, "Brightest star" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT "Origin" FROM table_30699 WHERE "Other abbreviation" = 'Tele'
wikisql
CREATE TABLE table_66300 ( "School" text, "Location" text, "Mascot" text, "Size" real, "IHSAA Class" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Mascot has a County of 69 ripley, and an IHSAA Class of aa, and a School of ...
SELECT "Mascot" FROM table_66300 WHERE "County" = '69 ripley' AND "IHSAA Class" = 'aa' AND "School" = 'south ripley'
wikisql
CREATE TABLE table_41366 ( "Year" real, "Venue" text, "Location" text, "Winners" text, "Runners-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location when Canada was the runner-up and Australia was the winner?
SELECT "Location" FROM table_41366 WHERE "Runners-up" = 'canada' AND "Winners" = 'australia'
wikisql
CREATE TABLE table_name_90 ( rank INTEGER, silver VARCHAR, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank has a Gold larger than 1, and a Bronze of 4, and a Silver smaller than 1?
SELECT MAX(rank) FROM table_name_90 WHERE gold > 1 AND bronze = 4 AND silver < 1
sql_create_context
CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, ...
SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id)
spider
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) ...
SELECT Season, COUNT(Season) FROM game GROUP BY Season ORDER BY Season
nvbench
CREATE TABLE table_9345 ( "Event" text, "Skip" text, "Lead" text, "Alternate" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for the 2007 WCC when Sun Yue was the alternate?
SELECT "Result" FROM table_9345 WHERE "Alternate" = 'sun yue' AND "Event" = '2007 wcc'
wikisql
CREATE TABLE table_name_34 ( laps INTEGER, grid VARCHAR, manufacturer VARCHAR, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps by Jorge Lorenzo on the Aprilia with a grid bigger than 1?
SELECT SUM(laps) FROM table_name_34 WHERE manufacturer = "aprilia" AND rider = "jorge lorenzo" AND grid > 1
sql_create_context
CREATE TABLE table_13619053_4 ( score VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score against san antonio?
SELECT score FROM table_13619053_4 WHERE team = "San Antonio"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patie...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'drug withdrawal syndrome - alcohol' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIM...
eicu
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 demographic.marital_status, demographic.admission_location FROM demographic WHERE demographic.subject_id = "15898"
mimicsql_data
CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE student_course_attendance ( student_id number, course_id number, date_of_attendance time ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date time, asessm...
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id
spider
CREATE TABLE table_4396 ( "Heat Rank" real, "Lane" real, "Swimmer" text, "Country" text, "Time" real, "Overall Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the highest time for spain and lane larger than 8
SELECT MAX("Time") FROM table_4396 WHERE "Country" = 'spain' AND "Lane" > '8'
wikisql
CREATE TABLE table_33131 ( "Team" text, "Manager" text, "Captain" text, "Kit maker" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who sponsors Middlesbrough?
SELECT "Shirt sponsor" FROM table_33131 WHERE "Team" = 'middlesbrough'
wikisql
CREATE TABLE table_13110459_2 ( rating VARCHAR, viewers__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the rating with viewers (m) being 2.89
SELECT rating FROM table_13110459_2 WHERE viewers__m_ = "2.89"
sql_create_context
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 prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17505) AND prescriptions.drug = 'bisacodyl' AND STRFTIME('%y-%m', prescriptions.startdate) = '2101-03'
mimic_iii
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 zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '32751875737' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '32751875737'
css
CREATE TABLE table_13618584_2 ( district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many election results are there from the 19th district?
SELECT COUNT(2007 AS _result) FROM table_13618584_2 WHERE district = "19th"
sql_create_context
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
SELECT lab FROM resultsdata15 GROUP BY lab ORDER BY COUNT(*) DESC LIMIT 5
pesticide
CREATE TABLE table_8028 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the season when the third is shawn rojeski?
SELECT "Season" FROM table_8028 WHERE "Third" = 'shawn rojeski'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586')) AND intakeoutput.cellpath LIKE '%intake%'...
eicu
CREATE TABLE table_23390604_1 ( total_votes VARCHAR, spoiled_ballots VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the total scores for the election which had 3072 invalid votes
SELECT total_votes FROM table_23390604_1 WHERE spoiled_ballots = 3072
sql_create_context
CREATE TABLE table_name_42 ( money___$__ VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the money value that went along with the score of 68-67-69-76=280?
SELECT money___$__ FROM table_name_42 WHERE score = 68 - 67 - 69 - 76 = 280
sql_create_context
CREATE TABLE table_name_84 ( round VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds did Brett go for the Strikeforce: Shamrock vs. Diaz match?
SELECT round FROM table_name_84 WHERE event = "strikeforce: shamrock vs. diaz"
sql_create_context
CREATE TABLE museums ( museum_id number, museum_details text ) CREATE TABLE tourist_attraction_features ( tourist_attraction_id number, feature_id number ) CREATE TABLE ref_attraction_types ( attraction_type_code text, attraction_type_description text ) CREATE TABLE street_markets ( marke...
SELECT price_range FROM hotels WHERE star_rating_code = "5"
spider
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '012-31752...
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_32323 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team when the home team scored ...
SELECT "Away team" FROM table_32323 WHERE "Home team score" = '16.16 (112)'
wikisql
CREATE TABLE table_17103729_7 ( location_attendance VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a score of 68-85, what is the location and attendance?
SELECT location_attendance FROM table_17103729_7 WHERE score = "68-85"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCAT...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_name_70 ( population INTEGER, per_capita_income VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Per capita income is $29,194, what is the average population?
SELECT AVG(population) FROM table_name_70 WHERE per_capita_income = "$29,194"
sql_create_context
CREATE TABLE table_19158 ( "Year" real, "1st District" text, "2nd District" text, "3rd District" text, "4th District" text, "5th District" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in the 4th district in 1924?
SELECT "4th District" FROM table_19158 WHERE "Year" = '1924'
wikisql
CREATE TABLE table_22945 ( "Year" real, "Qatari Male" real, "Qatari Female" real, "Total Qatari" real, "Non Qatari Male" real, "Non Qatari Female" real, "Total Non Qatar" real, "Total Male" real, "Total Female" real, "Grand Total" real ) -- Using valid SQLite, answer the follow...
SELECT COUNT("Qatari Female") FROM table_22945 WHERE "Qatari Male" = '97'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JCFF FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH...
css
CREATE TABLE table_42429 ( "Season" text, "Tier" real, "League" text, "Postseason" text, "European competitions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Season when league shows bundesliga, and a European competition of played kor...
SELECT "Season" FROM table_42429 WHERE "League" = 'bundesliga' AND "European competitions" = 'played korac cup'
wikisql
CREATE TABLE table_204_503 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times did she participate in the heptathalon ?
SELECT COUNT(*) FROM table_204_503 WHERE "notes" = 'heptathlon'
squall
CREATE TABLE table_name_7 ( bible_gothic VARCHAR, english VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Bible Gothic for the word hand?
SELECT bible_gothic FROM table_name_7 WHERE english = "hand"
sql_create_context
CREATE TABLE procedures ( 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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND lab.itemid = "51363"
mimicsql_data
CREATE TABLE table_203_190 ( id number, "name" text, "type" text, "circle" text, "bench" text, "formed" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the first state formed ?
SELECT "name" FROM table_203_190 ORDER BY "formed" LIMIT 1
squall
CREATE TABLE table_1341707_15 ( party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What party did the incumbent from the Illinois 12 district belong to?
SELECT party FROM table_1341707_15 WHERE district = "Illinois 12"
sql_create_context
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 procedures.icd9_code, procedures.long_title FROM procedures WHERE procedures.subject_id = "26746"
mimicsql_data
CREATE TABLE table_200_14 ( id number, "act" text, "year signed" number, "# albums released under bad boy" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was cassie signed to bad boy ?
SELECT "year signed" FROM table_200_14 WHERE "act" = 'cassie'
squall
CREATE TABLE table_name_45 ( rank INTEGER, name VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Rank, when Name is Will Solomon, and when Games is greater than 21?
SELECT SUM(rank) FROM table_name_45 WHERE name = "will solomon" AND games > 21
sql_create_context
CREATE TABLE table_33196 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team has a venue of Arden Street Oval...
SELECT "Home team" FROM table_33196 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medication...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho...
eicu
CREATE TABLE table_name_54 ( constructor VARCHAR, rounds VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the constructor for divina galica rounds of 1-2
SELECT constructor FROM table_name_54 WHERE rounds = "1-2" AND driver = "divina galica"
sql_create_context
CREATE TABLE table_17940 ( "Year" real, "Starts" real, "Wins (Majors)" text, "2nd" real, "3rd" real, "Earnings ($)" real, "Money list rank" text, "Scoring average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of star...
SELECT COUNT("Starts") FROM table_17940 WHERE "Year" = '1987'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_6704 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Partner had an Opponent of darija jurak carmen klaschka?
SELECT "Partner" FROM table_6704 WHERE "Opponent" = 'darija jurak carmen klaschka'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "COLANGITIS"
mimicsql_data
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text,...
SELECT * FROM CloseReasonTypes
sede
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_22999 ( "Pos" real, "Member Association" text, "Points (total 500)" real, "Clubs" text, "Group stage" real, "Play-off" real, "AFC Cup" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many clubs are there in the Korea Re...
SELECT "Clubs" FROM table_22999 WHERE "Member Association" = 'Korea Republic'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT Id, Title, AnswerCount, Score / (AnswerCount + 1.0) AS Ratio FROM Posts ORDER BY Ratio DESC LIMIT 100
sede
CREATE TABLE table_name_78 ( date VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Scott Hoch (2) win?
SELECT date FROM table_name_78 WHERE winner = "scott hoch (2)"
sql_create_context
CREATE TABLE table_21649285_2 ( no VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tournaments were at sime darby lpga malaysia?
SELECT COUNT(no) FROM table_21649285_2 WHERE tournament = "Sime Darby LPGA Malaysia"
sql_create_context
CREATE TABLE table_name_62 ( league_cup_goals INTEGER, name VARCHAR, fa_cup_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most league cup goals for David Beresford having less than 0 FA Cup Goals?
SELECT MAX(league_cup_goals) FROM table_name_62 WHERE name = "david beresford" AND fa_cup_goals < 0
sql_create_context
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 SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '3061264' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-05-05' AND '2012-09-12'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '62692281748' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '62692281748'
css