context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE transactions ( transaction_id number, investor_id number, transaction_type_code text, date_of_transaction time, amount_of_transaction number, share_count text, other_details text ) CREATE TABLE lots ( lot_id number, investor_id number, lot_details text ) CREATE TAB...
Show the average amount of transactions for different investors.
SELECT investor_id, AVG(amount_of_transaction) FROM transactions GROUP BY investor_id
spider
CREATE TABLE table_name_99 ( Id VARCHAR )
What's the 1997 if 1993 has a 1R, 1995 has a 3R, and 1999 has a 1R?
SELECT 1997 FROM table_name_99 WHERE 1999 = "1r" AND 1995 = "3r" AND 1993 = "1r"
sql_create_context
CREATE TABLE table_name_90 ( decile VARCHAR, roll VARCHAR )
tell me the total number of decile with a roll showing 251.
SELECT COUNT(decile) FROM table_name_90 WHERE roll = 251
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
provide the number of patients whose admission location is clinic referral/premature and drug name is clindamycin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.drug = "Clindamycin"
mimicsql_data
CREATE TABLE table_15319684_1 ( lost VARCHAR, against VARCHAR )
Name the number of lost for against being 46
SELECT COUNT(lost) FROM table_15319684_1 WHERE against = 46
sql_create_context
CREATE TABLE table_29486189_4 ( representative VARCHAR, residence VARCHAR )
which representative is from willowick
SELECT representative FROM table_29486189_4 WHERE residence = "Willowick"
sql_create_context
CREATE TABLE table_name_8 ( _number___county VARCHAR, location VARCHAR )
What county is Fountain City?
SELECT _number___county FROM table_name_8 WHERE location = "fountain city"
sql_create_context
CREATE TABLE table_name_92 ( to_par VARCHAR, player VARCHAR )
What to par has tom kite as the player?
SELECT to_par FROM table_name_92 WHERE player = "tom kite"
sql_create_context
CREATE TABLE table_63534 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What average bronze has 0 as the silver, 17 as the rank, and a gold less than 1?
SELECT AVG("Bronze") FROM table_63534 WHERE "Silver" = '0' AND "Rank" = '17' AND "Gold" < '1'
wikisql
CREATE TABLE table_41135 ( "S No" real, "Team (A)" text, "Team (B)" text, "Winner" text, "Margin" text, "Match Date" text )
What is Margin, when Match Date is Oct 17, 2007?
SELECT "Margin" FROM table_41135 WHERE "Match Date" = 'oct 17, 2007'
wikisql
CREATE TABLE table_55247 ( "Year" text, "President" text, "Vice President" text, "Gen.-Secretary" text, "Treasurer" text )
Which Gen.-Secretary that has a Vice President named charlotte saes?
SELECT "Gen.-Secretary" FROM table_55247 WHERE "Vice President" = 'charlotte saes'
wikisql
CREATE TABLE table_name_28 ( team VARCHAR, manager VARCHAR )
Which team does David O'leary manage?
SELECT team FROM table_name_28 WHERE manager = "david o'leary"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
How many patients are with admission year below 2164 and with lab test name p02?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2164" AND lab.label = "pO2"
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...
How many patients from american indian/alaska native origin were admitted before the year 2164?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.admityear < "2146"
mimicsql_data
CREATE TABLE table_2897457_3 ( nhl_team VARCHAR, player VARCHAR )
Which nhl team has kris draper as the player?
SELECT nhl_team FROM table_2897457_3 WHERE player = "Kris Draper"
sql_create_context
CREATE TABLE table_32099 ( "Result" text, "Opponent" text, "Type" text, "Rd., Time" text, "Date" text )
What was the result of the match against Pat Lawlor?
SELECT "Result" FROM table_32099 WHERE "Opponent" = 'pat lawlor'
wikisql
CREATE TABLE table_14460085_3 ( played INTEGER, team VARCHAR )
What is the lowest number of games played for deportivo espa ol?
SELECT MIN(played) FROM table_14460085_3 WHERE team = "Deportivo Español"
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...
what was the last height of patient 7698 in the last month?
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 = 7698)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ...
mimic_iii
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
名叫花心宜的团伙成员最常开的药品排序是怎么样的呢?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '花心宜' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me a pie chart to reflect the proportion of Team_Name and ACC_Percent.
SELECT Team_Name, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_name_3 ( position VARCHAR, player VARCHAR )
What position for jj gagiano?
SELECT position FROM table_name_3 WHERE player = "jj gagiano"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
what is the name of procedure patient 58730 has been given two or more times until 30 months ago?
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 = 587...
mimic_iii
CREATE TABLE table_70327 ( "Year" real, "Award" text, "Category" text, "Nominated Work" text, "Result" text )
What result in the table is from the year 2012?
SELECT "Result" FROM table_70327 WHERE "Year" = '2012'
wikisql
CREATE TABLE table_74802 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
At the match where the away team scored 4.5 (29), what was the crowd size?
SELECT COUNT("Crowd") FROM table_74802 WHERE "Away team score" = '4.5 (29)'
wikisql
CREATE TABLE table_41632 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity in use" text )
Where is the airport located that has a 98.9% in use capacity?
SELECT "Location" FROM table_41632 WHERE "Capacity in use" = '98.9%'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, ...
Give me a histogram for how many students are older than 20 in each dorm?, display by the names from low to high.
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY dorm_name
nvbench
CREATE TABLE table_46799 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text, "Team(s)" text )
What is the sum of value for average finish with poles less than 0?
SELECT SUM("Avg. Finish") FROM table_46799 WHERE "Poles" < '0'
wikisql
CREATE TABLE Staff ( staff_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ) CREATE TABLE Customers ( customer_id INTEGER, customer_type_code VARCHAR(20), address_line_1 VARCHAR(80), address_line_...
what are all the different product names, and how many complains has each received?, rank in desc by the product_name.
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name DESC
nvbench
CREATE TABLE table_name_30 ( season VARCHAR, wins VARCHAR, final_placing VARCHAR )
What is the total number of seasons with more than 0 wins and a 1st final placing?
SELECT COUNT(season) FROM table_name_30 WHERE wins > 0 AND final_placing = "1st"
sql_create_context
CREATE TABLE table_name_58 ( attendance VARCHAR, week VARCHAR, opponent VARCHAR )
What was the attendance for a week larger than 3, and an opponent of philadelphia eagles?
SELECT attendance FROM table_name_58 WHERE week > 3 AND opponent = "philadelphia eagles"
sql_create_context
CREATE TABLE table_52862 ( "Rank" text, "Name" text, "Height ft (m)" text, "Floors" real, "Year" real )
What Year has a Rank of 12.0 12?
SELECT AVG("Year") FROM table_52862 WHERE "Rank" = '12.0 12'
wikisql
CREATE TABLE table_79517 ( "Position" real, "Athlete" text, "Compulsory" real, "Voluntary" real, "Total" real )
What's the total of the position of 1?
SELECT SUM("Total") FROM table_79517 WHERE "Position" < '1'
wikisql
CREATE TABLE table_name_58 ( ends INTEGER, name VARCHAR, since VARCHAR )
What is the sum of Ends with a Name of abidal, and has a Since larger than 2007?
SELECT SUM(ends) FROM table_name_58 WHERE name = "abidal" AND since > 2007
sql_create_context
CREATE TABLE table_204_90 ( id number, "rank" number, "name" text, "nationality" text, "time" text )
who ran a shorter time than emebet anteneh mengistu ?
SELECT "name" FROM table_204_90 WHERE "time" < (SELECT "time" FROM table_204_90 WHERE "name" = 'emebet anteneh mengistu')
squall
CREATE TABLE table_name_58 ( score VARCHAR, player VARCHAR )
What was Raymond Floyd's score?
SELECT score FROM table_name_58 WHERE player = "raymond floyd"
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_...
give me the flights from PITTSBURGH to LOS ANGELES on thursday evening
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 = 'LOS ANGELES' AND date_day.day_number = 24 AND date_day.month_number = 5 ...
atis
CREATE TABLE table_26115 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
What is every location for the date of March 20?
SELECT "Location" FROM table_26115 WHERE "Date" = 'March 20'
wikisql
CREATE TABLE table_203_496 ( id number, "pos" number, "country" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many medals total did poland win ?
SELECT "total" FROM table_203_496 WHERE "country" = 'poland'
squall
CREATE TABLE table_69950 ( "Program" text, "Degree" text, "Teaching language" text, "Duration (years)" real, "full-time/part-time" text, "ECTS Credit Points" real )
How many ECTS credit points occur with Master in Management?
SELECT COUNT("ECTS Credit Points") FROM table_69950 WHERE "Program" = 'master in management'
wikisql
CREATE TABLE table_60225 ( "Crude oil name \\Rightarrow Location \\Rightarrow" text, "Barrow Island Australia" real, "Mutineer-Exeter Australia" real, "CPC Blend Kazakhstan" real, "Draugen North Sea" real )
What is the lowest CPC Blend Kazakhstan number when Draugen North Sea is 17?
SELECT MIN("CPC Blend Kazakhstan") FROM table_60225 WHERE "Draugen North Sea" = '17'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, Last...
v2 - Answers that are possibly link only which were posted by new users and question asker is new. credit to Bill the Lizard for help putting this together http://meta.stackexchange.com/a/238320/244519
SELECT p.Id AS "post_link", p.CreationDate, LEN(p.Body) AS BodyLength FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 1 AND p.CreationDate > '2015-04-15T00:00:00.000' AND DATEDIFF(WEEK, u.CreationDate, CreationDate) < 104 ORDER BY p.CreationDate
sede
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
when was the first time patient 22449 was having less than 111.0 arterial bp [systolic] since 1302 days ago?
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 = 22449)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_72651 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "Viewers (millions)" text )
How many viewers in millions for episode 'sokka's master'?
SELECT "Viewers (millions)" FROM table_72651 WHERE "Title" = 'Sokka''s Master'
wikisql
CREATE TABLE table_name_58 ( round VARCHAR, player VARCHAR )
What round was Craig Erickson drafted?
SELECT round FROM table_name_58 WHERE player = "craig erickson"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
what were the five drugs most frequently prescribed to the patients aged 50s during the same hospital visit after they had been diagnosed with 35-36 comp wks gestation until 2101?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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_...
mimic_iii
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
count the amount of hospital visits of patient 26720 until 2 years ago.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 26720 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-2 year')
mimic_iii
CREATE TABLE table_1341884_20 ( party VARCHAR, incumbent VARCHAR )
What party did Hale Boggs belong to?
SELECT party FROM table_1341884_20 WHERE incumbent = "Hale Boggs"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLO...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of department_id bin hire_date by time in a bar chart.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
what are the top three prescribed drugs for the patients of age 50s until 2100?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND STRFTIME('%y', medication.drugstarttime) <= '2100' GROUP BY medication.drugn...
eicu
CREATE TABLE table_15388 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text )
What is the number of games played in the season before 2005?
SELECT SUM("Played") FROM table_15388 WHERE "First game" < '2005'
wikisql
CREATE TABLE table_80020 ( "Year" real, "Champion" text, "City" text, "LLWS" text, "Record" text )
Which Little League World Series took place in Parsippany?
SELECT "LLWS" FROM table_80020 WHERE "City" = 'parsippany'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
70649441899那个门诊在哪年哪月的哪一天就诊
SELECT JZKSRQ FROM mzjzjlb WHERE JZLSH = '70649441899'
css
CREATE TABLE table_4766 ( "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
What race did Bobby Unser win?
SELECT "Name" FROM table_4766 WHERE "Winning driver" = 'bobby unser'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
mention the drug type and route of the drug code onda4i.
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ONDA4I"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid n...
when was patient 031-23605's last microbiological sputum, expectorated test performed until 08/2104?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'sputum, expectorated' AN...
eicu
CREATE TABLE table_name_3 ( date VARCHAR, high_rebounds VARCHAR )
On what date was a two-way tie (8) the high rebound?
SELECT date FROM table_name_3 WHERE high_rebounds = "two-way tie (8)"
sql_create_context
CREATE TABLE table_26638 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
Name the date successor seated for successor being vacant
SELECT "Date successor seated" FROM table_26638 WHERE "Successor" = 'Vacant'
wikisql
CREATE TABLE table_name_17 ( grid VARCHAR, car_no VARCHAR )
What is the grid of car no. 3?
SELECT grid FROM table_name_17 WHERE car_no = "3"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Po...
top users by amount of answers in a day.
SELECT OwnerUserId, DATE(CreationDate) AS DT, COUNT(p.Id) FROM Posts AS p WHERE PostTypeId = 2 AND OwnerUserId > 0 GROUP BY OwnerUserId, DATE(CreationDate) ORDER BY 3 DESC
sede
CREATE TABLE table_22265261_1 ( jockey VARCHAR, position VARCHAR )
Who was the jockey in 7th position?
SELECT jockey FROM table_22265261_1 WHERE position = "7th"
sql_create_context
CREATE TABLE table_14922 ( "Station" text, "Frequency" real, "Network Affiliation" text, "Format" text, "City of License" text, "Status" text )
Which format has a Frequency larger than 1050, and a Station of kvto?
SELECT "Format" FROM table_14922 WHERE "Frequency" > '1050' AND "Station" = 'kvto'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
what is the number of patients who died in or before 2122 and with drug code pred5sm?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "PRED5SM"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what number of patients born before the year 1837 had lab test item id as 50885?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1837" AND lab.itemid = "50885"
mimicsql_data
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
二零零四年六月十八日二零一一年六月十三日,在9385529医院有多少科室涉及医疗费总额低于4.11元
SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9385529' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-18' AND '2011-06-13' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 4.11) AS T
css
CREATE TABLE table_47448 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
Which To par is the lowest one that has a Year(s) won of 1962, 1967, 1972, 1980, and a Total larger than 149?
SELECT MIN("To par") FROM table_47448 WHERE "Year(s) won" = '1962, 1967, 1972, 1980' AND "Total" > '149'
wikisql
CREATE TABLE table_204_680 ( id number, "released" text, "title" text, "artist" text, "format" text, "language" text )
did big bang release more or less albums than 2ne1 ?
SELECT (SELECT COUNT(*) FROM table_204_680 WHERE "artist" = 'big bang') > (SELECT COUNT(*) FROM table_204_680 WHERE "artist" = '2ne1')
squall
CREATE TABLE table_36531 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
The record of 35-31 has what score?
SELECT "Score" FROM table_36531 WHERE "Record" = '35-31'
wikisql
CREATE TABLE table_204_108 ( id number, "typ" text, "construction time" text, "cylinders" text, "capacity" text, "power" text, "top speed" text )
number of cylinders the standard 8 have
SELECT "cylinders" FROM table_204_108 WHERE "typ" = 'standard 8'
squall
CREATE TABLE table_19517621_3 ( directed_by VARCHAR, title VARCHAR )
If the title if the Lost Boy, how many directors were there?
SELECT COUNT(directed_by) FROM table_19517621_3 WHERE title = "The Lost Boy"
sql_create_context
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), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For all employees who have the letters D or S in their first name, show me about the change of manager_id over hire_date in a line chart, sort by the X-axis in ascending.
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_12548 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the highest Wins, when Goals For is greater than 39, and when Points is less than 25?
SELECT MAX("Wins") FROM table_12548 WHERE "Goals for" > '39' AND "Points" < '25'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
Number of posts by type.
SELECT COUNT(1) AS N FROM Posts WHERE PostTypeId = '##type##'
sede
CREATE TABLE table_204_595 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many nations received more medals than canada ?
SELECT COUNT("nation") FROM table_204_595 WHERE "total" > (SELECT "total" FROM table_204_595 WHERE "nation" = 'canada')
squall
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
what laboratory test was given to patient 010-33968 for the last time until 12/2104?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-33968')) AND STRFTIME('%y-%m', lab.labresulttime) <= '2104-12' ORDER BY lab.labresult...
eicu
CREATE TABLE table_48453 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text )
What is the average game number when the record is 4-1?
SELECT AVG("Game") FROM table_48453 WHERE "Record" = '4-1'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( ...
how many days has it been since patient 15794 last got a lab test for pco2 during their current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pco2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dis...
mimic_iii
CREATE TABLE table_203_74 ( id number, "rank" number, "urban area" text, "population\n(2001 census)" number, "area (km2)" number, "density (people/km2)" number, "major subdivisions" text, "metropolitan area" text )
how many urban areas have a population above 90,000 ?
SELECT COUNT("urban area") FROM table_203_74 WHERE "population\n(2001 census)" > 90000
squall
CREATE TABLE table_40767 ( "Club" text, "Wins" real, "Losses" real, "Points For" real, "Points Against" real, "Percentage" real, "Points" real )
What is the total number of Losses when the percentage is 54.83, with more than 8 points?
SELECT COUNT("Losses") FROM table_40767 WHERE "Percentage" = '54.83' AND "Points" > '8'
wikisql
CREATE TABLE table_65642 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What was the score when Arsenal was the away team?
SELECT "Score" FROM table_65642 WHERE "Away team" = 'arsenal'
wikisql
CREATE TABLE table_11456251_5 ( power_capacity__gw_ VARCHAR, number_of_generators VARCHAR )
What is the power capacity when the generators were 781?
SELECT power_capacity__gw_ FROM table_11456251_5 WHERE number_of_generators = 781
sql_create_context
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 )
How many products are there for each manufacturer Visualize by bar chart, list in desc by the X.
SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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...
从2007年8月29日开始,截止到2013年5月22日,请把彭飞沉的这位病人总共被开出的检验报告单的审核日期时间给列出来
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '彭飞沉' AND jybg...
css
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
show me all the DL flights leaving or arriving at PITTSBURGH between 1200 and 1600 in the afternoon
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE (((flight.arrival_time <= 1600 AND flight.arrival_time >= 1200) AND city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.to_airport = airport_service.airport_code) OR ((flight.departure_time <= 1600 AND flight.d...
atis
CREATE TABLE table_69881 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
How many lanes have a Nationality of iceland?
SELECT SUM("Lane") FROM table_69881 WHERE "Nationality" = 'iceland'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
编号01352770在2014年10月3日到2016年4月14日期间所在检验所有结果指标记录中的仪器编号以及名称都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_name_35 ( score INTEGER, place VARCHAR, player VARCHAR )
Which Score has a Place of t1, and a Player of hubert green?
SELECT AVG(score) FROM table_name_35 WHERE place = "t1" AND player = "hubert green"
sql_create_context
CREATE TABLE table_18018214_4 ( games_played INTEGER )
What is the highest number of games played?
SELECT MAX(games_played) FROM table_18018214_4
sql_create_context
CREATE TABLE table_name_19 ( score VARCHAR, visitor VARCHAR, record VARCHAR )
Which Score has a Visitor of ny rangers, and a Record of 19 28 15?
SELECT score FROM table_name_19 WHERE visitor = "ny rangers" AND record = "19–28–15"
sql_create_context
CREATE TABLE table_1207 ( "Year" real, "Dates" text, "Venue" text, "Champion" text, "Country" text, "Score" real, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Purse ( $ )" real, "Winners share ($)" real )
At what venues did Lorena Ochoa win the championship?
SELECT "Venue" FROM table_1207 WHERE "Champion" = 'Lorena Ochoa'
wikisql
CREATE TABLE table_73442 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
Who is the tournament winner in the Atlantic Coast Conference?
SELECT "Tournament Winner" FROM table_73442 WHERE "Conference" = 'Atlantic Coast Conference'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
Let 's see Actuarial Math courses with 7 credits .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Actuarial Math%' OR name LIKE '%Actuarial Math%') AND credits = 7
advising
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is minimum age of patients whose marital status is single and admission location is emergency room admit?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
mimicsql_data
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
Get user id and rep by name.
SELECT Id, Reputation FROM Users WHERE DisplayName = 'HyperNeutrino' LIMIT 1
sede
CREATE TABLE table_65059 ( "Round" real, "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Attendance" real, "Stadium" text )
What is the latest round for Pohang Steelers as the away team?
SELECT MAX("Round") FROM table_65059 WHERE "Away Team" = 'pohang steelers'
wikisql
CREATE TABLE table_59789 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sogn)" text, "Church Name" text, "Year Built" real, "Location of the Church" text )
Which Sub-Parish (Sogn) was built before 1883 in the Parish (Prestegjeld) of jostedal parish and is located in the Church of Gaupne?
SELECT "Sub-Parish (Sogn)" FROM table_59789 WHERE "Year Built" < '1883' AND "Parish (Prestegjeld)" = 'jostedal parish' AND "Location of the Church" = 'gaupne'
wikisql
CREATE TABLE table_203_36 ( id number, "parish" text, "locality" text, "parish priest" text, "founded" number, "closed" number )
which parish is the only one to have closed ?
SELECT "parish" FROM table_203_36 WHERE NOT "closed" IS NULL
squall
CREATE TABLE table_47540 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What is the name of the bike that has a grid number smaller than 9 with a time of +7.764?
SELECT "Bike" FROM table_47540 WHERE "Grid" < '9' AND "Time" = '+7.764'
wikisql
CREATE TABLE table_203_356 ( id number, "type" text, "diagonal (mm)" text, "width (mm)" text, "height (mm)" text, "area (mm2)" text, "stops (area)" number, "crop factor" text )
how long is the diagonal size of a 1/10 sensor ?
SELECT "diagonal (mm)" FROM table_203_356 WHERE "type" = '1/10"'
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
what is the number of patients on promethazine hcl drug prescription who stayed in hospital for more than 5 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.drug = "Promethazine HCl"
mimicsql_data
CREATE TABLE table_41861 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is average Top 10 with 0 wins?
SELECT AVG("Top-10") FROM table_41861 WHERE "Wins" < '0'
wikisql