instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_14903491_1 ( womens_singles VARCHAR, womens_doubles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the womens singles for raina tzvetkova petya nedelcheva
SELECT womens_singles FROM table_14903491_1 WHERE womens_doubles = "Raina Tzvetkova Petya Nedelcheva"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '苗伟懋' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6998.54)
css
CREATE TABLE table_23293785_2 ( date VARCHAR, race_total_pts_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many dates have a total points for race of 180?
SELECT COUNT(date) FROM table_23293785_2 WHERE race_total_pts_ = 180
sql_create_context
CREATE TABLE table_23721 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players...
SELECT COUNT("Player") FROM table_23721 WHERE "180s" = '6'
wikisql
CREATE TABLE table_67960 ( "Year" real, "Population (Region total)" real, "Population (Stanthorpe)" real, "Population (Warwick)" real, "Population (Allora)" real, "Population (Glengallan)" real, "Population (Rosenthal)" real ) -- Using valid SQLite, answer the following questions for the t...
SELECT COUNT("Population (Stanthorpe)") FROM table_67960 WHERE "Population (Rosenthal)" = '1,553' AND "Population (Region total)" > '25,917'
wikisql
CREATE TABLE table_77276 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the match where the home team was Leicester City?
SELECT "Score" FROM table_77276 WHERE "Home team" = 'leicester city'
wikisql
CREATE TABLE table_39189 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round for the Minnesota Junior Stars (Mjhl)?
SELECT MAX("Round") FROM table_39189 WHERE "College/Junior/Club Team (League)" = 'minnesota junior stars (mjhl)'
wikisql
CREATE TABLE table_69928 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the opponent on november 14, 2005?
SELECT "Opponent" FROM table_69928 WHERE "Date" = 'november 14, 2005'
wikisql
CREATE TABLE table_203_420 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "home team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which stadium has the largest number of seats ?
SELECT "stadium" FROM table_203_420 ORDER BY "capacity" DESC LIMIT 1
squall
CREATE TABLE table_name_54 ( centerfold_model VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Centerfold model has a Date of 3-01?
SELECT centerfold_model FROM table_name_54 WHERE date = "3-01"
sql_create_context
CREATE TABLE table_name_47 ( tournament VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHich Tournament has a Finalist of marat safin (12)?
SELECT tournament FROM table_name_47 WHERE finalist = "marat safin (12)"
sql_create_context
CREATE TABLE table_name_8 ( time_retired VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time/retired for grid 5?
SELECT time_retired FROM table_name_8 WHERE grid = 5
sql_create_context
CREATE TABLE table_29217650_1 ( movies VARCHAR, december_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What film earmed p3.2 million on December 25?
SELECT movies FROM table_29217650_1 WHERE december_25 = "P3.2 million"
sql_create_context
CREATE TABLE table_32038 ( "Manager" text, "Ukraine career" text, "Played" real, "Drawn" real, "Lost" real, "Win %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years had a manager who lost more than 1 and drawn more than 11?
SELECT "Ukraine career" FROM table_32038 WHERE "Lost" > '1' AND "Drawn" > '11'
wikisql
CREATE TABLE table_5868 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NHL team of dave murphy?
SELECT "NHL team" FROM table_5868 WHERE "Player" = 'dave murphy'
wikisql
CREATE TABLE table_12077 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Club team of brandon wheat kings (whl)?
SELECT "Round" FROM table_12077 WHERE "Club team" = 'brandon wheat kings (whl)'
wikisql
CREATE TABLE table_name_88 ( authority VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the authority for morrinsville college
SELECT authority FROM table_name_88 WHERE name = "morrinsville college"
sql_create_context
CREATE TABLE table_name_50 ( week_4 VARCHAR, week_9 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Week 4 has a Week 9 of all housemates?
SELECT week_4 FROM table_name_50 WHERE week_9 = "all housemates"
sql_create_context
CREATE TABLE table_203_502 ( id number, "team" text, "titles" number, "runner-up" number, "third place" number, "fourth place" number, "years participated" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which school has placed fourth the m...
SELECT "team" FROM table_203_502 ORDER BY "fourth place" DESC LIMIT 1
squall
CREATE TABLE table_49604 ( "Place" text, "Country" text, "Qualifying Grand Prix" text, "Class" text, "Dates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Class, when Dates is '22 April - 3 May 2009'?
SELECT "Class" FROM table_49604 WHERE "Dates" = '22 april - 3 may 2009'
wikisql
CREATE TABLE table_54383 ( "Rank" text, "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the highest silver for table tennis and bronze more than 0
SELECT MAX("Silver") FROM table_54383 WHERE "Sport" = 'table tennis' AND "Bronze" > '0'
wikisql
CREATE TABLE table_203_231 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many years were they in tier 3
SELECT COUNT("season") FROM table_203_231 WHERE "tier" = 3
squall
CREATE TABLE table_134987_3 ( target_city__market VARCHAR, city_of_license VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the market city/market(s) for Rapid City Alternative format?
SELECT target_city__market FROM table_134987_3 WHERE city_of_license = "Rapid City" AND format = "Alternative"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ...
SELECT COUNT(q.Id) FROM Posts AS q INNER JOIN PostHistory AS ph ON q.Id = ph.PostId WHERE q.PostTypeId = 1 AND NOT ClosedDate IS NULL AND q.Body LIKE '%started%'
sede
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 medication ( medi...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'ns 0.9%' AND STR...
eicu
CREATE TABLE table_204_12 ( id number, "area served" text, "city of license" text, "vc" number, "rf" number, "callsign" text, "network" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which city is served by the most full po...
SELECT "city of license" FROM table_204_12 GROUP BY "city of license" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay = "16"
mimicsql_data
CREATE TABLE school ( School_name VARCHAR, Mascot VARCHAR, IHSAA_Football_Class VARCHAR, school_id VARCHAR ) CREATE TABLE budget ( school_id VARCHAR, total_budget_percent_invested VARCHAR, total_budget_percent_budgeted VARCHAR ) -- Using valid SQLite, answer the following questions for th...
SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested, T2.total_budget_percent_budgeted
sql_create_context
CREATE TABLE table_name_56 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day had 37,500 attending?
SELECT date FROM table_name_56 WHERE attendance = "37,500"
sql_create_context
CREATE TABLE table_name_25 ( süskən VARCHAR, malax VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the S sk n village with a Malax village me ba ?
SELECT süskən FROM table_name_25 WHERE malax = "meşəbaş"
sql_create_context
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 jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '62752967258'
css
CREATE TABLE table_48494 ( "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 attendance for the game against the Houston Oilers?
SELECT "Attendance" FROM table_48494 WHERE "Opponent" = 'houston oilers'
wikisql
CREATE TABLE table_4871 ( "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 away team that features a home team o...
SELECT "Away team score" FROM table_4871 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_29836 ( "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 w...
SELECT "Location Attendance" FROM table_29836 WHERE "Team" = 'Charlotte'
wikisql
CREATE TABLE table_name_41 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Crowd number for the Away team of Richmond?
SELECT SUM(crowd) FROM table_name_41 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE table_29437 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Directed by" FROM table_29437 WHERE "Written by" = 'Elaine Ko'
wikisql
CREATE TABLE table_35869 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event has 12-1 as a record?
SELECT "Event" FROM table_35869 WHERE "Record" = '12-1'
wikisql
CREATE TABLE table_203_476 ( id number, "no." number, "title (latin)" text, "title (english translation)" text, "subject" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the number of titles with a date of november ?
SELECT COUNT("title (latin)") FROM table_203_476 WHERE "date" = 11
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, h...
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'twin-mate lb-in hos w cs') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1205) AND DATETIM...
mimic_iii
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 lab ( labid numbe...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636' AND patient.hospitaldischargetime IS NULL)) AND medication.drugn...
eicu
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) 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...
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY Allergy DESC
nvbench
CREATE TABLE table_name_64 ( election INTEGER, mayor VARCHAR, inhabitants VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Election year was Adalberto Mosaner the Mayor with less than 16,170 Inhabitants?
SELECT SUM(election) FROM table_name_64 WHERE mayor = "adalberto mosaner" AND inhabitants < 16 OFFSET 170
sql_create_context
CREATE TABLE table_52259 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue when the home team is melbourne?
SELECT "Venue" FROM table_52259 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50915"
mimicsql_data
CREATE TABLE table_name_98 ( runs VARCHAR, batting_partners VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many runs did Vijay Hazare and Gul Mohammad score?
SELECT runs FROM table_name_98 WHERE batting_partners = "vijay hazare and gul mohammad"
sql_create_context
CREATE TABLE table_58504 ( "Grid" real, "Driver" text, "Constructor" text, "Qual" real, "Rank" real, "Laps" real, "Time/Retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which constructor has Chuck Weyant as a driver, 45 laps, and a qu...
SELECT "Constructor" FROM table_58504 WHERE "Laps" = '45' AND "Qual" < '142.29' AND "Driver" = 'chuck weyant'
wikisql
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 microlab ( microl...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091...
eicu
CREATE TABLE table_40419 ( "Advocate" text, "Wins" real, "Losses" real, "Ties" real, "Poll wins" real, "Poll losses" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest poll of the advocate Andy Kindler with poll losses greater th...
SELECT MAX("Poll wins") FROM table_40419 WHERE "Poll losses" > '2' AND "Advocate" = 'andy kindler' AND "Ties" < '0'
wikisql
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, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_27501971_2 ( categoría VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the categoria when E.E.U.U was the country?
SELECT categoría FROM table_27501971_2 WHERE country = "E.E.U.U"
sql_create_context
CREATE TABLE table_name_90 ( home_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Home team in Tie no 16?
SELECT home_team FROM table_name_90 WHERE tie_no = "16"
sql_create_context
CREATE TABLE table_name_23 ( height VARCHAR, date_of_birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Height of the Player with a Date of Birth of 1979-06-12?
SELECT height FROM table_name_23 WHERE date_of_birth = "1979-06-12"
sql_create_context
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CR...
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102'
nvbench
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Po...
SELECT (SUM(pd.Questions) * 1.00 / COUNT(pd.Date)) AS "questions_per_day", (SUM(pd.Answers) * 1.00 / COUNT(pd.Date)) AS "answers_per_day", TIME_TO_STR(pd.Date, '%m') AS "month", TIME_TO_STR(pd.Date, '%Y') AS "year" FROM (SELECT SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions", SUM(CASE WHEN p.PostTypeId...
sede
CREATE TABLE table_28211674_3 ( mixed_restricted VARCHAR, mixed_veteran VARCHAR, u21_womens VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the mixed restricted when Tomasz Rzeszotko won the mixed veteran and Karina Le Fevre won the U21 womens?
SELECT mixed_restricted FROM table_28211674_3 WHERE mixed_veteran = "Tomasz Rzeszotko" AND u21_womens = "Karina Le Fevre"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '5003066' AND IN_HOSP_DATE BETWEEN '2012-10-01' AND '2019-11-24') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '5003066' AND IN_HOSP_DATE BETWEEN '2012-10-01' AND '2019-11-24' AND MED_ORG_DEPT_NM = '小儿屈光科')
css
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 23 AND DATE_DAY_0.month_...
atis
CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE lives...
SELECT COUNT(DISTINCT gender) FROM dorm
spider
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
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 ref_colors ( color_code text, color_description text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_product_details t...
SELECT product_name, typical_buying_price FROM products
spider
CREATE TABLE table_name_32 ( frequency VARCHAR, power VARCHAR, channel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On channel 32, when the power is 32 kW horizontal, what is the frequency?
SELECT frequency FROM table_name_32 WHERE power = "32 kw horizontal" AND channel = 32
sql_create_context
CREATE TABLE coach ( Coach_ID int, Coach_name text, Gender text, Club_ID int, Rank int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupation text, Votes int, Rank text ) CREATE TABLE player_coach ( Pl...
SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY Occupation
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuest...
SELECT DISTINCT (PostId), COUNT(Id) FROM Comments GROUP BY PostId ORDER BY COUNT(Id) DESC
sede
CREATE TABLE table_name_69 ( year INTEGER, position VARCHAR, performance VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year in which long jump was performed in the world indoor Championships in 5th position...
SELECT MIN(year) FROM table_name_69 WHERE performance = "long jump" AND competition = "world indoor championships" AND position = "5th"
sql_create_context
CREATE TABLE table_19169116_6 ( high_rebounds VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games with high rebounds where in february 26
SELECT COUNT(high_rebounds) FROM table_19169116_6 WHERE date = "February 26"
sql_create_context
CREATE TABLE table_25640730_7 ( written_by VARCHAR, uk_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the UK air date is February 18, 2013, who was the episode written by?
SELECT written_by FROM table_25640730_7 WHERE uk_air_date = "February 18, 2013"
sql_create_context
CREATE TABLE table_4108 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers *" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people watched 'it's bet...
SELECT "Viewers *" FROM table_4108 WHERE "Title" = 'It''s Better to Burn Out Than Fae Away'
wikisql
CREATE TABLE table_1333612_1 ( native_american VARCHAR, es_mulatto VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the native american with es mulatto being 0.7%
SELECT native_american FROM table_1333612_1 WHERE es_mulatto = "0.7%"
sql_create_context
CREATE TABLE table_57830 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the roll of 651, what was the lowest Decile?
SELECT MIN("Decile") FROM table_57830 WHERE "Roll" = '651'
wikisql
CREATE TABLE table_18600760_20 ( land___sqmi__ VARCHAR, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the land area (sqmi) for the township at longtidue 47.548602?
SELECT land___sqmi__ FROM table_18600760_20 WHERE latitude = "47.548602"
sql_create_context
CREATE TABLE Documents_to_be_destroyed ( Destruction_Authorised_by_Employee_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the ids of all employees who have authorized destruction.
SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
sql_create_context
CREATE TABLE table_11037 ( "Code" real, "Type" text, "Name" text, "Area (km 2 )" real, "Population" real, "Regional County Municipality" text, "Region" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is total population of Saint-Agapit (...
SELECT SUM("Region") FROM table_11037 WHERE "Name" = 'saint-agapit' AND "Code" < '33045'
wikisql
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_50709 ( "Appearances" real, "School" text, "Wins" real, "Losses" real, "Percent" text, "Last Appearance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Losses, when Last Appearance is 2003, and when...
SELECT COUNT("Losses") FROM table_50709 WHERE "Last Appearance" = '2003' AND "Wins" > '2'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptio...
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND inputevents_cv.it...
mimic_iii
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT procedures.long_title, prescriptions.route FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "24425"
mimicsql_data
CREATE TABLE table_name_25 ( laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which laps has a grid of 8?
SELECT laps FROM table_name_25 WHERE grid = "8"
sql_create_context
CREATE TABLE table_name_96 ( laps VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps does olivier panis have?
SELECT laps FROM table_name_96 WHERE driver = "olivier panis"
sql_create_context
CREATE TABLE table_23982399_1 ( challenger VARCHAR, overall_episode__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the challenger on Episode 5?
SELECT challenger FROM table_23982399_1 WHERE overall_episode__number = 5
sql_create_context
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id 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 tim...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '沈伟祺' AND hz_info.YLJGDM = '8930086' AND mzjzjlb.JZZDSM LIKE '%颅脑%'
css
CREATE TABLE table_name_74 ( general_classification VARCHAR, mountains_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the general classification of stage 3 with David Loosli as the mountains classification?
SELECT general_classification FROM table_name_74 WHERE mountains_classification = "david loosli" AND stage = "3"
sql_create_context
CREATE TABLE table_61062 ( "Season" text, "Date" text, "Winners" text, "Finalists" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the finalists in the 1972 73 season?
SELECT "Finalists" FROM table_61062 WHERE "Season" = '1972–73'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2124" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]"
mimicsql_data
CREATE TABLE table_name_3 ( enrollment INTEGER, team_nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Enrollment for the Pilots?
SELECT MIN(enrollment) FROM table_name_3 WHERE team_nickname = "pilots"
sql_create_context
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 COUNT(*) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '04723884' AND zzmzjzjlb.JZKSRQ BETWEEN '2002-08-03' AND '2011-02-27' AND zzmzjzjlb.YLJGDM = '8468602' UNION SELECT COUNT(*) FROM hz_info JOIN fzzmzjzjlb ON...
css
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.short_title = "Endosc retro cholangiopa"
mimicsql_data
CREATE TABLE table_65888 ( "Year" real, "Class" text, "Team" text, "Machine" text, "Points" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class before 1990 has points of 33?
SELECT "Class" FROM table_65888 WHERE "Year" < '1990' AND "Points" = '33'
wikisql
CREATE TABLE table_name_7 ( player VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player went to college at Tennessee-Chattanooga?
SELECT player FROM table_name_7 WHERE college = "tennessee-chattanooga"
sql_create_context
CREATE TABLE table_16323766_3 ( preliminary_average VARCHAR, semifinal_average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the preliminary average for the one who had a semifinal average of 8.966 (3)?
SELECT preliminary_average FROM table_16323766_3 WHERE semifinal_average = "8.966 (3)"
sql_create_context
CREATE TABLE table_53874 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was there a score of 5-1?
SELECT "Date" FROM table_53874 WHERE "Score" = '5-1'
wikisql
CREATE TABLE table_name_97 ( director VARCHAR, gross__worldwide_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which director had a worldwide gross of $30,471?
SELECT director FROM table_name_97 WHERE gross__worldwide_ = "$30,471"
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 mzjzjlb.JZKSRQ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '21018594065'
css
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86786) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND STRFTIME('%y-%m', labevents.charttime) <= '2105-11' ORDER BY l...
mimic_iii
CREATE TABLE table_name_11 ( heat_points VARCHAR, game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Heat Points, when Game is less than 80, and when Date is 'April 26 (First Round)'?
SELECT heat_points FROM table_name_11 WHERE game < 80 AND date = "april 26 (first round)"
sql_create_context
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, ...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "10" AND lab.label = "Ferritin"
mimicsql_data