instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_55713 ( "Game #" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the points where Tor...
SELECT MAX("Points") FROM table_55713 WHERE "Home" = 'toronto' AND "Game #" > '63'
wikisql
CREATE TABLE table_17949 ( "Season" text, "Airdate" text, "The Mole" text, "Winner" text, "Runner-up" text, "Prize money" text, "International destination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the mole with prize money being...
SELECT "The Mole" FROM table_17949 WHERE "Prize money" = '€24,475'
wikisql
CREATE TABLE table_26907 ( "Codename (main article)" text, "Brand name (list)" text, "Cores" real, "L3 Cache" text, "Socket" text, "TDP" text, "I/O Bus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the i/o bus for the brand name Co...
SELECT "I/O Bus" FROM table_26907 WHERE "Brand name (list)" = 'Core i3-21xx'
wikisql
CREATE TABLE product ( product_id number, product_name text, product_details text ) CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_problem_closed time, problem_des...
SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" AND T2.staff_last_name = "Berge" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Ashley"...
spider
CREATE TABLE table_77228 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Sum of ERP W, when Call Sign is K216GA?
SELECT SUM("ERP W") FROM table_77228 WHERE "Call sign" = 'k216ga'
wikisql
CREATE TABLE table_45015 ( "Event" text, "Score" real, "Name" text, "Nation" text, "Games" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the 27 arrow match event, what's the sum of all scores for that event?
SELECT SUM("Score") FROM table_45015 WHERE "Event" = '27 arrow match'
wikisql
CREATE TABLE table_27498 ( "Year" real, "Population" real, "Index" real, "Violent" real, "Property" real, "Murder" real, "Forcible rape" real, "Robbery" real, "Aggravated assault" real, "Burglary" real, "Larceny Theft" real, "Vehicle Theft" real ) -- Using valid SQLite,...
SELECT "Murder" FROM table_27498 WHERE "Forcible rape" = '166'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND DATETIME(microlab.culturetakentime) <= DATETIME(...
eicu
CREATE TABLE table_name_59 ( score INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the top score for grier jones?
SELECT MAX(score) FROM table_name_59 WHERE player = "grier jones"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
SELECT * FROM Posts WHERE CreationDate = '##PostDate##' LIMIT 10
sede
CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, support_rep_id number ) CREATE TABLE genres ( id number, name text ) CRE...
SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5
spider
CREATE TABLE table_name_74 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on May 20?
SELECT opponent FROM table_name_74 WHERE date = "may 20"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "30"
mimicsql_data
CREATE TABLE table_name_77 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Brian Gay's place?
SELECT place FROM table_name_77 WHERE player = "brian gay"
sql_create_context
CREATE TABLE table_66198 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the title when the release date is 1938-12-17 and the production number is 8610?
SELECT "Title" FROM table_66198 WHERE "Release date" = '1938-12-17' AND "Production Num." = '8610'
wikisql
CREATE TABLE table_name_41 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game against the San Diego Chargers?
SELECT score FROM table_name_41 WHERE opponent = "san diego chargers"
sql_create_context
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_Road, Team_ID FROM basketball_match
nvbench
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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "0"
mimicsql_data
CREATE TABLE table_name_3 ( away_team VARCHAR, crowd INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team at the match where the crowd was larger than 30,000?
SELECT away_team FROM table_name_3 WHERE crowd > 30 OFFSET 000
sql_create_context
CREATE TABLE table_29574 ( "Name/Name of Act" text, "Age(s)" text, "Genre" text, "Act" text, "Hometown" text, "Qtr. Final (Week)" real, "Semi Final (Week)" text, "Position Reached" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT "Age(s)" FROM table_29574 WHERE "Act" = 'Rapper'
wikisql
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Da...
SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code
nvbench
CREATE TABLE table_204_567 ( id number, "team" text, "location" text, "stadium" text, "capacity" number, "manager" text, "captain" text, "kit manufacturer" text, "shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what sta...
SELECT "stadium" FROM table_204_567 WHERE "capacity" <= 2500
squall
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId nu...
SELECT UserId AS "user_link", COUNT(Id) FROM PostHistory WHERE PostHistoryTypeId = 6 GROUP BY UserId ORDER BY COUNT(Id) DESC
sede
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Microscopic hematuria"
mimicsql_data
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) -- Using valid SQLite, answer the following questions fo...
SELECT People_ID, Total FROM body_builder
nvbench
CREATE TABLE table_28480 ( "Episode" text, "Theme" text, "Song choice" text, "Original recording artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episode had Lavern Baker?
SELECT "Episode" FROM table_28480 WHERE "Original recording artist" = 'LaVern Baker'
wikisql
CREATE TABLE table_204_129 ( id number, "place" number, "team" text, "titles" number, "runners-up" number, "winning years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many more titles did team maccabi tel aviv win than every other team co...
SELECT (SELECT "titles" FROM table_204_129 WHERE "team" = 'maccabi tel aviv') - (SELECT SUM("titles") FROM table_204_129 WHERE "team" <> 'maccabi tel aviv')
squall
CREATE TABLE table_24210 ( "Order" real, "Couple" text, "Karen" text, "Nicky" text, "Jason" text, "Ruthie" text, "Robin" text, "Total" text, "Scoreboard" text, "Song" text, "Public Vote %" text, "Result" text ) -- Using valid SQLite, answer the following questions for t...
SELECT COUNT("Song") FROM table_24210 WHERE "Scoreboard" = '3rd'
wikisql
CREATE TABLE table_18143210_2 ( first_season_of_current_spell_in_top_division VARCHAR, first_season_in_top_division VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the 'first season of current spell in top division' if the first season in top divisio...
SELECT first_season_of_current_spell_in_top_division FROM table_18143210_2 WHERE first_season_in_top_division = "1964-65"
sql_create_context
CREATE TABLE table_79064 ( "Elimination" text, "Wrestler" text, "Team" text, "Eliminated by" text, "Elimination Move" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Wrestler plays for Team Batista which was Elimated by Orton o...
SELECT "Wrestler" FROM table_79064 WHERE "Team" = 'team batista' AND "Eliminated by" = 'orton' AND "Elimination" = '8'
wikisql
CREATE TABLE table_5765 ( "Opposition" text, "Score" text, "Venue" text, "City" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Year of 1911?
SELECT "Venue" FROM table_5765 WHERE "Year" = '1911'
wikisql
CREATE TABLE table_name_73 ( total VARCHAR, rank VARCHAR, silver VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total show when silver is 0, bronze is 1, and the rank is less than 3?
SELECT COUNT(total) FROM table_name_73 WHERE silver = 0 AND bronze = 1 AND rank < 3
sql_create_context
CREATE TABLE table_name_12 ( record VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record when the TKO (elbows) method was used?
SELECT record FROM table_name_12 WHERE method = "tko (elbows)"
sql_create_context
CREATE TABLE table_5677 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Per capita income i...
SELECT AVG("Population") FROM table_5677 WHERE "Per capita income" = '$29,194'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_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 = 'insert infusion pump'))
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "85" AND diagnoses.icd9_code = "53541"
mimicsql_data
CREATE TABLE table_42360 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the issue date for the song by Paul Mccartney and Michael Jackson?
SELECT "Issue Date(s)" FROM table_42360 WHERE "Artist" = 'paul mccartney and michael jackson'
wikisql
CREATE TABLE table_name_51 ( airline VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Airline when the notes show aoc 135?
SELECT airline FROM table_name_51 WHERE notes = "aoc 135"
sql_create_context
CREATE TABLE table_name_16 ( date VARCHAR, visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the visitor Chicago Black Hawks and the record 0-2?
SELECT date FROM table_name_16 WHERE visitor = "chicago black hawks" AND record = "0-2"
sql_create_context
CREATE TABLE table_204_55 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games were scheduled betwe...
SELECT COUNT(*) FROM table_204_55
squall
CREATE TABLE table_52270 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the authority status of the school in Ellerslie with a decile of 7?
SELECT "Authority" FROM table_52270 WHERE "Area" = 'ellerslie' AND "Decile" = '7'
wikisql
CREATE TABLE table_80169 ( "Representative" text, "Years" text, "State" text, "Party" text, "Lifespan" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lifespan of Joseph Vance, a democratic-republican from Ohio?
SELECT "Lifespan" FROM table_80169 WHERE "State" = 'ohio' AND "Representative" = 'joseph vance' AND "Party" = 'democratic-republican'
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.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '61218284' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '2524-6')
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, ...
SELECT CAST(a.zero_voted_answers * 100.0 AS FLOAT) / a.total_answers AS percentage FROM (SELECT COUNT(*) AS total_answers, COUNT(CASE WHEN Score = 0 THEN 1 ELSE NULL END) AS zero_voted_answers FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2) AS a
sede
CREATE TABLE table_name_69 ( standard_order VARCHAR, traditional_chinese VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which number is ?
SELECT standard_order FROM table_name_69 WHERE traditional_chinese = "國殤"
sql_create_context
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
SELECT major FROM student WHERE sex = "M"
spider
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE addresses ( address_id number, line_1_number_building text, ci...
SELECT T1.state_province_county FROM addresses AS T1 JOIN staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4
spider
CREATE TABLE table_68885 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team did Johnson (11-7) play for?
SELECT "Opponent" FROM table_68885 WHERE "Loss" = 'johnson (11-7)'
wikisql
CREATE TABLE table_name_96 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2002 has a 2009 of 2r?
SELECT 2002 FROM table_name_96 WHERE 2009 = "2r"
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 procedures ( ...
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.short_title = "Seroma complicting proc" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stuid number, clu...
SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = "HOU"
spider
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE table_53572 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the heigh of the player who went to lake howell high school?
SELECT "Height" FROM table_53572 WHERE "School" = 'lake howell high school'
wikisql
CREATE TABLE table_35254 ( "Rank" real, "Airport" text, "Location" text, "Code (IATA)" text, "Total Cargo (Metric Tonnes)" text, "2003 Rank" text, "% Change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2003 rank does the airport IATA...
SELECT "2003 Rank" FROM table_35254 WHERE "Code (IATA)" = 'sin'
wikisql
CREATE TABLE table_80274 ( "Year" text, "Team" text, "Chassis" text, "Engine" text, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank did the chassis reynard 94i have in 1996?
SELECT "Rank" FROM table_80274 WHERE "Chassis" = 'reynard 94i' AND "Year" = '1996'
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 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 = '018-81471')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE table_47038 ( "Name" text, "Period" text, "Games" real, "Wins" real, "Draws" real, "Lost" real, "Win Ratio" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of games with more than 0 draws and 11 losses?...
SELECT MAX("Games") FROM table_47038 WHERE "Draws" > '0' AND "Lost" = '11'
wikisql
CREATE TABLE table_name_68 ( country VARCHAR, to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT COUNTRY HAS A TO PAR OF +1, WITH WOODY AUSTIN?
SELECT country FROM table_name_68 WHERE to_par = "+1" AND player = "woody austin"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'hypoxemia - due to hypercarbia' AND DATETIME(diagn...
eicu
CREATE TABLE tryout ( cName VARCHAR, decision VARCHAR, pPos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college has any student who is a goalie and succeeded in the tryout.
SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'
sql_create_context
CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number ) CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text ) -- Using valid SQLite, answer th...
SELECT DISTINCT nominee FROM musical WHERE award <> "Tony Award"
spider
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
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 = 3125) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it...
mimic_iii
CREATE TABLE table_name_12 ( team VARCHAR, class VARCHAR, points VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Team which has Points larger than 9, and a Year larger than 1971, and a Class of 250cc?
SELECT team FROM table_name_12 WHERE points > 9 AND year > 1971 AND class = "250cc"
sql_create_context
CREATE TABLE table_name_44 ( time VARCHAR, res VARCHAR, location VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time is associated with the event that happened in Tokyo, Japan, ending in a draw, with 3 rounds?
SELECT time FROM table_name_44 WHERE location = "tokyo, japan" AND round = 3 AND res = "draw"
sql_create_context
CREATE TABLE table_64537 ( "Rank" text, "Group" text, "Name" text, "Nationality" text, "Mark" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a mark of 6.17 in group B?
SELECT "Name" FROM table_64537 WHERE "Group" = 'b' AND "Mark" = '6.17'
wikisql
CREATE TABLE table_26957063_3 ( _percentage_similarity_to_c7orf38 INTEGER, _percentage_identity_to_c7orf38 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the % similarity to C7orf38 of the animal whose % identity to C7orf38 is 81?
SELECT MAX(_percentage_similarity_to_c7orf38) FROM table_26957063_3 WHERE _percentage_identity_to_c7orf38 = 81
sql_create_context
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLO...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "78321" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_91 ( championship VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Championship has a Score of 2 6, 4 6, 4 6?
SELECT championship FROM table_name_91 WHERE score = "2–6, 4–6, 4–6"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6774238' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-05-02' AND '2011-06-21' AND t_kc21.INSURED_STS = '未就业' AND t_kc21.MED_AMOUT >= 745.28
css
CREATE TABLE table_name_37 ( opponent VARCHAR, result VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent with the loss in Westbury, NY?
SELECT opponent FROM table_name_37 WHERE result = "loss" AND location = "westbury, ny"
sql_create_context
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_J...
SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE cinema ( LOCATION VARCHAR, openning_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location with the most cinemas opened in year 2010 or later?
SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_55690 ( "Season" real, "Series Name" text, "Champion" text, "Team Champion" text, "Secondary Class Champion" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the champion of JD Motorsport after 2005?
SELECT "Champion" FROM table_55690 WHERE "Season" > '2005' AND "Team Champion" = 'jd motorsport'
wikisql
CREATE TABLE table_name_29 ( period VARCHAR, chart VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the period for Chart of g-music j-pop/k-pop chart
SELECT period FROM table_name_29 WHERE chart = "g-music j-pop/k-pop chart"
sql_create_context
CREATE TABLE table_name_20 ( position VARCHAR, round VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Position with a round 3 pick for r. jay soward?
SELECT position FROM table_name_20 WHERE round < 3 AND name = "r. jay soward"
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY...
css
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '48679933' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2011-03-05')
css
CREATE TABLE table_name_62 ( dialcode VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Dialcode of whitechapel?
SELECT dialcode FROM table_name_62 WHERE location = "whitechapel"
sql_create_context
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_ID = '36015603' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (...
eicu
CREATE TABLE table_2027 ( "Name" text, "Nation" text, "Seasons" text, "Championship Titles" text, "Race Starts" real, "Poles" real, "Wins" real, "Podiums" real, "Fastest Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many n...
SELECT COUNT("Nation") FROM table_2027 WHERE "Name" = 'FMS International'
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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE table_75940 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points of the honda hr-1 engine?
SELECT COUNT("Points") FROM table_75940 WHERE "Engine" = 'honda hr-1'
wikisql
CREATE TABLE table_name_10 ( grid INTEGER, laps VARCHAR, constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest grid when the laps is less than 44 and the constructor is renault?
SELECT MAX(grid) FROM table_name_10 WHERE laps < 44 AND constructor = "renault"
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 MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4970864' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM HAVING AVG(PERSON_AGE) > 21
css
CREATE TABLE table_17905 ( "Series number" text, "Episode number" real, "Date of first broadcast" text, "Total viewers" real, "Series average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the episode number where the total viewers is 61400...
SELECT MIN("Episode number") FROM table_17905 WHERE "Total viewers" = '614000'
wikisql
CREATE TABLE table_name_4 ( year VARCHAR, engine VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many entrants have a mercedes fo 108w 2.4l v8 engine and over 0 points?
SELECT COUNT(year) FROM table_name_4 WHERE engine = "mercedes fo 108w 2.4l v8" AND points > 0
sql_create_context
CREATE TABLE table_32924 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest week the team played the chicago cardinals in front of less than 25,312?
SELECT MIN("Week") FROM table_32924 WHERE "Opponent" = 'chicago cardinals' AND "Attendance" < '25,312'
wikisql
CREATE TABLE table_name_52 ( studio_analysts VARCHAR, ice_level_reporters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which studio analyst has Scott Oake for the ice level reporter?
SELECT studio_analysts FROM table_name_52 WHERE ice_level_reporters = "scott oake"
sql_create_context
CREATE TABLE table_39742 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had a home team of the Wizards?
SELECT "Date" FROM table_39742 WHERE "Home" = 'wizards'
wikisql
CREATE TABLE player_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won NUMERIC, points_max INTEGER, votes_first NUMERIC ) CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUM...
SELECT year, AVG(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC
nvbench
CREATE TABLE table_name_22 ( site VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which site was the game against Louisville played?
SELECT site FROM table_name_22 WHERE opponent = "louisville"
sql_create_context
CREATE TABLE table_7520 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mark number when the lane for Rabangaki Nawai when it is greater than 2 and the heat is larger than 4?...
SELECT "Mark" FROM table_7520 WHERE "Lane" > '2' AND "Heat" > '4' AND "Name" = 'rabangaki nawai'
wikisql
CREATE TABLE table_11688 ( "Year" real, "Tournament" text, "Partner" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent in the final for year of 1888
SELECT "Opponent in the final" FROM table_11688 WHERE "Year" = '1888'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationD...
SELECT OwnerUserId AS "user_link", COUNT(*) - COUNT(AcceptedAnswerId) AS HasNoAccept, COUNT(AcceptedAnswerId) AS HasAccepted FROM Posts WHERE PostTypeId = 1 AND OwnerUserId > 0 AND CommunityOwnedDate IS NULL AND AnswerCount > 0 GROUP BY OwnerUserId HAVING COUNT(*) > '##MaxAcceptRatio:int?10##' * COUNT(AcceptedAnswerId)...
sede
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '45027908' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '7909') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '45027908' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_C...
css
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
nvbench
CREATE TABLE table_25781 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha...
SELECT "High assists" FROM table_25781 WHERE "Score" = 'L 85–118 (OT)'
wikisql
CREATE TABLE table_name_98 ( ekstraklasa INTEGER, total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Ekstraklasa has a Total smaller than 3?
SELECT SUM(ekstraklasa) FROM table_name_98 WHERE total < 3
sql_create_context