context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_39297 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text )
Which Date has a Partner of daniella dominikovic?
SELECT "Date" FROM table_39297 WHERE "Partner" = 'daniella dominikovic'
wikisql
CREATE TABLE table_204_232 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
was chile below or above the gold medal count for panama ?
SELECT (SELECT "gold" FROM table_204_232 WHERE "nation" = 'chile') > (SELECT "gold" FROM table_204_232 WHERE "nation" = 'panama')
squall
CREATE TABLE table_53715 ( "Year" real, "Award" text, "Category" text, "Work" text, "Result" text )
What was the result of t.u.f.f. puppy?
SELECT "Result" FROM table_53715 WHERE "Work" = 't.u.f.f. puppy'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number ...
what is the earliest flight from OAKLAND to WASHINGTON on sunday
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 = 'WASHINGTON' AND date_day.day_number = 27 AND date_day.month_number = 8 A...
atis
CREATE TABLE table_name_42 ( frequency VARCHAR, city_of_license VARCHAR )
what is the frequency when the city of license is belleville?
SELECT frequency FROM table_name_42 WHERE city_of_license = "belleville"
sql_create_context
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 ...
患者曹静婉过去的住院诊断怎么样?
SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '曹静婉' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM person_info JOIN...
css
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
What are the names and ages of artists? Show the result in a bar graph, and show x axis in asc order.
SELECT Name, Age FROM artist ORDER BY Name
nvbench
CREATE TABLE table_27403 ( "Language" text, "Sorata Municipality" text, "Guanay Municipality" text, "Tacacoma Municipality" text, "Quiabaya Municipality" text, "Combaya Municipality" text, "Tipuani Municipality" text, "Mapiri Municipality" text, "Teoponte Municipality" text )
What is the number for combaya municipality when quiabaya municipality is 33?
SELECT "Combaya Municipality" FROM table_27403 WHERE "Quiabaya Municipality" = '33'
wikisql
CREATE TABLE table_28328 ( "Episode #" real, "Series #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text, "Viewers (in millions)" text )
Who wrote episode 26 in the series?
SELECT "Writer" FROM table_28328 WHERE "Episode #" = '26'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a scatter chart about the correlation between commission_pct and manager_id .
SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_train_189 ( "id" int, "alt" float, "hyperglycemia" bool, "liver_disease" bool, "smoking" bool, "alcohol_abuse" bool, "drug_abuse" bool, "triglyceride_tg" float, "NOUSE" float )
chronic or persistent alcohol or drug abuse
SELECT * FROM table_train_189 WHERE alcohol_abuse = 1 OR drug_abuse = 1
criteria2sql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int...
show me flights from MILWAUKEE to ORLANDO on thursday 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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND date_day.day_number = 24 AND date_day.month_number = 5 AND ...
atis
CREATE TABLE table_76444 ( "Date" text, "Event" text, "City" text, "Oil Pattern" text, "Winner (Title #)" text, "Runner-up" text, "Score" text )
Name the Date when has robert smith (7)?
SELECT "Date" FROM table_76444 WHERE "Winner (Title #)" = 'robert smith (7)'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, show me about the correlation between code and price , and group by attribute headquarter in a scatter chart.
SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
Show the smallest enrollment of each state using a bar chart, show in ascending by the y axis.
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr)
nvbench
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...
患者苏正诚在2021-04-10之前有哪些门诊就诊的检验报告单?列出门诊就诊流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '苏正诚' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2021-04-10')
css
CREATE TABLE table_80259 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What team did they lose to when they had a 28-22 record?
SELECT "Loss" FROM table_80259 WHERE "Record" = '28-22'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
since 2102, patient 021-250695 underwent any procedure?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-250695')) AND STRFTIME('%y', treatment.treatmenttime) >= '2102'
eicu
CREATE TABLE table_14342592_5 ( player VARCHAR, position VARCHAR )
What players played the position of left tackle?
SELECT player FROM table_14342592_5 WHERE position = "Left tackle"
sql_create_context
CREATE TABLE table_34999 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text )
Name the course for 24 july
SELECT "Course" FROM table_34999 WHERE "Date" = '24 july'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
Could you tell me about NERS 583 ?
SELECT DISTINCT description, name FROM course WHERE department = 'NERS' AND number = 583
advising
CREATE TABLE table_name_75 ( away_team VARCHAR, home_team VARCHAR )
What was the away team for the game in Slough Town?
SELECT away_team FROM table_name_75 WHERE home_team = "slough town"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 ( ...
what was the total number of patients on careunit csru last year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'csru' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
mimic_iii
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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_int...
please show me flights from DALLAS FORT WORTH to ATLANTA on monday
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 = 'ATLANTA' AND date_day.day_number = 21 AND date_day.month_number = 2 AND d...
atis
CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent ...
Draw a bar chart of owner versus total number of rating in percent, and order in descending by the y axis.
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent) DESC
nvbench
CREATE TABLE table_6930 ( "Name" text, "Overs Bowled" real, "Maidens" real, "Runs Conceded" real, "Wickets" real, "Extras" real, "E.R." real )
What is the average Extras for Muttiah Muralitharan, with less than 353 Runs Conceded?
SELECT AVG("Extras") FROM table_6930 WHERE "Name" = 'muttiah muralitharan' AND "Runs Conceded" < '353'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
the previous year, what is the three most frequent drugs prescribed during the same month to female patients of age 50s after having been diagnosed with thrombocytopenia nos?
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 zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
门诊就诊37345239024是多少号来就诊的?
SELECT JZKSRQ FROM mzjzjlb WHERE JZLSH = '37345239024'
css
CREATE TABLE table_name_67 ( prominence__ft_ VARCHAR, name_of_peak VARCHAR, prominence__m_ VARCHAR )
What is the total prominence in ft of the peak of kangchenjunga central, which has a prominence in m less than 32?
SELECT COUNT(prominence__ft_) FROM table_name_67 WHERE name_of_peak = "kangchenjunga central" AND prominence__m_ < 32
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
2008年5月16日-2018年8月8日期间,苏幼安这名患者的428058这个指标的所有记录
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE table_name_97 ( year INTEGER, event VARCHAR )
what year was the memphis event?
SELECT SUM(year) FROM table_name_97 WHERE event = "memphis"
sql_create_context
CREATE TABLE table_name_48 ( ship VARCHAR, pennant_number VARCHAR )
What is the name of the ship that had a Pennant number of h55?
SELECT ship FROM table_name_48 WHERE pennant_number = "h55"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9...
when was the first time patient 9338 had the maximum arterial bp [systolic] on 01/28/last year.
SELECT chartevents.charttime 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 = 9338)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe tex...
SO - Total Posts by Could Service Providers Per Month - Azure.
SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'Azure' AS TagName, COUNT(*) AS PostCount 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 LIKE '%azure%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY Y...
sede
CREATE TABLE table_1973842_1 ( joined VARCHAR, location VARCHAR )
On how many different dates did schools from Chestnut Hill, Massachusetts join the conference?
SELECT COUNT(joined) FROM table_1973842_1 WHERE location = "Chestnut Hill, Massachusetts"
sql_create_context
CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_De...
Show the location codes and the number of documents in each location in a bar chart, and I want to display by the names from high to low.
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC
nvbench
CREATE TABLE table_name_31 ( fastest_lap VARCHAR, winning_driver VARCHAR )
When the winning driver was jacques villeneuve what was the fastest lap driven?
SELECT fastest_lap FROM table_name_31 WHERE winning_driver = "jacques villeneuve"
sql_create_context
CREATE TABLE table_name_86 ( fourth_quarter VARCHAR, rank VARCHAR, second_quarter VARCHAR )
When the rank is larger than 3 with a second quarter of johnson & johnson 156,515.9, what is the fourth quarter?
SELECT fourth_quarter FROM table_name_86 WHERE rank > 3 AND second_quarter = "johnson & johnson 156,515.9"
sql_create_context
CREATE TABLE table_25497 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Where was game 41 held, and how many people attended?
SELECT "Location Attendance" FROM table_25497 WHERE "Game" = '41'
wikisql
CREATE TABLE table_62853 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text )
Which Moving from has a Nat of ned?
SELECT "Moving from" FROM table_62853 WHERE "Nat." = 'ned'
wikisql
CREATE TABLE table_28807 ( "English" text, "Galician ( Official )" text, "Galician ( Reintegrationist )" text, "Portuguese" text, "Spanish" text )
What is the Portuguese word for the English word 'welcome'?
SELECT "Portuguese" FROM table_28807 WHERE "English" = 'Welcome'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of patients whose insurance is medicare and diagnoses long title is acute respiratory failure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.long_title = "Acute respiratory failure"
mimicsql_data
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Number of posts with links to Wikipedia.
SELECT COUNT(p.Id) FROM Posts AS p WHERE p.Body LIKE '%http://en.wikipedia%'
sede
CREATE TABLE table_name_78 ( date_of_inauguration VARCHAR, length_of_retirement VARCHAR )
What is the date of the inauguration with a Length of retirement of 00,624 days?
SELECT date_of_inauguration FROM table_name_78 WHERE length_of_retirement = "00,624 days"
sql_create_context
CREATE TABLE table_19229713_6 ( us_viewers__million_ VARCHAR, production_code VARCHAR )
How many u.s. viewers (million) have the production code of 5.09?
SELECT us_viewers__million_ FROM table_19229713_6 WHERE production_code = "5.09"
sql_create_context
CREATE TABLE table_24482 ( "Day" text, "Stage" text, "Time (EET)" text, "Name" text, "Length" text, "Winner" text, "Time" text, "Avg. spd." text, "Rally leader" text )
Which stage has kourdali as the name?
SELECT "Stage" FROM table_24482 WHERE "Name" = 'Kourdali'
wikisql
CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE channel ( channel_id number, name text, owner text, share_in_percent numb...
how many programs are broadcast in each time section of the day?
SELECT COUNT(*), time_of_day FROM broadcast GROUP BY time_of_day
spider
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, ...
until 2104 is the three most frequent drugs prescribed during the same month to the patients aged 20s after being diagnosed with status autm crd dfbrltr.
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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
how many patients have had foley catheter within 2 months after the beta blocker - metoprolol until 2100?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'beta blocker - metoprolol' AND STRFTIME('%y', treatment.treatmenttime) <= '2100') AS t1 JOIN (SELECT patient...
eicu
CREATE TABLE table_53351 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
What is the purse total for the royal caribbean golf classic?
SELECT SUM("Purse( $ )") FROM table_53351 WHERE "Tournament" = 'royal caribbean golf classic'
wikisql
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHA...
Show all card type codes and the number of cards in each type by a bar chart, and I want to rank names in ascending order.
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code
nvbench
CREATE TABLE table_name_65 ( gold VARCHAR, bronze VARCHAR, silver VARCHAR )
How many golds have bronze values of 4 and silver values over 2?
SELECT COUNT(gold) FROM table_name_65 WHERE bronze = 4 AND silver > 2
sql_create_context
CREATE TABLE table_10399701_2 ( class_aAA VARCHAR, class_a VARCHAR )
Who was Class AAA during the same year that Class A was (tie) Apple Springs/Texline?
SELECT class_aAA FROM table_10399701_2 WHERE class_a = "(tie) Apple Springs/Texline"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
what were the top four most frequent diagnoses of patients who were diagnosed with arterial thromboembolism - left upper extremity until 2103 that followed during the same hospital visit?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'arter...
eicu
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( r...
what's the cost of a drug named multivitamin-12?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'multivitamin-12')
mimic_iii
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 ...
从零零年一月二十四号到零四年四月十四号,患者85533304这个甲状腺摄取实验情况怎么样
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_203_535 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many medals did france and cuba win ?
SELECT SUM("total") FROM table_203_535 WHERE "nation" IN ('france', 'cuba')
squall
CREATE TABLE table_47558 ( "Name" text, "Company" text, "Platform" text, "Latest stable release" text, "Price in USD" text )
What is the platform for the latest release 8.4?
SELECT "Platform" FROM table_47558 WHERE "Latest stable release" = '8.4'
wikisql
CREATE TABLE STUDENT ( Age INTEGER )
Find the maximum age of all the students.
SELECT MAX(Age) FROM STUDENT
sql_create_context
CREATE TABLE table_name_54 ( round INTEGER, player VARCHAR )
What round was Ken Irvin drafted?
SELECT MAX(round) FROM table_name_54 WHERE player = "ken irvin"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
what is the name of the drug that patient 808 was prescribed within 2 days, after being diagnosed this month with unsp hemiplga unspf side?
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 808 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'unsp hem...
mimic_iii
CREATE TABLE table_39346 ( "County" text, "1948" real, "1956" real, "1966" real, "1977" real, "1992" real, "2002" real, "2011" real )
Which 2011 is the lowest one that has a 1948 smaller than 15872624, and a 1966 of 263103, and a 1992 larger than 266308?
SELECT MIN("2011") FROM table_39346 WHERE "1948" < '15872624' AND "1966" = '263103' AND "1992" > '266308'
wikisql
CREATE TABLE table_12382 ( "School" text, "Location (Population)" text, "Nickname(s)" text, "Colors" text, "Years Member" text, "Enrollment (2013/14)" text )
What is the school with the nickname Tornadoes Lady Tornadoes?
SELECT "School" FROM table_12382 WHERE "Nickname(s)" = 'tornadoes lady tornadoes'
wikisql
CREATE TABLE table_name_87 ( regular_season VARCHAR, playoffs VARCHAR )
Which regular season had the playoffs of 0 mls cups?
SELECT regular_season FROM table_name_87 WHERE playoffs = "0 mls cups"
sql_create_context
CREATE TABLE table_55794 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What home team score has a Away team of melbourne?
SELECT "Home team score" FROM table_55794 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_name_61 ( team VARCHAR, high_rebounds VARCHAR )
What is Team, when High Rebounds is David Lee (15)?
SELECT team FROM table_name_61 WHERE high_rebounds = "david lee (15)"
sql_create_context
CREATE TABLE table_43461 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the result when the week is greater than 6 and the Buffalo Bills are the opponent?
SELECT "Result" FROM table_43461 WHERE "Week" > '6' AND "Opponent" = 'buffalo bills'
wikisql
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE va...
How many courses for each course description? Show me a stacked bar chart The x-axis is course description and group by office name, and order by the y-axis in descending.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE, CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION) DESC
nvbench
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number,...
how many times was the metoclopramide prescribed in this month for patient 42829?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42829) AND prescriptions.drug = 'metoclopramide' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
CREATE TABLE table_79799 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Name the total number of wins with top-25 of 10 and events less than 26
SELECT COUNT("Wins") FROM table_79799 WHERE "Top-25" = '10' AND "Events" < '26'
wikisql
CREATE TABLE table_74491 ( "Year" text, "Competition" text, "Opponent" text, "Score" text, "Venue" text )
In what competition was the score reported as 12.8 (80) - 8.7 (55)?
SELECT "Competition" FROM table_74491 WHERE "Score" = '12.8 (80) - 8.7 (55)'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
what is the five most commonly taken lab test until 3 years ago for patients with age 40s?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY lab.labname) AS t1 WHER...
eicu
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
对于被门诊诊断为疾病号码E70.881的人来说甲胎蛋白的参考值范畴下限和上限为多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'E70.881' AND jyjgzbb.JCZBMC = '甲胎蛋白' UNION SELECT jyjgzbb.CKZFWXX,...
css
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE dual_carrier ( main_airline varchar,...
could you please list all of the classes of flights there are
SELECT DISTINCT booking_class FROM class_of_service
atis
CREATE TABLE table_75033 ( "Games" real, "First" real, "Last" real, "Gold" real, "Bronze" real, "Total" real, "Best finish (first/last)" text )
What is the latest first year with 0 total medals and over 0 golds?
SELECT MAX("First") FROM table_75033 WHERE "Total" > '0' AND "Gold" > '0'
wikisql
CREATE TABLE table_name_41 ( laps INTEGER, time_retired VARCHAR, grid VARCHAR )
Name the least Laps for accident and gird more than 13
SELECT MIN(laps) FROM table_name_41 WHERE time_retired = "accident" AND grid > 13
sql_create_context
CREATE TABLE table_24819 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
What is the result for partial thromboplastin time when prothrombin time and bleeding time are prolonged?
SELECT "Partial thromboplastin time" FROM table_24819 WHERE "Prothrombin time" = 'Prolonged' AND "Bleeding time" = 'Prolonged'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
what is the earliest flight leaving from BOSTON going to ATLANTA
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
atis
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
tell me the number of patients who were diagnosed with acute respiratory failure and did not return to hospital during the same month since 4 years ago?
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 yea...
eicu
CREATE TABLE table_name_28 ( produced VARCHAR, aircraft VARCHAR )
Where was the Kai Kuh-1 Surion Produced?
SELECT produced FROM table_name_28 WHERE aircraft = "kai kuh-1 surion"
sql_create_context
CREATE TABLE table_275162_1 ( to_par VARCHAR, player VARCHAR )
What was zach johnson's score to par?
SELECT to_par FROM table_275162_1 WHERE player = "Zach Johnson"
sql_create_context
CREATE TABLE table_13513 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
what is the i/o bus when the sspec numebr is sr0n5(l1)?
SELECT "I/O bus" FROM table_13513 WHERE "sSpec number" = 'sr0n5(l1)'
wikisql
CREATE TABLE table_203_506 ( id number, "opponent" text, "played" number, "won" number, "lost" number, "drawn" number, "% won overall" text )
who did they have the largest win/loss differential against ?
SELECT "opponent" FROM table_203_506 ORDER BY ABS("won" - "lost") DESC LIMIT 1
squall
CREATE TABLE table_name_95 ( venue VARCHAR, away_team VARCHAR )
What was the venue that featured the Melbourne Tigers as the away team?
SELECT venue FROM table_name_95 WHERE away_team = "melbourne tigers"
sql_create_context
CREATE TABLE table_name_32 ( runner_s__up VARCHAR, winning_score VARCHAR )
During the championship where the winning score was 9 (66-69-73-71=279)?, who was the runner-up?
SELECT runner_s__up FROM table_name_32 WHERE winning_score = −9(66 - 69 - 73 - 71 = 279)
sql_create_context
CREATE TABLE table_name_61 ( transfer_fee VARCHAR, app_l_c_e_ VARCHAR, notes VARCHAR )
What was the transfer fee for the player who had an App(L/C/E) of 0 (0/0/0) and notes of to anagennisi karditsa?
SELECT transfer_fee FROM table_name_61 WHERE app_l_c_e_ = "0 (0/0/0)" AND notes = "to anagennisi karditsa"
sql_create_context
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,...
在哪几次医疗记录中病患许飞烟被开出的药物全部都比1281.74元大?当时就诊的编玛是多少号?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '许飞烟' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 1281.74)
css
CREATE TABLE table_name_63 ( crowd INTEGER, venue VARCHAR )
What was the attendance at Kardinia Park?
SELECT AVG(crowd) FROM table_name_63 WHERE venue = "kardinia park"
sql_create_context
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...
is it possible to search my own topics?. http://meta.stackexchange.com/questions/167328/is-it-possible-to-search-my-own-topics
WITH allQs AS (SELECT COALESCE(ParentId, Id) AS postid FROM Posts AS p WHERE OwnerUserId = '##userid:int?393087##') SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate, Score FROM Posts AS p INNER JOIN allQs AS q ON q.postid = p.ParentId WHERE p.Body LIKE '%' + '##search:string?database##' + '%' AND p.Ow...
sede
CREATE TABLE table_56292 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
Who was the opponent in the game with save ||33,723||93 64?
SELECT "Opponent" FROM table_56292 WHERE "Save" = '||33,723||93–64'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose ethnicity is black/cape verdean and drug name is 0.45% sodium chloride?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "0.45% Sodium Chloride"
mimicsql_data
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and employee_id .
SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStat...
query question, get top python answers.
SELECT p.Id, p2.Score, p2.ParentId, p2.Body FROM Posts AS p JOIN Posts AS p2 ON p2.ParentId = p.Id JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName LIKE '%python%'
sede
CREATE TABLE table_35047 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
What record has points greater than 39, with 38 as the game?
SELECT "Record" FROM table_35047 WHERE "Points" > '39' AND "Game" = '38'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number,...
among patients who were prescribed methadone pca after they had been diagnosed with cerebral edema show me the four year survival rate.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
what about a flight from BOSTON to SAN FRANCISCO stopping in DENVER
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, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE table_2279413_1 ( conversion_from_patent_application VARCHAR, country VARCHAR )
In Tonga, what is the conversion from patent application?
SELECT conversion_from_patent_application FROM table_2279413_1 WHERE country = "Tonga"
sql_create_context
CREATE TABLE table_name_73 ( opponents VARCHAR, record VARCHAR )
Who are the opponents with a record of 3-0?
SELECT opponents FROM table_name_73 WHERE record = "3-0"
sql_create_context
CREATE TABLE table_65700 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text )
Which 2008 club has the name Francesca Piccinini Category:Articles with hCards?
SELECT "2008 club" FROM table_65700 WHERE "Name" = 'francesca piccinini category:articles with hcards'
wikisql
CREATE TABLE table_14773 ( "Gersdorf" text, "Gershausen" text, "Heddersdorf" text, "Kemmerode" text, "Kirchheim" text, "Reckerode ****" text, "Reimboldsh." text, "Rotterterode" text, "Willingshain" text )
What Gershausen has a Willingshain of 243 and Reckerode of 224?
SELECT "Gershausen" FROM table_14773 WHERE "Willingshain" = '243' AND "Reckerode ****" = '224'
wikisql