instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Insertion of non-drug-eluting coronary artery stent(s)"
mimicsql_data
CREATE TABLE table_name_17 ( colors VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Colors has a School of zeigler high school?
SELECT colors FROM table_name_17 WHERE school = "zeigler high school"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND lab.labname = '-lymphs' AND DATETIME(lab.labresulttime, 'start of ...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid...
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE table_name_34 ( release_date VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Release date has a Type of 2d?
SELECT release_date FROM table_name_34 WHERE type = "2d"
sql_create_context
CREATE TABLE table_204_530 ( id number, "type" text, "stage" number, "cyclist" text, "team" text, "reason" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which cyclist withdrew after breaking his arm in a crash during stage 2 ?
SELECT "cyclist" FROM table_204_530 WHERE "reason" = 'broken arm sustained from crash in stage 2'
squall
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varc...
SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building ORDER BY building DESC
nvbench
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Road, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_7511 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is airing at 9:00 on the channel that airs Chuck at 8:30 and Medium at 10:00?
SELECT "9:00" FROM table_7511 WHERE "10:00" = 'medium' AND "8:30" = 'chuck'
wikisql
CREATE TABLE table_17615 ( "Rank" real, "Fastest time (s)" text, "Wind (m/s)" text, "Athlete" text, "Nation" text, "Date" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which athlete is from Mexico City?
SELECT "Athlete" FROM table_17615 WHERE "Location" = 'Mexico City'
wikisql
CREATE TABLE table_17632217_1 ( total_wins VARCHAR, runners_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total wins with Shanghai as runner-up?
SELECT COUNT(total_wins) FROM table_17632217_1 WHERE runners_up = "Shanghai"
sql_create_context
CREATE TABLE table_name_84 ( round INTEGER, player VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Round, when Player is 'Gurnest Brown', and when Pick # is greater than 180?
SELECT AVG(round) FROM table_name_84 WHERE player = "gurnest brown" AND pick__number > 180
sql_create_context
CREATE TABLE table_1756264_2 ( subsidiaries INTEGER, company_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many subsidiaries are there of Postermobile Advertising Limited?
SELECT MIN(subsidiaries) FROM table_1756264_2 WHERE company_name = "POSTERMOBILE ADVERTISING LIMITED"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
SELECT number = ROW_NUMBER() OVER (ORDER BY YEAR(CreationDate), TIME_TO_STR(CreationDate, '%W')), (CAST(SUM(CASE WHEN ((Tags LIKE '%<probability>%') OR (Tags LIKE '%<statistics>%')) THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(Posts.Id)) AS "perc" FROM Posts WHERE (PostTypeId = 1 AND CreationDate >= '##Date1##' AND Creat...
sede
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End...
SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made
nvbench
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CAAS' AND course.number = 426 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1
advising
CREATE TABLE table_22873 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was her partner at the US Open and they were runner-up?...
SELECT "Partner" FROM table_22873 WHERE "Outcome" = 'Runner-up' AND "Championship" = 'US Open'
wikisql
CREATE TABLE table_29871617_1 ( chromosomal_location VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the chromosomal location of il-1 ?
SELECT chromosomal_location FROM table_29871617_1 WHERE name = "IL-1β"
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 gwyjzb.IN_HOSP_DAYS FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '26786067488' UNION SELECT fgwyjzb.IN_HOSP_DAYS FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '26786067488'
css
CREATE TABLE table_203_426 ( id number, "year" number, "title" text, "peak chart positions\naus" number, "peak chart positions\nnz" number, "peak chart positions\nuk" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many si...
SELECT COUNT(*) FROM table_203_426 WHERE "album" = 'single-only release'
squall
CREATE TABLE table_51221 ( "Jurisdiction" text, "For Prohibition" real, "Percent For" real, "Against Prohibition" real, "Percent Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number supporting prohibition in British Col...
SELECT MAX("For Prohibition") FROM table_51221 WHERE "Percent Against" > '10.8' AND "Percent For" < '72.2' AND "Jurisdiction" = 'british columbia' AND "Against Prohibition" < '4,756'
wikisql
CREATE TABLE table_name_35 ( year INTEGER, start VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the most recent year when a g-force chassis started in 1st?
SELECT MAX(year) FROM table_name_35 WHERE start = "1st" AND chassis = "g-force"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "24" AND demographic.days_stay > "43"
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 SUM(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '任元恺' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-09-23' AND '2006-11-28' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjz...
css
CREATE TABLE table_name_88 ( home_leg VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home leg who are opponents of rotor volgograd
SELECT home_leg FROM table_name_88 WHERE opponents = "rotor volgograd"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737')) AND treatment.treatmentname = 'surgery consultation' AND DATETI...
eicu
CREATE TABLE table_name_95 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Record is '2-0'?
SELECT score FROM table_name_95 WHERE record = "2-0"
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 demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Francis Baseler"
mimicsql_data
CREATE TABLE table_25675509_1 ( longitude VARCHAR, date__yyyy_mm_dd_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the longitude for the shock that occured on 2010-01-09?
SELECT longitude FROM table_25675509_1 WHERE date__yyyy_mm_dd_ = "2010-01-09"
sql_create_context
CREATE TABLE table_36274 ( "Date" text, "Site" text, "Sport" text, "Winning team" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What winning team has volleyball as the sport?
SELECT "Winning team" FROM table_36274 WHERE "Sport" = 'volleyball'
wikisql
CREATE TABLE table_66260 ( "Date" text, "Name of ship" text, "Flag" text, "Tonnage" real, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the Brookwood, which weighed over 5,008 tons, attacked?
SELECT "Date" FROM table_66260 WHERE "Tonnage" > '5,008' AND "Name of ship" = 'brookwood'
wikisql
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.admission_type = "URGENT" AND lab.itemid = "50808"
mimicsql_data
CREATE TABLE table_name_9 ( beat_by VARCHAR, distance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who beat Chic by 8fm?
SELECT beat_by FROM table_name_9 WHERE distance = "8fm"
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2194" AND procedures.long_title = "Circumcision"
mimicsql_data
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT (SELECT SUM(t_kc22.STA_FLG) FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '14428902426') = (SELECT COUNT(*) FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID = '14428902426')
css
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 jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '63570417818'
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid n...
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 = 'severe sepsis') AN...
mimic_iii
CREATE TABLE table_name_42 ( score VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the New Jersey home game?
SELECT score FROM table_name_42 WHERE home = "new jersey"
sql_create_context
CREATE TABLE table_77042 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is P...
SELECT "Position in table" FROM table_77042 WHERE "Replaced by" = 'sergio bueno'
wikisql
CREATE TABLE table_1289860_2 ( hometown VARCHAR, candidate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was Kristen Kirchner from?
SELECT hometown FROM table_1289860_2 WHERE candidate = "Kristen Kirchner"
sql_create_context
CREATE TABLE table_9460 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the t...
SELECT COUNT("Position") FROM table_9460 WHERE "Drawn" > '7' AND "Played" < '40'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '012-66291' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255), Order_Item_ID INTEGER ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code
nvbench
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, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE table_name_55 ( football_stadium VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the name of the carabins stadium?
SELECT football_stadium FROM table_name_55 WHERE team = "carabins"
sql_create_context
CREATE TABLE table_name_66 ( assists INTEGER, rank VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Assists for the Player with a Rank greater than 3 in less than 25 Games?
SELECT AVG(assists) FROM table_name_66 WHERE rank > 3 AND games < 25
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, ...
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 = 2 AND date_day.month_number = 7 AND da...
atis
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Thoracentesis"
mimicsql_data
CREATE TABLE table_22538587_3 ( total_apps INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least total apps for jaime
SELECT MIN(total_apps) FROM table_22538587_3 WHERE player = "Jaime"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE charte...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND STRFTIME('%y', prescriptions.startdate) = '2102' GROUP BY prescriptions.drug) AS t1 WH...
mimic_iii
CREATE TABLE table_35301 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What visitor has February 11 as the date?
SELECT "Visitor" FROM table_35301 WHERE "Date" = 'february 11'
wikisql
CREATE TABLE table_55840 ( "Year" real, "MRHMA" text, "USCA" text, "RTHK" text, "Joint Music Award" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the USCA that's Total is smaller than 14, with 1 Joint Music Award, MRHMA of...
SELECT "USCA" FROM table_55840 WHERE "Total" < '14' AND "Joint Music Award" = '1' AND "MRHMA" = '2' AND "RTHK" = '3'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport ( ...
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE table_name_89 ( away_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What away team has 12 as the tie no.?
SELECT away_team FROM table_name_89 WHERE tie_no = "12"
sql_create_context
CREATE TABLE table_62447 ( "Elected" text, "Assembled" text, "Dissolved" text, "1st member" text, "2nd member" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the 1st member that was elected in 1541/42?
SELECT "1st member" FROM table_62447 WHERE "Elected" = '1541/42'
wikisql
CREATE TABLE table_49109 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date when the score is 115-93?
SELECT "Date" FROM table_49109 WHERE "Score" = '115-93'
wikisql
CREATE TABLE table_60411 ( "Year" real, "Name of Tournament" text, "Champions" text, "Runners-up" text, "Score" text ) -- 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_60411 WHERE "Champions" = 'stefan edberg' AND "Year" = '1987'
wikisql
CREATE TABLE table_name_17 ( destroyed INTEGER, survived VARCHAR, to_iran VARCHAR, damaged VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average destroyed with a 1990 over 12, more than 1 damaged, 6 survivors, and a to Iran less than 4?
SELECT AVG(destroyed) FROM table_name_17 WHERE 1990 > 12 AND damaged > 1 AND to_iran < 4 AND survived = 6
sql_create_context
CREATE TABLE table_name_74 ( constructor VARCHAR, laps VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who built james hunt's car that went 79 laps?
SELECT constructor FROM table_name_74 WHERE laps = 79 AND driver = "james hunt"
sql_create_context
CREATE TABLE table_name_32 ( round VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round is the player from Oregon from?
SELECT round FROM table_name_32 WHERE college = "oregon"
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.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '41121954222'
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.PERSON_ID = '28590316' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-06-14' AND '2008-03-13'
css
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE table_name_7 ( nationality VARCHAR, games VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nationality of Mike Gatting, who played 551 games?
SELECT nationality FROM table_name_7 WHERE games = "551" AND player = "mike gatting"
sql_create_context
CREATE TABLE table_name_92 ( round VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round was the opponent Manny Gamburyan?
SELECT round FROM table_name_92 WHERE opponent = "manny gamburyan"
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '葛岚霏' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2001-02-07' AND '2020-08-03' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb...
css
CREATE TABLE table_204_36 ( id number, "date" text, "opponent" text, "site" text, "result" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many wins did georgetown achieve in 1941 ?
SELECT COUNT(*) FROM table_204_36 WHERE "result" = 'w' AND "date" = 1941
squall
CREATE TABLE table_204_541 ( id number, "name" text, "area" text, "height" text, "floors" number, "year" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what tower has at most 10 floors ?
SELECT "name" FROM table_204_541 WHERE "floors" <= 10
squall
CREATE TABLE table_44445 ( "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps have a +0.4865 time/retired?
SELECT "Laps" FROM table_44445 WHERE "Time/Retired" = '+0.4865'
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2133.0" AND lab.itemid = "51384"
mimicsql_data
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, ...
SELECT T2.name FROM certificate AS T1 JOIN aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY COUNT(*) >= 5
spider
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment tex...
SELECT u.Id AS "user_link", COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / (COUNT(*))) AS AcceptedPercent, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * (SUM(CASE WHEN q.AcceptedAnswe...
sede
CREATE TABLE table_5122 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent has euro '84 qualifying as the type and split as the city?
SELECT "Opponent" FROM table_5122 WHERE "Type of game" = 'euro ''84 qualifying' AND "City" = 'split'
wikisql
CREATE TABLE table_name_61 ( played INTEGER, draws VARCHAR, goals_for VARCHAR, goal_difference VARCHAR, losses VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position had a goal difference of less than 27, lost more than 13 games, scored le...
SELECT MAX(played) FROM table_name_61 WHERE goal_difference < 27 AND losses > 13 AND goals_for < 42 AND draws = 6
sql_create_context
CREATE TABLE table_name_15 ( wins INTEGER, losses VARCHAR, draws VARCHAR, goal_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average wins of the team with more than 13 draws, a goal difference of -14, and losses less than 14?
SELECT AVG(wins) FROM table_name_15 WHERE draws > 13 AND goal_difference = -14 AND losses < 14
sql_create_context
CREATE TABLE table_202_253 ( id number, "team" text, "titles" text, "runners-up" text, "third place" text, "fourth place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which team has best percentage of titles to runner up finishes ?
SELECT "team" FROM table_202_253 ORDER BY "titles" / "runners-up" DESC LIMIT 1
squall
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-111547' AND patient.wardid = 814 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_74551 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has unknown attendance, and lost 2-0?
SELECT "Opponent" FROM table_74551 WHERE "Attendance" = 'unknown' AND "Result" = 'lost 2-0'
wikisql
CREATE TABLE member_attendance ( member_id number, performance_id number, num_of_pieces number ) CREATE TABLE member ( member_id text, name text, nationality text, role text ) CREATE TABLE performance ( performance_id number, date text, host text, location text, attenda...
SELECT COUNT(*) FROM performance
spider
CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla"
spider
CREATE TABLE table_34930 ( "Year" real, "Award" text, "Nominated work" text, "Category" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What category has a year after 2004?
SELECT "Category" FROM table_34930 WHERE "Year" > '2004'
wikisql
CREATE TABLE table_33730 ( "Date" text, "Venue" text, "Result" text, "Goals" real, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals have a result of 0-1 on march 28, 2007?
SELECT COUNT("Goals") FROM table_33730 WHERE "Result" = '0-1' AND "Date" = 'march 28, 2007'
wikisql
CREATE TABLE table_name_2 ( silver INTEGER, nation VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Silver has a Nation of china, and a Bronze smaller than 7?
SELECT SUM(silver) FROM table_name_2 WHERE nation = "china" AND bronze < 7
sql_create_context
CREATE TABLE table_name_93 ( date VARCHAR, japan VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had Japanese sales of 0.61 million?
SELECT date FROM table_name_93 WHERE japan = "0.61 million"
sql_create_context
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 hz_info ( KH text, KLX number...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '22945235' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2001-12-09')
css
CREATE TABLE table_1723080_1 ( viewers__in_millions_ VARCHAR, broadcast_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many viewers were there on 1august1964?
SELECT viewers__in_millions_ FROM table_1723080_1 WHERE broadcast_date = "1August1964"
sql_create_context
CREATE TABLE table_18318 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result when the incumbent was george h. mahon
SELECT "Result" FROM table_18318 WHERE "Incumbent" = 'George H. Mahon'
wikisql
CREATE TABLE table_11891841_2 ( type VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type where the name is bojan?
SELECT type FROM table_11891841_2 WHERE name = "Bojan"
sql_create_context
CREATE TABLE table_name_8 ( role VARCHAR, original_broadway_cast VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the role when the original broadway was Adam Riegler?
SELECT role FROM table_name_8 WHERE original_broadway_cast = "adam riegler"
sql_create_context
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '尤...
css
CREATE TABLE table_13694 ( "Lane" real, "Name" text, "Country" text, "Reaction Time" real, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Lane has a Country of united states, and a Time smaller than 22.01, and a Reaction Time smaller th...
SELECT MIN("Lane") FROM table_13694 WHERE "Country" = 'united states' AND "Time" < '22.01' AND "Reaction Time" < '0.193'
wikisql
CREATE TABLE table_name_56 ( score VARCHAR, game INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score at the game earlier than 66?
SELECT score FROM table_name_56 WHERE game < 66
sql_create_context
CREATE TABLE table_37008 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is listed for the Bronze, with the Location of Bangkok, and the Year of 1978?
SELECT "Bronze" FROM table_37008 WHERE "Location" = 'bangkok' AND "Year" = '1978'
wikisql
CREATE TABLE table_203_548 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who had the top number of bronze awards ?
SELECT "nation" FROM table_203_548 ORDER BY "bronze" DESC LIMIT 1
squall
CREATE TABLE table_32859 ( "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 venue where Collingwood played as th...
SELECT "Venue" FROM table_32859 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ...
SELECT COUNT(*) FROM Posts WHERE Tags LIKE '%python%'
sede
CREATE TABLE table_2380212_1 ( year INTEGER, avg_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the average attendance 789?
SELECT MIN(year) FROM table_2380212_1 WHERE avg_attendance = 789
sql_create_context