instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_64 ( chassis VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the chassis after 1991?
SELECT chassis FROM table_name_64 WHERE year > 1991
sql_create_context
CREATE TABLE table_36129 ( "Games" real, "Drawn" real, "Lost" real, "Goal difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of games associated with 6 points and under 2 losses?
SELECT AVG("Games") FROM table_36129 WHERE "Points" = '6' AND "Lost" < '2'
wikisql
CREATE TABLE table_name_17 ( status VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What status is shown for Cadeby?
SELECT status FROM table_name_17 WHERE name = "cadeby"
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'thoracoscopic pleural bx') AND DATETIME(procedures_i...
mimic_iii
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_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '严秀逸' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3743.87)
css
CREATE TABLE table_name_40 ( split_off___continuation_of VARCHAR, church_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Pure Church of Christ's Split off/ Continuation?
SELECT split_off___continuation_of FROM table_name_40 WHERE church_name = "pure church of christ"
sql_create_context
CREATE TABLE table_203_325 ( id number, "year" number, "title" text, "(english)" text, "ifpi israel certification" text, "label" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the name of the title previous to david & shlomo ?
SELECT "title" FROM table_203_325 WHERE "year" < (SELECT "year" FROM table_203_325 WHERE "title" = 'david & shlomo') ORDER BY "year" DESC LIMIT 1
squall
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 Team, COUNT(Team) FROM Elimination GROUP BY Team ORDER BY COUNT(Team) DESC
nvbench
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, ...
SELECT COUNT(Id) FROM Posts WHERE LOWER(Body) LIKE '% 9% byte%'
sede
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. -- how many awards did kang ji hwan win before 2010 ?
SELECT COUNT("award") FROM table_204_838 WHERE "result" = 'won' AND "year" < 2010
squall
CREATE TABLE table_65173 ( "Eliminated" text, "Tag Team" text, "Entered" real, "Eliminated by" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name Tag Team with a Eliminated of 5?
SELECT "Tag Team" FROM table_65173 WHERE "Eliminated" = '5'
wikisql
CREATE TABLE table_78015 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the region for december 7, 2004
SELECT "Region" FROM table_78015 WHERE "Date" = 'december 7, 2004'
wikisql
CREATE TABLE table_3306 ( "Circuit" text, "Location" text, "Date" text, "Series" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location when the winning driver was Nathana l Berthon?
SELECT "Location" FROM table_3306 WHERE "Winning driver" = 'Nathanaël Berthon'
wikisql
CREATE TABLE table_23925 ( "Name" text, "#" real, "Height" text, "Weight" real, "Position" text, "Year" text, "Home Town" text, "High School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the high school for the player who's hom...
SELECT "High School" FROM table_23925 WHERE "Home Town" = 'Blue Island, IL'
wikisql
CREATE TABLE country ( country_id number, name text, population number, area number, languages text ) CREATE TABLE roller_coaster ( roller_coaster_id number, name text, park text, country_id number, length number, height number, speed text, opened text, status te...
SELECT name FROM country WHERE languages <> "German"
spider
CREATE TABLE table_51539 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many picks included Kenny Evans?
SELECT COUNT("Pick") FROM table_51539 WHERE "Player" = 'kenny evans'
wikisql
CREATE TABLE table_2886617_3 ( nhl_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nhl team has the player kevin mckay?
SELECT nhl_team FROM table_2886617_3 WHERE player = "Kevin McKay"
sql_create_context
CREATE TABLE exhibition ( artist_id VARCHAR ) CREATE TABLE artist ( name VARCHAR, artist_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all artist names and the number of exhibitions for each artist.
SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id
sql_create_context
CREATE TABLE table_name_81 ( attendance INTEGER, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance San Jose home games?
SELECT AVG(attendance) FROM table_name_81 WHERE home = "san jose"
sql_create_context
CREATE TABLE table_54468 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of A. Benes loss to the Rockies?
SELECT "Date" FROM table_54468 WHERE "Loss" = 'a. benes' AND "Opponent" = 'rockies'
wikisql
CREATE TABLE table_15002265_1 ( mixed_doubles VARCHAR, mens_singles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the mixed doubles with mens singles being peter moritz
SELECT mixed_doubles FROM table_15002265_1 WHERE mens_singles = "Peter Moritz"
sql_create_context
CREATE TABLE table_name_15 ( club VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Club, when Points is '82'?
SELECT club FROM table_name_15 WHERE points = "82"
sql_create_context
CREATE TABLE table_name_95 ( year INTEGER, round VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did Ivanovic win with Ivanovic greater than 4 and round of R16?
SELECT SUM(year) FROM table_name_95 WHERE winner = "ivanovic" AND "ivanovic" > 4 AND round = "r16"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_201_18 ( id number, "date" text, "event" text, "headline act(s)" text, "supporting act(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which event is the most recurring on this list ?
SELECT "event" FROM table_201_18 GROUP BY "event" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_3546 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many results where given for the vote percentage 3.1%?
SELECT COUNT("Result") FROM table_3546 WHERE "Vote percentage" = '3.1%'
wikisql
CREATE TABLE table_71348 ( "Molecule" text, "Percent of Mass" text, "Mol.Weight (daltons)" text, "Molecules" text, "Percent of Molecules" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the percent of mass when the mol.weight (daltons) is 1e1...
SELECT "Percent of Mass" FROM table_71348 WHERE "Mol.Weight (daltons)" = '1e11'
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 MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2173.0"
mimicsql_data
CREATE TABLE table_28260 ( "No." real, "#" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Prod. code" real, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes are ...
SELECT COUNT("Original air date") FROM table_28260 WHERE "Title" = 'Like Mother, Like Daughter'
wikisql
CREATE TABLE table_11677100_5 ( school VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did Pat Osborn attend?
SELECT school FROM table_11677100_5 WHERE player = "Pat Osborn"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT demographic.gender FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_75684 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team 1 with team 2 Mount Cameroon FC?
SELECT "Team 1" FROM table_75684 WHERE "Team 2" = 'mount cameroon fc'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
nvbench
CREATE TABLE table_name_82 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2005 for 2003 of a and 2011 of 3r
SELECT 2005 FROM table_name_82 WHERE 2003 = "a" AND 2011 = "3r"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '袁修雅' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 1137.71)
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid ...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-1281')) AND lab.labname = 'vent rate' AND STRFTIME('%y-%m', lab.labresulttime) ...
eicu
CREATE TABLE table_name_20 ( date VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date is associated with the Loss of Farrell (6-13)?
SELECT date FROM table_name_20 WHERE loss = "farrell (6-13)"
sql_create_context
CREATE TABLE table_2562572_26 ( settlement VARCHAR, cyrillic_name_other_names VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many settlements are named (croatian: ur in)?
SELECT COUNT(settlement) FROM table_2562572_26 WHERE cyrillic_name_other_names = "Ђурђин (Croatian: Đurđin)"
sql_create_context
CREATE TABLE table_7049 ( "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 "Arabic capital name" FROM table_7049 WHERE "English capital name" = 'n''djamena'
wikisql
CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amen...
SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code
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 CIVIL_SUBSIDY FROM t_kc24 WHERE MED_CLINIC_ID = '74976158198'
css
CREATE TABLE table_201_13 ( id number, "city" text, "county(ies)" text, "population\n(2000 census)" number, "population\n(2010 census)" number, "class" text, "incorporation\ndate" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the...
SELECT "city" FROM table_201_13 ORDER BY "incorporation\ndate" LIMIT 1
squall
CREATE TABLE table_72311 ( "DS Division" text, "Main Town" text, "Divisional Secretary" text, "GN Divisions" real, "Area (km 2 )" real, "Sri Lankan Tamil" real, "Sri Lankan Moors" real, "Sinhalese" real, "Burgher" real, "Other" real, "Total" real, "Population Density (/km...
SELECT "DS Division" FROM table_72311 WHERE "Main Town" = 'Kaluvanchikudy'
wikisql
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_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '61804230348'
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 NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1281.74)
css
CREATE TABLE table_name_45 ( co_drivers VARCHAR, pos VARCHAR, team VARCHAR, laps VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the co-drivers the risi competizione gt2 class that went under 329 laps and recorded a DNF?
SELECT co_drivers FROM table_name_45 WHERE laps < 329 AND class = "gt2" AND team = "risi competizione" AND pos = "dnf"
sql_create_context
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT COUNT(*) FROM mzjzjlb WHERE ZZYSGH = '25408740' AND JZKSRQ BETWEEN '2011-01-20' AND '2019-07-19'
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id num...
SELECT MAX(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 = 17667)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE table_name_71 ( ag VARCHAR, d3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the AG value associated with a D3&4 of 41?
SELECT ag FROM table_name_71 WHERE d3 & 4 = "41"
sql_create_context
CREATE TABLE table_2500440_1 ( population_density__per_km_2__ VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population per km2 in Fishing Lake?
SELECT population_density__per_km_2__ FROM table_2500440_1 WHERE name = "Fishing Lake"
sql_create_context
CREATE TABLE table_57002 ( "Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode that was directed by Roy Dupuis?
SELECT "Title" FROM table_57002 WHERE "Directed by" = 'roy dupuis'
wikisql
CREATE TABLE table_75777 ( "Year" real, "Film" text, "Awards" text, "Category" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years were there for the 62nd golden globe awards?
SELECT SUM("Year") FROM table_75777 WHERE "Awards" = '62nd golden globe awards'
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_name_55 ( draw INTEGER, artist VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest draw for Beathoven when the place was smaller than 16?
SELECT MIN(draw) FROM table_name_55 WHERE artist = "beathoven" AND place < 16
sql_create_context
CREATE TABLE table_25595209_1 ( state_country VARCHAR, loa__metres_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What the is the state that the boat is from with LOA of 19.50?
SELECT state_country FROM table_25595209_1 WHERE loa__metres_ = "19.50"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
SELECT PostId AS "post_link", Id AS "comment_link", 'text', 'creationdate' FROM Comments WHERE Text LIKE '%##SearchString##%' ORDER BY CreationDate DESC
sede
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text te...
SELECT Posts.Body, Posts.Tags, Posts.CreationDate, Posts.Score, Posts.ViewCount, Posts.CreationDate, Posts.CommentCount, Users.Reputation FROM Posts JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.Tags LIKE '%aws-lambda%'
sede
CREATE TABLE financial_transactions ( transaction_id number, account_id number, invoice_number number, transaction_type text, transaction_date time, transaction_amount number, transaction_comment text, other_transaction_details text ) CREATE TABLE customers ( customer_id number, ...
SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM accounts AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_47276 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE 2011 PERFORMANCE FOR TOURNAMENTS PLAYED?
SELECT "2011" FROM table_47276 WHERE "Tournament" = 'tournaments played'
wikisql
CREATE TABLE table_name_72 ( total INTEGER, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Total of the Player who won in 1998?
SELECT MAX(total) FROM table_name_72 WHERE year_s__won = "1998"
sql_create_context
CREATE TABLE table_name_26 ( nationality VARCHAR, record VARCHAR, distance VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nationality's distance was 500m before 2012, when the record was 1:37.071s?
SELECT nationality FROM table_name_26 WHERE distance = "500m" AND year < 2012 AND record = "1:37.071s"
sql_create_context
CREATE TABLE table_204_523 ( id number, "week" number, "date" text, "opponent" text, "score" text, "result" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times was the opponent the edmonton e...
SELECT COUNT(*) FROM table_204_523 WHERE "opponent" = 'edmonton eskimos'
squall
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) -- Using valid SQLite, answer the ...
SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue ORDER BY Venue
nvbench
CREATE TABLE table_64742 ( "Rank" real, "Name" text, "Height ft ( m )" text, "Floors" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name before 1954 with more than 15 floors?
SELECT "Name" FROM table_64742 WHERE "Year" < '1954' AND "Floors" > '15'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2098" AND procedures.icd9_code = "40"
mimicsql_data
CREATE TABLE table_53341 ( "Season" text, "Division" text, "Position" text, "Played" text, "Lost" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the value for played when points is 8 and position is 11th?
SELECT "Played" FROM table_53341 WHERE "Position" = '11th' AND "Points" = '8'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, ...
SELECT * FROM (SELECT *, 0 AS isPandas FROM Posts AS p WHERE p.Tags LIKE '%python-3.x%' AND NOT p.Tags LIKE '%pandas%' AND p.CreationDate >= '2015-01-01' AND p.CreationDate < '2020-01-01' ORDER BY ViewCount DESC LIMIT 1000) AS withPandas UNION SELECT *, 1 AS isPandas FROM Posts AS p WHERE p.Tags LIKE '%python-3.x%' AND...
sede
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "3322" AND prescriptions.route = "PO"
mimicsql_data
CREATE TABLE table_25379 ( "No." real, "Player" text, "Hometown" text, "Class" text, "Position" text, "Height" text, "Weight" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every class with a position of guard and Tal Brody as the pl...
SELECT "Class" FROM table_25379 WHERE "Position" = 'Guard' AND "Player" = 'Tal Brody'
wikisql
CREATE TABLE table_75882 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Texans play at LP Field?
SELECT "Date" FROM table_75882 WHERE "Game site" = 'lp field'
wikisql
CREATE TABLE table_73132 ( "Rank by average" real, "Place" real, "Couple" text, "Number of Dances" real, "Total Points" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the couples name where the average is 15.9?
SELECT "Couple" FROM table_73132 WHERE "Average" = '15.9'
wikisql
CREATE TABLE table_name_13 ( year_s__of_manufacture VARCHAR, quantity VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year(s) of manufacture has a Quantity of 2, and a Type of b n2t?
SELECT year_s__of_manufacture FROM table_name_13 WHERE quantity = 2 AND type = "b n2t"
sql_create_context
CREATE TABLE table_name_63 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What away team played in Lake Oval?
SELECT away_team FROM table_name_63 WHERE venue = "lake oval"
sql_create_context
CREATE TABLE table_20721 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" text, "Population" real, "Density" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pinyin for 487 area
SELECT "Pinyin" FROM table_20721 WHERE "Area" = '487'
wikisql
CREATE TABLE table_69630 ( "Competition" text, "Started Round" text, "Final Position" text, "Final Round" text, "First Match" text, "Last Match" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition had a final round in the finals and ...
SELECT "Competition" FROM table_69630 WHERE "Final Position" = 'winners' AND "Final Round" = 'finals'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Spinal tap"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND prescriptions.drug IN ('fentanyl citrate', 'milk of magnesia', 'hurricaine spray') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), '...
mimic_iii
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '05261498' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2002-10-11' AND '2006-09-18' AND t_kc22.MED_I...
css
CREATE TABLE table_61625 ( "Tournament" text, "1993" text, "1994" text, "1995" text, "1996" text, "1998" text, "2003" text, "2004" text, "2005" text, "Career" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2003 value ...
SELECT "2003" FROM table_61625 WHERE "1994" = '1r' AND "Tournament" = 'french open'
wikisql
CREATE TABLE table_name_45 ( goal INTEGER, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest goal during the 2006 fifa world cup qualification competition?
SELECT MIN(goal) FROM table_name_45 WHERE competition = "2006 fifa world cup qualification"
sql_create_context
CREATE TABLE table_15827 ( "Ranking" real, "Nationality" text, "Name" text, "Years" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nation had 14 goals?
SELECT "Nationality" FROM table_15827 WHERE "Goals" = '14'
wikisql
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '38274476' AND qtb.IN_HOSP_DATE BETWEEN '2006-12-30' AND '2018-12-15' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_k...
css
CREATE TABLE table_77795 ( "Player" text, "Club" text, "League" real, "Play-offs" real, "FA Cup" real, "FA Trophy" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean number of play-offs when the league number was b...
SELECT AVG("Play-offs") FROM table_77795 WHERE "League" > '18' AND "Player" = 'john grant' AND "Total" > '25'
wikisql
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_Road, School_ID FROM basketball_match ORDER BY School_ID DESC
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT procedures.short_title, procedures.long_title FROM procedures WHERE procedures.icd9_code = "4591"
mimicsql_data
CREATE TABLE table_63256 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on April 12?
SELECT "Score" FROM table_63256 WHERE "Date" = 'april 12'
wikisql
CREATE TABLE table_name_39 ( position VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the winner with 792 points?
SELECT position FROM table_name_39 WHERE points = "792"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '9831232' AND jybgb.BGRQ BETWEEN '2012-08-01' AND '2019-02-12' GROUP BY jybgb.KSBM HAVING COUNT(*) < 6 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb J...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Abn react-surg proc NEC"
mimicsql_data
CREATE TABLE table_name_83 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the value in 2012 when 2002 was Q1 and 2010 was 1R?
SELECT 2012 FROM table_name_83 WHERE 2002 = "q1" AND 2010 = "1r"
sql_create_context
CREATE TABLE table_51005 ( "Year" real, "Nord" text, "West" text, "S\u00fcdwest" text, "Berlin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year borussia dortmund was west and bfc viktoria 1889 was Berlin?
SELECT MIN("Year") FROM table_51005 WHERE "West" = 'borussia dortmund' AND "Berlin" = 'bfc viktoria 1889'
wikisql
CREATE TABLE table_train_164 ( "id" int, "hemoglobin_a1c_hba1c" float, "diabetic" string, "fasting_plasma_glucose" int, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- baseline fasting plasma glucose <= 125 mg / dl
SELECT * FROM table_train_164 WHERE fasting_plasma_glucose <= 125
criteria2sql
CREATE TABLE table_13265 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the opponent with a time of 3:24?
SELECT "Opponent" FROM table_13265 WHERE "Time" = '3:24'
wikisql
CREATE TABLE table_77604 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text, "Free Practice driver(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of chassis...
SELECT "Chassis" FROM table_77604 WHERE "Driver" = 'ricardo zonta'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT Time, ID FROM swimmer
nvbench
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) -- Using valid SQLite, answer the following que...
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name DESC
nvbench
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_71632 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round of the match with a time ...
SELECT MAX("Round") FROM table_71632 WHERE "Time" = '0:57'
wikisql
CREATE TABLE table_23254 ( "School" text, "Baseball stadium" text, "Softball stadium" text, "Basketball arena" text, "Capacity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of UMass Boston's softball stadium?
SELECT "Softball stadium" FROM table_23254 WHERE "School" = 'UMass Boston'
wikisql
CREATE TABLE table_name_42 ( gold INTEGER, silver INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most gold where silver is 0?
SELECT MAX(gold) FROM table_name_42 WHERE silver < 0
sql_create_context