instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_57570 ( "Coach" text, "Season" text, "Record" text, "Home" text, "Away" text, "Win %" real, "Average (Total) Home Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest win% in the 1999-2013 season?
SELECT MIN("Win %") FROM table_57570 WHERE "Season" = '1999-2013'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2164.0"
mimicsql_data
CREATE TABLE table_11391954_3 ( Half VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whatis the total number of half marathon (mens) that represented kazakhstan?
SELECT COUNT(Half) AS marathon__mens_ FROM table_11391954_3 WHERE country = "Kazakhstan"
sql_create_context
CREATE TABLE gas_station ( LOCATION VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all locations and the number of gas stations in each location ordered by the count.
SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*)
sql_create_context
CREATE TABLE table_11964154_9 ( game INTEGER, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum game where high points is micka l gelabale (21)
SELECT MAX(game) FROM table_11964154_9 WHERE high_points = "Mickaël Gelabale (21)"
sql_create_context
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 AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP"
mimicsql_data
CREATE TABLE table_29283 ( "Position" real, "Building" text, "City" text, "Height" text, "Number of floors" real, "Completion" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions does building Costanera Center Torre 1 have?
SELECT COUNT("Position") FROM table_29283 WHERE "Building" = 'Costanera Center Torre 1'
wikisql
CREATE TABLE table_2517159_1 ( record VARCHAR, name_of_bowl VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for cotton bowl classic
SELECT record FROM table_2517159_1 WHERE name_of_bowl = "Cotton Bowl Classic"
sql_create_context
CREATE TABLE table_204_102 ( id number, "name" text, "location served" text, "governorate" text, "utilization" text, "helipads" number, "runways" number, "shelters" number, "squadrons" text, "coordinates" text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "helipads" FROM table_204_102 WHERE "name" = 'hama military airport'
squall
CREATE TABLE table_16767 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the race in the Modena circuit?
SELECT "Race Name" FROM table_16767 WHERE "Circuit" = 'Modena'
wikisql
CREATE TABLE table_2062148_3 ( race VARCHAR, distance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race has a distance of 1200 m?
SELECT race FROM table_2062148_3 WHERE distance = "1200 m"
sql_create_context
CREATE TABLE table_66431 ( "Millewa" text, "Wins" real, "Forfeits" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Losses have Draws larger than 0?
SELECT MAX("Losses") FROM table_66431 WHERE "Draws" > '0'
wikisql
CREATE TABLE table_28453 ( "Episode #" text, "Season Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many directors were there fo...
SELECT COUNT("Directed by") FROM table_28453 WHERE "Season Episode #" = '1'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32698')) ORDER BY treatment.treatmenttime DESC LIMIT 1
eicu
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
SELECT * FROM VoteTypes
sede
CREATE TABLE table_51595 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has the ICAO of LIRF?
SELECT "City" FROM table_51595 WHERE "ICAO" = 'lirf'
wikisql
CREATE TABLE table_46426 ( "Finished" real, "Time/ Behind" text, "Post" real, "Horse" text, "Jockey" text, "Trainer" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Owner, when Finished is less than 15, when Trainer is '...
SELECT "Owner" FROM table_46426 WHERE "Finished" < '15' AND "Trainer" = 'steve asmussen' AND "Horse" = 'z fortune'
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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "GREEK ORTHODOX" AND lab.itemid = "51288"
mimicsql_data
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ...
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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND date_day.day_number = 6 AND date_day.month_number = 4 AND...
atis
CREATE TABLE table_60820 ( "Player" text, "Position" text, "Ekstraklasa" real, "Polish Cup" real, "Puchat Ligi" real, "UEFA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Puchat Ligi has a UEFA Cup smaller than 2, an...
SELECT MIN("Puchat Ligi") FROM table_60820 WHERE "UEFA Cup" < '2' AND "Player" = 'takesure chinyama'
wikisql
CREATE TABLE table_44082 ( "School" text, "Conference" text, "Games" real, "Wins" real, "Losses" real, "Winning Pct." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of losses of the team with games less than 14, wins les...
SELECT COUNT("Losses") FROM table_44082 WHERE "Games" < '14' AND "Wins" < '3' AND "Conference" = 'maac' AND "School" = 'fairfield'
wikisql
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 person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = zyjybgb.JZLSH_ZYJZJLB WHERE zyjybgb.BGDH = '66920...
css
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) -- Using valid SQLite, answer the ...
SELECT Party, COUNT(*) FROM representative GROUP BY Party
nvbench
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT (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 = 22973) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE table_2259285_1 ( standing VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the standing when goal against were 279?
SELECT standing FROM table_2259285_1 WHERE goals_against = 279
sql_create_context
CREATE TABLE table_name_36 ( game INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game was played at Philadelphia?
SELECT AVG(game) FROM table_name_36 WHERE team = "philadelphia"
sql_create_context
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY COUNT(date_of_completion) DESC
nvbench
CREATE TABLE table_21143 ( "Country" text, "Name" text, "Network" text, "Premiere" text, "Host(s)" text, "Judges" text, "Seasons and Winners" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the host for prime
SELECT "Host(s)" FROM table_21143 WHERE "Network" = 'Prime'
wikisql
CREATE TABLE gwyjzb ( 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 SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '戚文栋' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '戚文栋' AND fgwyjzb.CLINIC_TYPE = '门诊'
css
CREATE TABLE table_20508 ( "Region of USSR" text, "Number of families" real, "Number of people" real, "Average family size" text, "% of total deportees" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most number of families in regions wh...
SELECT MAX("Number of families") FROM table_20508 WHERE "Average family size" = '2.7'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId n...
SELECT ph.PostId AS "post_link", ph.CreationDate AS LastEditDate, u.DisplayName AS LastEditor, pht.Name AS LastEditType, ph.Comment FROM PostHistory AS ph JOIN PostHistoryTypes AS pht ON pht.Id = ph.PostHistoryTypeId JOIN Posts AS p ON p.Id = ph.PostId AND p.LastEditDate = ph.CreationDate JOIN Users AS u ON u.Id = ph.U...
sede
CREATE TABLE table_12794 ( "Location" text, "Year" real, "Champion" text, "Runner-up" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When John Mcenroe won at Montreal, what was the score?
SELECT "Score" FROM table_12794 WHERE "Location" = 'montreal' AND "Champion" = 'john mcenroe'
wikisql
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 JZZDBM, JZZDSM FROM mzjzjlb WHERE JZLSH = '04766244693'
css
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Pri...
SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_76540 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week was the finalist Martina Hingis?
SELECT "Week" FROM table_76540 WHERE "Finalist" = 'martina hingis'
wikisql
CREATE TABLE table_203_689 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the total number of wins ?
SELECT COUNT(*) FROM table_203_689 WHERE "result" = 'win'
squall
CREATE TABLE table_79760 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What dates had matches at the venue Sabina Park?
SELECT "Date" FROM table_79760 WHERE "Venue" = 'sabina park'
wikisql
CREATE TABLE table_59775 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the broadcast date with 7.0 million viewers?
SELECT "Broadcast date" FROM table_59775 WHERE "Viewers (in millions)" = '7.0'
wikisql
CREATE TABLE table_36645 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Tries for" FROM table_36645 WHERE "Losing bonus" = '3' AND "Points" = '45'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.age < "71"
mimicsql_data
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, R...
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY Name DESC
nvbench
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID IN...
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank
nvbench
CREATE TABLE table_42499 ( "Year" real, "Winner" text, "School" text, "Position" text, "Points" text, "% of Points Possible" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the % of points possible of the winner from Penn State?
SELECT "% of Points Possible" FROM table_42499 WHERE "School" = 'penn state'
wikisql
CREATE TABLE table_23493 ( "Ostrich" text, "Hamerkop" text, "Hadeda Ibis" text, "African Spoonbill" text, "Whitefaced Duck" text, "Knobbilled Duck" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Hadeda Ibis when the Ostrich is Dark C...
SELECT "Hadeda Ibis" FROM table_23493 WHERE "Ostrich" = 'Dark Chanting Goshawk'
wikisql
CREATE TABLE table_5198 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the best time of the team that had a qualifying 1 time of 1:01.043?
SELECT "Best" FROM table_5198 WHERE "Qual 1" = '1:01.043'
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.dod_year <= "2138.0" AND procedures.short_title = "Aortocor bypas-1 cor art"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '1 ml vial : heparin sodium (porcine) 5000 unit/ml ij soln' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year'))
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "S/P HANGING"
mimicsql_data
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 COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6235721' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE table_23563 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Foochow" text, "Area" real, "Population" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the traditional for area ...
SELECT "Traditional" FROM table_23563 WHERE "Area" = '544'
wikisql
CREATE TABLE table_5694 ( "Week 6 Oct 5" text, "Week 7 Oct 12" text, "Week 9 Oct 26" text, "Week 10 Nov 2" text, "Week 11 Nov 9" text, "Week 13 Nov 23" text, "Week 14 Nov 30" text, "Week 15 (Final) Dec 7" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "Week 14 Nov 30" FROM table_5694 WHERE "Week 6 Oct 5" = 'michigan state (5-1)'
wikisql
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
(SELECT jyjgzbb.JYZBLSH 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 h...
css
CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) CREATE TABLE submission ( submission_id number, scores number, author text, college text ) -- Using valid SQLit...
SELECT COUNT(*) FROM submission
spider
CREATE TABLE table_1429629_1 ( episode VARCHAR, run_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all the episodes with an episode run time of 24:01?
SELECT episode FROM table_1429629_1 WHERE run_time = "24:01"
sql_create_context
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE T...
SELECT DISTINCT fare.fare_id, flight.flight_id, flight.meal_code FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_n...
atis
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Des...
SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date DESC
nvbench
CREATE TABLE table_62326 ( "Rank" real, "Name" text, "Season" text, "Club" text, "Goals" real, "Apps" real, "Goals per Match" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank that has goals per match less than 1.237, re...
SELECT MIN("Rank") FROM table_62326 WHERE "Goals per Match" < '1.237' AND "Club" = 'real madrid' AND "Goals" < '53' AND "Apps" > '40'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLic...
SELECT reoccurs.TagName AS reoccurs, 'WITH' AS presence, '##occurs:string##' AS occurs, COUNT(DISTINCT Posts.Id) AS nposts FROM Tags AS reoccurs, Posts, PostTags AS ptri WHERE Posts.Id = ptri.PostId AND ptri.TagId = reoccurs.Id AND '##occurs:string##' IN (SELECT TagName FROM Tags AS occurs, PostTags AS pti WHERE occurs...
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dob_year < "2200"
mimicsql_data
CREATE TABLE Courses ( course_id VARCHAR(100), course_name VARCHAR(120), course_description VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Candidates ( candidate_id INTEGER, candidate_details VARCHAR(255) ) CREATE TABLE People_Addresses ( person_address_id INTEGER, person_id I...
SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY last_name
nvbench
CREATE TABLE table_67050 ( "Quarter" text, "Score" text, "Club" text, "Opponent" text, "Year" text, "Round" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has a Club of essendon, and a Score of 13.4.82?
SELECT "Opponent" FROM table_67050 WHERE "Club" = 'essendon' AND "Score" = '13.4.82'
wikisql
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality
nvbench
CREATE TABLE table_25428629_1 ( opponent VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the location is Yangon, Myanmar, what is the opponent total number?
SELECT COUNT(opponent) FROM table_25428629_1 WHERE location = "Yangon, Myanmar"
sql_create_context
CREATE TABLE table_13696 ( "Season" text, "Teams" real, "Minor Ladder Position" text, "Finals Qualification" text, "Final Ladder Position" text, "ACL Qualification" text, "ACL Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT SUM("Teams") FROM table_13696 WHERE "Season" = '2012-13'
wikisql
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( ei...
SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_92 ( score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has south africa as the country?
SELECT score FROM table_name_92 WHERE country = "south africa"
sql_create_context
CREATE TABLE table_203_559 ( id number, "no." number, "name" text, "took office" text, "left office" text, "president served under" text, "notable for" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many commissioners served under calvin...
SELECT COUNT("name") FROM table_203_559 WHERE "president served under" = 'calvin coolidge'
squall
CREATE TABLE table_31968 ( "Heat Rank" real, "Lane" real, "Swimmer" text, "Country" text, "Time" real, "Overall Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For how long did Bolivia have a lane greater than 6?
SELECT COUNT("Time") FROM table_31968 WHERE "Country" = 'bolivia' AND "Lane" > '6'
wikisql
CREATE TABLE table_name_12 ( try_bonus VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the try bonus for ynysybwl rfc?
SELECT try_bonus FROM table_name_12 WHERE club = "ynysybwl rfc"
sql_create_context
CREATE TABLE table_75443 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Score of 4 1?
SELECT SUM("Game") FROM table_75443 WHERE "Score" = '4–1'
wikisql
CREATE TABLE table_name_7 ( position VARCHAR, losses VARCHAR, wins VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions have 14 wins, goals against of 61 and fewer than 19 losses?
SELECT COUNT(position) FROM table_name_7 WHERE wins = 14 AND goals_against = 61 AND losses < 19
sql_create_context
CREATE TABLE table_20396710_1 ( drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when points against is points again, which are the drawn?
SELECT drawn FROM table_20396710_1 WHERE "points_against" = "points_against"
sql_create_context
CREATE TABLE table_203_735 ( id number, "rd" number, "pick" number, "player" text, "position" text, "school" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many players were from notre dame ?
SELECT COUNT("player") FROM table_203_735 WHERE "school" = 'notre dame'
squall
CREATE TABLE table_44305 ( "Rank" real, "Country" text, "Miss United Continent" real, "Virreina" real, "1st RU" real, "2nd RU" real, "3rd RU" real, "4th RU" real, "Semifinalists" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT COUNT("Semifinalists") FROM table_44305 WHERE "Miss United Continent" = '0' AND "2nd RU" = '0' AND "1st RU" > '0' AND "Total" < '2'
wikisql
CREATE TABLE race ( name VARCHAR, date VARCHAR, track_id VARCHAR ) CREATE TABLE track ( name VARCHAR, track_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the name and date for each race and its track name.
SELECT T1.name, T1.date, T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id
sql_create_context
CREATE TABLE table_name_86 ( position VARCHAR, team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the position that has baltimore bullets and college of texas tech
SELECT position FROM table_name_86 WHERE team = "baltimore bullets" AND college = "texas tech"
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 intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) AND intakeoutput.cellpath LIKE '%intake...
eicu
CREATE TABLE table_11208143_9 ( capacity INTEGER, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Pittodrie Stadium's maximum capacity?
SELECT MAX(capacity) FROM table_11208143_9 WHERE stadium = "Pittodrie"
sql_create_context
CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE channel ( channel_id number, name text, owner text, share_in_percent numb...
SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
SELECT Id AS "post_link" FROM Posts WHERE 'body' LIKE '<p>-1 %'
sede
CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) -- Using valid SQLite...
SELECT allergytype FROM allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_24906653_5 ( field_goals VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many long range shots did tonya edwards make.
SELECT COUNT(field_goals) FROM table_24906653_5 WHERE player = "Tonya Edwards"
sql_create_context
CREATE TABLE table_59413 ( "Year" text, "Result" text, "Matches" text, "Wins" text, "Draws" text, "Losses" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the result did not qualify?
SELECT "Year" FROM table_59413 WHERE "Result" = 'did not qualify'
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_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '钱婉娜' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '814113')
css
CREATE TABLE table_name_47 ( champion VARCHAR, location VARCHAR, semi_finalist__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which champion was from the location of Morrisville, NC, and whose SemiFinalist #2 of Clemson?
SELECT champion FROM table_name_47 WHERE location = "morrisville, nc" AND semi_finalist__number2 = "clemson"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'DL' AND airline_name LIKE 'DELTA'
atis
CREATE TABLE table_20214 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the interview subject in the 2-86 issue?
SELECT "Interview subject" FROM table_20214 WHERE "Date" = '2-86'
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.JZZDSM = '慢性龈炎' GROUP BY person_info.JGDM UNION SELECT pe...
css
CREATE TABLE table_name_47 ( average VARCHAR, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average when the matches are 11?
SELECT average FROM table_name_47 WHERE matches = "11"
sql_create_context
CREATE TABLE table_74914 ( "Pick #" real, "Round" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player is a Wide Receiver?
SELECT "Player" FROM table_74914 WHERE "Position" = 'wide receiver'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
SELECT Score, COUNT(*) FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2 GROUP BY Score ORDER BY Score
sede
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
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 = '011-55939')) AND lab.labname = 'bedside glucose' AND DATETIME(lab.labresulttime) >= DAT...
eicu
CREATE TABLE table_204_238 ( id number, "#" number, "title" text, "producer(s)" text, "performer (s)" text, "time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many tracks last for more than three minutes ?
SELECT COUNT("title") FROM table_204_238 WHERE "time" >= 3
squall
CREATE TABLE table_name_17 ( laps INTEGER, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps resulted from a Qual of 165.229?
SELECT MAX(laps) FROM table_name_17 WHERE qual = "165.229"
sql_create_context
CREATE TABLE table_name_28 ( stadium VARCHAR, week INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the stadium that held that game after week 15?
SELECT stadium FROM table_name_28 WHERE week > 15
sql_create_context
CREATE TABLE table_269888_1 ( area__km²_ VARCHAR, population__2010_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the area for population of 53542
SELECT area__km²_ FROM table_269888_1 WHERE population__2010_ = 53542
sql_create_context
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '30325789197' AND HOSP_DOC_NM LIKE '何%'
css