instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_47378 ( "Rank" real, "Mountain Peak" text, "Region" text, "Mountain Range" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the region when the location is 49.7462 n 117.1419 w?
SELECT "Region" FROM table_47378 WHERE "Location" = '49.7462°n 117.1419°w'
wikisql
CREATE TABLE table_25563779_4 ( champion VARCHAR, third VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the third name is Bruno Bonifacio, what is the champion?
SELECT champion FROM table_25563779_4 WHERE third = "Bruno Bonifacio"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, Review...
SELECT Location, COUNT(*) FROM Users WHERE Location LIKE '%portugal%' OR Location LIKE '%lisbon%' OR Location LIKE '%lisboa%' GROUP BY Location
sede
CREATE TABLE table_32900 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the Browns' game that over 36,796 attended?
SELECT "Date" FROM table_32900 WHERE "Attendance" > '36,796'
wikisql
CREATE TABLE table_31641 ( "Census year" real, "Total" real, "Macedonians" real, "Albanians" real, "Turks" real, "Roma" real, "Vlachs" real, "Serbs" real, "Bosniaks" real, "Other" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Te...
SELECT MAX("Bosniaks") FROM table_31641 WHERE "Census year" > '2002'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT demographic.dob, demographic.insurance FROM demographic WHERE demographic.name = "Lawrence Wibbens"
mimicsql_data
CREATE TABLE table_name_72 ( top_5 INTEGER, tournament VARCHAR, cuts_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Top-5, when Tournament is U.S. Open, and when Cuts Made is greater than 10?
SELECT AVG(top_5) FROM table_name_72 WHERE tournament = "u.s. open" AND cuts_made > 10
sql_create_context
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For ea...
SELECT T1.name, MAX(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name
spider
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 All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID)
nvbench
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'CO'
atis
CREATE TABLE table_11058 ( "Year" real, "Competition" text, "Date" text, "Surface" text, "Location" text, "Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which competition has a Year of 2008, a Surface of carpet, and a ...
SELECT "Competition" FROM table_11058 WHERE "Year" = '2008' AND "Surface" = 'carpet' AND "Date" = '31 jan'
wikisql
CREATE TABLE table_name_18 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the smallest crowd that Melbourne played for at home?
SELECT MIN(crowd) FROM table_name_18 WHERE home_team = "melbourne"
sql_create_context
CREATE TABLE table_68979 ( ".308 Winchester cartridge type" text, "100 m group (mm)" text, "100 m group ( MOA )" text, "300 m group (mm)" text, "300 m group ( MOA )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the .308 Winchester cartrid...
SELECT ".308 Winchester cartridge type" FROM table_68979 WHERE "100 m group (mm)" = '14' AND "300 m group ( MOA )" = '0.63'
wikisql
CREATE TABLE table_1745843_7 ( part_4 VARCHAR, part_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the part 4 for the verb whose part 3 is borgen?
SELECT part_4 FROM table_1745843_7 WHERE part_3 = "borgen"
sql_create_context
CREATE TABLE table_name_18 ( width INTEGER, frame_size VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest width for a frame size of 5k and a height shorter than 2700?
SELECT MIN(width) FROM table_name_18 WHERE frame_size = "5k" AND height < 2700
sql_create_context
CREATE TABLE table_63918 ( "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 Total number of medals for the Nation with 7 or less Bronze medals and 1 Silver ...
SELECT MIN("Total") FROM table_63918 WHERE "Bronze" < '7' AND "Silver" = '1' AND "Rank" > '9'
wikisql
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 Height, Weight FROM people GROUP BY Sex
nvbench
CREATE TABLE table_65441 ( "Position" text, "Drivers" text, "Entrant" text, "Class" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For what class is the laps 66?
SELECT "Class" FROM table_65441 WHERE "Laps" = '66'
wikisql
CREATE TABLE manufacturers ( code VARCHAR, name VARCHAR ) CREATE TABLE products ( name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find number of products which Sony does not make.
SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony')
sql_create_context
CREATE TABLE table_203_506 ( id number, "opponent" text, "played" number, "won" number, "lost" number, "drawn" number, "% won overall" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name two countries that the england women 's rfu have playe...
SELECT "opponent" FROM table_203_506 WHERE "played" >= 30
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeo...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131')) AND lab.labname = 'potassium' AND DATETIME(lab.labresulttime, 'start of mont...
eicu
CREATE TABLE table_73783 ( "Song" text, "Singer" text, "Co-Singers" text, "Music Director" text, "Lyricist" text, "Co-Stars" text, "Movie/Album" text, "Year" real, "Additional Info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT "Movie/Album" FROM table_73783 WHERE "Co-Stars" = 'Bela Bose'
wikisql
CREATE TABLE table_36730 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Incumbent that has a District of ohio 13 in Democratic Party?
SELECT "Incumbent" FROM table_36730 WHERE "District" = 'ohio 13'
wikisql
CREATE TABLE table_69011 ( "Year" text, "Venue" text, "Winners" text, "Runner-up" text, "3rd place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for 3rd place when Runner-up shows as runner-up?
SELECT "3rd place" FROM table_69011 WHERE "Runner-up" = 'runner-up'
wikisql
CREATE TABLE table_name_96 ( fifth VARCHAR, sixth VARCHAR, second VARCHAR, first VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team placed fifth during the season where Victoria placed second, Tasmania placed first, and South Australia placed s...
SELECT fifth FROM table_name_96 WHERE second = "victoria" AND first = "tasmania" AND sixth = "south australia"
sql_create_context
CREATE TABLE table_18620 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the first elected with candidates being joe starnes (d) 100.0% ge...
SELECT "First elected" FROM table_18620 WHERE "Candidates" = 'Joe Starnes (D) 100.0% George Bogus ( W/I ) 0.003%'
wikisql
CREATE TABLE table_67936 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 2009 result associated with a...
SELECT "2009" FROM table_67936 WHERE "2012" = '1r' AND "2007" = '2r'
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2335631' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-06-24' AND '2021-07-31' AND gwyjzb.INSURED_STS = '未就业' AND gwyjzb.MED_AMOUT >= 7979.89 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2335631' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2011-06-24' AND '...
css
CREATE TABLE table_name_24 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What away team played at Kardinia Park?
SELECT away_team FROM table_name_24 WHERE venue = "kardinia park"
sql_create_context
CREATE TABLE table_1602858_1 ( margin_of_victory VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the margin of victory with the winning score '63-68-68-68=267'?
SELECT margin_of_victory FROM table_1602858_1 WHERE winning_score = 63 - 68 - 68 - 68 = 267
sql_create_context
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.id DESC
nvbench
CREATE TABLE table_54857 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the college that paul davis went to
SELECT "College" FROM table_54857 WHERE "Player" = 'paul davis'
wikisql
CREATE TABLE table_76671 ( "Driver" text, "Team" text, "Race 1" text, "Race 2" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team received 4 in race 1?
SELECT "Team" FROM table_76671 WHERE "Race 1" = '4'
wikisql
CREATE TABLE table_44781 ( "Year" real, "Month" text, "Single" text, "Album" text, "Record label" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the earliest year listed for 'where are you going to my love' from the album united we stand?
SELECT MIN("Year") FROM table_44781 WHERE "Album" = 'united we stand' AND "Single" = 'where are you going to my love'
wikisql
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEG...
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code
nvbench
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 program_requirement ( program_id int, category varchar, min_credit int, additio...
SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'COMM' AND cou...
advising
CREATE TABLE table_name_16 ( member VARCHAR, electorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which member has Cook as the electorate?
SELECT member FROM table_name_16 WHERE electorate = "cook"
sql_create_context
CREATE TABLE table_name_4 ( soap_opera VARCHAR, duration VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the soap opera when the duration is 18 years and the character is miley byrne?
SELECT soap_opera FROM table_name_4 WHERE duration = "18 years" AND character = "miley byrne"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT zyjzjlb.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '94773706571'
css
CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ...
SELECT t_fed_rev FROM finrev_fed_17 WHERE school_district LIKE "%Pecatonia Area%"
studentmathscore
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_12496 ( "Lexton Plains" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which against has 14 losses?
SELECT "Against" FROM table_12496 WHERE "Losses" = '14'
wikisql
CREATE TABLE table_7184 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is HDTV, when Content is Cinema, when Package/Option is Sky C...
SELECT "HDTV" FROM table_7184 WHERE "Content" = 'cinema' AND "Package/Option" = 'sky cinema + sky hd' AND "Television service" = 'sky cinema passion hd'
wikisql
CREATE TABLE table_59052 ( "Place" text, "Player" text, "Country" text, "Score" real, "To Par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a To Par of 1?
SELECT MIN("Score") FROM table_59052 WHERE "To Par" = '–1'
wikisql
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 allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120551'))
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '015-100195' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) = '2105'
eicu
CREATE TABLE table_name_20 ( fumble_force VARCHAR, solo VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many forced fumbles for jim laney with under 2 solo tackles?
SELECT COUNT(fumble_force) FROM table_name_20 WHERE solo < 2 AND player = "jim laney"
sql_create_context
CREATE TABLE table_204_13 ( id number, "finished" text, "post" number, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the top horse 's trainer...
SELECT "trainer" FROM table_204_13 ORDER BY "finished" LIMIT 1
squall
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has friends that are ol...
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) ORDER BY T1.name
nvbench
CREATE TABLE table_name_98 ( nation VARCHAR, rank VARCHAR, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nation when gold is 0, bronze is more than 0 and rank is 16?
SELECT nation FROM table_name_98 WHERE gold = 0 AND bronze > 0 AND rank = "16"
sql_create_context
CREATE TABLE table_name_42 ( location VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location of the fight when Sara McMann's record was 1-0?
SELECT location FROM table_name_42 WHERE record = "1-0"
sql_create_context
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 medication ( medi...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE table_35272 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 9:00 show that will be aired on the station that ai...
SELECT "9:00" FROM table_35272 WHERE "8:00" = 'dawson''s creek'
wikisql
CREATE TABLE table_29106 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote 'Monica's bad day'?
SELECT "Writer" FROM table_29106 WHERE "Title" = 'Monica''s Bad Day'
wikisql
CREATE TABLE table_203_250 ( id number, "name" text, "type" text, "r.a. (j2000)" text, "dec. (j2000)" text, "redshift (km/s)" text, "apparent magnitude" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what number of irregular types are ther...
SELECT COUNT(*) FROM table_203_250 WHERE "type" = 'irregular'
squall
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 "suggested_edit_link" FROM SuggestedEdits WHERE OwnerUserId = '##UserId##'
sede
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 cost ( costid number, ...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-196241') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) -- U...
SELECT Country, COUNT(Country) FROM member GROUP BY Country
nvbench
CREATE TABLE table_train_57 ( "id" int, "bleeding" int, "in_another_study" bool, "hiv_infection" bool, "hepatitis_c_infection" bool, "receiving_vasopressor" bool, "hypotension" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT * FROM table_train_57 WHERE hypotension = 1 AND receiving_vasopressor = 1
criteria2sql
CREATE TABLE table_26448179_4 ( title VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode with production code 305?
SELECT title FROM table_26448179_4 WHERE production_code = 305
sql_create_context
CREATE TABLE organizations ( organization_id number, date_formed time, organization_name text, uk_vat_number text ) CREATE TABLE organization_contact_individuals ( individual_id number, organization_id number, date_contact_from time, date_contact_to time ) CREATE TABLE addresses ( ...
SELECT payment_method_code, party_phone FROM parties WHERE party_email = "enrico09@example.com"
spider
CREATE TABLE table_58211 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NBA draft result of the player from Dunbar High School?
SELECT "NBA Draft" FROM table_58211 WHERE "School" = 'dunbar high school'
wikisql
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.JZLSH = '71275819532' GROUP BY jybgb.BGRGH HAVING COUNT(*) > 20
css
CREATE TABLE table_name_34 ( player VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player belongs to Northwestern College?
SELECT player FROM table_name_34 WHERE college = "northwestern"
sql_create_context
CREATE TABLE table_204_881 ( id number, "round" number, "date" text, "score" text, "opponent" text, "opponent's score" text, "result" text, "venue" text, "attendance" number, "best on ground" text, "team" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "opponent" FROM table_204_881 WHERE id = (SELECT id FROM table_204_881 WHERE "opponent" = 'hawthorn') + 1
squall
CREATE TABLE table_16891 ( "Name of ground" text, "Location" text, "First-class span" text, "Worcs f-c matches" real, "List A span" text, "Worcs LA matches" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- There were 68 worcs f-c matches played on...
SELECT "Worcs f-c matches" FROM table_16891 WHERE "Name of ground" = 'Chester Road North Ground'
wikisql
CREATE TABLE table_204_558 ( id number, "name" text, "location" text, "city" text, "listing date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of locations in the city of algonac ?
SELECT COUNT("location") FROM table_204_558 WHERE "city" = 'algonac'
squall
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 COUNT(gwyjzb.MED_SER_ORG_NO) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '方光华' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-07-13' AND '2021-05-12' UNION SELECT COUNT(fgwyjzb.MED_SER_ORG_NO) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '方光华' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2007-07-13' AND '2021-05-12'
css
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare ( fare...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.arrival_time <= 1300 AND flight.departure_time <= 1100) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = ...
atis
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
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 '%William Gehring%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
CREATE TABLE table_4223 ( "Quartier" text, "% 0-19 years" text, "% 20-39 years" text, "% 40-59 years" text, "% 60-74 years" text, "% 75 years and +" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many o-19% are where the quartier is in saint...
SELECT "% 0-19 years" FROM table_4223 WHERE "Quartier" = 'Saint-Loup'
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 txmzjzjlb.MZZYZDZZBM, txmzjzjlb.MZZYZDZZMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '65477459453' UNION SELECT ftxmzjzjlb.MZZYZDZZBM, ftxmzjzjlb.MZZYZDZZMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '65477459453'
css
CREATE TABLE table_204_500 ( id number, "year" number, "title" text, "peak chart positions\nus country" number, "peak chart positions\nus" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many singles did kitty wells release be...
SELECT COUNT("title") FROM table_204_500 WHERE "year" < 1952
squall
CREATE TABLE table_name_74 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is Jeff Brown?
SELECT position FROM table_name_74 WHERE player = "jeff brown"
sql_create_context
CREATE TABLE table_name_54 ( goals VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the goals for score of 38-28
SELECT goals FROM table_name_54 WHERE score = "38-28"
sql_create_context
CREATE TABLE table_204_48 ( id number, "date" text, "race name" text, "location" text, "uci rating" text, "winner" text, "team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who won more races , the usa or canada ?
SELECT "winner" FROM table_204_48 WHERE "winner" IN ('usa', 'canada') GROUP BY "winner" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_26758 ( "Player" text, "Group Legs won" real, "Play-Off Legs won" real, "Winners Group Legs won" real, "Winners Play-Off Legs won" real, "Final position money won*" text, "Total money won" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT MAX("Winners Group Legs won") FROM table_26758 WHERE "Total money won" = '£21,850'
wikisql
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 AVG(Reputation) AS "average_reputation", COUNT(Id) AS "total_users" FROM Users WHERE LOWER(Location) LIKE '%manchester, united kingdom' AND Reputation > 1
sede
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_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '陈雅惠' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_12 ( gold VARCHAR, total VARCHAR, silver VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the number of gold for albania with a silver of 1 and total less than 1
SELECT COUNT(gold) FROM table_name_12 WHERE silver = 1 AND nation = "albania" AND total < 1
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2094" AND diagnoses.short_title = "Anemia in chr kidney dis"
mimicsql_data
CREATE TABLE table_55082 ( "Season" text, "Club" text, "National League" text, "National Cup" text, "European Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the club that has the turkish basketball cup and fiba eurochallenge (3rd tier)?...
SELECT "Club" FROM table_55082 WHERE "National Cup" = 'turkish basketball cup' AND "European Cup" = 'fiba eurochallenge (3rd tier)'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '8588386' AND RYDJSJ BETWEEN '2002-01-28' AND '2018-05-06' AND WDBZ > 0
css
CREATE TABLE table_name_38 ( population INTEGER, name_of_city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population of Chimbote?
SELECT SUM(population) FROM table_name_38 WHERE name_of_city = "chimbote"
sql_create_context
CREATE TABLE table_name_51 ( winning_score VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score in 1980?
SELECT winning_score FROM table_name_51 WHERE year = 1980
sql_create_context
CREATE TABLE premises ( premises_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show each premise type and the number of premises in that type.
SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name te...
SELECT COUNT(*) FROM Posts WHERE LastEditorUserId = 635608 AND OwnerUserId != 635608 AND LastEditDate > '2013-05-03 12:00:00 AM'
sede
CREATE TABLE table_14062 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of pos...
SELECT COUNT("Position") FROM table_14062 WHERE "Losses" = '1' AND "Conceded" > '9'
wikisql
CREATE TABLE table_3594 ( "Team" text, "Manager" text, "Chairman" text, "Team captain" text, "Kit maker" text, "Sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the chairman of Mark Robins team?
SELECT "Chairman" FROM table_3594 WHERE "Manager" = 'Mark Robins'
wikisql
CREATE TABLE table_62794 ( "Name" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" real, "Land area (km\u00b2)" real, "Population density (per km\u00b2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Land area (km ) ...
SELECT MAX("Land area (km\u00b2)") FROM table_62794 WHERE "Population density (per km\u00b2)" > '112.6' AND "Population (2006)" > '785' AND "Name" = 'pinehouse'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_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 ti...
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissio...
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND treatment.treatmentname = 'surgery consultation' AND STRFTIME('...
eicu
CREATE TABLE table_name_14 ( record VARCHAR, location VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record has montreal, qc as the location, with boston bruins as the visitor?
SELECT record FROM table_name_14 WHERE location = "montreal, qc" AND visitor = "boston bruins"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
WITH Interesting(UserId) AS (SELECT 342852 UNION ALL SELECT 57611) SELECT PostId = p.Id, QuestionId = COALESCE(a.Id, p.Id), AnswerId = CASE WHEN p.PostTypeId = 2 THEN p.Id ELSE NULL END FROM Posts AS p LEFT JOIN Posts AS a ON p.PostTypeId = 2 AND p.ParentId = a.Id WHERE EXISTS(SELECT * FROM Interesting AS i WHERE p.Own...
sede
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 WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.dod_year <= "2174.0"
mimicsql_data
CREATE TABLE table_21020 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" ...
SELECT "Memory" FROM table_21020 WHERE "Model number" = 'Atom E640T'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM 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, J...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE Video_Games ( Ga...
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*)
nvbench
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 WHERE diagnoses.long_title = "Anemia in chronic kidney disease"
mimicsql_data