instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_62 ( pick INTEGER, overall VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SUM OF PICK WITH AN OVERALL LARGER THAN 250, AND FOR FLORIDA COLLEGE?
SELECT SUM(pick) FROM table_name_62 WHERE overall > 250 AND college = "florida"
sql_create_context
CREATE TABLE table_18298 ( "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 candidate is a member of the Republican party?
SELECT "Candidates" FROM table_18298 WHERE "Party" = 'Republican'
wikisql
CREATE TABLE table_52489 ( "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 venue when the away team scored 15.9...
SELECT "Venue" FROM table_52489 WHERE "Away team score" = '15.9 (99)'
wikisql
CREATE TABLE table_41882 ( "Episode number" real, "Title" text, "Original airing on Channel 4" text, "Time of airing on Channel 4" text, "Original airing on E4" text, "Time of airing on E4" text, "Position in Channel 4 and Channel 4+1's ratings" text, "Position in E4 and E4+1's ratings" ...
SELECT "Position in Channel 4 and Channel 4+1's ratings" FROM table_41882 WHERE "Position in E4 and E4+1's ratings" = '780,200'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '神经内科' AND IN_HOSP_DATE BETWEEN '2008-03-15' AND '2013-06-01' AND IN_DIAG_DIS_CD = 'L40.551' AND CLINIC_TYPE = '住院'
css
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descri...
SELECT Score, CASE WHEN NOT ClosedDate IS NULL THEN 'N' ELSE 'Er' END AS "closed?", Title AS "post_link" FROM Posts WHERE PostTypeId = 1 AND (NOT ClosedDate IS NULL OR Score < -3) ORDER BY Score LIMIT 500
sede
CREATE TABLE head ( name VARCHAR, born_state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of the heads who are born outside the California state?
SELECT name FROM head WHERE born_state <> 'California'
sql_create_context
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
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 AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94542')) AND intakeoutput.celllabel = 'enter...
eicu
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Alkalosis" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, ...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_name_20 ( altitude__mslm_ INTEGER, density__inhabitants_km_2__ VARCHAR, area__km_2__ VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Altitude (mslm) is the highest one that has an Area (km 2) smaller than 1...
SELECT MAX(altitude__mslm_) FROM table_name_20 WHERE area__km_2__ < 13.01 AND population = 74536 AND density__inhabitants_km_2__ > 5869
sql_create_context
CREATE TABLE table_name_24 ( against VARCHAR, opposing_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Against when the Opposing Team was sheffield wednesday?
SELECT against FROM table_name_24 WHERE opposing_team = "sheffield wednesday"
sql_create_context
CREATE TABLE table_65671 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Driver has a Grid smaller than 17, and Points larger than 0, and a Lapse of 87, a...
SELECT "Driver" FROM table_65671 WHERE "Grid" < '17' AND "Points" > '0' AND "Laps" = '87' AND "Time/Retired" = '1:48:11.023'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, chartti...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27362)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_62067 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses for the team with less than 4 wins, more than 0 byes and 2510 against...
SELECT AVG("Losses") FROM table_62067 WHERE "Wins" < '4' AND "Against" = '2510' AND "Byes" > '0'
wikisql
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) -- Using valid SQLite, answer the following questions ...
SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height
nvbench
CREATE TABLE table_23214055_2 ( district VARCHAR, others VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the district for others being 18.3
SELECT district FROM table_23214055_2 WHERE others = "18.3"
sql_create_context
CREATE TABLE table_1313 ( "Team" text, "Titles" real, "Runner-up" real, "Third place" real, "Fourth place" real, "Years participated" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the team is yale what is max amount of times they placed fo...
SELECT MAX("Fourth place") FROM table_1313 WHERE "Team" = 'Yale'
wikisql
CREATE TABLE table_49992 ( "Position" real, "Pilot" text, "Country" text, "Glider" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average position of pilot petr krejcirik, who has less than 11 points?
SELECT AVG("Position") FROM table_49992 WHERE "Points" < '11' AND "Pilot" = 'petr krejcirik'
wikisql
CREATE TABLE table_1151 ( "Year (Ceremony)" text, "English title" text, "Hungarian title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director for the witman boys?
SELECT "Director" FROM table_1151 WHERE "English title" = 'The Witman Boys'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '谢婉慧' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-07-26' AND '2013-12-31' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, ...
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE table_14622 ( "Player" text, "Country" text, "Caps" real, "Goals" text, "Years Active" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the years active of the player from New Zealand with more than 11 caps?
SELECT "Years Active" FROM table_14622 WHERE "Caps" > '11' AND "Country" = 'new zealand'
wikisql
CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE student_course_e...
SELECT COUNT(DISTINCT student_id) FROM student_course_enrolment
spider
CREATE TABLE table_38686 ( "Type" text, "Actual Exponent" text, "Exp (biased)" text, "Exponent field" text, "Significand (fraction field)" text, "Value" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the exponent field that has 255 exp an...
SELECT "Exponent field" FROM table_38686 WHERE "Exp (biased)" = '255' AND "Value" = '+∞'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_da...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL...
atis
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID
nvbench
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
CREATE TABLE table_49301 ( "Trident" text, "Gecko" text, "WebKit" text, "KHTML" text, "Presto" text, "Prince XML" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the item with a Prince XML value of 'font', what is the WebKit value?
SELECT "WebKit" FROM table_49301 WHERE "Prince XML" = 'font'
wikisql
CREATE TABLE table_26540 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What series number had an ...
SELECT MIN("No. in series") FROM table_26540 WHERE "Original air date" = 'March 1, 1991'
wikisql
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 treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', treatment.treatmenttime) >= '2102' GROUP BY treatment....
eicu
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT 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 = 15754)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE table_train_178 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "hiv_infection" bool, "hepatitis_c" bool, "renal_disease" bool, "hypoglycemia" bool, "serum_creatinine" float, "seizure_disorder" bool, "body_mass_index_bmi" float, "NOUSE" float ) -- U...
SELECT * FROM table_train_178 WHERE renal_disease = 1 OR serum_creatinine > 1.5
criteria2sql
CREATE TABLE table_name_41 ( years_in_orlando VARCHAR, position VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Years in Orlando has a Position of center, and a School/Club Team of louisiana state?
SELECT years_in_orlando FROM table_name_41 WHERE position = "center" AND school_club_team = "louisiana state"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.days_stay > "17"
mimicsql_data
CREATE TABLE table_48575 ( "Position" real, "Driver / Passenger" text, "Equipment" text, "Bike No" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Bike No, when Driver / Passenger is Joris Hendrickx / Kaspars Liepin...
SELECT AVG("Bike No") FROM table_48575 WHERE "Driver / Passenger" = 'joris hendrickx / kaspars liepins' AND "Position" > '4'
wikisql
CREATE TABLE table_name_11 ( finish VARCHAR, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of finish of the Qual of 159.384?
SELECT finish FROM table_name_11 WHERE qual = "159.384"
sql_create_context
CREATE TABLE table_17288869_7 ( high_assists VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high assists while Erick Dampier (8) had the high rebounds?
SELECT high_assists FROM table_17288869_7 WHERE high_rebounds = "Erick Dampier (8)"
sql_create_context
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 bdmzjzjlb ( CYBQDM text, CYBQ...
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj...
css
CREATE TABLE table_name_3 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the Melbourne team score in their away game?
SELECT away_team AS score FROM table_name_3 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_nam...
SELECT apt_number, room_count FROM Apartments ORDER BY room_count DESC
nvbench
CREATE TABLE table_53809 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the high capacity that has an average under 489 and a highest over 778?
SELECT MAX("Capacity") FROM table_53809 WHERE "Average" < '489' AND "Highest" > '778'
wikisql
CREATE TABLE table_204_665 ( id number, "rank" number, "name" text, "notability" text, "birthplace" text, "advocate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is pictured on top of the list ?
SELECT "name" FROM table_204_665 WHERE id = 1
squall
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20441)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'po intake' A...
mimic_iii
CREATE TABLE table_43193 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses have a draw greater than 0?
SELECT SUM("Lost") FROM table_43193 WHERE "Draw" > '0'
wikisql
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_46 ( set_5 VARCHAR, date VARCHAR, set_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Set 5, when Date is Jun 26, and when Set 2 is 25-22?
SELECT set_5 FROM table_name_46 WHERE date = "jun 26" AND set_2 = "25-22"
sql_create_context
CREATE TABLE table_203_244 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the only rider with more points than doriano romboni ?
SELECT "rider" FROM table_203_244 WHERE "points" > (SELECT "points" FROM table_203_244 WHERE "rider" = 'doriano romboni')
squall
CREATE TABLE table_name_83 ( call_sign VARCHAR, frequency_mhz VARCHAR, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the call sign which has a frequency Mhz more than 90.1 and ERP W of 1
SELECT call_sign FROM table_name_83 WHERE frequency_mhz > 90.1 AND erp_w = 1
sql_create_context
CREATE TABLE table_name_45 ( venue VARCHAR, attendance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has more than 50,715 attending?
SELECT venue FROM table_name_45 WHERE attendance > 50 OFFSET 715
sql_create_context
CREATE TABLE table_22771048_2 ( transit_connections VARCHAR, station VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the transit connections from Pioneer Square U?
SELECT transit_connections FROM table_22771048_2 WHERE station = "Pioneer Square U"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT Id AS "post_link", CreationDate, AnswerCount, Tags FROM Posts AS P WHERE P.Id IN (SELECT ParentId AS Post FROM Posts AS P WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2) AND AnswerCount > 1 ORDER BY CreationDate DESC
sede
CREATE TABLE table_50360 ( "Team" text, "Head Coach" text, "Team Captain" text, "Kitmaker" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the team whose shirt sponsor is Evonik, who is the kitmaker?
SELECT "Kitmaker" FROM table_50360 WHERE "Shirt sponsor" = 'evonik'
wikisql
CREATE TABLE table_name_20 ( game VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which games had Philadelphia as home team?
SELECT game FROM table_name_20 WHERE home_team = "philadelphia"
sql_create_context
CREATE TABLE table_name_23 ( league_cup_goals INTEGER, total_goals VARCHAR, league_apps VARCHAR, fa_cup_apps VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum league cup goals when there has been 0 FA cup appear...
SELECT MAX(league_cup_goals) FROM table_name_23 WHERE fa_cup_apps = "0" AND position = "mf" AND league_apps = "1" AND total_goals < 0
sql_create_context
CREATE TABLE table_204_468 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was richie hearn 's race...
SELECT "pos" FROM table_204_468 WHERE "driver" = 'richie hearn'
squall
CREATE TABLE table_55574 ( "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 venue is the home field of Richmond?
SELECT "Venue" FROM table_55574 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) ...
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) DESC
nvbench
CREATE TABLE all_star ( player_id TEXT, year INTEGER, game_num INTEGER, game_id TEXT, team_id TEXT, league_id TEXT, gp NUMERIC, starting_pos NUMERIC ) CREATE TABLE team ( year INTEGER, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INTEGER, ...
SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year
nvbench
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_1876262_10 ( safari VARCHAR, internet_explorer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If Internet Explorer is 47.22%, what is the Safari total?
SELECT safari FROM table_1876262_10 WHERE internet_explorer = "47.22%"
sql_create_context
CREATE TABLE table_name_54 ( hdtv VARCHAR, content VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the HDTV when the content shows a timeshift +1 di disney junior?
SELECT hdtv FROM table_name_54 WHERE content = "timeshift +1 di disney junior"
sql_create_context
CREATE TABLE table_name_4 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the game played at Windy Hill, who was the away team?
SELECT away_team FROM table_name_4 WHERE venue = "windy hill"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, expectorated' AND STRFTIME('%y', microlab.culturetakentime) = '2104')
eicu
CREATE TABLE table_57923 ( "Number & name" text, "Description" text, "Current status" text, "Livery" text, "Date" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date with identifying number of No. 37817?
SELECT "Date" FROM table_57923 WHERE "Number & name" = 'no. 37817'
wikisql
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ...
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY cName
nvbench
CREATE TABLE table_27146868_1 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2003 when 1999 is 2.1?
SELECT 2003 FROM table_27146868_1 WHERE 1999 = "2.1"
sql_create_context
CREATE TABLE table_name_56 ( competition VARCHAR, town VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the competition played in budva against italy?
SELECT competition FROM table_name_56 WHERE town = "budva" AND opponent = "italy"
sql_create_context
CREATE TABLE table_1213511_7 ( pick__number VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of pick # where nhl team is philadelphia flyers
SELECT COUNT(pick__number) FROM table_1213511_7 WHERE nhl_team = "Philadelphia Flyers"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '83857179' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
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 demographic ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "LEFT COLON CANCER"
mimicsql_data
CREATE TABLE table_69698 ( "Name" text, "Championship" real, "League Cup" real, "FA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many FA cups for the player with under 5 champs, 0 league cups, and over 3 total?
SELECT SUM("FA Cup") FROM table_69698 WHERE "Championship" < '5' AND "League Cup" = '0' AND "Total" > '3'
wikisql
CREATE TABLE table_30338 ( "No. in series" real, "Title" text, "Directed by" text, "Story & Storyboards by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the title of the episode ...
SELECT "Title" FROM table_30338 WHERE "No. in series" = '36'
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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age >= "80"
mimicsql_data
CREATE TABLE table_name_22 ( date VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date, when the home team is the NY Rangers?
SELECT date FROM table_name_22 WHERE home = "ny rangers"
sql_create_context
CREATE TABLE table_78650 ( "Place" text, "Player" text, "Country" text, "Score" text, "To Par" real, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for t9 place for Harold Mcspaden?
SELECT "Score" FROM table_78650 WHERE "Place" = 't9' AND "Player" = 'harold mcspaden'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'splenic trauma - with hematoma' AND DATE...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid num...
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-163354' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmi...
eicu
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1368313' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-02-22' AND '2005-11-03' GROUP BY gwyjzb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 26 UNION SELECT fg...
css
CREATE TABLE table_77739 ( "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 did the away team score when playing North ...
SELECT "Away team score" FROM table_77739 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_14222 ( "T-35" text, "T-100" text, "KV-1 M1940" text, "KV-1 M1941" text, "KV-1 M1942" text, "KV-1S M1942" text, "KV-85 M1943" text, "IS-2 M1945" text, "IS-3 M1945" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT "IS-3 M1945" FROM table_14222 WHERE "KV-1S M1942" = '45'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691')) AND vitalperiodic.systemicmean < 91.0 ...
eicu
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE table_55047 ( "Name" text, "Model" text, "Park" text, "Opened" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of the junior coaster model that opened in 2008?
SELECT "Status" FROM table_55047 WHERE "Opened" = '2008' AND "Model" = 'junior coaster'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar,...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'FORT WORTH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
atis
CREATE TABLE table_name_60 ( years INTEGER, tied VARCHAR, total_games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of years associated with 51 games tied and over 1184 total games?
SELECT AVG(years) FROM table_name_60 WHERE tied = 51 AND total_games > 1184
sql_create_context
CREATE TABLE table_15872814_3 ( score VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for washington
SELECT score FROM table_15872814_3 WHERE team = "Washington"
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Tit...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%deutschland%' OR LOWER(Location) LIKE '%germany%' ORDER BY Reputation DESC LIMIT 2500
sede
CREATE TABLE table_203_758 ( id number, "no." number, "dub no." number, "english dubbed title / english subbed title\noriginal japanese title" text, "original air date" text, "english air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how ...
SELECT COUNT("english dubbed title / english subbed title\noriginal japanese title") FROM table_203_758 WHERE NOT "original air date" IS NULL AND "english air date" IS NULL
squall
CREATE TABLE table_name_52 ( surface VARCHAR, opponent_in_the_final VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Surface has an Opponent in the final of don mcneill, and a Year of 1940?
SELECT surface FROM table_name_52 WHERE opponent_in_the_final = "don mcneill" AND year = 1940
sql_create_context
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 = "EMERGENCY" AND demographic.insurance = "Medicaid"
mimicsql_data
CREATE TABLE table_25208 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race time" text, "Average speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Report" FROM table_25208 WHERE "Year" = '2003'
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '28349097' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2015-04-17')
css
CREATE TABLE table_name_87 ( score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has 15.0% as the 2012?
SELECT score FROM table_name_87 WHERE 2012 = "15.0%"
sql_create_context
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_name_41 ( visiting_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visiting team that played on September 15?
SELECT visiting_team FROM table_name_41 WHERE date = "september 15"
sql_create_context
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 COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '7702859' AND zzmzjzjlb.JZKSRQ BETWEEN '2011-06-06' AND '2021-10-25' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '7702859' AND fzzmzjzjlb.JZKSRQ BETWEEN '2011-06-06' AND '2021-10-25' AND fzzmzjzjlb.ZSEBZ > 0
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE...
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
nvbench
CREATE TABLE table_52747 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visiting team in the game against the Dallas Cowboys?
SELECT "Visiting Team" FROM table_52747 WHERE "Host Team" = 'dallas cowboys'
wikisql