instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_12 ( year_won INTEGER, player VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year won Paul Azinger had with a to par higher than 5?
SELECT MIN(year_won) FROM table_name_12 WHERE player = "paul azinger" AND to_par > 5
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '奚星晖' AND MED_SER_ORG_NO = '5472060' AND NOT OUT_DIAG_DIS_NM LIKE '%社交%'
css
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
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 = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND ...
atis
CREATE TABLE table_13490 ( "Date" text, "Japan" text, "Americas" text, "Other" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had Japanese sales of 0.59 million?
SELECT "Date" FROM table_13490 WHERE "Japan" = '0.59 million'
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...
WITH times_cte AS (SELECT p.Id AS pid, p.CreationDate AS cre, ph.CreationDate AS hot, FLOOR(CAST(CAST((JULIANDAY(CreationDate) - JULIANDAY(p.CreationDate)) * 1440.0 AS INT) AS FLOAT) / '##interval?10##') AS time FROM PostHistory AS ph INNER JOIN Posts AS p ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 52) SELECT tim...
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 COUNT(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_ID = '90084471' AND qtb.IN_HOSP_DATE BETWEEN '2008-08-17' AND '2018-05-20' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_ID = '90084471' AND gyb.IN_HOSP_DATE BETWEEN '2008-08-17' AND '2018-05-20' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zy...
css
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT groupyear FROM torrents GROUP BY groupyear ORDER BY COUNT(groupname) DESC LIMIT 1
whatcdhiphop
CREATE TABLE table_47208 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- for how many years did the player who graduated from stanford play for Grizz...
SELECT "Years for Grizzlies" FROM table_47208 WHERE "School/Club Team" = 'stanford'
wikisql
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_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '严光辉' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_name_88 ( goals_for INTEGER, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest goals for more than 30 games played?
SELECT MIN(goals_for) FROM table_name_88 WHERE played > 30
sql_create_context
CREATE TABLE table_67919 ( "Name" text, "Period" text, "Matches" real, "Wins" real, "Draws" real, "Losses" real, "Efficiency %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Draws with less than 4 matches?
SELECT COUNT("Draws") FROM table_67919 WHERE "Matches" < '4'
wikisql
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 = '8898248' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-11-20' AND '2014-03-05' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 5327.65) AS T
css
CREATE TABLE table_train_277 ( "id" int, "gender" string, "cholesterol" float, "blood_platelet_counts" int, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "severe_dyslipidemia" bool, "fasting_triglyceride" int, "body_mass_index_bmi" float, "trig...
SELECT * FROM table_train_277 WHERE fasting_triglyceride > 250
criteria2sql
CREATE TABLE table_14115 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the partner on May 16, 2004?
SELECT "Partner" FROM table_14115 WHERE "Date" = 'may 16, 2004'
wikisql
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, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.JZLSH = j...
css
CREATE TABLE table_4136 ( "Stadium" text, "Location" text, "Opened" real, "Built for" text, "Capacity at Construction" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the stadium in Moorabbin, Victoria built for?
SELECT "Built for" FROM table_4136 WHERE "Location" = 'Moorabbin, Victoria'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, h...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE table_22050544_3 ( event VARCHAR, entries VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event had 25,883 entries?
SELECT event FROM table_22050544_3 WHERE entries = "25,883"
sql_create_context
CREATE TABLE table_204_162 ( id number, "team" text, "constructor" text, "motorcycle" text, "tyres" text, "no" number, "rider" text, "rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which team was larger than the rest ?
SELECT "team" FROM table_204_162 GROUP BY "team" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_46 ( score VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the score on february 18 when the visitors are the montreal canadiens?
SELECT score FROM table_name_46 WHERE visitor = "montreal canadiens" AND date = "february 18"
sql_create_context
CREATE TABLE table_77396 ( "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_77396 WHERE "Team" = 'atlanta'
wikisql
CREATE TABLE table_34100 ( "Round" real, "Track" text, "Date" text, "Pole Position" text, "Fastest Race Lap" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of team impul with the date of 8 july
SELECT SUM("Round") FROM table_34100 WHERE "Team" = 'team impul' AND "Date" = '8 july'
wikisql
CREATE TABLE table_name_93 ( record VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record when Tampa Bay is the visitor?
SELECT record FROM table_name_93 WHERE visitor = "tampa bay"
sql_create_context
CREATE TABLE table_203_465 ( id number, "name" text, "population (2002 census)" number, "population (2007 estimation)" number, "population (2011 census)" number, "area (km2)" number, "density (pop/km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "population (2007 estimation)" FROM table_203_465 WHERE "name" = 'predeal'
squall
CREATE TABLE table_47614 ( "Date" text, "Competition" text, "Winners" text, "Score" text, "Runners-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score in the game that was won by Sligo Rovers F.C.?
SELECT "Score" FROM table_47614 WHERE "Winners" = 'sligo rovers f.c.'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "1821"
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2686792' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE club ( Club_ID int, ...
SELECT Country, COUNT(Country) FROM competition GROUP BY Country
nvbench
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_29606 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "First Star" text, "Decision" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Decision" FROM table_29606 WHERE "Score" = '1-7'
wikisql
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "RASH" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_64931 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Attendance has a Score of 4 3, and Points s...
SELECT MAX("Attendance") FROM table_64931 WHERE "Score" = '4–3' AND "Points" < '5'
wikisql
CREATE TABLE table_5088 ( "Station Code" text, "Station Name" text, "Arrival" text, "Departure" text, "Platform" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Station Code of the Destination Station Departure?
SELECT "Station Code" FROM table_5088 WHERE "Departure" = 'destination station'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'proventil,ventolin' AND patient.uniquepid = '005-48105' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIM...
eicu
CREATE TABLE table_21086 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the most recently named feature named?
SELECT MAX("Year named") FROM table_21086
wikisql
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), ...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE, CRS_DESCRIPTION
nvbench
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are th...
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class
nvbench
CREATE TABLE table_204_692 ( id number, "publication" text, "score" text, "review" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of publications ?
SELECT COUNT("publication") FROM table_204_692
squall
CREATE TABLE table_1737 ( "Episode" real, "Original title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Duration" text, "Viewership" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of original t...
SELECT COUNT("Original title") FROM table_1737 WHERE "Written by" = 'John Sullivan and Keith Lindsay'
wikisql
CREATE TABLE table_10808 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score in the final on ...
SELECT "Score in the final" FROM table_10808 WHERE "Date" = '14 august 1994'
wikisql
CREATE TABLE member ( Name VARCHAR, Country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the names of members whose country is 'United States' or 'Canada'.
SELECT Name FROM member WHERE Country = "United States" OR Country = "Canada"
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "30" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE manufacturer ( manufacturer_id number, open_year number, name text, num_of_factories number, num_of_shops number ) CREATE TABLE furniture_manufacte ( manufacturer_id number, furniture_id number, price_in_dollar number ) CREATE TABLE furniture ( furniture_id number, ...
SELECT num_of_component, name FROM furniture WHERE num_of_component > 10
spider
CREATE TABLE table_7825 ( "Country" text, "2010" real, "2011" real, "2012" real, "2013" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of participants in 2012 when there were less than 8 in 2013 and 7 in 2011?
SELECT AVG("2012") FROM table_7825 WHERE "2013" < '8' AND "2011" = '7'
wikisql
CREATE TABLE table_150 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The stenhousemuir team had how many highest attendances?
SELECT COUNT("Highest") FROM table_150 WHERE "Team" = 'Stenhousemuir'
wikisql
CREATE TABLE table_name_87 ( interacting__settings_ VARCHAR, need VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the interacting for need of protection
SELECT interacting__settings_ FROM table_name_87 WHERE need = "protection"
sql_create_context
CREATE TABLE table_10163 ( "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. -- Who was the away team when Geelong was the home ...
SELECT "Away team" FROM table_10163 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE table_203_358 ( id number, "pos." number, "athlete" text, "run 1" number, "run 2" number, "total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many athlete 's first run was between 51 and 52 seconds ?
SELECT COUNT("athlete") FROM table_203_358 WHERE "run 1" >= 51 AND "run 1" <= 52
squall
CREATE TABLE table_name_28 ( bronze INTEGER, gold VARCHAR, nation VARCHAR, silver VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total bronze medals when the silver medals is 0, and 1 is the rank, Brazil (BRA) is the nat...
SELECT SUM(bronze) FROM table_name_28 WHERE silver = 0 AND rank = "1" AND nation = "brazil (bra)" AND gold < 2
sql_create_context
CREATE TABLE table_name_68 ( enrollment VARCHAR, established INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the enrollment of the university established in or after 2011?
SELECT enrollment FROM table_name_68 WHERE established > 2011
sql_create_context
CREATE TABLE table_43174 ( "Rd. / Race" text, "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date for the City/State of Sydney, New South ...
SELECT "Date" FROM table_43174 WHERE "City / State" = 'sydney, new south wales'
wikisql
CREATE TABLE table_name_41 ( total INTEGER, rank VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total when the rank is 7 and gold is more than 0?
SELECT AVG(total) FROM table_name_41 WHERE rank = "7" AND gold > 0
sql_create_context
CREATE TABLE table_453 ( "Episode" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the theme for the episode selection process?
SELECT "Theme" FROM table_453 WHERE "Episode" = 'Selection Process'
wikisql
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_NM = '魏星辰' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '魏星辰' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_...
css
CREATE TABLE table_79554 ( "Date" text, "Location" text, "Lineup" text, "Assist/pass" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Result of the Lineup of start, an Assist/pass of c...
SELECT "Result" FROM table_79554 WHERE "Lineup" = 'start' AND "Assist/pass" = 'carli lloyd' AND "Competition" = '2011 fifa women’s world cup – group stage'
wikisql
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '4040000' AND IN_HOSP_DATE BETWEEN '2000-10-19' AND '2016-12-23') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '4040000' AND IN_HOSP_DATE BETWEEN '2000-10-19' AND '2016-12-23' AND MED_ORG_DEPT_NM = '慢病科')
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx-rectal ...
mimic_iii
CREATE TABLE table_33266 ( "Game Name" text, "Price" text, "Top Prize" text, "Launch Date" text, "Odds of Winning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the top price of $1 with a launch date on February 12, 2008?
SELECT "Top Prize" FROM table_33266 WHERE "Price" = '$1' AND "Launch Date" = 'february 12, 2008'
wikisql
CREATE TABLE table_name_72 ( lane VARCHAR, time VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Lanes have a rank higher than 3 with a time of 2:08.11?
SELECT COUNT(lane) FROM table_name_72 WHERE time = "2:08.11" AND rank > 3
sql_create_context
CREATE TABLE table_name_17 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on April 22?
SELECT score FROM table_name_17 WHERE date = "april 22"
sql_create_context
CREATE TABLE table_name_89 ( winning_score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score on Aug 28, 1983?
SELECT winning_score FROM table_name_89 WHERE date = "aug 28, 1983"
sql_create_context
CREATE TABLE table_25818630_1 ( affiliation VARCHAR, candidate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every affiliation for candidate Daren Ireland?
SELECT affiliation FROM table_25818630_1 WHERE candidate = "Daren Ireland"
sql_create_context
CREATE TABLE table_56903 ( "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. -- Where was the game played where the home team wa...
SELECT "Venue" FROM table_56903 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zo...
SELECT DISTINCT flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CI...
atis
CREATE TABLE table_name_33 ( european_competitions VARCHAR, tier INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the European competition when the tier is more than 2?
SELECT european_competitions FROM table_name_33 WHERE tier > 2
sql_create_context
CREATE TABLE table_name_59 ( cuts_made INTEGER, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of cuts when there were more than 0 wins?
SELECT MIN(cuts_made) FROM table_name_59 WHERE wins > 0
sql_create_context
CREATE TABLE table_name_71 ( laps INTEGER, driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Laps with a Grid smaller than 11 did John Watson have?
SELECT AVG(laps) FROM table_name_71 WHERE driver = "john watson" AND grid < 11
sql_create_context
CREATE TABLE table_name_48 ( attendance VARCHAR, arena VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Attendance at Jobing.com Arena?
SELECT COUNT(attendance) FROM table_name_48 WHERE arena = "jobing.com arena"
sql_create_context
CREATE TABLE table_name_49 ( republican_ticket VARCHAR, democratic_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Republican ticket with a Democratic ticket of matthew j. merritt?
SELECT republican_ticket FROM table_name_49 WHERE democratic_ticket = "matthew j. merritt"
sql_create_context
CREATE TABLE table_4571 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date in which the Crowed was over 10,...
SELECT "Date" FROM table_4571 WHERE "Crowd" > '10,300' AND "Home team" = 'melbourne'
wikisql
CREATE TABLE table_name_2 ( round INTEGER, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average round number for East Carolina?
SELECT AVG(round) FROM table_name_2 WHERE school = "east carolina"
sql_create_context
CREATE TABLE Office_locations ( building_id VARCHAR, company_id VARCHAR ) CREATE TABLE buildings ( name VARCHAR, id VARCHAR ) CREATE TABLE Companies ( id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the name of the building that has the ...
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_92 ( silver INTEGER, gold VARCHAR, total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of silver when total is mor ethan 1, bronze is 1 and gold is les than 0
SELECT SUM(silver) FROM table_name_92 WHERE total > 1 AND bronze = 1 AND gold < 0
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "86"
mimicsql_data
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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....
css
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real...
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.id
nvbench
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(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_ID = '17722570' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-12-03' AND '2015-08-20'
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) 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.MED_SER_ORG_NO = '4694071' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_D...
css
CREATE TABLE table_name_75 ( bronze VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Bronze that's also got a Godl of Kim Woo-Jin?
SELECT bronze FROM table_name_75 WHERE gold = "kim woo-jin"
sql_create_context
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.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '43665866915'
css
CREATE TABLE table_56911 ( "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. -- When the home team scored 11.15 (81), what did t...
SELECT "Away team score" FROM table_56911 WHERE "Home team score" = '11.15 (81)'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jo...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_id
restaurants
CREATE TABLE table_204_57 ( id number, "year" number, "film" text, "role" text, "language" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which language has madhurima spoken more often in films : malayalam or telugu ?
SELECT "language" FROM table_204_57 WHERE "language" IN ('malayalam', 'telugu') GROUP BY "language" ORDER BY COUNT("film") DESC LIMIT 1
squall
CREATE TABLE table_name_4 ( years VARCHAR, jersey_number_s_ VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did the player with the jersey number 33 and played position pf play?
SELECT years FROM table_name_4 WHERE jersey_number_s_ = 33 AND position = "pf"
sql_create_context
CREATE TABLE table_48449 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest numbered game with an opponent of Minnesota North Stars earlier than February 25?
SELECT MIN("Game") FROM table_48449 WHERE "Opponent" = 'minnesota north stars' AND "February" < '25'
wikisql
CREATE TABLE table_19072602_1 ( score VARCHAR, team_europe VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when Tore Torgersen played for Team Europe?
SELECT score FROM table_19072602_1 WHERE team_europe = "Tore Torgersen"
sql_create_context
CREATE TABLE table_name_26 ( state VARCHAR, interview VARCHAR, swimsuit VARCHAR, evening_gown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state had less than 8.874 for swimsuit, less than 9.257 for evening gown, and less than 9.121 for interv...
SELECT state FROM table_name_26 WHERE swimsuit < 8.874 AND evening_gown < 9.257 AND interview < 9.121
sql_create_context
CREATE TABLE table_name_85 ( rank INTEGER, lane VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank of a swimmer named Elizabeth Van Welie with a lane larger than 5?
SELECT MIN(rank) FROM table_name_85 WHERE lane > 5 AND name = "elizabeth van welie"
sql_create_context
CREATE TABLE table_name_64 ( owner VARCHAR, trainer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Owner's Trainer is Todd A. Pletcher?
SELECT owner FROM table_name_64 WHERE trainer = "todd a. pletcher"
sql_create_context
CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Description VARCHAR(30) ) CREATE TABLE On_Call ( Nurse INTEGER, BlockFloor INTEGER, BlockCode INTEGER, OnCallStart DATETIME, OnCallEnd DATETIME ) CREATE TABLE Procedures ( Code INTEGER, Name VARCHA...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
SELECT 'close_votes', COUNT(*) FROM (SELECT COUNT(*) AS "close_votes" FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 6 AND NOT Posts.ClosedDate IS NULL GROUP BY Posts.Id) AS X GROUP BY 'close_votes'
sede
CREATE TABLE table_23284271_10 ( high_assists VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the high assists when 50-26 is the record?
SELECT high_assists FROM table_23284271_10 WHERE record = "50-26"
sql_create_context
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1714876' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-08' AND '2016-11-26' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 6282.3 UNION SELECT gyb.MED_ORG_DEPT_CD FROM...
css
CREATE TABLE table_2791668_1 ( title VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the episode whose writer is philippe browning?
SELECT title FROM table_2791668_1 WHERE written_by = "Philippe Browning"
sql_create_context
CREATE TABLE table_27098 ( "#" real, "Title" text, "Director" text, "Writer(s)" text, "Viewers" text, "Air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 7.55 is the amount of viewers what is the lowest num...
SELECT MIN("#") FROM table_27098 WHERE "Viewers" = '7.55'
wikisql
CREATE TABLE table_3123 ( "Rank" text, "Player" text, "Nationality" text, "Team" text, "Opponent" text, "Score" text, "Competition" text, "Vote percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the player th...
SELECT "Player" FROM table_3123 WHERE "Vote percentage" = '7.85%'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID)
nvbench
CREATE TABLE table_11203 ( "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. -- Who was the Away team at Hawthorn?
SELECT "Home team" FROM table_11203 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_name_41 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the cubs on July 19?
SELECT record FROM table_name_41 WHERE date = "july 19"
sql_create_context