context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_36 ( main_colour_s_ VARCHAR, main_sponsor_s_ VARCHAR )
What is the main color(s) for marlboro?
SELECT main_colour_s_ FROM table_name_36 WHERE main_sponsor_s_ = "marlboro"
sql_create_context
CREATE TABLE table_name_57 ( record VARCHAR, week VARCHAR )
What was week 12's record?
SELECT record FROM table_name_57 WHERE week = "12"
sql_create_context
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
Show all advisors and corresponding number of students.
SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor
nvbench
CREATE TABLE table_204_146 ( id number, "tie" number, "home team" text, "score" text, "away team" text, "attendance" number )
what was the next team to score two points after aylesbury united ?
SELECT "home team" FROM table_204_146 WHERE "score" = 2 AND id > (SELECT id FROM table_204_146 WHERE "home team" = 'aylesbury united') ORDER BY id LIMIT 1
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
how many patients were prescribed the drug 2 ml: ondansetron hcl 4 mg/2ml ij soln in 2104?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '2 ml: ondansetron hcl 4 mg/2ml ij soln' AND STRFTIME('%y', medication.drugstarttime) = '2104')
eicu
CREATE TABLE table_19925114_1 ( us_viewers__millions_ VARCHAR, no_in_season VARCHAR )
How many different numbers of people in the US who'd seen the episode with a season number 8 are there?
SELECT COUNT(us_viewers__millions_) FROM table_19925114_1 WHERE no_in_season = 8
sql_create_context
CREATE TABLE table_41512 ( "Nation" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." text )
What is the highest Stolen Ends when ludmila privivkova shows for skip?
SELECT MAX("Stolen Ends") FROM table_41512 WHERE "Skip" = 'ludmila privivkova'
wikisql
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 text ) CREATE TABLE product_characteristics ( product_id number, char...
Count the number of different characteristic names the product 'cumin' has.
SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
spider
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
what exactly does tb pneumonia-cult dx mean?
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tb pneumonia-cult dx' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tb pneumonia-cult dx'
mimic_iii
CREATE TABLE table_79197 ( "Year" real, "Date" text, "Location" text, "Winner" text, "Loser" text, "Weight class" text )
How many years were lightweight class on february 28, 2009?
SELECT COUNT("Year") FROM table_79197 WHERE "Weight class" = 'lightweight' AND "Date" = 'february 28, 2009'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, ...
What is the class CICS 301 about ?
SELECT DISTINCT description, name FROM course WHERE department = 'CICS' AND number = 301
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 intakeoutput ( in...
what is the first time patient 002-20631 was admitted through the operating room to the hospital?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-20631' AND patient.hospitaladmitsource = 'operating room' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_name_34 ( transfer_fee VARCHAR, type VARCHAR, name VARCHAR )
Willy Sagnol with a type as career end had what has the transfer fee?
SELECT transfer_fee FROM table_name_34 WHERE type = "career end" AND name = "willy sagnol"
sql_create_context
CREATE TABLE table_11167610_1 ( torque VARCHAR, performance VARCHAR )
what's the torque where performance is 0 100km/h: 7.5s auto, vmax: km/h (mph)
SELECT torque FROM table_11167610_1 WHERE performance = "0–100km/h: 7.5s auto, VMax: km/h (mph)"
sql_create_context
CREATE TABLE table_26599 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text )
What was the result of the games VS the Lions?
SELECT "Final Score" FROM table_26599 WHERE "Opponent" = 'Lions'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give me the number of patients whose age is less than 59 and lab test name is sodium, whole blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab.label = "Sodium, Whole Blood"
mimicsql_data
CREATE TABLE table_train_254 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "hgba1c" float, "renal_disease" bool, "creatinine_clearance_cl" float, "diastolic_blood_pressure_dbp" int, "diabetes" bool, "hypertension" bool, "fasting_glucose...
hypertension defined as a systolic blood pressure >= 150 mmhg and a diastolic blood pressure >= 95 mmhg;
SELECT * FROM table_train_254 WHERE hypertension = 1 OR (systolic_blood_pressure_sbp >= 150 AND diastolic_blood_pressure_dbp >= 95)
criteria2sql
CREATE TABLE table_55286 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer window" text, "Transfer fee" text )
Where is Odjidja-Ofoe, with an undisclosed transfer fee, moving to?
SELECT "Moving to" FROM table_55286 WHERE "Transfer fee" = 'undisclosed' AND "Name" = 'odjidja-ofoe'
wikisql
CREATE TABLE table_20614109_1 ( earnings_before_interest_and_taxes__€m_ VARCHAR, earnings_per_share__€_ VARCHAR )
Name the ebit for eps being 1.78
SELECT earnings_before_interest_and_taxes__€m_ FROM table_20614109_1 WHERE earnings_per_share__€_ = "1.78"
sql_create_context
CREATE TABLE table_12435 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is Home Team, when Tie No is '7'?
SELECT "Home team" FROM table_12435 WHERE "Tie no" = '7'
wikisql
CREATE TABLE table_39912 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
What is the Ground with a Score that is 49-80?
SELECT "Ground" FROM table_39912 WHERE "Score" = '49-80'
wikisql
CREATE TABLE table_name_93 ( name VARCHAR, royal_house VARCHAR, state VARCHAR )
What is Name, when Royal House is 'Ji', and when State is 'Cai'?
SELECT name FROM table_name_93 WHERE royal_house = "ji" AND state = "cai"
sql_create_context
CREATE TABLE table_train_238 ( "id" int, "hemoglobin_a1c_hba1c" float, "fasting_c_peptide" float, "hba1c" float, "allergy_to_mammalian_derived_drug_preparations" bool, "body_mass_index_bmi" float, "renal_transplantation" bool, "NOUSE" float )
patients with a body mass index ( bmi ) of less than or equal to 26 .
SELECT * FROM table_train_238 WHERE body_mass_index_bmi <= 26
criteria2sql
CREATE TABLE table_23455 ( "Number" real, "Registration" text, "First flew" text, "Last flew" text, "Flying hours" real, "Location" text )
on 19 april 1985 how many of number last flew
SELECT COUNT("Number") FROM table_23455 WHERE "Last flew" = '19 April 1985'
wikisql
CREATE TABLE table_337 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
what is the total amount of players for the rockets in 1998 only?
SELECT COUNT("Player") FROM table_337 WHERE "Years for Rockets" = '1998'
wikisql
CREATE TABLE Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATETIME, End_Date DATETIME ) CREATE TABLE Claims_Processing_Stages ( Claim_Stage_ID INTEGER, Next_Claim_Stage_ID INTEGER, Claim_Status_Name VARCHAR(255), Claim_Status_Description V...
Find the number of records of each policy type and its type code. Plot them as pie chart.
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code
nvbench
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 ) ...
count the patients who have abnormal lab tests and diagnosis icd9 code 3051.
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 = "3051" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_26986076_6 ( wed_25_aug VARCHAR, fri_27_aug VARCHAR )
What was the Weds 25 Aug time for the driver whose Aug 27 time was 22' 23.97 101.065mph?
SELECT wed_25_aug FROM table_26986076_6 WHERE fri_27_aug = "22' 23.97 101.065mph"
sql_create_context
CREATE TABLE gwyjzb ( 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, ...
在0750542医院就医的患者郑碧菡出院的时候其出院诊断结果的诊断医生姓戚的是什么时候?
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郑碧菡' AND gwyjzb.MED_SER_ORG_NO = '0750542' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '戚%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '郑碧菡' AND fgwyjzb.MED_SER_ORG_NO = '0750542' AN...
css
CREATE TABLE table_name_34 ( capacity INTEGER, head_coach VARCHAR )
What is the Capacity of the Venue of Head Coach Farhad Kazemi?
SELECT SUM(capacity) FROM table_name_34 WHERE head_coach = "farhad kazemi"
sql_create_context
CREATE TABLE table_204_805 ( id number, "name" text, "club" text, "date of departure" text, "replacement" text, "date of appointment" text )
what is the last name on the list ?
SELECT "name" FROM table_204_805 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_name_71 ( high_points VARCHAR, date VARCHAR )
On the date April 11, what were the high points?
SELECT high_points FROM table_name_71 WHERE date = "april 11"
sql_create_context
CREATE TABLE table_30072 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
what is the location for saturday, april 21
SELECT "Game site" FROM table_30072 WHERE "Date" = 'Saturday, April 21'
wikisql
CREATE TABLE table_name_25 ( representative VARCHAR, state VARCHAR, years VARCHAR )
Which Representative was from Kentucky during the years of 1855 1859?
SELECT representative FROM table_name_25 WHERE state = "kentucky" AND years = "1855–1859"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
how much is the weight difference for patient 19428 last measured on the current hospital visit compared to the value first measured on the current hospital visit?
SELECT (SELECT 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 = 19428 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
mimic_iii
CREATE TABLE table_1342249_13 ( candidates VARCHAR, incumbent VARCHAR )
Who were the candidates when Sid Simpson was the incumbent?
SELECT candidates FROM table_1342249_13 WHERE incumbent = "Sid Simpson"
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, C...
select count(*) from posts.
SELECT COUNT(*) FROM Users
sede
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE flight_fare ( flight_id int, f...
i need ground transportation in DALLAS please show me what 's available
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_name_2 ( winning_score VARCHAR, date VARCHAR )
What was the Winning Score on May 29, 1977?
SELECT winning_score FROM table_name_2 WHERE date = "may 29, 1977"
sql_create_context
CREATE TABLE table_78602 ( "Date" text, "Venue" text, "Winner" text, "Runner-up" text, "Score" text )
When was the match that had Shaun Murphy as runner-up?
SELECT "Date" FROM table_78602 WHERE "Runner-up" = 'shaun murphy'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the founder , and group by attribute founder by a bar chart, I want to show in descending by the total number.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC
nvbench
CREATE TABLE table_33857 ( "Name" text, "Caps" real, "Goals" real, "First cap" text, "Latest cap" text )
Name of gilmar, and a Caps smaller than 94 had how many highest goals?
SELECT MAX("Goals") FROM table_33857 WHERE "Name" = 'gilmar' AND "Caps" < '94'
wikisql
CREATE TABLE table_5784 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text )
Party of republican, and a District of 7th is what elected?
SELECT "Elected" FROM table_5784 WHERE "Party" = 'republican' AND "District" = '7th'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
list patient 007-4322's daily maximum output y (ml)-chest tube y - a #1 right mid b #2 left mid output.
SELECT MAX(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 = '007-4322')) AND intakeoutput.celllabel = 'output...
eicu
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport...
show me the flights from BALTIMORE to PHILADELPHIA
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL...
atis
CREATE TABLE table_41073 ( "Platform" real, "Frequency (per hour)" real, "Destination" text, "Service Pattern" text, "Operator" text, "Line" text )
How many Platforms have a Frequency of less than 2?
SELECT COUNT("Platform") FROM table_41073 WHERE "Frequency (per hour)" < '2'
wikisql
CREATE TABLE user_profiles ( uid number, name text, email text, partitionid number, followers number ) CREATE TABLE tweets ( id number, uid number, text text, createdate time ) CREATE TABLE follows ( f1 number, f2 number )
Find the names of the users whose number of followers is greater than that of the user named 'Tyler Swift'.
SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING COUNT(*) > (SELECT COUNT(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 WHERE T1.name = 'Tyler Swift')
spider
CREATE TABLE table_51298 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
Which CFL team drafted a pick from Boston College?
SELECT "CFL Team" FROM table_51298 WHERE "College" = 'boston college'
wikisql
CREATE TABLE table_46672 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text )
Which united states player had a To par of 12?
SELECT "Player" FROM table_46672 WHERE "To par" = '12' AND "Country" = 'united states'
wikisql
CREATE TABLE table_name_47 ( studio_host VARCHAR, play_by_play VARCHAR, year VARCHAR )
Play-by-play of sean grande, and a Year of 2004-05 had what studio host?
SELECT studio_host FROM table_name_47 WHERE play_by_play = "sean grande" AND year = "2004-05"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id, and order in ascending by the names.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, ...
when was first time the sao2 of patient 013-30085 was less than 88.0 today?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-30085')) AND vitalperiodic.sao2 < 88.0 AND NOT ...
eicu
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...
how many patients with lab test item id 51438 have american indian/alaska native ethnic background?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.itemid = "51438"
mimicsql_data
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
患者水雯华就诊过的医院有哪几家,时间是从01年12月24日到08年4月20日
SELECT COUNT(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_NM = '水雯华' AND qtb.IN_HOSP_DATE BETWEEN '2001-12-24' AND '2008-04-20' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_NM = '水雯华' AND gyb.IN_HOSP_DATE BETWEEN '2001-12-24' AND '2008-04-20' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zyb WHERE zy...
css
CREATE TABLE table_name_37 ( word__number VARCHAR, name VARCHAR )
What is the word count that is named omega dot?
SELECT word__number FROM table_name_37 WHERE name = "omega dot"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
the last year, patient 84042 visited an emergency room?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 84042 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_204_484 ( id number, "song" text, "artists" text, "release" text, "year" number, "notes" text )
how many total songs did shameless perform on ?
SELECT COUNT("song") FROM table_204_484 WHERE "artists" = 'shameless'
squall
CREATE TABLE table_name_12 ( draws INTEGER, losses VARCHAR, byes VARCHAR )
What is the lowest value for Draws, when Losses is '0', and when Byes is greater than 4?
SELECT MIN(draws) FROM table_name_12 WHERE losses = 0 AND byes > 4
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the minimum age of patients who are more or equal to 71 years and who have stayed in the hospital for 34 days?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= "71" AND demographic.days_stay = "34"
mimicsql_data
CREATE TABLE table_name_98 ( week VARCHAR, date VARCHAR )
October 28, 2001 was what week of the season?
SELECT week FROM table_name_98 WHERE date = "october 28, 2001"
sql_create_context
CREATE TABLE table_name_9 ( player VARCHAR, college VARCHAR )
Which player is from Murray State college?
SELECT player FROM table_name_9 WHERE college = "murray state"
sql_create_context
CREATE TABLE table_61668 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What Place has a Player of tony jacklin?
SELECT "Place" FROM table_61668 WHERE "Player" = 'tony jacklin'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
Next semester which classes will Dr. Wendy Robinson be teaching ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Wendy Robinson%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of...
advising
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
what are the four most commonly prescribed medications the previous year?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE table_name_47 ( score_in_the_final VARCHAR, surface VARCHAR, date VARCHAR )
Which Score in the final has a Surface of hard on august 20, 1989?
SELECT score_in_the_final FROM table_name_47 WHERE surface = "hard" AND date = "august 20, 1989"
sql_create_context
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, ...
is the respiration of patient 028-11360 last measured on the last icu visit greater than its value first measured on the last icu visit?
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-11360') AND NOT patient.unitdischargetime I...
eicu
CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperw...
Which game type has most number of games?
SELECT gtype FROM video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_54 ( event VARCHAR, method VARCHAR, opponent VARCHAR )
What is Event, when Method is 'Submission (Armbar)', and when Opponent is 'Jason St. Louis'?
SELECT event FROM table_name_54 WHERE method = "submission (armbar)" AND opponent = "jason st. louis"
sql_create_context
CREATE TABLE table_63413 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
Which Laps have a Rider of russell holland, and a Grid smaller than 10?
SELECT MAX("Laps") FROM table_63413 WHERE "Rider" = 'russell holland' AND "Grid" < '10'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
查询医疗就诊84892309667所需要的住院时长
SELECT IN_HOSP_DAYS FROM t_kc21 WHERE MED_CLINIC_ID = '84892309667'
css
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as ...
Are there courses that are only available in the Spring-Summer ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EECS' AND semester.semester = 'Spring-Summer' AND (SELECT COUNT(DISTINCT ...
advising
CREATE TABLE table_11208143_9 ( stadium VARCHAR, average VARCHAR )
Which stadiums have an average attendance of 13840?
SELECT stadium FROM table_11208143_9 WHERE average = 13840
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_cod...
which are the least expensive flights between DALLAS and BALTIMORE on 7 19
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da...
atis
CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain ( did int...
return me the homepage of PVLDB .
SELECT homepage FROM journal WHERE name = 'PVLDB'
academic
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,...
85454377号参保人在门诊一年花费了多少医疗费?
SELECT SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_ID = '85454377' AND CLINIC_TYPE = '门诊'
css
CREATE TABLE table_67620 ( "Seasons" real, "Team" text, "Ch.Wins" real, "Promotions" real, "Relegations" real )
Whats the highest Promotions that has a Team of Pallacanestro Messina, along with Relegations larger than 0?
SELECT MAX("Promotions") FROM table_67620 WHERE "Team" = 'pallacanestro messina' AND "Relegations" > '0'
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...
how many patients are born before 2168 and treated with procedure continuous invasive mechanical ventilation for 96 consecutive hours or more?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2168" AND procedures.long_title = "Continuous invasive mechanical ventilation for 96 consecutive hours or more"
mimicsql_data
CREATE TABLE table_28618 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text )
What is every value for Under-11 when value of under-17 is Salma Nassar?
SELECT "Under-11" FROM table_28618 WHERE "Under-17" = 'Salma Nassar'
wikisql
CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE a...
Return the issue date of the volume that has spent the fewest weeks on top.
SELECT issue_date FROM volume ORDER BY weeks_on_top LIMIT 1
spider
CREATE TABLE table_65045 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What's the result when the Carolina Panthers were the opponent?
SELECT "Result" FROM table_65045 WHERE "Opponent" = 'carolina panthers'
wikisql
CREATE TABLE table_name_50 ( points VARCHAR, match INTEGER )
What is the number of points when the match is smaller than 14?
SELECT COUNT(points) FROM table_name_50 WHERE match < 14
sql_create_context
CREATE TABLE table_72954 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
What district first elected a Democratic incumbent in 1998?
SELECT "District" FROM table_72954 WHERE "Party" = 'Democratic' AND "First elected" = '1998'
wikisql
CREATE TABLE table_77382 ( "Tournament" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text...
What shows for 202 when the 1994 is A, the 1989 is NME, and the 199 is 2R?
SELECT "2002" FROM table_77382 WHERE "1994" = 'a' AND "1989" = 'nme' AND "1999" = '2r'
wikisql
CREATE TABLE table_64524 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
What is the average number of games drawn among the teams that lost over 13 games?
SELECT AVG("Drawn") FROM table_64524 WHERE "Lost" > '13'
wikisql
CREATE TABLE table_name_21 ( total INTEGER, nation VARCHAR, silver VARCHAR )
What's the total of Sweden (SWE) having less than 1 silver?
SELECT MIN(total) FROM table_name_21 WHERE nation = "sweden (swe)" AND silver < 1
sql_create_context
CREATE TABLE table_11748792_2 ( friday VARCHAR, monday VARCHAR )
Who is the friday presenter for each show, when the monday presenter is Emma Willis Jamie East?
SELECT friday FROM table_11748792_2 WHERE monday = "Emma Willis Jamie East"
sql_create_context
CREATE TABLE table_name_31 ( position VARCHAR, cfl_team VARCHAR )
What position did the player from the saskatchewan roughriders (via toronto) play?
SELECT position FROM table_name_31 WHERE cfl_team = "saskatchewan roughriders (via toronto)"
sql_create_context
CREATE TABLE table_name_9 ( name VARCHAR, capacity__mw_ VARCHAR )
What is the Name of the power station with a Capacity of 25 MW?
SELECT name FROM table_name_9 WHERE capacity__mw_ = 25
sql_create_context
CREATE TABLE table_name_39 ( club VARCHAR, round VARCHAR, score VARCHAR )
Which club has a 2nd round score of 1:0, 3:0?
SELECT club FROM table_name_39 WHERE round = "2nd round" AND score = "1:0, 3:0"
sql_create_context
CREATE TABLE PersonFriend ( friend VARCHAR, name VARCHAR ) CREATE TABLE Person ( name VARCHAR, job VARCHAR, gender VARCHAR )
Find the male friend of Alice whose job is a doctor?
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'
sql_create_context
CREATE TABLE table_74806 ( "Year" real, "Driver" text, "Nation of citizenship" text, "Racing series" text, "Type of vehicle" text )
What Nation of citizenship has a stock car vehicle with a year of 1999?
SELECT "Nation of citizenship" FROM table_74806 WHERE "Type of vehicle" = 'stock car' AND "Year" = '1999'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) 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 varch...
Of all the PreMajor classes , which ones are in Winter .
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE table_name_40 ( absorb__nm_ VARCHAR, color VARCHAR )
What is the Absorbtion (in nanometers) of the color Orange?
SELECT absorb__nm_ FROM table_name_40 WHERE color = "orange"
sql_create_context
CREATE TABLE table_11734041_6 ( years_for_rockets VARCHAR, player VARCHAR )
What years for the rockets did player ford, alton alton ford play?
SELECT years_for_rockets FROM table_11734041_6 WHERE player = "Ford, Alton Alton Ford"
sql_create_context
CREATE TABLE table_name_2 ( player VARCHAR, place VARCHAR )
What Player has a Place of t10?
SELECT player FROM table_name_2 WHERE place = "t10"
sql_create_context
CREATE TABLE table_919 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many tries for does Pontardawe RFC have?
SELECT "Tries for" FROM table_919 WHERE "Club" = 'Pontardawe RFC'
wikisql
CREATE TABLE table_71471 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
On what date was the record with catalog ALCA-275 released?
SELECT "Date" FROM table_71471 WHERE "Catalog" = 'alca-275'
wikisql
CREATE TABLE game ( stadium_id number, id number, season number, date text, home_team text, away_team text, score text, competition text ) CREATE TABLE stadium ( id number, name text, home_games number, average_attendance number, total_attendance number, capacity...
List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.
SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Thiago Mo...
spider
CREATE TABLE table_name_96 ( fall_08 INTEGER, fall_05 VARCHAR, fall_09 VARCHAR, fall_06 VARCHAR )
What's the largest Fall 08 number when fall 09 is less than 82, fall 06 is 5, and fall 05 is less than 3?
SELECT MAX(fall_08) FROM table_name_96 WHERE fall_09 < 82 AND fall_06 = 5 AND fall_05 < 3
sql_create_context
CREATE TABLE table_56720 ( "Season" text, "Games" real, "Lost" real, "Tied" real, "Points" real, "Goals for" real, "Goals against" real, "Standing" text )
How many games have more than 288 goals and less than 34 losses?
SELECT COUNT("Games") FROM table_56720 WHERE "Goals against" > '288' AND "Lost" < '34'
wikisql