context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_19 ( challenge_winner VARCHAR, challenge_loser VARCHAR )
Which winner has a Challenge Loser of gisel?
SELECT challenge_winner FROM table_name_19 WHERE challenge_loser = "gisel"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PendingFlags ( Id nu...
Search for users by rep and location.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_id", (CASE WHEN DisplayName LIKE '%arbar%zha%' THEN '|_' + DisplayName + '_|' ELSE DisplayName END) AS DisplayName, Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%portland, or%' OR LOWER(Location) LIKE '%porlland, oregon%') ORDER BY ...
sede
CREATE TABLE table_name_90 ( visitor VARCHAR, date VARCHAR )
Who was the visiting team on December 17?
SELECT visitor FROM table_name_90 WHERE date = "december 17"
sql_create_context
CREATE TABLE table_38598 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
What surface was used on may 13, 2007?
SELECT "Surface" FROM table_38598 WHERE "Date" = 'may 13, 2007'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
编号01352770在2014年10月3日到2016年4月14日期间所在检验所有结果指标记录中的仪器编号以及名称都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = ...
css
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
has patient 29806 undergone any lab testing when they came to the hospital first time?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29806 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
mimic_iii
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Draw a bar chart about the distribution of Sex and the average of Weight , and group by attribute Sex, and order by the X-axis from high to low please.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients are admitted under emergency room admit and diagnosed with icd9 code 78559?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "78559"
mimicsql_data
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
Which courses do I need before taking AT 362 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_59924 ( "Week 8 Oct 26" text, "Week 10 Nov 9" text, "Week 11 Nov 16" text, "Week 12 Nov 23" text, "Week 13 Nov 30" text, "Week 14 (Final) Dec 7" text )
What is the week 14 (final) dec 7 standing with Florida (6-1) on week 8 Oct 26?
SELECT "Week 14 (Final) Dec 7" FROM table_59924 WHERE "Week 8 Oct 26" = 'florida (6-1)'
wikisql
CREATE TABLE table_39793 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the lowest Points when against is 50, and there are less than 20 played?
SELECT MIN("Points") FROM table_39793 WHERE "Against" = '50' AND "Played" < '20'
wikisql
CREATE TABLE table_33133 ( "Team" text, "Manager" text, "Captain" text, "Kit maker" text, "Shirt sponsor" text )
Which kit maker does Aston Villa use?
SELECT "Kit maker" FROM table_33133 WHERE "Team" = 'aston villa'
wikisql
CREATE TABLE table_28846752_4 ( innings INTEGER, highest_score VARCHAR )
What is the innings when the highest score is 72?
SELECT MAX(innings) FROM table_28846752_4 WHERE highest_score = "72"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
患者年龄高于7岁的医疗记录中的平均医疗费金额是多少
SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE > 7)
css
CREATE TABLE table_76411 ( "Name" text, "Championship" real, "FA Cup" real, "League Cup" real, "Total" real )
What is the total championships that the league cup is less than 0?
SELECT SUM("Championship") FROM table_76411 WHERE "League Cup" < '0'
wikisql
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
A bar chart about what are the names of climbers and the corresponding heights of the mountains that they climb?
SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
nvbench
CREATE TABLE table_name_58 ( fips_code INTEGER, coordinates VARCHAR, land___sq_mi__ VARCHAR )
Name the highest FIPS code for coordinates of 41.827547, -74.118478 and land less than 1.196
SELECT MAX(fips_code) FROM table_name_58 WHERE coordinates = "41.827547, -74.118478" AND land___sq_mi__ < 1.196
sql_create_context
CREATE TABLE table_name_81 ( score VARCHAR, venue VARCHAR, date VARCHAR )
What was the score at Pankritio Stadium on June 6, 2007?
SELECT score FROM table_name_81 WHERE venue = "pankritio stadium" AND date = "june 6, 2007"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
calculate the difference between patient 016-3407's total input and output amounts on the first intensive care unit visit.
SELECT (SELECT SUM(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 = '016-3407') AND NOT patient.unitdischarge...
eicu
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Unanswered questions tagged with google-maps for last 7 days.
SELECT p.Id, p.Title, p.Tags, p.AcceptedAnswerId, p.Score, p.ViewCount, p.AnswerCount, p.CommentCount, p.ClosedDate FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = Pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName = 'google-maps' AND p.CreationDate >= DATEADD(Day, -7, GETDATE()) ORDER BY p.Score DES...
sede
CREATE TABLE table_name_61 ( date VARCHAR, tyre VARCHAR, winning_driver VARCHAR )
What date was the Tyre d and Bruce Mclaren won?
SELECT date FROM table_name_61 WHERE tyre = "d" AND winning_driver = "bruce mclaren"
sql_create_context
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...
Unmerged answered self-duplicates (list of stub Qs). Find duplicate questions where OP from the stub post (source) is the same OP as from the destination post (master/target) and both stub/source and master/target questions have answers (hence, they are candidates to be merged).
WITH stub_list AS (SELECT p.Id, p.Score, p.OwnerUserId, pl.RelatedPostId FROM Posts AS p JOIN PostLinks AS pl ON pl.PostId = p.Id WHERE p.PostTypeId = 1 AND EXISTS(SELECT * FROM PostHistory AS ph WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId IN (10)) AND pl.LinkTypeId = 3 AND p.AnswerCount > 0) SELECT s.Id AS "post_l...
sede
CREATE TABLE table_3354 ( "meas. num." real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
What is every entry for passed when NO votes is 312187?
SELECT "passed" FROM table_3354 WHERE "NO votes" = '312187'
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...
名叫马文敏的患者抓过的药品盐酸帕罗西汀片都是在什么医院开的?
SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '马文敏' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '盐酸帕罗西汀片')
css
CREATE TABLE table_76460 ( "Place" text, "Code" real, "Area (km 2 )" real, "Population" real, "Most spoken language" text )
What is the place that speaks xhosa, has a population less than 87,585, an area smaller than 1.28 squared kilometers, and a code larger than 27504?
SELECT "Place" FROM table_76460 WHERE "Population" < '87,585' AND "Area (km 2 )" < '1.28' AND "Code" > '27504' AND "Most spoken language" = 'xhosa'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose ethnicity is black/haitian and diagnoses icd9 code is 2948?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND diagnoses.icd9_code = "2948"
mimicsql_data
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize the relationship between commission_pct and department_id .
SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
since 3 years ago has patient 010-5895 been prescribed 2 ml vial : ondansetron hcl 4 mg/2ml ij soln.
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-5895')) AND medication.drugname = '2 ml vial : ondansetron hcl 4 mg/2m...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients have been prescribed the drug esmolol?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Esmolol"
mimicsql_data
CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion ...
For each headquarter, what are the headquarter and how many companies are centered there?
SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters
spider
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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, J...
何阳夏患者的检验报告单对应的检验结果指标均异常有哪些?列出异常的检验报告单号都是哪些?
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_40796 ( "Free" text, "Free polite" text, "Genitive 1" text, "Genitive 2" text, "Genitive 3" text )
Which Free polite has a Genitive 3 of *ni-da?
SELECT "Free polite" FROM table_40796 WHERE "Genitive 3" = '*ni-da'
wikisql
CREATE TABLE table_name_39 ( gold VARCHAR, silver VARCHAR, year VARCHAR )
Can you tell me the Gold that has the Silver of south korea, and the Year of 1986?
SELECT gold FROM table_name_39 WHERE silver = "south korea" AND year = 1986
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide me the number of patients admitted before the year 2162 who have been diagnosed with blood in feces.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2162" AND diagnoses.short_title = "Blood in stool"
mimicsql_data
CREATE TABLE table_37501 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Who was the opponent at the week 6 game?
SELECT "Opponent" FROM table_37501 WHERE "Week" = '6'
wikisql
CREATE TABLE table_43650 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Who was the opponent in a week over 8 on December 4, 1960?
SELECT "Opponent" FROM table_43650 WHERE "Week" > '8' AND "Date" = 'december 4, 1960'
wikisql
CREATE TABLE employment ( Name VARCHAR, People_ID VARCHAR ) CREATE TABLE people ( Name VARCHAR, People_ID VARCHAR )
List the names of people that are not employed by any company
SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM employment)
sql_create_context
CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Gradeconversion ( lettergrade VARCHAR(2), gradepoint FLOAT ) CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) ) CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER,...
Give the number of each course name with at least five enrollments Return a bar chart, and display by the names in asc.
SELECT T1.CName, COUNT(T1.CName) FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T1.CName, T2.CID HAVING COUNT(*) >= 5 ORDER BY T1.CName
nvbench
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartmen...
show me flights going from BOSTON to DENVER arriving on wednesday morning
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 (((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.da...
atis
CREATE TABLE table_name_83 ( representative VARCHAR, title VARCHAR, termination_of_mission VARCHAR )
Which representative was the Ambassador Extraordinary and Plenipotentiary and had a Termination of Mission date September 20, 1996?
SELECT representative FROM table_name_83 WHERE title = "ambassador extraordinary and plenipotentiary" AND termination_of_mission = "september 20, 1996"
sql_create_context
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CR...
Is there class for AEROSP 481 on Friday ?
SELECT DISTINCT course_offering.friday 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 = 'AEROSP' AND course.number = 481 AND semester.semester = 'WN' AND semester.year = 2016
advising
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
编号62244045203的医疗就诊中,药品0268开出的医疗发票,项目类别这一栏填的是什么
SELECT t_kc22.MED_INV_ITEM_TYPE 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 = '62244045203' AND t_kc22.SOC_SRT_DIRE_CD = '0268'
css
CREATE TABLE table_name_80 ( country VARCHAR, player VARCHAR )
What country was Ernie Els from?
SELECT country FROM table_name_80 WHERE player = "ernie els"
sql_create_context
CREATE TABLE table_75987 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Who was the Partner that was a winner, a Year smaller than 1993, and a Score of 6 4, 6 2?
SELECT "Partner" FROM table_75987 WHERE "Outcome" = 'winner' AND "Year" < '1993' AND "Score" = '6–4, 6–2'
wikisql
CREATE TABLE table_52710 ( "Rank" real, "Mountain Peak" text, "State" text, "Mountain Range" text, "Location" text )
What is the location of Blanca Peak?
SELECT "Location" FROM table_52710 WHERE "Mountain Peak" = 'blanca peak'
wikisql
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE table_name_48 ( laps INTEGER, grid VARCHAR )
What is the average number of laps when the grid number is 9?
SELECT AVG(laps) FROM table_name_48 WHERE grid = 9
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjybgb ( BBCJBW text, BBDM t...
在04年9月6日到12年2月8日期间的门诊就诊中有多少医院2106089的科室开出了超出24张检验报告单?
SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '2106089' AND zyjybgb.BGRQ BETWEEN '2004-09-06' AND '2012-02-08' GROUP BY zyjybgb.KSBM HAVING COUNT(*) > 24 UNION SELECT mzjybgb.KSBM FROM mzjzj...
css
CREATE TABLE table_65196 ( "Rank" text, "Country" text, "Jerseys" real, "Giro wins" real, "Points" real, "Young rider" real, "Most recent cyclist" text, "Most recent date" text, "Different holders" real )
what is the highest jersey when points is 0, different holders is less than 3, giro wins is less than 1 and young rider is more than 1?
SELECT MAX("Jerseys") FROM table_65196 WHERE "Points" = '0' AND "Different holders" < '3' AND "Giro wins" < '1' AND "Young rider" > '1'
wikisql
CREATE TABLE table_1425948_1 ( chassis_manufacturer VARCHAR, fleet_numbers VARCHAR )
Which chassis manufacturer is for fleet numbers range 2530-2558
SELECT chassis_manufacturer FROM table_1425948_1 WHERE fleet_numbers = "2530-2558"
sql_create_context
CREATE TABLE table_67311 ( "Name" text, "Party" text, "Hometown" text, "District" text, "Term" text, "Legislatures" text )
What is the hometown of the representative that served the twenty-sixth legislature?
SELECT "Hometown" FROM table_67311 WHERE "Legislatures" = 'twenty-sixth'
wikisql
CREATE TABLE table_name_67 ( number_of_people_1991 INTEGER, percent_of_slovenes_1991 VARCHAR )
Which Number of people 1991 has a Percent of Slovenes 1991 of 14.4%?
SELECT MAX(number_of_people_1991) FROM table_name_67 WHERE percent_of_slovenes_1991 = "14.4%"
sql_create_context
CREATE TABLE table_21170 ( "Date of Sterilization" text, "Age 10-19" real, "Age 20-29" real, "Age 30-39" real, "Age 40-49" real, "Age 50-59" real, "Age Unknown" real, "Total" real )
Name the age 30-39 and age 10-19 380
SELECT "Age 30-39" FROM table_21170 WHERE "Age 10-19" = '380'
wikisql
CREATE TABLE table_9157 ( "Year" real, "Host" text, "Gold" text, "Silver" text, "Bronze" text )
In what year was Luxembourg Host?
SELECT MIN("Year") FROM table_9157 WHERE "Host" = 'luxembourg'
wikisql
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphras...
List papers that has keyword Temporal Correlation
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Temporal Correlation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE table_78145 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
Where was the security pacific senior classic?
SELECT "Location" FROM table_78145 WHERE "Tournament" = 'security pacific senior classic'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
how much did patient 29611's stay at the hospital cost on their last hospital visit?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29611 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
mimic_iii
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) )
Give me a histogram for what are the naems of all the projects, and how many scientists were assigned to each of them?, list from low to high by the x axis.
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name
nvbench
CREATE TABLE table_48552 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
WHAT NATIONALITY HAS ROUND 3?
SELECT "Nationality" FROM table_48552 WHERE "Round" = '3'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, ...
are there any flights from ATLANTA to BALTIMORE
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM...
atis
CREATE TABLE table_name_64 ( completed VARCHAR, rank VARCHAR )
When did the rank 9 building got completed?
SELECT completed FROM table_name_64 WHERE rank = "9"
sql_create_context
CREATE TABLE table_5197 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
Which team had a qualifying 1 time of 1:01.342?
SELECT "Team" FROM table_5197 WHERE "Qual 1" = '1:01.342'
wikisql
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
what was the name of the procedure that was given two times to patient 51200 a month before?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 512...
mimic_iii
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
Does it have something interesting about the employee id and the manager id?
SELECT T1.EMPLOYEE_ID, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID
nvbench
CREATE TABLE table_204_538 ( id number, "pos." number, "driver" text, "co-driver" text, "car" text, "time" text )
which racer finished after jose camacho ?
SELECT "driver" FROM table_204_538 WHERE "pos." = (SELECT "pos." FROM table_204_538 WHERE "driver" = 'jose camacho') + 1
squall
CREATE TABLE table_19453 ( "Virtual" real, "Physical" real, "Call sign" text, "Branding" text, "Network" text, "Owner" text )
Name the number of virtual for NBC
SELECT COUNT("Virtual") FROM table_19453 WHERE "Network" = 'NBC'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TA...
show me the flights from ST. PETERSBURG to SALT LAKE CITY that arrive before 1200
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT LAKE CITY' AND flight.arrival_time <= 1200 AND flight.to_airport = AIRPORT_SERVICE_1...
atis
CREATE TABLE table_name_1 ( winner VARCHAR, runner_up VARCHAR )
Who was the winner in the event with a runner-up of Alberto Mancini?
SELECT winner FROM table_name_1 WHERE runner_up = "alberto mancini"
sql_create_context
CREATE TABLE table_name_51 ( team_s_ VARCHAR, time VARCHAR )
What teams used a track 3:29 long?
SELECT team_s_ FROM table_name_51 WHERE time = "3:29"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid numb...
count the number of patients who had the intake of enteral tube intake: orogastric oral 14f since 2103.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'enteral tube intake: orogastric oral 14f' AND intakeoutput.cellpath LIKE '%input%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) >= '2103'...
eicu
CREATE TABLE table_72470 ( "Country" real, "Rank" text, "Aid" text, "Trade" text, "Investment" text, "Migration" text, "Environment" text, "Security" text, "Technology" text, "Overall (Average)" text )
What country has a 5.5 mark for security?
SELECT "Rank" FROM table_72470 WHERE "Security" = '5.5'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患者37544109在2015年2月26日到2020年8月30日内所做的检测丙戊酸的检查是哪个医务人员工号及姓名都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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 ...
css
CREATE TABLE table_204_53 ( id number, "date" text, "result" text, "opponent" text, "event" text, "location" text, "method" text, "round" number, "time" text )
how many rounds did the fight against ibrahim benazza last ?
SELECT "round" FROM table_204_53 WHERE "opponent" = 'ibrahim benazza'
squall
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...
provide me the type of admission and abnormal lab test status for the patient with patient id 7273.
SELECT demographic.admission_type, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "7273"
mimicsql_data
CREATE TABLE table_54187 ( "! Late 1941" text, "Late 1942" real, "Sept. 1943" real, "Late 1943" real, "Late 1944" real, "1978 Veteran membership" real )
What is the highest late 1943 number with a late 1941 of vojvodina and a 1978 membership less than 40,000?
SELECT MAX("Late 1943") FROM table_54187 WHERE "! Late 1941" = 'vojvodina' AND "1978 Veteran membership" < '40,000'
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, find name and the amount of name , and group by attribute name, and visualize them by a bar chart, and rank by the total number in desc.
SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC
nvbench
CREATE TABLE table_204_55 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
what is the total number of games played at notre dame stadium notre dame , in ?
SELECT COUNT(*) FROM table_204_55 WHERE "site" = 'notre dame stadium • notre dame, in'
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
is patient 035-24054's systemicdiastolic second measured on the current icu visit greater than the value first measured on the current icu visit?
SELECT (SELECT vitalperiodic.systemicdiastolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054') AND patient.unitdischargetime...
eicu
CREATE TABLE table_24399615_4 ( episode_no INTEGER, cable_rank VARCHAR )
What episode number had a cable ranking of 8?
SELECT MIN(episode_no) FROM table_24399615_4 WHERE cable_rank = "8"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
show me ground transportation in WASHINGTON
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WASHINGTON' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_1969634_1 ( enrollment VARCHAR, institution VARCHAR )
How many schools named southern new hampshire university?
SELECT COUNT(enrollment) FROM table_1969634_1 WHERE institution = "Southern New Hampshire University"
sql_create_context
CREATE TABLE table_68553 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Which opponent has a Score of 6 4, 3 6, 6 3?
SELECT "Opponent" FROM table_68553 WHERE "Score" = '6–4, 3–6, 6–3'
wikisql
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
Give me a bar chart for the total number of each class, display in asc by the Y-axis.
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_5 ( points INTEGER, chassis VARCHAR, year VARCHAR )
What is the lowest amount of points held by the Epperly Indy roadster in 1959?
SELECT MIN(points) FROM table_name_5 WHERE chassis = "epperly indy roadster" AND year = 1959
sql_create_context
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
Draw a bar chart for what is the average base price of rooms, for each bed type?
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
nvbench
CREATE TABLE table_23337 ( "Contestant" text, "Background" text, "Original team" text, "Age" real, "Hometown" text, "Result" text )
For how many contestants was the background internet dreamer?
SELECT COUNT("Contestant") FROM table_23337 WHERE "Background" = 'Internet dreamer'
wikisql
CREATE TABLE table_14128 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What to par has t3 as the place and england as the country?
SELECT "To par" FROM table_14128 WHERE "Place" = 't3' AND "Country" = 'england'
wikisql
CREATE TABLE table_35693 ( "Category" text, "Type" text, "Attribute" text, "Bubbles" text, "Cancelable" text )
For the attribute of onpointerout, what is the cancelable?
SELECT "Cancelable" FROM table_35693 WHERE "Attribute" = 'onpointerout'
wikisql
CREATE TABLE table_26389588_1 ( primary_cartridge VARCHAR, year_of_introduction VARCHAR, country_of_origin VARCHAR )
If the Country of Origin is Denmark and the year of introduction is 1962, what is the primary cartridge?
SELECT primary_cartridge FROM table_26389588_1 WHERE year_of_introduction = "1962" AND country_of_origin = "Denmark"
sql_create_context
CREATE TABLE table_name_34 ( season VARCHAR, lost VARCHAR, points VARCHAR )
Which season did the Minnesota Kicks lose 13 games and scored 156 points?
SELECT COUNT(season) FROM table_name_34 WHERE lost = 13 AND points = 156
sql_create_context
CREATE TABLE table_203_793 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
in what year did he have the most international goals ?
SELECT "date" FROM table_203_793 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
tell me the number of black/cape verdean ethnic background patients for whom direct bilirubin lab test was ordered.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.label = "Bilirubin, Direct"
mimicsql_data
CREATE TABLE table_77220 ( "Rank" text, "Name" text, "Location" text, "Length ( m )" text, "Length ( ft )" text )
What is the length in feet of the Jiangzhou arch?
SELECT "Length ( ft )" FROM table_77220 WHERE "Name" = 'jiangzhou arch'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
how many time did patient 030-42006 produce a balance this exchange (ml) output on this month/26?
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
eicu
CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age...
How many hosts does each nationality have? List the nationality and the count. Plot them as pie chart.
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality
nvbench
CREATE TABLE table_name_54 ( chinese__traditional_ VARCHAR, label VARCHAR, english_title VARCHAR )
What traditional Chinese name would the Rock Records release Grown up Overnight be given?
SELECT chinese__traditional_ FROM table_name_54 WHERE label = "rock records" AND english_title = "grown up overnight"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
how much was patient 18677's body weight first measured until 06/2102?
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 = 18677)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
mimic_iii
CREATE TABLE table_name_65 ( heat INTEGER, race_title VARCHAR )
What is the lowest heat of the Lakeside race?
SELECT MIN(heat) FROM table_name_65 WHERE race_title = "lakeside"
sql_create_context
CREATE TABLE table_38243 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text )
Name the outcome for jordan kerr july 19, 2004
SELECT "Outcome" FROM table_38243 WHERE "Partnering" = 'jordan kerr' AND "Date" = 'july 19, 2004'
wikisql
CREATE TABLE table_7350 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
Which tournament had an outcome of winner, a hard surface, and happened on August 26, 2006?
SELECT "Tournament" FROM table_7350 WHERE "Outcome" = 'winner' AND "Surface" = 'hard' AND "Date" = 'august 26, 2006'
wikisql