instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_2385460_1 ( stations VARCHAR, travel_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of stations for 15 minutes travel time
SELECT COUNT(stations) FROM table_2385460_1 WHERE travel_time = "15 minutes"
sql_create_context
CREATE TABLE table_47984 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for the match held in Boston?
SELECT "Result" FROM table_47984 WHERE "Location" = 'boston'
wikisql
CREATE TABLE table_21100348_15 ( rank INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank does Rodney Marsh have?
SELECT MAX(rank) FROM table_21100348_15 WHERE player = "Rodney Marsh"
sql_create_context
CREATE TABLE table_name_76 ( points VARCHAR, goal_difference VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points of the club with a goal difference greater than 17 and more than 34 played?
SELECT COUNT(points) FROM table_name_76 WHERE goal_difference > 17 AND played > 34
sql_create_context
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'dextrose 50%' ORDER BY prescriptions.startda...
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Insomnia, unspecified" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_35 ( melbourne VARCHAR, perth VARCHAR, auckland VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Melbourne has a Perth of yes, and an Auckland of yes?
SELECT melbourne FROM table_name_35 WHERE perth = "yes" AND auckland = "yes"
sql_create_context
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND procedures.short_title = "Opn mitral valvuloplasty"
mimicsql_data
CREATE TABLE table_name_25 ( total INTEGER, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when the gold of 0, and a bronze larger than 1?
SELECT MAX(total) FROM table_name_25 WHERE gold = 0 AND bronze > 1
sql_create_context
CREATE TABLE table_name_97 ( record VARCHAR, game_site VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Record on Week 13 at the Hoosier Dome?
SELECT record FROM table_name_97 WHERE game_site = "hoosier dome" AND week = 13
sql_create_context
CREATE TABLE table_name_6 ( college VARCHAR, pick VARCHAR, round VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college had a pick in a round under 7, with a pick number 13 and overall was under 186?
SELECT college FROM table_name_6 WHERE round < 7 AND overall < 186 AND pick = 13
sql_create_context
CREATE TABLE table_27573848_18 ( general_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different people had a General Classification on Stage 5?
SELECT COUNT(general_classification) FROM table_27573848_18 WHERE stage = 5
sql_create_context
CREATE TABLE table_28237 ( "NSG Nr." real, "Name of the nature reserve" text, "District / Town" text, "Area (ha)" text, "Date established" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Stellbrookmoor established?
SELECT "Date established" FROM table_28237 WHERE "Name of the nature reserve" = 'Stellbrookmoor'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "HOME"
mimicsql_data
CREATE TABLE table_52871 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the high lap total for a grid less than 6, and a Time/Retired of halfshaft?
SELECT MAX("Laps") FROM table_52871 WHERE "Grid" < '6' AND "Time/Retired" = 'halfshaft'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, ...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-11300' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pa...
eicu
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_7322 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Outcome of the match with Partner Kateryna Bondarenko?
SELECT "Outcome" FROM table_7322 WHERE "Partner" = 'kateryna bondarenko'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
SELECT Id AS "comment_link", Text, CreationDate FROM Comments WHERE Text LIKE '%http://idownvotedbecau.se/%' AND LEN(Text) <= '##CommentLength:int##' AND CreationDate > DATEADD(dd, -'##CreationDate:int?30##', GETDATE())
sede
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 person_info JOIN hz_info JOIN zyjzjlb 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 WHERE person_info.XM = '冯勇军' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2019-11-18')
css
CREATE TABLE table_name_12 ( date VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did NY Rangers play at home?
SELECT date FROM table_name_12 WHERE home = "ny rangers"
sql_create_context
CREATE TABLE table_14511 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for record 3-3
SELECT "Date" FROM table_14511 WHERE "Record" = '3-3'
wikisql
CREATE TABLE table_name_61 ( country VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is player jay haas, who is in t10 place, from?
SELECT country FROM table_name_61 WHERE place = "t10" AND player = "jay haas"
sql_create_context
CREATE TABLE table_name_46 ( location VARCHAR, round VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of fightfest 2, which has 3 rounds?
SELECT location FROM table_name_46 WHERE round = 3 AND event = "fightfest 2"
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.diagnosis = "VENTRICULAR TACHYCARDIA" AND demographic.age < "70"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J...
css
CREATE TABLE table_29918 ( "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. -- What t...
SELECT "Team" FROM table_29918 WHERE "Date" = 'April 6'
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 patient.age FROM patient WHERE patient.uniquepid = '006-143187' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE table_name_58 ( week INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What average week number had the Chicago bears as the opponent?
SELECT AVG(week) FROM table_name_58 WHERE opponent = "chicago bears"
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 Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name
nvbench
CREATE TABLE table_56664 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the time/retired is electrical how many laps did Rubens Barrichello have?
SELECT "Laps" FROM table_56664 WHERE "Time/Retired" = 'electrical' AND "Driver" = 'rubens barrichello'
wikisql
CREATE TABLE table_14640 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Marja Ridder won the Women's singles who won ...
SELECT "Men's singles" FROM table_14640 WHERE "Women's singles" = 'marja ridder'
wikisql
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CO...
SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM ORDER BY CLASS_ROOM DESC
nvbench
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 prescriptions ( subject_id text, hadm_id...
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 = "41512" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-43795')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
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 WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.age < "20"
mimicsql_data
CREATE TABLE table_name_61 ( attendance INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the home game against the New York Jets?
SELECT SUM(attendance) FROM table_name_61 WHERE opponent = "new york jets"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate ...
SELECT COUNT(p.Id) AS TotalPosts, SUM(CAST(ViewCount AS FLOAT)) AS TotalViews, SUM(AnswerCount) AS TotalAnswers, SUM(CommentCount) AS TotalComments, SUM(Score) AS TotalScore, SUM(FavoriteCount) AS TotalFavourites, tg.TagName FROM Posts AS p INNER JOIN PostTags AS t ON p.Id = t.PostId INNER JOIN Tags AS tg ON tg.Id = t....
sede
CREATE TABLE table_name_78 ( team_nickname VARCHAR, joined_tschl INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the team nickname that joined tschl after 2010?
SELECT team_nickname FROM table_name_78 WHERE joined_tschl > 2010
sql_create_context
CREATE TABLE table_65658 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location and attendance when the record was 19-17?
SELECT "Location/Attendance" FROM table_65658 WHERE "Record" = '19-17'
wikisql
CREATE TABLE table_name_17 ( club VARCHAR, group VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When in 2009 season has a Group of group b, and cancha del mystic with a Club of el tecal?
SELECT 2009 AS _season FROM table_name_17 WHERE group = "group b" AND stadium = "cancha del mystic" AND club = "el tecal"
sql_create_context
CREATE TABLE table_325 ( "Country" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who scored a 9.72 in the swimsuit?
SELECT "Interview" FROM table_325 WHERE "Swimsuit" = '9.72'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
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 = '022-199074')) AND NOT vitalperiodic.sao2 IS NULL OR...
eicu
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '俞...
css
CREATE TABLE host ( host_id number, name text, nationality text, age text ) CREATE TABLE party_host ( party_id number, host_id number, is_main_in_charge others ) CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, ...
SELECT party_theme FROM party ORDER BY number_of_hosts
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl...
css
CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), ...
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY purchase_details DESC
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay = "23"
mimicsql_data
CREATE TABLE table_204_974 ( id number, "season" number, "level" text, "division" text, "section" text, "administration" text, "position" text, "movements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many 2nd positions were there ...
SELECT COUNT(*) FROM table_204_974 WHERE "position" = 2
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT prescriptions.icustay_id, prescriptions.drug_type FROM prescriptions WHERE prescriptions.subject_id = "74032"
mimicsql_data
CREATE TABLE table_74807 ( "Year" real, "Driver" text, "Nation of citizenship" text, "Racing series" text, "Type of vehicle" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver has a stock car vehicle with a year of 1999?
SELECT "Driver" FROM table_74807 WHERE "Type of vehicle" = 'stock car' AND "Year" = '1999'
wikisql
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "OVERDOSE"
mimicsql_data
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 lab ( subject_id text, hadm_id text, ...
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Dexamethasone"
mimicsql_data
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 ...
css
CREATE TABLE table_12112 ( "Team" text, "Average" real, "Points" real, "Played" real, "1988-89" text, "1989-90" text, "1990-1991" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total average when there are less than 107 points, 19...
SELECT SUM("Average") FROM table_12112 WHERE "1988-89" = '33' AND "1989-90" = '36' AND "Points" < '107'
wikisql
CREATE TABLE table_2670 ( "Event" text, "Season" text, "Compulsory Dance (CD)" text, "Original Dance (OD)" text, "Free Dance (FD)" text, "Combined Total Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what even was the compulsory dance ...
SELECT "Event" FROM table_2670 WHERE "Compulsory Dance (CD)" = '23.75'
wikisql
CREATE TABLE table_name_15 ( against INTEGER, byes VARCHAR, losses VARCHAR, mininera_dfl VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many against for the Moyston-Willaura team with 4 losses and fewer than 2 byes?
SELECT MAX(against) FROM table_name_15 WHERE losses = 4 AND mininera_dfl = "moyston-willaura" AND byes < 2
sql_create_context
CREATE TABLE table_14058433_5 ( points_for VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the points for with lost being 4
SELECT points_for FROM table_14058433_5 WHERE lost = "4"
sql_create_context
CREATE TABLE table_name_13 ( surface VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Surface has a Score of 2009 wta tour?
SELECT surface FROM table_name_13 WHERE score = "2009 wta tour"
sql_create_context
CREATE TABLE table_name_84 ( city VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has the ICAO of LIRF?
SELECT city FROM table_name_84 WHERE icao = "lirf"
sql_create_context
CREATE TABLE table_8814 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest pick of the wr player with an overall less than 15?
SELECT MAX("Pick") FROM table_8814 WHERE "Position" = 'wr' AND "Overall" < '15'
wikisql
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND CITY_...
atis
CREATE TABLE table_23726 ( "Date" text, "Presenter" text, "Guest 1" text, "Guest 2" text, "Guest 3" text, "Guest 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the guest 1 in the episode where guest 4 is Jill Douglas?
SELECT "Guest 1" FROM table_23726 WHERE "Guest 4" = 'Jill Douglas'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number...
SELECT TIME_TO_STR(CreationDate, '%Y') AS CreationYear, COUNT(*) AS TagCount FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId JOIN Posts ON Posts.Id = PostTags.PostId WHERE TagName IN (@Tag) GROUP BY TIME_TO_STR(CreationDate, '%Y') ORDER BY TIME_TO_STR(CreationDate, '%Y')
sede
CREATE TABLE table_name_88 ( region VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What region is the catalogue released on June 8, 2004 from?
SELECT region FROM table_name_88 WHERE date = "june 8, 2004"
sql_create_context
CREATE TABLE table_202_233 ( id number, "date and time" text, "opponent" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which opponent did kindley have the most victories against ?
SELECT "opponent" FROM table_202_233 GROUP BY "opponent" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_79822 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is The Melbourne with a No- Gold Coast
SELECT "Melbourne" FROM table_79822 WHERE "Gold Coast" = 'no'
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '47170641' AND t_kc22.STA_DATE BETWEEN '2003-05-14' AND '2009-01-31' AND t_kc22.SELF_PAY_AMO > 6302.95
css
CREATE TABLE table_name_2 ( malaysia_cup VARCHAR, total VARCHAR, league VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Malaysia Cups have 0 for the total with a league greater than 0?
SELECT COUNT(malaysia_cup) FROM table_name_2 WHERE total = 0 AND league > 0
sql_create_context
CREATE TABLE table_24132083_1 ( original_air_date VARCHAR, directed_by VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On how many different dates did the episode directed by Marcos Siega and written by Scott Buck air for the first tim...
SELECT COUNT(original_air_date) FROM table_24132083_1 WHERE directed_by = "Marcos Siega" AND written_by = "Scott Buck"
sql_create_context
CREATE TABLE table_71670 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of a state Authority that has a Roll of 72?
SELECT "Name" FROM table_71670 WHERE "Authority" = 'state' AND "Roll" = '72'
wikisql
CREATE TABLE table_11384 ( "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. -- Which away team was at windy hill?
SELECT "Away team" FROM table_11384 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE t...
SELECT Name, Total_Passengers FROM station WHERE Location <> 'London' ORDER BY Name
nvbench
CREATE TABLE table_203_283 ( id number, "#" number, "name" text, "strike tone\n(st-1/16)" text, "weight\n(kg)" number, "diameter\n(mm)" number, "inscription" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference of weight bet...
SELECT (SELECT "weight\n(kg)" FROM table_203_283 WHERE "name" = 'maria') - (SELECT "weight\n(kg)" FROM table_203_283 WHERE "name" = 'carolus')
squall
CREATE TABLE table_50909 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the method of resolution for the fight at cage warriors 39?...
SELECT "Method" FROM table_50909 WHERE "Event" = 'cage warriors 39'
wikisql
CREATE TABLE table_name_93 ( wins INTEGER, goals_for VARCHAR, games_played VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of wins with 7 games played and goals against less than 46 when goals for is ...
SELECT MIN(wins) FROM table_name_93 WHERE games_played = 7 AND goals_against < 46 AND goals_for > 34
sql_create_context
CREATE TABLE table_16705 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the crowd when the grand fina...
SELECT "Crowd" FROM table_16705 WHERE "Grand Finalist" = 'South Melbourne'
wikisql
CREATE TABLE zyjybgb ( 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 hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON 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 = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf...
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '凤德容' AND t_kc21.MED_SER_ORG_NO = '8078105' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-02-04' AND '2014-05-24')
css
CREATE TABLE table_name_28 ( time_retired VARCHAR, laps VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was time/retired with less than 67 laps and 6 points?
SELECT time_retired FROM table_name_28 WHERE laps < 67 AND points = 6
sql_create_context
CREATE TABLE table_name_49 ( province VARCHAR, period VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the province of 1941-1946
SELECT province FROM table_name_49 WHERE period = "1941-1946"
sql_create_context
CREATE TABLE checking ( custid number, balance number ) CREATE TABLE savings ( custid number, balance number ) CREATE TABLE accounts ( custid number, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of accounts whose checking ...
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking)
spider
CREATE TABLE table_58367 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How few laps were finished in 17?
SELECT MIN("Laps") FROM table_58367 WHERE "Finish" = '17'
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 SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '云昂雄' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-08-10' AND '2011-12-12'
css
CREATE TABLE table_name_90 ( type VARCHAR, fleet_numbers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Type has a Fleet numbers of 2 8, 91 92, 97 100?
SELECT type FROM table_name_90 WHERE fleet_numbers = "2–8, 91–92, 97–100"
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 zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 WHERE person_info.XM = '奚子平' ...
css
CREATE TABLE table_58071 ( "Tournament" text, "Winner" text, "Runner-up" text, "Score" text, "Third Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when Stefan Edberg won?
SELECT "Score" FROM table_58071 WHERE "Winner" = 'stefan edberg'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, ...
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3415980' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-08-09' AND '2005-09-08' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 7321.4) AS T
css
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CR...
SELECT AVG(CAST(ROUND(Reputation, -FLOOR(LOG(10, Reputation))) AS INT)) AS UserReputation, AVG(CAST(Posts.Score AS FLOAT)) AS AverageAnswerScore FROM Posts INNER JOIN Users ON (Users.Id = Posts.OwnerUserId) WHERE PostTypeId = 2 GROUP BY ROUND(Reputation, -FLOOR(LOG(10, Reputation))) ORDER BY UserReputation
sede
CREATE TABLE table_name_15 ( week INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of week for result of l 24 21
SELECT SUM(week) FROM table_name_15 WHERE result = "l 24–21"
sql_create_context
CREATE TABLE table_42225 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of top-25s for events with more than 0 wins?
SELECT MIN("Top-25") FROM table_42225 WHERE "Wins" > '0'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) ...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ATLANTA' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_30739 ( "Region Represented" text, "First Place" real, "Second Place" real, "Third Place" real, "Total Top 3 Placements" real, "First Place Winning Year(s) (if applicable)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT MAX("Second Place") FROM table_30739 WHERE "Region Represented" = 'Tajikistan'
wikisql
CREATE TABLE table_name_35 ( high_assists VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the High assists when jalen rose (22) had the high points?
SELECT high_assists FROM table_name_35 WHERE high_points = "jalen rose (22)"
sql_create_context
CREATE TABLE table_20191 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the years in orlando for forward
SELECT "Years in Orlando" FROM table_20191 WHERE "Position" = 'Forward'
wikisql
CREATE TABLE table_19398 ( "#" real, "Episode Title" text, "Situation" text, "Date of Situation" text, "Nature of Situation" text, "Original U.S. Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many # entries are there for the date o...
SELECT COUNT("#") FROM table_19398 WHERE "Date of Situation" = '23 January 2003'
wikisql
CREATE TABLE table_70685 ( "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. -- What is the date that a game at the Alltel Stadium had a final score of 6-20?
SELECT "Date" FROM table_70685 WHERE "Stadium" = 'alltel stadium' AND "Final Score" = '6-20'
wikisql
CREATE TABLE table_24182 ( "Model" text, "Years" text, "Type/code" text, "Transmission" text, "max. power" text, "Torque" text, "0-km/h (mph) (sec)" text, "top speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum spe...
SELECT "top speed" FROM table_24182 WHERE "max. power" = 'PS (kW; bhp)'
wikisql