context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_97 ( gold VARCHAR, bronze VARCHAR )
Who won the gold when Kim Hyang-Mi won the bronze?
SELECT gold FROM table_name_97 WHERE bronze = "kim hyang-mi"
sql_create_context
CREATE TABLE table_64132 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest number of bronze when silver is larger than 0, rank is larger than 3?
SELECT MAX("Bronze") FROM table_64132 WHERE "Silver" > '0' AND "Rank" > '3'
wikisql
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 jobs ( JOB_ID varchar(10), JOB_TI...
For employees with first names that end with the letter m, give me a bar chart to show their average salary, and order Y-axis in desc order.
SELECT FIRST_NAME, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE Products ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_name VARCHAR(80), customer_details VARCHAR(255) ) CREATE TABLE Shipments ( shipment_id INTEGER, order_id INTEGER, invoice_numb...
For each product, show its name and the number of times it was ordered. Plot them as bar chart.
SELECT T3.product_name, SUM(COUNT(*)) FROM Orders AS T1 JOIN Order_Items AS T2 JOIN Products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_name
nvbench
CREATE TABLE table_64284 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the nationality of the swimmer with a rank over 2 with a time of 55.77?
SELECT "Nationality" FROM table_64284 WHERE "Rank" > '2' AND "Time" = '55.77'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose admission year is less than 2112 and diagnoses long title is retained plastic fragments?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2112" AND diagnoses.long_title = "Retained plastic fragments"
mimicsql_data
CREATE TABLE table_19587 ( "Number of episode" real, "Number of season" real, "Title (original)" text, "Title (English)" text, "Original air date" text )
What was the original air date for episode number 6?
SELECT "Original air date" FROM table_19587 WHERE "Number of episode" = '6'
wikisql
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Descrip...
Show the total number from each document type code
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code
nvbench
CREATE TABLE table_name_42 ( loss VARCHAR, score VARCHAR, arena VARCHAR )
What is the Loss of the game at Nationwide Arena with a Score of 4 3?
SELECT loss FROM table_name_42 WHERE score = "4–3" AND arena = "nationwide arena"
sql_create_context
CREATE TABLE table_test_4 ( "id" int, "ejection_fraction_ef" int, "systolic_blood_pressure_sbp" int, "active_infection" bool, "heart_disease" bool, "renal_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic_shock" bool, "diastolic_blood_pressure_dbp" int, ...
preexisting severe valvular heart disease
SELECT * FROM table_test_4 WHERE heart_disease = 1
criteria2sql
CREATE TABLE table_name_85 ( goal_difference INTEGER, position INTEGER )
What's the lowest goal difference when the position is higher than 16?
SELECT MIN(goal_difference) FROM table_name_85 WHERE position > 16
sql_create_context
CREATE TABLE table_name_78 ( italian VARCHAR, andalusian VARCHAR )
How would an Italian say the Andalusian word coche?
SELECT italian FROM table_name_78 WHERE andalusian = "coche"
sql_create_context
CREATE TABLE table_train_272 ( "id" int, "fasting_plasma_glucose_fpg" float, "creatinine_clearance_cl" float, "baseline_hemoglobin_hgb" float, "sensitization_on_pra" bool, "age" float, "NOUSE" float )
evidence of sensitization on pra
SELECT * FROM table_train_272 WHERE sensitization_on_pra = 1
criteria2sql
CREATE TABLE table_2493 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
If the position is 12th, what was the series?
SELECT "Series" FROM table_2493 WHERE "Position" = '12th'
wikisql
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...
被门诊诊断为D87.114这个病的患者04324529,看看他的检测指标451191的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_64577 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
Which Land (sqmi) has a GEO ID smaller than 3800587900?
SELECT MIN("Land ( sqmi )") FROM table_64577 WHERE "GEO ID" < '3800587900'
wikisql
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, ...
医疗就诊76565041487对于病情描述是什么样子的?
SELECT t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '76565041487'
css
CREATE TABLE hosting_city ( year number, match_id number, host_city text ) CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, regi...
Which cities have regional population above 10000000?
SELECT city FROM city WHERE regional_population > 10000000
spider
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number...
SELECT DISTINCT u.Id, DisplayName, Location, Aboutme, EmailHash, AccountId.
SELECT DISTINCT u.Id, DisplayName, Location, AboutMe, EmailHash, AccountId FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 AND u.Location LIKE '%London%'
sede
CREATE TABLE table_name_6 ( music VARCHAR, style VARCHAR )
WHAT IS THE MUSIC WITH SAMBA?
SELECT music FROM table_name_6 WHERE style = "samba"
sql_create_context
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 patient ( uniquep...
how many people were diagnosed with cardiomyopathy and did not visit the hospital within 2 months during this year?
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardiomyopathy' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 's...
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 ...
among patients treated with drug psyllium, how many of them were aged below 48?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "48" AND prescriptions.drug = "Psyllium"
mimicsql_data
CREATE TABLE table_78386 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
How many grids for peter collins?
SELECT COUNT("Grid") FROM table_78386 WHERE "Driver" = 'peter collins'
wikisql
CREATE TABLE team ( team_id number, name text ) CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl ...
How many players played each position?
SELECT position, COUNT(*) FROM match_season GROUP BY position
spider
CREATE TABLE zyb ( 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...
编号是59835005196在医疗就诊的住院是多长时间?
SELECT qtb.IN_HOSP_DAYS FROM qtb WHERE qtb.MED_CLINIC_ID = '59835005196' UNION SELECT gyb.IN_HOSP_DAYS FROM gyb WHERE gyb.MED_CLINIC_ID = '59835005196' UNION SELECT zyb.IN_HOSP_DAYS FROM zyb WHERE zyb.MED_CLINIC_ID = '59835005196' UNION SELECT mzb.IN_HOSP_DAYS FROM mzb WHERE mzb.MED_CLINIC_ID = '59835005196'
css
CREATE TABLE table_34253 ( "interval name" text, "size (steps)" real, "size (cents)" real, "just ratio" text, "just (cents)" real, "error" text )
ratio of 15:14, and a just (cents) larger than 119.44 is what average size (cents)?
SELECT AVG("size (cents)") FROM table_34253 WHERE "just ratio" = '15:14' AND "just (cents)" > '119.44'
wikisql
CREATE TABLE train_station ( train_id number, station_id number ) CREATE TABLE station ( station_id number, name text, annual_entry_exit number, annual_interchanges number, total_passengers number, location text, main_services text, number_of_platforms number ) CREATE TABLE tra...
List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.
SELECT name, location FROM station ORDER BY annual_entry_exit, annual_interchanges
spider
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
how many patients diagnosed with enthesopathy of hip are ethnically black/african american?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.short_title = "Enthesopathy of hip"
mimicsql_data
CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) )
Find the number of the name of the project for which a scientist whose name contains Smith is assigned to, and rank by the how many name in ascending please.
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.Name)
nvbench
CREATE TABLE table_5218 ( "Variant id" text, "5\u2019UTR splice" text, "Coding" text, "3\u2019UTR sequence" text, "GenBank id" text )
What Coding has a 3 UTR sequence of 6a 4 with a GenBank id of hq021439?
SELECT "Coding" FROM table_5218 WHERE "3\u2019UTR sequence" = '6a 4' AND "GenBank id" = 'hq021439'
wikisql
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...
Return a bar chart about the distribution of ACC_Road and the amount of ACC_Road , and group by attribute ACC_Road, and display from high to low by the ACC_Road.
SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
nvbench
CREATE TABLE table_44886 ( "Round" real, "Pick" real, "Position" text, "Nationality" text, "College/Team" text )
What is College/Team, when Round is less than 2, and when Nationality is 'United States'?
SELECT "College/Team" FROM table_44886 WHERE "Round" < '2' AND "Nationality" = 'united states'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number...
how tall is patient 009-10951 based on the last measurement during this month?
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-10951') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ...
eicu
CREATE TABLE table_name_47 ( class__old__to_1868 VARCHAR, quantity INTEGER )
Can you tell me the Class (old) to 1868 that has the Quantity larger than 8?
SELECT class__old__to_1868 FROM table_name_47 WHERE quantity > 8
sql_create_context
CREATE TABLE table_79520 ( "Title" text, "Series" text, "Director" text, "Production Number" real, "Release date" text )
What date was Wet Hare, directed by Robert McKimson, released?
SELECT "Release date" FROM table_79520 WHERE "Director" = 'robert mckimson' AND "Title" = 'wet hare'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
看看在医疗机构7566807的记录里,这位21438648的患者在11年11月13日到12年6月11日期间,治疗过程中给开出的西药总共有多少
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '21438648' AND t_kc22.STA_DATE BETWEEN '2011-11-13' AND '2012-06-11' AND t_kc21.MED_SER_ORG_NO = '7566807' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
A bar chart about what are the number of rooms for each bed type?, could you sort in descending by the x-axis?
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType DESC
nvbench
CREATE TABLE table_26201 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "School" text )
What's Doug Borden's position?
SELECT "Position" FROM table_26201 WHERE "Player" = 'Doug Borden'
wikisql
CREATE TABLE table_name_59 ( against VARCHAR, venue VARCHAR, date VARCHAR )
What is the total number of Against that were played in the H Venue on 26 february 1949?
SELECT COUNT(against) FROM table_name_59 WHERE venue = "h" AND date = "26 february 1949"
sql_create_context
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...
列出在2001年5月22日到2007年11月6日内开出的检验报告单在医院3701997中,不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的是多少平均值,并按平均值降序排序?
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '3701997' AND BGRQ BETWEEN '2001-05-22' AND '2007-11-06' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) DESC
css
CREATE TABLE table_57284 ( "Rank" real, "Name" text, "Nationality" text, "Team" text, "Points" real )
Cumulative point total for all teams playing on the Discovery Channel?
SELECT COUNT("Points") FROM table_57284 WHERE "Team" = 'discovery channel'
wikisql
CREATE TABLE table_train_112 ( "id" int, "systolic_blood_pressure_sbp" int, "modified_geriatric_depression_scale_gds" int, "diastolic_blood_pressure_dbp" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float )
a score of 5 or more on the hashinski ischemic scale ( rosen modification.
SELECT * FROM table_train_112 WHERE rosen_modified_hachinski_ischemic_score >= 5
criteria2sql
CREATE TABLE table_1558 ( "Team" text, "Average" text, "Points" real, "Played" real, "1991-92" text, "1992-93" text, "1993-94" real )
Name the average is 1991-92 is 39
SELECT "Average" FROM table_1558 WHERE "1991-92" = '39'
wikisql
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE...
What is the total time for all lessons taught by Janessa Sawayn?
SELECT SUM(lesson_time) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
spider
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...
had patient 008-10139 in this year been admitted to an emergency room?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '008-10139' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
has patient 60136 been tested for urea nitrogen on the current hospital visit?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_train_108 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "deficiency_to_iga" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "NOUSE" float )
a systolic blood pressure >= 180 mmhg and / or a diastolic blood pressure >= 105 mmhg
SELECT * FROM table_train_108 WHERE systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 105
criteria2sql
CREATE TABLE table_26335424_86 ( event VARCHAR, round_of_32 VARCHAR )
If round of 32 is sawatvilay phimmasone ( lao ) w pts 9-7, what was the event?
SELECT event FROM table_26335424_86 WHERE round_of_32 = "Sawatvilay Phimmasone ( LAO ) W PTS 9-7"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDis...
Top users by specified age.
SELECT Id AS "user_link", Reputation, Age, CreationDate, LastAccessDate FROM Users WHERE Age = @age ORDER BY Reputation DESC LIMIT 100
sede
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, friday varchar, saturday varchar, sunday varchar, has_final_proje...
How many years have they offered SPANISH 113 ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SPANISH' AND course.number = 113 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE inst ( instid number, name text, country text )
List the titles of the papers whose authors are from the institution 'Indiana University'.
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
spider
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopi...
Find questions with not many answers.
SELECT q.Id AS "post_link", q.Score, q.ViewCount, q.AnswerCount FROM Posts AS q WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL ORDER BY q.AnswerCount, q.ViewCount DESC
sede
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
count the number of patients whose age is less than 81 and drug code is prismab32k25000?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.formulary_drug_cd = "PRISMAB32K25000"
mimicsql_data
CREATE TABLE city ( City_ID int, City text, Hanzi text, Hanyu_Pinyin text, Regional_Population int, GDP real ) CREATE TABLE match ( Match_ID int, Date text, Venue text, Score text, Result text, Competition text ) CREATE TABLE temperature ( City_ID int, Jan real,...
Create a pie chart showing the total number across competition.
SELECT Competition, COUNT(*) FROM match GROUP BY Competition
nvbench
CREATE TABLE table_54748 ( "Father" text, "Birth" text, "Marriage" text, "Became Queen" text, "Ceased to be Queen" text, "Death" text, "Spouse" text )
When did the person who died on 6 Dec 1240 get married?
SELECT "Marriage" FROM table_54748 WHERE "Death" = '6 dec 1240'
wikisql
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID...
Return the ids and details corresponding to projects for which there are more than two documents by a pie chart.
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
give me the number of patients whose admission year is less than 2195 and lab test name is urobilinogen?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2195" AND lab.label = "Urobilinogen"
mimicsql_data
CREATE TABLE table_34158 ( "Barangay" text, "Population (2010)" real, "Economic Class" text, "Land Area (In sqm.)" real, "Punong Barangay (Term 2010-2013)" text )
Which Economic Class has a Barangay of imelda bliss village?
SELECT "Economic Class" FROM table_34158 WHERE "Barangay" = 'imelda bliss village'
wikisql
CREATE TABLE table_name_6 ( score VARCHAR, country VARCHAR, player VARCHAR )
What was Australia's score when Peter Lonard played?
SELECT score FROM table_name_6 WHERE country = "australia" AND player = "peter lonard"
sql_create_context
CREATE TABLE table_name_5 ( country VARCHAR, client VARCHAR )
What country did the client Agiba-agip work in?
SELECT country FROM table_name_5 WHERE client = "agiba-agip"
sql_create_context
CREATE TABLE table_61413 ( "Letter" text, "American" text, "British" text, "Australian" text, "Examples" text )
What is the Australian letter with a British of and a letter of /i/??
SELECT "Australian" FROM table_61413 WHERE "British" = 'ɪ' AND "Letter" = 'æ /i/'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
indicate the daily maximum amount of foley output that patient 68280 had had since 12/18/2105.
SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 68280)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'fol...
mimic_iii
CREATE TABLE table_name_27 ( runner_up VARCHAR, city VARCHAR )
Who is the runner-up from Milwaukee?
SELECT runner_up FROM table_name_27 WHERE city = "milwaukee"
sql_create_context
CREATE TABLE table_name_40 ( rank INTEGER, year VARCHAR )
In 1950 what is the average rank?
SELECT AVG(rank) FROM table_name_40 WHERE year = 1950
sql_create_context
CREATE TABLE table_name_34 ( nationality VARCHAR, position VARCHAR, school_club_team VARCHAR )
What is the nationality of the guard for the chool/Club Team in Virginia?
SELECT nationality FROM table_name_34 WHERE position = "guard" AND school_club_team = "virginia"
sql_create_context
CREATE TABLE table_name_66 ( rank VARCHAR, total VARCHAR, silver VARCHAR )
What is the rank of the country with total more than 3 and more than 6 silver?
SELECT rank FROM table_name_66 WHERE total > 3 AND silver > 6
sql_create_context
CREATE TABLE table_name_49 ( method VARCHAR, time VARCHAR )
What was the method used when the time was 4:52?
SELECT method FROM table_name_49 WHERE time = "4:52"
sql_create_context
CREATE TABLE table_2955 ( "Vehicle" text, "Operating mode" text, "EPA rated All-electric range" text, "EPA rated combined fuel economy" text, "Clean electric grid California (San Francisco)" text, "U.S. national average electric mix" text, "Dirty electric grid Rocky Mountains (Denver)" text ...
What is the epa rated combined fuel economy for the Nissan Leaf?
SELECT "EPA rated combined fuel economy" FROM table_2955 WHERE "Vehicle" = 'Nissan Leaf'
wikisql
CREATE TABLE table_name_2 ( proto_germanic_origin VARCHAR, sound__phoneme_ VARCHAR )
What is the Proto-Germanic origin of the phoneme /[[|j]]/?
SELECT proto_germanic_origin FROM table_name_2 WHERE sound__phoneme_ = "/[[|j]]/"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
give me the number of patients whose primary disease is femoral artery thrombosis and age is less than 85?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND demographic.age < "85"
mimicsql_data
CREATE TABLE table_5847 ( "Year Ended" text, "Passengers Flown" real, "Passenger Load Factor (%)" real, "Revenue (\u20acm)" real, "Profit / (Loss) Before Tax (\u20acm)" text, "Net Profit / (Loss) (\u20acm)" text )
Which Year Ended has a Passenger Load Factor (%) larger than 72.8, and a Revenue ( m) smaller than 906.8?
SELECT "Year Ended" FROM table_5847 WHERE "Passenger Load Factor (%)" > '72.8' AND "Revenue (\u20acm)" < '906.8'
wikisql
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, ...
what is the drug that patient 021-93953 was prescribed for during the same hospital visit after undergoing mechanical ventilation?
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_24087 ( "County" text, "Won by" text, "Walker %" real, "Walker votes" real, "Barrett %" real, "Barrett votes" real )
How many total figures are given for Milwaukee county?
SELECT COUNT("Won by") FROM table_24087 WHERE "County" = 'Milwaukee'
wikisql
CREATE TABLE table_name_10 ( others VARCHAR, szdsz VARCHAR, fidesz VARCHAR )
What percentage of others have an SZDSZ of 4% and a Fidesz of 60%?
SELECT others FROM table_name_10 WHERE szdsz = "4%" AND fidesz = "60%"
sql_create_context
CREATE TABLE table_23831 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text )
How many millions of people in the US saw the episode titled 'The Reunion Job'?
SELECT "U.S. viewers (in millions)" FROM table_23831 WHERE "Title" = 'The Reunion Job'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者韩曼冬在2002年2月11日到2014年2月3日内都做了什么检验把检验结果指标记录中的仪器编号以及名称列出来
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZL...
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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, ...
看看之前11219115患者的住院诊断有哪些
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 = '11219115'
css
CREATE TABLE table_name_10 ( supercopa_1994 VARCHAR, team VARCHAR )
Which Supercopa 1994 has a Team of estudiantes?
SELECT supercopa_1994 FROM table_name_10 WHERE team = "estudiantes"
sql_create_context
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
how many entrepreneurs correspond to each investor?
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
nvbench
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text )
For each reviewer id, show their corresponding the smallest rating for the movie in a scatter chart.
SELECT rID, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY rID
nvbench
CREATE TABLE table_69190 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
On what date was the record 2 1?
SELECT "Date" FROM table_69190 WHERE "Record" = '2–1'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
whats the sex of patient 97734?
SELECT patients.gender FROM patients WHERE patients.subject_id = 97734
mimic_iii
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
What are the allergy types and how many allergies correspond to each one, and order Y in asc order.
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*)
nvbench
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, ...
日期均在2021-05-03之后的患者王向卉的哪些门诊就诊记录对应的检验报告单的报告?列出门诊就诊流水号是什么?
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZ...
姓名是吕经艺的患者的哪些检验报告单上的检验结论指标都正常的?具体的检验报告单号是啥?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_24490 ( "Week of" text, "Tournament" text, "Champion" text, "Runner-up" text, "Semifinalists" text, "Quarterfinalists" text )
Who were the quarterfinalists for the runner-ups of mike de palmer gary donnelly?
SELECT "Quarterfinalists" FROM table_24490 WHERE "Runner-up" = 'Mike De Palmer Gary Donnelly'
wikisql
CREATE TABLE table_name_38 ( theme VARCHAR, week VARCHAR )
What was the theme for week 3?
SELECT theme FROM table_name_38 WHERE week = "week 3"
sql_create_context
CREATE TABLE table_name_59 ( year VARCHAR, artist VARCHAR, weeks_at_number_one VARCHAR )
What's the sum of years when the Artist of the queen were less than 1?
SELECT COUNT(year) FROM table_name_59 WHERE artist = "queen" AND weeks_at_number_one < 1
sql_create_context
CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT ) CREATE TABLE Patient ...
Return the name of each physician and the number of patients he or she treats in a bar chart, and I want to sort in ascending by the bars.
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY T1.Name
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of government health insurance patients who had laryngoscopy and other tracheoscopy procedure?
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 = "Laryngoscopy and other tracheoscopy"
mimicsql_data
CREATE TABLE table_16381914_1 ( affiliation VARCHAR, location VARCHAR )
What kind of school is Canton, New York?
SELECT affiliation FROM table_16381914_1 WHERE location = "Canton, New York"
sql_create_context
CREATE TABLE table_25551880_2 ( winner VARCHAR, mountains_classification VARCHAR )
How many winners were there when the mountains classification was not awarded?
SELECT COUNT(winner) FROM table_25551880_2 WHERE mountains_classification = "not awarded"
sql_create_context
CREATE TABLE table_203_674 ( id number, "name" text, "mark" text, "system" text, "from" number, "to" number, "successor" text, "notes" text )
what now defunct railroad existed for the shortest time ?
SELECT "name" FROM table_203_674 ORDER BY "to" - "from" LIMIT 1
squall
CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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_id varchar...
For Prof. Waheed Samy 's classes , is there always an exam ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN...
advising
CREATE TABLE table_13646 ( "Year" real, "Song" text, "Artist" text, "Place" text, "Points" text )
How many years have claudia beni as the artist?
SELECT SUM("Year") FROM table_13646 WHERE "Artist" = 'claudia beni'
wikisql
CREATE TABLE table_203_603 ( id number, "service" text, "service id" text, "bit rate" text, "audio channels" text, "description" text, "analogue availability" text )
name the only indie/alternative/rock music radio station broadcasted by mxr yorkshire .
SELECT "service" FROM table_203_603 WHERE "description" = 'indie / alternative / rock music'
squall
CREATE TABLE table_41874 ( "First District" text, "Second District" text, "Third District" text, "Fourth District" text, "Fifth District" text )
Who's the First District with a Fifth District of prudy adam?
SELECT "First District" FROM table_41874 WHERE "Fifth District" = 'prudy adam'
wikisql
CREATE TABLE table_52193 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the high grid that has a Time/Retired of +6 laps, and under 69 laps?
SELECT MAX("Grid") FROM table_52193 WHERE "Time/Retired" = '+6 laps' AND "Laps" < '69'
wikisql
CREATE TABLE table_name_71 ( serial_no VARCHAR, engine_no VARCHAR, colour VARCHAR, pilot_car_no VARCHAR )
What is the serial number of the pilot car that is black, has a pilot car number larger than 2, and an engine number of 1008?
SELECT serial_no FROM table_name_71 WHERE colour = "black" AND pilot_car_no > 2 AND engine_no = 1008
sql_create_context
CREATE TABLE table_13808 ( "Year" text, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text )
What genre has the game god of war?
SELECT "Genre" FROM table_13808 WHERE "Game" = 'god of war'
wikisql