context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_40136 ( "Office" text, "Republican ticket" text, "Democratic ticket" text, "Socialist Labor ticket" text, "Prohibition ticket" text, "Independent Citizens' ticket" text )
What kind of Republican ticket has a Prohibition ticket of stephen mead wing?
SELECT "Republican ticket" FROM table_40136 WHERE "Prohibition ticket" = 'stephen mead wing'
wikisql
CREATE TABLE table_203_654 ( id number, "position" number, "team" text, "points" number, "played" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "difference" number )
how many teams had more points than silex ?
SELECT COUNT("team") FROM table_203_654 WHERE "points" > (SELECT "points" FROM table_203_654 WHERE "team" = 'silex')
squall
CREATE TABLE table_18602462_21 ( quarterfinals VARCHAR, athlete VARCHAR )
When bas van erp was the athlete what was the quarterfinals?
SELECT quarterfinals FROM table_18602462_21 WHERE athlete = "Bas van Erp"
sql_create_context
CREATE TABLE table_34071 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text )
What is the leading scorer of the game with an attendance of 14,096?
SELECT "Leading scorer" FROM table_34071 WHERE "Attendance" = '14,096'
wikisql
CREATE TABLE table_59061 ( "Place" text, "Competitor" text, "Downhill points" real, "Slalom points" text, "Total" text )
What are the total points for the skier with 3.18 slalom points?
SELECT "Total" FROM table_59061 WHERE "Slalom points" = '3.18'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_leg ( flight_id int, ...
show me US flights from SAN FRANCISCO to PITTSBURGH on tuesday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 A...
atis
CREATE TABLE table_51439 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Can you tell me the Away team that has the Away team score of 6.11 (47)?
SELECT "Away team" FROM table_51439 WHERE "Away team score" = '6.11 (47)'
wikisql
CREATE TABLE table_name_26 ( attendance INTEGER, venue VARCHAR, round VARCHAR )
What is the average attendance at a game held at Firhill for the 5(r) round?
SELECT AVG(attendance) FROM table_name_26 WHERE venue = "firhill" AND round = "5(r)"
sql_create_context
CREATE TABLE table_10786 ( "Player" text, "Att." real, "Yards" real, "Avg." real, "Long" real, "FumL" real )
Tell me the most Att with a long of 27 with yards longer than 27
SELECT MAX("Att.") FROM table_10786 WHERE "Long" = '27' AND "Yards" > '27'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, ...
what is the cost of drug name aspirin chew tab 81 mg?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'aspirin chew tab 81 mg')
eicu
CREATE TABLE table_name_85 ( team__league_ VARCHAR, player VARCHAR, reg_gp VARCHAR, pick__number VARCHAR )
Which team has a Reg GP of 0, a pick number under 136 with a player named Regan Darby?
SELECT team__league_ FROM table_name_85 WHERE reg_gp = 0 AND pick__number < 136 AND player = "regan darby"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TA...
Votes on deleted posts by year.
SELECT COUNT(*) FROM Votes WHERE PostId IS NULL
sede
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...
what are the five most commonly prescribed medications in the same month to the female patients aged 20s after having been diagnosed with chf nos until 2104?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
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,...
6106826这个医院的患者卫若兰,列出某次谢姓医生为其开出的出院诊断结果
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '卫若兰' AND MED_SER_ORG_NO = '6106826' AND OUT_DIAG_DOC_NM LIKE '谢%'
css
CREATE TABLE table_name_39 ( points INTEGER, chassis VARCHAR, year VARCHAR )
What is the most points that the Maserati 250F chassis scored in years after 1955?
SELECT MAX(points) FROM table_name_39 WHERE chassis = "maserati 250f" AND year > 1955
sql_create_context
CREATE TABLE table_21690339_1 ( country VARCHAR, _percentage_cut VARCHAR )
What country had a 100% cut?
SELECT country FROM table_21690339_1 WHERE _percentage_cut = "100%"
sql_create_context
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_DIRE_CD text, MED_DIRE_NM text,...
患者尤和悌付出最多自费金额的项目是哪个?在19212040551这个医疗就诊中
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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 = '19212040551' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES...
css
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
please give me round trip fares from PITTSBURGH to PHILADELPHIA
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
CREATE TABLE table_name_98 ( father VARCHAR, husband VARCHAR )
Which father had william iv as a husband?
SELECT father FROM table_name_98 WHERE husband = "william iv"
sql_create_context
CREATE TABLE table_204_476 ( id number, "name" text, "date built" number, "builder" text, "works no." number, "wheels" text, "cylinders" text, "notes" text, "withdrawn" number )
was no. 1 or veteran built in 1847 ?
SELECT "name" FROM table_204_476 WHERE "name" IN ('no.1', 'veteran') AND "date built" = 1847
squall
CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE member ( Member_ID int, Member_Name tex...
Give me a histogram for how many members are in each party?, and rank from low to high by the bar.
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name
nvbench
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_...
For those days with the 3 largest maximum gust speeds, can you plot a bar chart to compare the total mean humidity of each day of the weeks?
SELECT date, SUM(mean_humidity) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
CREATE TABLE table_name_19 ( chassis VARCHAR, entrant VARCHAR )
What is the company that made the chassis for the entrant danka arrows yamaha?
SELECT chassis FROM table_name_19 WHERE entrant = "danka arrows yamaha"
sql_create_context
CREATE TABLE table_31088 ( "Year" real, "Number of tropical storms" real, "Number of hurricanes" real, "Number of major hurricanes" real, "Deaths" text, "Strongest storm" text )
How many deaths did the year with 10 hurricanes and exactly 1 major hurricane have?
SELECT "Deaths" FROM table_31088 WHERE "Number of hurricanes" = '10' AND "Number of major hurricanes" = '1'
wikisql
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...
What are the last year of the parties whose theme is 'Spring' or 'Teqnology'? Count the last year for a bar chart, I want to rank y axis in desc order.
SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY Last_year ORDER BY COUNT(Last_year) DESC
nvbench
CREATE TABLE table_name_92 ( category VARCHAR, year VARCHAR, award VARCHAR )
Tell me the category for 2012 and drama league award
SELECT category FROM table_name_92 WHERE year = 2012 AND award = "drama league award"
sql_create_context
CREATE TABLE table_23670057_4 ( year_born INTEGER, player VARCHAR )
What is the date of birth for basket baller called ido kozikaro
SELECT MAX(year_born) FROM table_23670057_4 WHERE player = "Ido Kozikaro"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
Deletable questions with a tag.
SELECT p.Id FROM Posts AS p WHERE (p.PostTypeId = 1 AND NOT p.ClosedDate IS NULL AND p.Score <= '##maxscore##' AND p.ViewCount <= '##maxviews##' AND p.Tags LIKE '%##tag##%' AND DATEDIFF(day, p.ClosedDate, GETDATE()) >= '##mindays##' AND '##maxscore##' >= ALL (SELECT a.Score FROM Posts AS a WHERE (a.ParentId = p.Id)) AN...
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose diagnoses short title is subarachnoid hemorrhage and lab test fluid is pleural?
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.short_title = "Subarachnoid hemorrhage" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the number of patients whose gender is m and year of birth is less than 2024?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year < "2024"
mimicsql_data
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Percentage of Posts w/ Scores of >1, 0 and <1, by Post Type.
SELECT pt.Name AS "Type", COUNT(p.Id) AS "Total", CAST(ROUND(COUNT(CASE WHEN p.Score > 0 THEN 1 ELSE NULL END) / CAST(COUNT(p.Id) AS FLOAT) * 100, 4) AS TEXT(7)) + '%' AS "+", CAST(ROUND(COUNT(CASE WHEN p.Score = 0 THEN 1 ELSE NULL END) / CAST(COUNT(p.Id) AS FLOAT) * 100, 4) AS TEXT(7)) + '%' AS "0", CAST(ROUND(COUNT(C...
sede
CREATE TABLE table_36751 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
How much Played has a Lost larger than 14, and Drawn of 8, and a Team of ipatinga?
SELECT SUM("Played") FROM table_36751 WHERE "Lost" > '14' AND "Drawn" = '8' AND "Team" = 'ipatinga'
wikisql
CREATE TABLE constructorStandings ( constructorid VARCHAR )
What are the numbers of races for each constructor id?
SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid
sql_create_context
CREATE TABLE table_64466 ( "Season" real, "Level" text, "Division" text, "Administration" text, "Position" text )
What Level has a Season larger than 2010?
SELECT "Level" FROM table_64466 WHERE "Season" > '2010'
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...
在06年1月1日到11年8月25日内病号56134698的所有检验结果指标记录中的仪器编号以及名称分别叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_name_19 ( district VARCHAR, incumbent VARCHAR )
What district is Wyatt Aiken in?
SELECT district FROM table_name_19 WHERE incumbent = "wyatt aiken"
sql_create_context
CREATE TABLE table_59313 ( "Portland DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the average entry in the against column with draws smaller than 0?
SELECT AVG("Against") FROM table_59313 WHERE "Draws" < '0'
wikisql
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...
what is the daily average amount of actual patient fluid removal that patient 028-30487 had in 05/this year?
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-30487')) AND intakeoutput.celllabel = 'actua...
eicu
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
在医院9220092出院诊断患者71205137的疾病名称不包含2的医疗就诊记录编号都有哪些?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '71205137' AND MED_SER_ORG_NO = '9220092' AND NOT OUT_DIAG_DIS_NM LIKE '%2%'
css
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 last ward id of patient 009-424 on the first hospital visit?
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-424' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_train_186 ( "id" int, "language" string, "diabetic" string, "regular_alcohol_intake" int, "allergy_to_drug" bool, "alcohol_abuse" bool, "age" float, "NOUSE" float )
history of hypersensitivity to the trial drug or to drugs with similar chemical structures.
SELECT * FROM table_train_186 WHERE allergy_to_drug = 1
criteria2sql
CREATE TABLE table_204_634 ( id number, "tour" number, "official title" text, "venue" text, "city" text, "date\nstart" text, "date\nfinish" text, "prize money\nusd" number, "report" text )
which has the same prize money as the french super series ?
SELECT "official title" FROM table_204_634 WHERE "official title" <> 'french super series' AND "prize money\nusd" = (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'french super series')
squall
CREATE TABLE table_24471 ( "Team" text, "Sport" text, "League" text, "Established" real, "Began in St. Louis" real, "Venue" text, "Championships in St. Louis" text, "Left St. Louis" real )
How many championships were won for arena football?
SELECT "Championships in St. Louis" FROM table_24471 WHERE "Sport" = 'Arena Football'
wikisql
CREATE TABLE table_203_694 ( id number, "#" number, "name" text, "took office" text, "left office" text, "party" text )
who was the only prime minister to be in office three times ?
SELECT "name" FROM table_203_694 GROUP BY "name" HAVING COUNT(*) >= 3
squall
CREATE TABLE table_2417 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Midshipmen points" real, "Opponents" real, "Record" text )
Name the most opponents for 8-1 record
SELECT MAX("Opponents") FROM table_2417 WHERE "Record" = '8-1'
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, visualize a bar chart about the distribution of founder and the sum of revenue , and group by attribute founder, and display by the y-axis in ascending.
SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Revenue)
nvbench
CREATE TABLE table_name_70 ( date VARCHAR, score_in_final VARCHAR )
On what Date was the Score in Final 6 3, 6 3?
SELECT date FROM table_name_70 WHERE score_in_final = "6–3, 6–3"
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 jyjgzbb ( BGDH text, BGRQ tim...
范梦竹这个病患在编号为4362119的医院的门诊诊断结果的名称中包含牙髓炎的门诊就诊记录有哪些
SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '范梦竹' AND hz_info.YLJGDM = '4362119' AND zzmzjzjlb.JZZDSM LIKE '%牙髓炎%' UNION SELECT * FROM person_info JOIN ...
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
tell me whether patient 004-66442 got 30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg/5ml po susp until 03/2102?
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 = '004-66442')) AND medication.drugname = '30 ml cup : alum & mag hydroxide-s...
eicu
CREATE TABLE table_name_75 ( points INTEGER, year VARCHAR, rank VARCHAR )
Which Points is the lowest one that has a Year larger than 1974, and a Rank of 15th?
SELECT MIN(points) FROM table_name_75 WHERE year > 1974 AND rank = "15th"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose diagnoses title is abrasion or friction burn of trunk, without mention of infection were admitted before the year 2125?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2125" AND diagnoses.long_title = "Abrasion or friction burn of trunk, without mention of infection"
mimicsql_data
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 many days have gone since patient 60136 was admitted to the hospital for?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_39888 ( "Match No." text, "Home Team" text, "Score" text, "Away Team" text, "Attendance" text )
What is the home team of the game that ended with a score of 0-1?
SELECT "Home Team" FROM table_39888 WHERE "Score" = '0-1'
wikisql
CREATE TABLE table_77550 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the score when the NY Islanders was the visiting team?
SELECT "Score" FROM table_77550 WHERE "Visitor" = 'ny islanders'
wikisql
CREATE TABLE products_for_hire ( product_description VARCHAR, product_id VARCHAR ) CREATE TABLE products_booked ( product_id VARCHAR, booked_amount VARCHAR )
What is the product description of the product booked with an amount of 102.76?
SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
Any available ULCS next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = course...
advising
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...
how many hours have passed since the first time patient 006-195316 visited ward 386 during the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-195316' AND patient.wardid = 386 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Select Top 100 *From Posts.
SELECT * FROM Users LIMIT 100
sede
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...
Give me a histogram for how many rooms cost more than 120, for each different decor?, could you sort y-axis from low to high order?
SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY COUNT(*)
nvbench
CREATE TABLE table_203_288 ( id number, "season" text, "premiere date" text, "the winner" text, "runner-up" text, "finalists" text, "contestants in order of elimination" text, "number of contestants" text, "number of concerts" number )
what is the least number of concerts given in a season
SELECT MIN("number of concerts") FROM table_203_288
squall
CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id nu...
Count the number of different affected regions.
SELECT COUNT(DISTINCT region_id) FROM affected_region
spider
CREATE TABLE table_45174 ( "Circuit" text, "Location / State" text, "Date" text, "Round winner" text, "Team" text )
On what team did John Bowe round winner at Winton Motor Raceway belong to?
SELECT "Team" FROM table_45174 WHERE "Round winner" = 'john bowe' AND "Circuit" = 'winton motor raceway'
wikisql
CREATE TABLE table_204_592 ( id number, "#" number, "title" text, "type" text, "opening\ndate" text, "closing\ndate" text, "performances" number, "comment" text )
which production has the same number of performances as sleuth ?
SELECT "title" FROM table_204_592 WHERE "title" <> 'sleuth' AND "performances" = (SELECT "performances" FROM table_204_592 WHERE "title" = 'sleuth')
squall
CREATE TABLE table_44576 ( "Skip" text, "Third" text, "Second" text, "Lead" text, "City" text )
WHAT IS THE CITY WITH THIRD AS LORI OLSON-JOHNS?
SELECT "City" FROM table_44576 WHERE "Third" = 'lori olson-johns'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
以前这位患者82162201有什么疾病?
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '82162201'
css
CREATE TABLE table_name_75 ( away VARCHAR, club VARCHAR )
What is NK Rijeka's away score?
SELECT away FROM table_name_75 WHERE club = "nk rijeka"
sql_create_context
CREATE TABLE table_name_10 ( hard VARCHAR, record VARCHAR, carpet VARCHAR, clay VARCHAR, grass VARCHAR )
Which hard has a Clay of 0 0, Grass of 0 0, Carpet of 0 0, and a Record of 1 0?
SELECT hard FROM table_name_10 WHERE clay = "0–0" AND grass = "0–0" AND carpet = "0–0" AND record = "1–0"
sql_create_context
CREATE TABLE artist ( name VARCHAR, year_join VARCHAR, country VARCHAR )
Show all artist names and the year joined who are not from United States.
SELECT name, year_join FROM artist WHERE country <> 'United States'
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
find out the number of divorced patients for whom cortisol lab test had been ordered.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Cortisol"
mimicsql_data
CREATE TABLE table_39336 ( "Rank" real, "Country/Territory" text, "Miss World" real, "1st Runner-up" real, "2nd Runner-up" real, "3rd Runner-up" real, "4th Runner-up" real, "5th Runner-up" real, "6th Runner-up" real, "Semifinalists" real, "Total" real )
Rank larger than 3, and a 6th Runner-up larger than 0, and a 5th Runner-up smaller than 1 has which lowest 1st Runner-up?
SELECT MIN("1st Runner-up") FROM table_39336 WHERE "Rank" > '3' AND "6th Runner-up" > '0' AND "5th Runner-up" < '1'
wikisql
CREATE TABLE table_50351 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real )
How much money for 1st place with a to par less than 1?
SELECT COUNT("Money ( $ )") FROM table_50351 WHERE "Place" = '1' AND "To par" < '1'
wikisql
CREATE TABLE table_name_93 ( tournament VARCHAR, date VARCHAR )
What tournament was on May 31, 1987?
SELECT tournament FROM table_name_93 WHERE date = "may 31, 1987"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
Find the number of patients whose is age less than 80 years and diagnoses long title is late effects of cerebrovascular disease hemiplegia affecting unspecified side.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "80" AND diagnoses.long_title = "Late effects of cerebrovascular disease, hemiplegia affecting unspecified side"
mimicsql_data
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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,...
i want to fly from CLEVELAND to SAN DIEGO tomorrow and stop in INDIANAPOLIS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, flight, flight_stop WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'INDIA...
atis
CREATE TABLE table_name_71 ( height VARCHAR, player VARCHAR )
What is the height of the player, Larry Hughes?
SELECT height FROM table_name_71 WHERE player = "larry hughes"
sql_create_context
CREATE TABLE table_25740548_2 ( written_by VARCHAR, production_code VARCHAR )
How many episodes with the production code CA106 are there?
SELECT COUNT(written_by) FROM table_25740548_2 WHERE production_code = "CA106"
sql_create_context
CREATE TABLE table_9034 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the outcome of the match on 01/07/2007?
SELECT "Outcome" FROM table_9034 WHERE "Date" = '01/07/2007'
wikisql
CREATE TABLE table_74458 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
In how many different games did Oliver Miller (7) did the high rebounds?
SELECT COUNT("Game") FROM table_74458 WHERE "High rebounds" = 'Oliver Miller (7)'
wikisql
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...
whats patient 14467 last ward id since 4 years ago?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( ...
BALTIMORE to PHILADELPHIA wednesday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4 ...
atis
CREATE TABLE table_67604 ( "Name" text, "League" real, "Play-offs" real, "FA Cup" real, "League Cup" real, "Total" real )
What's the FA Cup that has a league less than 1?
SELECT SUM("FA Cup") FROM table_67604 WHERE "League" < '1'
wikisql
CREATE TABLE table_name_83 ( school VARCHAR, county VARCHAR )
County of 46 laporte is what school?
SELECT school FROM table_name_83 WHERE county = "46 laporte"
sql_create_context
CREATE TABLE table_26545 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What episode number in the series is 'dance to the music'?
SELECT MIN("No. in series") FROM table_26545 WHERE "Title" = 'Dance to the Music'
wikisql
CREATE TABLE table_name_7 ( attendance INTEGER, opponents VARCHAR )
What is the attendance when Cork City is the opponent?
SELECT AVG(attendance) FROM table_name_7 WHERE opponents = "cork city"
sql_create_context
CREATE TABLE table_name_60 ( opponents VARCHAR, partnering VARCHAR, date VARCHAR )
Which Opponents have a Partnering of alessandro motti, and a Date of 12 september 2005?
SELECT opponents FROM table_name_60 WHERE partnering = "alessandro motti" AND date = "12 september 2005"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, ...
How to create an Image file from dataURL and save it?.
SELECT Ans.CreationDate, Qus.Tags, Qus.Title, Qus.ViewCount, Ans.Score, Ans.Id, Qus.AcceptedAnswerId FROM Posts AS Qus LEFT JOIN Posts AS Ans ON Qus.Id = Ans.ParentId WHERE Ans.OwnerUserId = 5720148 ORDER BY Ans.CreationDate DESC
sede
CREATE TABLE table_203_737 ( id number, "#" number, "employer" text, "# of employees" number )
how many employers have at least 300 employees ?
SELECT COUNT("employer") FROM table_203_737 WHERE "# of employees" >= 300
squall
CREATE TABLE table_75368 ( "Country" text, "Project Name" text, "Year startup" text, "Operator" text, "Peak" text )
What is the Project Name with a Country that is kazakhstan and a Peak that is 150?
SELECT "Project Name" FROM table_75368 WHERE "Country" = 'kazakhstan' AND "Peak" = '150'
wikisql
CREATE TABLE table_name_5 ( week VARCHAR, result VARCHAR, attendance VARCHAR )
Which Week had a Result of w 10-0, and an Attendance smaller than 58,571?
SELECT COUNT(week) FROM table_name_5 WHERE result = "w 10-0" AND attendance < 58 OFFSET 571
sql_create_context
CREATE TABLE news_report ( journalist_id number, event_id number, work_type text ) CREATE TABLE journalist ( journalist_id number, name text, nationality text, age text, years_working number ) CREATE TABLE event ( event_id number, date text, venue text, name text, e...
What is the nationality of the journalist with the largest number of years working?
SELECT nationality FROM journalist ORDER BY years_working DESC LIMIT 1
spider
CREATE TABLE table_1879 ( "Sl no" real, "Name of the prabandham" text, "Starting from" real, "Ending with" real, "Number of pasurams" real, "Sung by" text )
Name the most ending with
SELECT MAX("Ending with") FROM table_1879
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
参考值在检验结果指标记录14290376283上有什么范围、范围下限和上限是什么?
SELECT CKZFWDX, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE JYZBLSH = '14290376283'
css
CREATE TABLE table_13861 ( "Competition" text, "Total" real, "Al Ahly wins" real, "Draws" real, "El Zamalek wins" real )
What is the fewest Al Ahly wins for El Zamalek wins of 0 and 0 draws?
SELECT MIN("Al Ahly wins") FROM table_13861 WHERE "Draws" = '0' AND "El Zamalek wins" < '0'
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 code over the name , and group by attribute headquarter by a bar chart, and sort x-axis in descending order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_name_21 ( title VARCHAR, appointed_by VARCHAR )
Which Title has an Appointed by of Millard Fillmore?
SELECT title FROM table_name_21 WHERE appointed_by = "millard fillmore"
sql_create_context
CREATE TABLE table_36662 ( "Season" real, "Driver" text, "Team" text, "Tyre" text, "Points" real )
Who is the driver for team Coll Racing with more than 206 points?
SELECT "Driver" FROM table_36662 WHERE "Team" = 'collé racing' AND "Points" > '206'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of employee_id bin hire_date by time in a bar chart, and sort by the y-axis in descending.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE d...
what were the first ast (sgot) from patient 010-20205 in 08/last year?
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-20205')) AND lab.labname = 'ast (sgot)' AND DATETIME(lab.labresulttime, 'start of y...
eicu
CREATE TABLE table_54538 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the result of the UEFA Euro 2008 Qualifying competition?
SELECT "Result" FROM table_54538 WHERE "Competition" = 'uefa euro 2008 qualifying'
wikisql
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE accounts ( account_id number, statement_id number,...
Count the number of budget codes.
SELECT COUNT(*) FROM ref_budget_codes
spider