context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_18086 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What was the number of points against when the amount won is 10?
SELECT "Points against" FROM table_18086 WHERE "Won" = '10'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
this year, what were the top four most frequent diagnoses of which patients were diagnosed in the same hospital visit after receiving enteral feeds?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'enter...
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
what are the one year survival rates for fever 41 degrees c or over - heat stroke patients?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
the number of patients in ward 874 since 5 years ago?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 874 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year')
eicu
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
在2007年2月14日到2021年2月4日这一段时间医疗机构0598399外地住院就诊记录数量有几条?
SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZYBMLX = '0598399' AND bdmzjzjlb.RYDJSJ BETWEEN '2007-02-14' AND '2021-02-04'
css
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 ...
what was patient 29666's first value of ph in 03/this year?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29666) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(...
mimic_iii
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
Visualize a bar chart for how many players are from each country?
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name
nvbench
CREATE TABLE table_name_32 ( place VARCHAR, prize VARCHAR )
What is Place, when Prize is '$381.030'?
SELECT place FROM table_name_32 WHERE prize = "$381.030"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Draw a scatter chart about the correlation between Team_ID and School_ID , and group by attribute All_Road.
SELECT Team_ID, School_ID FROM basketball_match GROUP BY All_Road
nvbench
CREATE TABLE table_7530 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What rank has 0 as the bronze, and a total less than 3, with north korea as the nation?
SELECT "Rank" FROM table_7530 WHERE "Bronze" = '0' AND "Total" < '3' AND "Nation" = 'north korea'
wikisql
CREATE TABLE table_71583 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text )
What is the name of the School of the Sussex Tech's Team?
SELECT "Team" FROM table_71583 WHERE "School" = 'sussex tech'
wikisql
CREATE TABLE table_43822 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text )
Who is the opponent when the record is 17-19-4?
SELECT "Opponent" FROM table_43822 WHERE "Record" = '17-19-4'
wikisql
CREATE TABLE table_name_76 ( winner VARCHAR, date VARCHAR )
Who won on May 2011?
SELECT winner FROM table_name_76 WHERE date = "may 2011"
sql_create_context
CREATE TABLE table_name_22 ( played VARCHAR, lost VARCHAR, first_game VARCHAR, percentage VARCHAR )
What is the total number of games played that correlates with a first game in 1991, a percentage of 22.22%, and less than 7 losses?
SELECT COUNT(played) FROM table_name_22 WHERE first_game = 1991 AND percentage = "22.22%" AND lost > 7
sql_create_context
CREATE TABLE table_name_27 ( game VARCHAR, date VARCHAR )
what game was on may 24
SELECT game FROM table_name_27 WHERE date = "may 24"
sql_create_context
CREATE TABLE table_name_72 ( title VARCHAR, platform_s_ VARCHAR, director VARCHAR )
What 3ds game did Naohiko Aoyama direct?
SELECT title FROM table_name_72 WHERE platform_s_ = "3ds" AND director = "naohiko aoyama"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
when did patient 65582 get in the first hospital encounter a lab test for the first time?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1
mimic_iii
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
Return the number of the countries of the mountains that have a height larger than 5000, display from high to low by the bar.
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, Li...
Accepted vs. Rejected edits per month.
WITH Raw AS (SELECT TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%Y') AS yyyy, TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%M') AS mm, COUNT(ApprovalDate) AS ApprovalCount, COUNT(RejectionDate) AS RejectionCount FROM SuggestedEdits GROUP BY TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%Y'), TIME_T...
sede
CREATE TABLE table_name_11 ( date VARCHAR, record VARCHAR )
What date was the record 34-41?
SELECT date FROM table_name_11 WHERE record = "34-41"
sql_create_context
CREATE TABLE table_78646 ( "Ecclesiastical Jurisdictions" text, "Latin name" text, "Type" text, "Rite" text, "Ecclesiastical Province" text, "Area (km 2 )" real )
What Area (km 2) is lowest with a type being Apostolic Administration?
SELECT MIN("Area (km 2 )") FROM table_78646 WHERE "Type" = 'apostolic administration'
wikisql
CREATE TABLE table_46885 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
How many were in attendance during week 12?
SELECT "Attendance" FROM table_46885 WHERE "Week" = '12'
wikisql
CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, me...
What are the ids and trade names of the medicine that can interact with at least 3 enzymes?
SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3
spider
CREATE TABLE table_44751 ( "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real )
What is the total number of React, when Name is Sean Wroe, and when Lane is greater than 2?
SELECT COUNT("React") FROM table_44751 WHERE "Name" = 'sean wroe' AND "Lane" > '2'
wikisql
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...
Visualize the relationship between School_ID and ACC_Percent , and group by attribute ACC_Regular_Season.
SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_36208 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text )
Performer 2 of chip esten has what performer 3?
SELECT "Performer 3" FROM table_36208 WHERE "Performer 2" = 'chip esten'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
8089411这所医疗机构现在有多少人在院
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8089411' AND t_kc21.HOSP_STS > 0
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients with primary disease st-segment elevation myocardial infarction/cardiac catheterization have iv bolus route of drug administration?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_27817 ( "Position" real, "Sail Number" text, "Yacht" text, "State/Country" text, "Yacht Type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed Time d:hh:mm:ss" text )
What is the state that the boat is from that finished in 2:15:14:06?
SELECT "State/Country" FROM table_27817 WHERE "Elapsed Time d:hh:mm:ss" = '2:15:14:06'
wikisql
CREATE TABLE table_name_64 ( competition VARCHAR, score VARCHAR )
Which competition ended with a score of 58-4?
SELECT competition FROM table_name_64 WHERE score = "58-4"
sql_create_context
CREATE TABLE table_name_46 ( replica VARCHAR, race VARCHAR )
What Replica has a race of supersport race 1?
SELECT replica FROM table_name_46 WHERE race = "supersport race 1"
sql_create_context
CREATE TABLE table_203_76 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many drivers received points from the race ?
SELECT COUNT("driver") FROM table_203_76 WHERE NOT "points" IS NULL
squall
CREATE TABLE table_204_441 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text )
what was the first opponent oxford united f.c. defeated during the season ?
SELECT "opponent" FROM table_204_441 WHERE "result" > "result" ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_39 ( played INTEGER, losses VARCHAR, goals_for VARCHAR, goals_against VARCHAR, wins VARCHAR )
Which Played has Goals against larger than 34, and Wins smaller than 12, and Goals for smaller than 50, and Losses larger than 15?
SELECT AVG(played) FROM table_name_39 WHERE goals_against > 34 AND wins < 12 AND goals_for < 50 AND losses > 15
sql_create_context
CREATE TABLE table_68062 ( "Goal #" real, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Name the result for goal # more than 4
SELECT "Result" FROM table_68062 WHERE "Goal #" > '4'
wikisql
CREATE TABLE table_64800 ( "School (IHSAA ID#)" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text, "Year Joined" real )
What is the sum of enrollments for schools located in Culver?
SELECT SUM("Enrollment") FROM table_64800 WHERE "Location" = 'culver'
wikisql
CREATE TABLE table_21394 ( "Name" text, "Model" text, "Max FS" text, "Tested FS" text, "Short description" text, "Publication" text, "Method" text, "Output" text, "Status" text )
what is the max fs where the status is status and the method is method?
SELECT "Max FS" FROM table_21394 WHERE "Status" = 'Status' AND "Method" = 'Method'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在2006年10月23日到2018年1月9日期间,1075351医疗机构有过几次转诊门诊的就诊记录
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '10...
css
CREATE TABLE table_78710 ( "Ending" text, "American" text, "British" text, "Australian" text, "Examples" text )
Which Examples has Australian of m?
SELECT "Examples" FROM table_78710 WHERE "Australian" = 'əm'
wikisql
CREATE TABLE table_204_190 ( id number, "rank" number, "city" text, "county" text, "state" text, "percentage" text )
which california city has a higher percentage of korean americans ?
SELECT "city" FROM table_204_190 WHERE "state" = 'california' ORDER BY "percentage" DESC LIMIT 1
squall
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients whose language is russ and discharge location is disc-tran cancer/chldrn h?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "RUSS" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
mimicsql_data
CREATE TABLE table_24798489_2 ( original_airdate VARCHAR, episode_number VARCHAR )
How many original air dates were there for episode 22?
SELECT COUNT(original_airdate) FROM table_24798489_2 WHERE episode_number = 22
sql_create_context
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, planned_destruction_date time, ...
What are each document's location code, and starting date and ending data in that location?
SELECT location_code, date_in_location_from, date_in_locaton_to FROM document_locations
spider
CREATE TABLE table_name_70 ( time VARCHAR, lane VARCHAR )
What was lane 4's time?
SELECT time FROM table_name_70 WHERE lane = 4
sql_create_context
CREATE TABLE table_2859 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Name the title for number 16
SELECT "Title" FROM table_2859 WHERE "No. in season" = '16'
wikisql
CREATE TABLE table_name_7 ( player VARCHAR, place VARCHAR, score VARCHAR )
Who is the player with a t6 place and a 72-68-72=212 score?
SELECT player FROM table_name_7 WHERE place = "t6" AND score = 72 - 68 - 72 = 212
sql_create_context
CREATE TABLE table_name_22 ( date VARCHAR, uci_rating VARCHAR, race_name VARCHAR )
What is the date of the omloop van de vlaamse scheldeboorden race with a UCI rating of 1.1?
SELECT date FROM table_name_22 WHERE uci_rating = "1.1" AND race_name = "omloop van de vlaamse scheldeboorden"
sql_create_context
CREATE TABLE table_name_12 ( pick INTEGER, player VARCHAR )
What is the total pick with Bill Duffy?
SELECT SUM(pick) FROM table_name_12 WHERE player = "bill duffy"
sql_create_context
CREATE TABLE table_17467578_1 ( original_airdate VARCHAR, episode__number VARCHAR )
What is the original air date of episode 8? Answer: Dec. 21, 2006
SELECT COUNT(original_airdate) FROM table_17467578_1 WHERE episode__number = 8
sql_create_context
CREATE TABLE table_name_24 ( ihsaa_class__football_ VARCHAR, mascot VARCHAR )
What IHSAA football class do the Generals play in?
SELECT ihsaa_class__football_ FROM table_name_24 WHERE mascot = "generals"
sql_create_context
CREATE TABLE table_2676980_4 ( seats_in_congress VARCHAR, electoral_district VARCHAR )
What is the number of seats in congress when the electoral district is Ucayali?
SELECT COUNT(seats_in_congress) FROM table_2676980_4 WHERE electoral_district = "Ucayali"
sql_create_context
CREATE TABLE table_75238 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
Name the save for braves for may 15
SELECT "Save" FROM table_75238 WHERE "Opponent" = 'braves' AND "Date" = 'may 15'
wikisql
CREATE TABLE table_53108 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who made the car that Alberto Ascari went more than 35 laps on a grid less than 7?
SELECT "Constructor" FROM table_53108 WHERE "Grid" < '7' AND "Laps" > '35' AND "Driver" = 'alberto ascari'
wikisql
CREATE TABLE table_34699 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" text )
What is the tournament on Apr 6?
SELECT "Tournament" FROM table_34699 WHERE "Date" = 'apr 6'
wikisql
CREATE TABLE table_56537 ( "Club" text, "Wins" text, "Last win" text, "Runners-up" text, "Last final lost" text )
When was the last win for the club that had a final loss in 2011?
SELECT "Last win" FROM table_56537 WHERE "Last final lost" = '2011'
wikisql
CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE appellations ( no numbe...
What is the county that produces the most wines scoring higher than 90?
SELECT T1.county FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T2.score > 90 GROUP BY T1.county ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_1342379_23 ( candidates VARCHAR, district VARCHAR )
who is the the candidates with district being mississippi 4
SELECT candidates FROM table_1342379_23 WHERE district = "Mississippi 4"
sql_create_context
CREATE TABLE table_1085 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What is the lowest pick number?
SELECT MIN("Pick #") FROM table_1085
wikisql
CREATE TABLE table_49347 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text )
What's the report about townsville crocodiles as an away team?
SELECT "Report" FROM table_49347 WHERE "Away team" = 'townsville crocodiles'
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
how much was the intake of lactated ringers that patient 13329 received on the last icu visit?
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13329) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND inputev...
mimic_iii
CREATE TABLE table_43590 ( "Round" real, "Pick" text, "Player" text, "Position" text, "Nationality" text, "School/Club Team" text )
What is Pick, when Round is greater than 1, and when School/Club Team is South Carolina?
SELECT "Pick" FROM table_43590 WHERE "Round" > '1' AND "School/Club Team" = 'south carolina'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
High-scoring questions that have been closed as being off-topic..
SELECT DISTINCT Q.Id AS "post_link", Q.Score AS "number_of_votes", PH.Comment AS "close_reason" FROM Posts AS Q INNER JOIN PostHistory AS PH ON (Q.Id = PH.PostId) WHERE Q.PostTypeId = 1 AND Q.Score >= 100 AND PH.PostHistoryTypeId = 10 AND PH.Comment IN (2, 3, 102, 104, 105) ORDER BY Q.Score DESC
sede
CREATE TABLE table_14903081_1 ( tournament VARCHAR, current_venue VARCHAR )
How many tournaments have their current venue as the Lindner Family Tennis Center?
SELECT COUNT(tournament) FROM table_14903081_1 WHERE current_venue = "Lindner Family Tennis Center"
sql_create_context
CREATE TABLE products ( product_id number, product_name text, product_price number, product_description text ) CREATE TABLE order_deliveries ( location_code text, actual_order_id number, delivery_status_code text, driver_employee_id number, truck_id number, delivery_date time ) ...
How many different payment methods are there?
SELECT COUNT(DISTINCT payment_method) FROM customers
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
provide me the number of emergency hospital admitted patients with diagnosis icd9 code 6959.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "6959"
mimicsql_data
CREATE TABLE table_78248 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text )
Name the D 44 when it has a D 46 of d 31
SELECT "D 44" FROM table_78248 WHERE "D 46" = 'd 31'
wikisql
CREATE TABLE table_name_73 ( island VARCHAR, age___ma__ VARCHAR )
Name the island with age ma of 1.0
SELECT island FROM table_name_73 WHERE age___ma__ = "1.0"
sql_create_context
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...
Asked by user1 and answered by user2.
SELECT q.Id AS "post_link" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.OwnerUserId = '##askerid##' AND a.OwnerUserId = '##answererid##'
sede
CREATE TABLE table_name_95 ( losses VARCHAR, appearances INTEGER )
How many losses did the division who appeared less than 16 times have?
SELECT losses FROM table_name_95 WHERE appearances < 16
sql_create_context
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
Bar graph to show mean memory in g from different carrier, rank Y-axis in asc order please.
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G)
nvbench
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, draw a bar chart about the distribution of name and the amount of name , and group by attribute name, and show in desc by the names.
SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
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...
患者77127973在医院6027111入院诊断时的医疗就诊记录里疾病名称不包含瘙痒症的编号有什么?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '77127973' AND qtb.MED_SER_ORG_NO = '6027111' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%瘙痒症%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '77127973' AND gyb.MED_SER_ORG_NO = '6027111' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%瘙痒症%' UNION SELECT zyb.MED_CLINIC_ID...
css
CREATE TABLE Features ( Feature_ID INTEGER, Feature_Details VARCHAR(255) ) CREATE TABLE Street_Markets ( Market_ID INTEGER, Market_Details VARCHAR(255) ) CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) ) CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Details VARCH...
Display a bar chart for what are the names and ids of the tourist attractions that are visited at most once?, and list by the X in asc.
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name
nvbench
CREATE TABLE songs ( songid VARCHAR ) CREATE TABLE vocals ( songid VARCHAR )
What are the vocal types used in song 'Badlands'?
SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands"
sql_create_context
CREATE TABLE table_30453 ( "Player" text, "Cap(s)" real, "Goal(s)" real, "International Debut" text, "Club(s)" text )
When winston reid category:articles with hcards is the player what is the club?
SELECT "Club(s)" FROM table_30453 WHERE "Player" = 'Winston Reid Category:Articles with hCards'
wikisql
CREATE TABLE table_59748 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is the sum of Against, when Status is 'Six Nations', and when Date is '30/03/2003'?
SELECT SUM("Against") FROM table_59748 WHERE "Status" = 'six nations' AND "Date" = '30/03/2003'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
how many patients whose admission type is newborn and diagnoses long title is esophageal reflux?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Esophageal reflux"
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 hours have passed since the first time patient 28447 was given a d5w intake on the current intensive care unit visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND icustays.outtime IS NULL)...
mimic_iii
CREATE TABLE table_37618 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What is the amount of money that a +5 to par with a score of 76-69-70-70=285?
SELECT COUNT("Money ( $ )") FROM table_37618 WHERE "To par" = '+5' AND "Score" = '76-69-70-70=285'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
was patient 26156 heart rate ever less than 83.0 on the last intensive care unit visit?
SELECT COUNT(*) > 0 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 = 26156) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELE...
mimic_iii
CREATE TABLE table_name_2 ( director VARCHAR, title VARCHAR )
Who directed hamateur night?
SELECT director FROM table_name_2 WHERE title = "hamateur night"
sql_create_context
CREATE TABLE table_name_58 ( erp_w VARCHAR, class VARCHAR, frequency_mhz VARCHAR )
What is the total erp w of class c3, which has a frequency mhz less than 89.9?
SELECT COUNT(erp_w) FROM table_name_58 WHERE class = "c3" AND frequency_mhz < 89.9
sql_create_context
CREATE TABLE research_staff ( staff_id number, employer_organisation_id number, staff_details text ) CREATE TABLE research_outcomes ( outcome_code text, outcome_description text ) CREATE TABLE staff_roles ( role_code text, role_description text ) CREATE TABLE project_outcomes ( projec...
List the description of the outcomes for all projects.
SELECT T1.outcome_description FROM research_outcomes AS T1 JOIN project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code
spider
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
从在2003年2月7日至2010年3月27日期间医院4645126医疗记录一共多少?
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '4645126' AND IN_HOSP_DATE BETWEEN '2003-02-07' AND '2010-03-27'
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients are discharged to home health care and the admission year is before 2110?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2110"
mimicsql_data
CREATE TABLE table_2853 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the high points for 30-23
SELECT "High points" FROM table_2853 WHERE "Record" = '30-23'
wikisql
CREATE TABLE table_name_63 ( Last INTEGER, club VARCHAR )
What is the number of Last Runners-up that has the club name of dempo sc?
SELECT SUM(Last) AS runners_up FROM table_name_63 WHERE club = "dempo sc"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDe...
Questions with titles like 'exists %' or 'exist %'. posts that could probably use editing, as this is broken English
SELECT p.Id AS "post_link", DisplayName, p.CreationDate FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.Title LIKE 'exist %' OR p.Title LIKE 'exists %' OR p.Title LIKE 'Exist %' OR p.Title LIKE 'Exists %'
sede
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) ...
could you give me the schedule of flights for AA and DL to DFW on 8 15
SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport, date_day, days, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (((FLIGHT_1.airline_code = 'AA') OR (FLIGHT_1.airline_code = 'DL')) AND date_day.day_number = 15 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name ...
atis
CREATE TABLE table_1579922_1 ( broadcast_date VARCHAR, run_time VARCHAR )
What date was an episode with a run time of 24:30 broadcasted?
SELECT broadcast_date FROM table_1579922_1 WHERE run_time = "24:30"
sql_create_context
CREATE TABLE table_203_346 ( id number, "date" text, "location" text, "venue" text, "opening act" text, "supporting" text )
in which venue was the next performance after the one at verdun auditorium ?
SELECT "venue" FROM table_203_346 WHERE "date" > (SELECT "date" FROM table_203_346 WHERE "venue" = 'verdun auditorium') ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_59 ( place VARCHAR, to_par VARCHAR, score VARCHAR )
What is Place, when To Par is less than 15, and when Score is 76-72-75-71=294?
SELECT place FROM table_name_59 WHERE to_par < 15 AND score = 76 - 72 - 75 - 71 = 294
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_CLINIC_ID text, MED_DIRE_CD tex...
自一二年三月十九日起到一三年五月二十三日的这段时间里,7349327这个医疗机构一共有多少检查费
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7349327' AND t_kc22.STA_DATE BETWEEN '2012-03-19' AND '2013-05-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE college ( Leader_Name VARCHAR, College_ID VARCHAR ) CREATE TABLE member ( College_ID VARCHAR, Country VARCHAR )
Show the distinct leader names of colleges associated with members from country 'Canada'.
SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada"
sql_create_context
CREATE TABLE table_26914854_3 ( team VARCHAR, incoming_manager VARCHAR )
What is the team when the incoming manager is martin allen?
SELECT team FROM table_26914854_3 WHERE incoming_manager = "Martin Allen"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
Users above given number of upvotes (just names).
SELECT Id AS "user_link", DisplayName FROM Users WHERE UpVotes > '##votes?100##' ORDER BY Id
sede
CREATE TABLE table_name_90 ( losses VARCHAR, wins INTEGER )
How many losses when there are less than 0 wins?
SELECT COUNT(losses) FROM table_name_90 WHERE wins < 0
sql_create_context
CREATE TABLE table_45446 ( "Round" real, "Race Name" text, "Pole position" text, "Winning driver" text, "Winning Team" text )
What race after round 6 did Graham Rahal win with a pole position of graham rahal?
SELECT "Race Name" FROM table_45446 WHERE "Winning driver" = 'graham rahal' AND "Round" > '6' AND "Pole position" = 'graham rahal'
wikisql
CREATE TABLE entrepreneur ( People_ID VARCHAR ) CREATE TABLE people ( Name VARCHAR, People_ID VARCHAR )
What are the names of entrepreneurs?
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
sql_create_context
CREATE TABLE table_356 ( "L&CR No." real, "Type" text, "Manufacturer" text, "Delivered" text, "Name" text, "Jt. Cttee No." real, "1845 disposal" text )
What was the maximum l&cr number for archimedes?
SELECT MAX("L&CR No.") FROM table_356 WHERE "Name" = 'Archimedes'
wikisql