instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_47863 ( "Date" text, "Time" text, "Opponent" text, "Site" text, "City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game held at UMBC Field?
SELECT "Date" FROM table_47863 WHERE "Site" = 'umbc field'
wikisql
CREATE TABLE table_204_47 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did she play in more matche...
SELECT "date" FROM table_204_47 WHERE "date" IN (2007, 2008) GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_9411 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player's Score is 72-70-66=208?
SELECT "Player" FROM table_9411 WHERE "Score" = '72-70-66=208'
wikisql
CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABLE operate_company...
SELECT Country, COUNT(*) FROM airport GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE table_22269839_1 ( written_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the title with the production code is 7acx08?
SELECT written_by FROM table_22269839_1 WHERE production_code = "7ACX08"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5553)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart...
mimic_iii
CREATE TABLE table_50063 ( "2012 rank" real, "Municipio" text, "2010 land area" text, "2010 population density" text, "ANSI" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the 2010 population density for municipio ponce?...
SELECT "2010 population density" FROM table_50063 WHERE "Municipio" = 'ponce'
wikisql
CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE medicine ( id number, name text,...
SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction)
spider
CREATE TABLE Customers ( customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR ) CREATE TABLE Accounts ( customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show distinct first and last names for all customers with an a...
SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id
sql_create_context
CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) ) CREATE TABLE Department ( DNO INTEGER, Division VARCHAR(2), DName VARCHAR(25), Room VARCHAR(5), Building VARCHAR(13), DPhone INTEGER ) CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), C...
SELECT LName, COUNT(LName) FROM Student WHERE Sex = "F" GROUP BY LName ORDER BY Age DESC
nvbench
CREATE TABLE table_20667854_1 ( gics_sector VARCHAR, free_float VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every GICS sector for free float of 0.3180?
SELECT gics_sector FROM table_20667854_1 WHERE free_float = "0.3180"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT SOC_SRT_DIRE_NM, AMOUNT, MED_CLINIC_ID FROM t_kc22 WHERE (MED_CLINIC_ID = '74972041144' OR MED_CLINIC_ID = '38400798086') AND SOC_SRT_DIRE_NM IN ((SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '74972041144') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '38400798086'))
css
CREATE TABLE table_70030 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was Extreme Challenge 63 with a time of 2:00 ...
SELECT "Location" FROM table_70030 WHERE "Event" = 'extreme challenge 63' AND "Time" = '2:00'
wikisql
CREATE TABLE table_44924 ( "Technology" text, "Moving Parts" text, "Room Temperature" text, "Flammable" text, "Toxic Materials" text, "In production" text, "Rare metals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the room temperat...
SELECT "Room Temperature" FROM table_44924 WHERE "In production" = 'no' AND "Toxic Materials" = 'no'
wikisql
CREATE TABLE table_name_81 ( soap_opera VARCHAR, rank VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What soap opera has a rank larger than 1, and a Character named Emily Bishop?
SELECT soap_opera FROM table_name_81 WHERE rank > 1 AND character = "emily bishop"
sql_create_context
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.admission_type = "ELECTIVE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
mimicsql_data
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 Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120
nvbench
CREATE TABLE table_name_94 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tournament when it has 2011 of 2r
SELECT tournament FROM table_name_94 WHERE 2011 = "2r"
sql_create_context
CREATE TABLE table_36490 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Team 1 where Team 2 is al tahrir?
SELECT "Team 1" FROM table_36490 WHERE "Team 2" = 'al tahrir'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'bone fracture(s) - sternum')) AND DATETIME(c...
eicu
CREATE TABLE table_74151 ( "Product Name" text, "Form Factor" text, "Storage Medium" text, "Max Usable Capacity (GB)" real, "Speed ( IOPS )" real, "Latency (microseconds)" real, "Bandwidth (GB/s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT("Latency (microseconds)") FROM table_74151 WHERE "Product Name" = 'RamSan-810'
wikisql
CREATE TABLE table_name_55 ( _number_of_episodes INTEGER, mole VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which # of Episodes has a Mole of craig slike?
SELECT MIN(_number_of_episodes) FROM table_name_55 WHERE mole = "craig slike"
sql_create_context
CREATE TABLE table_name_95 ( runners_up VARCHAR, champions VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1987, what is the Runners-up when Stefan Edberg is Champion?
SELECT runners_up FROM table_name_95 WHERE champions = "stefan edberg" AND year = 1987
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, res...
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, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND flight.arrival_time = (SELECT MIN(FLIGHTalias1.arrival_time) FROM airport_se...
atis
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
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 table_name_55 ( height__ft_ INTEGER, name VARCHAR, floors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest height (ft) for messeturm and more than 55 floors?
SELECT MIN(height__ft_) FROM table_name_55 WHERE name = "messeturm" AND floors > 55
sql_create_context
CREATE TABLE table_13229 ( "Rank" real, "Player" text, "Wickets" real, "Average" real, "Career" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Wickets with a 26.13 average?
SELECT COUNT("Wickets") FROM table_13229 WHERE "Average" = '26.13'
wikisql
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHA...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY Document_Type_Code 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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.long_title = "Procedure on single vessel"
mimicsql_data
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
SELECT JCZBMC, JCZBJGDL, JCZBJGDW, BGDH FROM jyjgzbb WHERE (BGDH = '69656792404' OR BGDH = '07524794645') AND JCZBMC IN ((SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '69656792404') INTERSECT (SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '07524794645'))
css
CREATE TABLE table_32987 ( "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 was the Home Team Score for the Windy Hill ...
SELECT "Home team score" FROM table_32987 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_23285805_5 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of records for 30 game
SELECT COUNT(record) FROM table_23285805_5 WHERE game = 30
sql_create_context
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.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '27129454'
css
CREATE TABLE team ( year INTEGER, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INTEGER, g INTEGER, ghome NUMERIC, w INTEGER, l INTEGER, div_win TEXT, wc_win TEXT, lg_win TEXT, ws_win TEXT, r INTEGER, ab INTEGER, h INTEGER, dou...
SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year
nvbench
CREATE TABLE table_63560 ( "Year [A ]" real, "Pick" text, "Player name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the position when the year [A} is after 2011 and the pick is 28?
SELECT "Position" FROM table_63560 WHERE "Year [A ]" > '2011' AND "Pick" = '28'
wikisql
CREATE TABLE church ( church_id number, name text, organized_by text, open_date number, continuation_of text ) CREATE TABLE people ( people_id number, name text, country text, is_male text, age number ) CREATE TABLE wedding ( church_id number, male_id number, female...
SELECT COUNT(*) FROM wedding WHERE year = 2016
spider
CREATE TABLE table_70066 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the loss when the record is 76-81
SELECT "Loss" FROM table_70066 WHERE "Record" = '76-81'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1837" AND prescriptions.drug = "Piperacillin-Tazobactam Na"
mimicsql_data
CREATE TABLE table_name_30 ( game INTEGER, december VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- December larger than 21, and a Opponent of Pittsburgh penguins had what average game?
SELECT AVG(game) FROM table_name_30 WHERE december > 21 AND opponent = "pittsburgh penguins"
sql_create_context
CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL...
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.customer_id DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2092"
mimicsql_data
CREATE TABLE submission ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many submissions are there?
SELECT COUNT(*) FROM submission
sql_create_context
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 (SELECT PER_ACC_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '27710855494') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '27710855494')
css
CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Objectives...
SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id
nvbench
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC), * FROM Users WHERE Location LIKE '%Dubai%' OR Location LIKE '%dubai%' ORDER BY Reputation DESC
sede
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '87317154' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "45821" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:00' AND course.course_id = course_offering.course_id AND course.department = 'PROSTHOD' AND course.number = 645 AND semester.semester = 'WN' ...
advising
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31229') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2105-08' ORDER BY patient.unitadmittime DESC LIMIT...
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'mcv')) AND STRFTIME('%y', cost.chargetime) = '2105' GROUP BY cost.pa...
eicu
CREATE TABLE table_28604 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the under-11 was Aly Abou El Einen, who was the under-13?
SELECT "Under-13" FROM table_28604 WHERE "Under-11" = 'Aly Abou El Einen'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i...
mimic_iii
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price)
nvbench
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '63342045' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2007-08-10')
css
CREATE TABLE table_46563 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game wehre the deportes savio were the home team?
SELECT "Score" FROM table_46563 WHERE "Home" = 'deportes savio'
wikisql
CREATE TABLE table_name_46 ( number_of_seasons_in_top_division INTEGER, position_in_2012_13 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least number of seasons in top division with position in 2012-13 of 001 1st
SELECT MIN(number_of_seasons_in_top_division) FROM table_name_46 WHERE position_in_2012_13 = "001 1st"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '64675893' AND t_kc22.STA_DATE BETWEEN '2006-03-30' AND '2013-06-05' AND t_kc21.MED_SER_ORG_NO = '0643879' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_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 time,...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '04812473443'
css
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, availa...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_date)
nvbench
CREATE TABLE table_44829 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money did David Toms get?
SELECT "Money ( $ )" FROM table_44829 WHERE "Player" = 'david toms'
wikisql
CREATE TABLE table_9149 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the overall score when the set 2 score is 25 18?
SELECT "Score" FROM table_9149 WHERE "Set 2" = '25–18'
wikisql
CREATE TABLE table_name_70 ( rookie VARCHAR, goalkeeper VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the rookie goalkeeper Mike Gabel?
SELECT rookie FROM table_name_70 WHERE goalkeeper = "mike gabel"
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Chronic kidney disease, Stage III (moderate)"
mimicsql_data
CREATE TABLE table_33225 ( "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 venue features fitzroy as the away side?
SELECT "Venue" FROM table_33225 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE table_name_8 ( bronze VARCHAR, rank VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Bronze when rank is 11, and the total is less than 1?
SELECT COUNT(bronze) FROM table_name_8 WHERE rank = "11" AND total < 1
sql_create_context
CREATE TABLE table_name_8 ( type VARCHAR, transfer_window VARCHAR, nat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of transfer window is winter in Ita?
SELECT type FROM table_name_8 WHERE transfer_window = "winter" AND nat = "ita"
sql_create_context
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name DESC
nvbench
CREATE TABLE table_37769 ( "Year" real, "Division" real, "League" text, "Reg. Season" text, "Playoffs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has a Reg Season of 3rd, western?
SELECT AVG("Year") FROM table_37769 WHERE "Reg. Season" = '3rd, western'
wikisql
CREATE TABLE table_name_60 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Tampa Bay Buccaneers play on december 23, 1995?
SELECT opponent FROM table_name_60 WHERE date = "december 23, 1995"
sql_create_context
CREATE TABLE table_45954 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "No. 3" FROM table_45954 WHERE "No. 7" = 'abigail' AND "No. 4" = 'ava'
wikisql
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 prescriptions ( subject_id text, hadm_id...
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Syringe (Neonatal) *NS*"
mimicsql_data
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.itemid = "50925"
mimicsql_data
CREATE TABLE table_63417 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the 2nd round 2nd leg?
SELECT "Date" FROM table_63417 WHERE "Round" = '2nd round 2nd leg'
wikisql
CREATE TABLE qualifying ( qualifyId INTEGER, raceId INTEGER, driverId INTEGER, constructorId INTEGER, number INTEGER, position INTEGER, q1 TEXT, q2 TEXT, q3 TEXT ) CREATE TABLE lapTimes ( raceId INTEGER, driverId INTEGER, lap INTEGER, position INTEGER, time TEXT,...
SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year
nvbench
CREATE TABLE table_train_261 ( "id" int, "allergy_to_biological_products" bool, "renal_disease" bool, "bursing_mothers" bool, "metabolic_bone_disease" bool, "liver_disease" bool, "allergy_to_drug" bool, "alcohol_abuse" bool, "drug_abuse" bool, "NOUSE" float ) -- Using valid SQL...
SELECT * FROM table_train_261 WHERE metabolic_bone_disease = 1
criteria2sql
CREATE TABLE table_39831 ( "Name" text, "Height" text, "Position" text, "Year" text, "Home Town" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 6-2 Martina Wood's Position?
SELECT "Position" FROM table_39831 WHERE "Height" = '6-2' AND "Name" = 'martina wood'
wikisql
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fli...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'DALLAS' AND ground_service.airpor...
atis
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2100' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_1745843_8 ( part_4 VARCHAR, part_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the part 4 of the word with the part 1 'heizan'?
SELECT part_4 FROM table_1745843_8 WHERE part_1 = "heizan"
sql_create_context
CREATE TABLE table_52654 ( "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 Time/Retired for the car going 42 Laps?
SELECT "Time/Retired" FROM table_52654 WHERE "Laps" = '42'
wikisql
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, ...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code
nvbench
CREATE TABLE table_37027 ( "Wrestler" text, "Reign" text, "Days held" text, "Location" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location has tatsuhito takaiwa as the wrestler?
SELECT "Location" FROM table_37027 WHERE "Wrestler" = 'tatsuhito takaiwa'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text...
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
atis
CREATE TABLE table_55611 ( "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 name of the away team whose opponent...
SELECT "Away team" FROM table_55611 WHERE "Home team score" = '11.8 (74)'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2137" AND procedures.icd9_code = "3322"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT demographic.ethnicity FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32430') AND diagnosis.diagnos...
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '方忆秋' AND t_kc21.MED_SER_ORG_NO = '1559785' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%肺病%'
css
CREATE TABLE table_name_93 ( host_location VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the 2nd place team when the location was Tulsa, OK before 1956?
SELECT 2 AS nd_place_team FROM table_name_93 WHERE host_location = "tulsa, ok" AND year < 1956
sql_create_context
CREATE TABLE table_name_48 ( instant_messaging VARCHAR, electronic_meeting_system VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Instant Messaging, when Electronic Meeting System is 'Yes', and when Name is 'Microsoft Sharepoint'?
SELECT instant_messaging FROM table_name_48 WHERE electronic_meeting_system = "yes" AND name = "microsoft sharepoint"
sql_create_context
CREATE TABLE table_8032 ( "Religion" text, "Scheduled Caste" text, "Scheduled Tribe" text, "Other Backward Class" text, "Forward caste" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE FORWARD CASTE WITH A SCHEDULED CASTE OF 0.80%?
SELECT "Forward caste" FROM table_8032 WHERE "Scheduled Caste" = '0.80%'
wikisql
CREATE TABLE table_71261 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points are there for a Mclaren m23 chassis later than 1972?
SELECT COUNT("Points") FROM table_71261 WHERE "Year" > '1972' AND "Chassis" = 'mclaren m23'
wikisql
CREATE TABLE table_62944 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average number of silver medals when bronze is less than 0?
SELECT AVG("Silver") FROM table_62944 WHERE "Bronze" < '0'
wikisql
CREATE TABLE table_name_59 ( score VARCHAR, partner VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the final in which Melanie South played with partner Ksenia Lykina during the Kurume Cup tournament?
SELECT score FROM table_name_59 WHERE partner = "ksenia lykina" AND tournament = "kurume"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'anticonvulsants - valproate' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIM...
eicu
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Cardiac rhythm conv NEC"
mimicsql_data
CREATE TABLE table_23576576_2 ( contestant VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the hometown is Omuthiya, what is the contestant name?
SELECT contestant FROM table_23576576_2 WHERE hometown = "Omuthiya"
sql_create_context
CREATE TABLE table_27155243_4 ( total__number INTEGER, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is largest total number that was written by Sheri Elwood?
SELECT MAX(total__number) FROM table_27155243_4 WHERE written_by = "Sheri Elwood"
sql_create_context
CREATE TABLE table_name_56 ( southbridge VARCHAR, cpu_support VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Southbridge when the CPU support was athlon, athlonxp, duron( socketa ), alpha21264?
SELECT southbridge FROM table_name_56 WHERE cpu_support = "athlon, athlonxp, duron( socketa ), alpha21264"
sql_create_context