context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_18453 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the district for carl vinson?
SELECT "District" FROM table_18453 WHERE "Incumbent" = 'Carl Vinson'
wikisql
CREATE TABLE table_name_58 ( winning_team VARCHAR, date VARCHAR )
What was the winning team on 11 July?
SELECT winning_team FROM table_name_58 WHERE date = "11 july"
sql_create_context
CREATE TABLE table_73112 ( "Song" text, "Porsgrunn" real, "Bergen" real, "Bod\u00f8" real, "Stavanger" real, "\u00c5lesund" real, "Elverum" real, "Troms\u00f8" real, "Fredrikstad" real, "Trondheim" real, "Oslo" real, "Total" real )
How many elverum are tehre for et sted i scandinavia?
SELECT COUNT("Elverum") FROM table_73112 WHERE "Song" = 'Et sted i Scandinavia'
wikisql
CREATE TABLE table_75401 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Road Team of utah jazz, and a Result of 81-83 (3-2) involved what game?
SELECT "Game" FROM table_75401 WHERE "Road Team" = 'utah jazz' AND "Result" = '81-83 (3-2)'
wikisql
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 all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of manager_id , and group by attribute job_id in a bar chart.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
CREATE TABLE table_name_11 ( area VARCHAR, authority VARCHAR, roll VARCHAR )
Where is the school with state authority that has a roll of more than 157 students?
SELECT area FROM table_name_11 WHERE authority = "state" AND roll > 157
sql_create_context
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...
when had patient 027-151154 on their current hospital encounter for the first time received chest x-ray?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-151154' AND patient.hospitaldischargetime IS NULL)) AND treat...
eicu
CREATE TABLE table_74343 ( "LGA Name" text, "Area (km 2 )" real, "Census 2006 population" real, "Administrative capital" text, "Postal Code" real )
What is the area when the Iga name is Ahoada East?
SELECT MAX("Area (km 2 )") FROM table_74343 WHERE "LGA Name" = 'Ahoada East'
wikisql
CREATE TABLE table_17076 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
What is the hometown of the player who attended American Heritage School?
SELECT "Hometown" FROM table_17076 WHERE "School" = 'American Heritage School'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, ...
tell me the top five of the most common diagnoses of patients in the 30s?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_203_254 ( id number, "position" number, "team" text, "points" number, "played" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "difference" number )
what 1919 brazilian football team had the most points ?
SELECT "team" FROM table_203_254 ORDER BY "points" DESC LIMIT 1
squall
CREATE TABLE table_6716 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Home" text, "Away" text, "Agg." text )
Which Away has a Season of 2001 02, and an Opponent of dinaburg?
SELECT "Away" FROM table_6716 WHERE "Season" = '2001–02' AND "Opponent" = 'dinaburg'
wikisql
CREATE TABLE table_name_14 ( rider VARCHAR, grid VARCHAR, manufacturer VARCHAR, laps VARCHAR )
What rider is on an aprilia that went under 18 laps with a grid total of 17?
SELECT rider FROM table_name_14 WHERE manufacturer = "aprilia" AND laps < 18 AND grid = 17
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
what is date of birth and procedure long title of subject id 81923?
SELECT demographic.dob, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "81923"
mimicsql_data
CREATE TABLE table_75782 ( "Capital/Region" text, "1997" real, "1998" real, "1999" real, "2000" real, "2001" real, "2002" real, "2003" real, "2004" real, "2005" real, "2006" real, "2007" real )
What is the average 2000 that has a 1997 greater than 34,6, a 2006 greater than 38,7, and a 2998 less than 76?
SELECT AVG("2000") FROM table_75782 WHERE "1997" > '34,6' AND "2006" > '38,7' AND "1998" < '76'
wikisql
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...
医疗就诊41840554876中统筹基金的支出占全部医疗费总额的比例是多少?
SELECT (SELECT OVE_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '41840554876') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '41840554876')
css
CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Staff ( staff_id INTEGER, staff_gende...
How many customers use each payment method, show the total number from low to high order.
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_95 ( away_team VARCHAR, tie_no VARCHAR, home_team VARCHAR )
Who was the away team in a tie no larger than 16 with forest green rovers at home?
SELECT away_team FROM table_name_95 WHERE tie_no > 16 AND home_team = "forest green rovers"
sql_create_context
CREATE TABLE table_204_851 ( id number, "serial number" number, "river" text, "name" text, "area (km2)" number, "district" text, "co-ordinate" text, "altitude (m)" number )
what is the difference in altitude between thunakkadavu and peechi ?
SELECT ABS((SELECT "altitude (m)" FROM table_204_851 WHERE "name" = 'thunakkadavu') - (SELECT "altitude (m)" FROM table_204_851 WHERE "name" = 'peechi'))
squall
CREATE TABLE table_32736 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score of essendon when they were the away team?
SELECT "Away team score" FROM table_32736 WHERE "Away team" = 'essendon'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, ...
what is the average amount of the total hospital cost which involves hemochromatosis nec since 4 years ago?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hemochromatosis nec')) AND DATETIME(cost.chargetime) >= DATETIM...
mimic_iii
CREATE TABLE table_name_82 ( away_team VARCHAR, home_team VARCHAR )
What team played Hawthorn?
SELECT away_team FROM table_name_82 WHERE home_team = "hawthorn"
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 was the first height of patient 17667 this 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 = 17667)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'...
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
specify the details of procedure icd9 code 640
SELECT procedures.long_title FROM procedures WHERE procedures.icd9_code = "640"
mimicsql_data
CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) 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 Course ( CID VARCHAR(7), CName VARCHAR(40), ...
What are the number of the last names of female students, ordered by age descending?
SELECT LName, COUNT(LName) FROM Student WHERE Sex = "F" GROUP BY LName ORDER BY Age DESC
nvbench
CREATE TABLE table_73200 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "Television order" text )
what is the television order of the episode directed by ben jones, written by j. m. dematteis and originally aired on february6,2009
SELECT "Television order" FROM table_73200 WHERE "Directed by" = 'Ben Jones' AND "Written by" = 'J. M. DeMatteis' AND "Original air date" = 'February6,2009'
wikisql
CREATE TABLE table_61318 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text )
What was the result for the game on October 5?
SELECT "Result" FROM table_61318 WHERE "Date" = 'october 5'
wikisql
CREATE TABLE visitors ( tourist_id number, tourist_details text ) CREATE TABLE ref_attraction_types ( attraction_type_code text, attraction_type_description text ) CREATE TABLE museums ( museum_id number, museum_details text ) CREATE TABLE ref_hotel_star_ratings ( star_rating_code text, ...
Show the average price of hotels for different pet policy.
SELECT pets_allowed_yn, AVG(price_range) FROM hotels GROUP BY pets_allowed_yn
spider
CREATE TABLE table_name_90 ( gender VARCHAR, years VARCHAR, decile VARCHAR, area VARCHAR )
Which gender has a Decile of 8, an Area of taradale, and Years of 1 13?
SELECT gender FROM table_name_90 WHERE decile = 8 AND area = "taradale" AND years = "1–13"
sql_create_context
CREATE TABLE table_name_31 ( chassis VARCHAR, year INTEGER )
which chassis were in use prior to 1988?
SELECT chassis FROM table_name_31 WHERE year < 1988
sql_create_context
CREATE TABLE table_name_17 ( pick INTEGER, round VARCHAR, player VARCHAR )
What is the pick number later than round 1, for Reyshawn Terry?
SELECT AVG(pick) FROM table_name_17 WHERE round > 1 AND player = "reyshawn terry"
sql_create_context
CREATE TABLE table_name_50 ( high_rebounds VARCHAR, high_points VARCHAR )
Which High rebounds have High points of chris bosh (18)?
SELECT high_rebounds FROM table_name_50 WHERE high_points = "chris bosh (18)"
sql_create_context
CREATE TABLE table_78106 ( "Date" text, "Winning Team" text, "Losing Team" text, "Score" text, "Venue" text )
what was the score on june 29?
SELECT "Score" FROM table_78106 WHERE "Date" = 'june 29'
wikisql
CREATE TABLE table_name_94 ( head_coach VARCHAR, team VARCHAR )
Who is the head coach for the team, arminia bielefeld?
SELECT head_coach FROM table_name_94 WHERE team = "arminia bielefeld"
sql_create_context
CREATE TABLE table_70197 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
Which class has a city of Richmond, Virginia?
SELECT "Class" FROM table_70197 WHERE "City of license" = 'richmond, virginia'
wikisql
CREATE TABLE table_2410 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
When 24:31 is the run time how many millions of viewers are there?
SELECT "Viewers (in millions)" FROM table_2410 WHERE "Run time" = '24:31'
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 ) ...
what is the number of patients whose age is less than 79 and days of hospital stay is greater than 27?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "79" AND demographic.days_stay > "27"
mimicsql_data
CREATE TABLE address ( city_id VARCHAR ) CREATE TABLE city ( city VARCHAR, city_id VARCHAR )
Which city has the most addresses? List the city name, number of addresses, and city id.
SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
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 int, dual_carrier text, flight_days text, flight_id int, flight_number...
please list available ground transportation in PITTSBURGH
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_name_30 ( matches INTEGER, goals VARCHAR, average VARCHAR )
What is the total of Matches with Goals of 18, and an Average larger than 0.55?
SELECT SUM(matches) FROM table_name_30 WHERE goals = 18 AND average > 0.55
sql_create_context
CREATE TABLE table_79705 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real )
What's Bulgaria's lane with a time more than 21.55?
SELECT SUM("Lane") FROM table_79705 WHERE "Nationality" = 'bulgaria' AND "Time" > '21.55'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
叫做花和豫的这个病人在09年1月20日到2018年27期间一共被开出了多少次的药品904255?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '花和豫' AND t_kc22.STA_DATE BETWEEN '2009-01-20' AND '2018-02-07' AND t_kc22.SOC_SRT_DIRE_CD = '904255'
css
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
查询出院诊断为牙体缺损的最少和最多医疗费总额,主要针对医院2100333的医疗记录
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2100333' AND t_kc21.OUT_DIAG_DIS_NM = '牙体缺损')
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 ) ...
what is maximum age of patients whose marital status is divorced and gender is f?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "F"
mimicsql_data
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImage...
Top Perl users from World - Query by Chankey Pathak.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE table_74092 ( "Episode" text, "Date" text, "Official ITV1 rating (millions)" text, "Weekly rank" real, "Share (%)" text, "Official ITV1 HD rating (millions)" text, "Total ITV1 viewers (millions)" text )
What was the official ITV1 HD rating in millions for the episode that had an official ITV1 rating of 8.98 million?
SELECT "Official ITV1 HD rating (millions)" FROM table_74092 WHERE "Official ITV1 rating (millions)" = '8.98'
wikisql
CREATE TABLE table_name_77 ( team VARCHAR, qual_1 VARCHAR )
What is the name of the team with a qual 1 time of 1:17.481?
SELECT team FROM table_name_77 WHERE qual_1 = "1:17.481"
sql_create_context
CREATE TABLE table_name_3 ( laps INTEGER, grid VARCHAR, time_retired VARCHAR )
What is the high lap total that has a grid of less than 4 and a Time/Retired of + 1 lap?
SELECT MAX(laps) FROM table_name_3 WHERE grid < 4 AND time_retired = "+ 1 lap"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
从二00五年十一月二十七日到二0一二年四月二十一日这段时间内,参保人韦新霁十元以内小金额结算的次数有多少
SELECT COUNT(*) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '韦新霁' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-11-27' AND '2012-04-21' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.P...
css
CREATE TABLE table_name_25 ( background_colour VARCHAR, border VARCHAR, type_of_sign VARCHAR )
What is the color of the background of the white border and sign of information?
SELECT background_colour FROM table_name_25 WHERE border = "white" AND type_of_sign = "information"
sql_create_context
CREATE TABLE table_name_75 ( school VARCHAR, player VARCHAR )
What school did Conor Jackson attend?
SELECT school FROM table_name_75 WHERE player = "conor jackson"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
compared to last measured on the first intensive care unit visit, was patient 008-10139's sao2 less than the value first measured on the first intensive care unit visit?
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-10139') AND NOT patient.unitdischargetime IS NULL ...
eicu
CREATE TABLE table_name_10 ( tries VARCHAR, date VARCHAR )
What were the tries on 14/6/97?
SELECT tries FROM table_name_10 WHERE date = "14/6/97"
sql_create_context
CREATE TABLE table_name_99 ( country VARCHAR )
What is the sum of participants in 2013 for Russia when there were 5 in 2010 and less than 4 in 2012?
SELECT SUM(2013) FROM table_name_99 WHERE 2010 = 5 AND country = "russia" AND 2012 < 4
sql_create_context
CREATE TABLE table_10756 ( "Year" real, "Location" text, "Champion" text, "Second" text, "Third" text )
Who was the winner the year Ramona Rahnis finished 2nd and Diana Sartor 3rd?
SELECT "Champion" FROM table_10756 WHERE "Second" = 'ramona rahnis' AND "Third" = 'diana sartor'
wikisql
CREATE TABLE table_62732 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total rank for the player with less than 2 silvers, 4 golds, and more than 2 bronze?
SELECT COUNT("Rank") FROM table_62732 WHERE "Silver" < '2' AND "Gold" = '4' AND "Bronze" > '2'
wikisql
CREATE TABLE table_17596418_5 ( country VARCHAR, loan_club VARCHAR )
what ist he country where the loan club is fulham?
SELECT country FROM table_17596418_5 WHERE loan_club = "Fulham"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
had there been any organism found in the last other microbiology test of patient 031-22988 when they visited the hospital last time?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp...
eicu
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
在05年8月5日到20年8月30日期间的患者37414336全部检验结果指标记录的检测人是82292587的检验指标流水号各是多少?
(SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE h...
css
CREATE TABLE table_28201 ( "Date" text, "Tournament" text, "Location" text, "Purse ( $ )" real, "Winner" text, "Score" text, "1st Prize ( $ )" text )
Name the total number of dates for toshiba classic
SELECT COUNT("Date") FROM table_28201 WHERE "Tournament" = 'Toshiba Classic'
wikisql
CREATE TABLE Customers_cards ( customer_id VARCHAR ) CREATE TABLE Customers ( customer_first_name VARCHAR, customer_id VARCHAR )
Show the customer ids and firstname without a credit card.
SELECT customer_id, customer_first_name FROM Customers EXCEPT SELECT T1.customer_id, T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE card_type_code = "Credit"
sql_create_context
CREATE TABLE table_35502 ( "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Venue" text )
Who was the home team on September 20, 1998 at Spartan Stadium?
SELECT "Home Team" FROM table_35502 WHERE "Venue" = 'spartan stadium' AND "Date" = 'september 20, 1998'
wikisql
CREATE TABLE table_name_66 ( rank VARCHAR, event VARCHAR )
What is Rank, when Event is 'LAPT4 S o Paulo'?
SELECT rank FROM table_name_66 WHERE event = "lapt4 são paulo"
sql_create_context
CREATE TABLE table_name_78 ( wins VARCHAR, series VARCHAR, position VARCHAR )
How many wins have a Series of formula nippon, and a Position of 8th?
SELECT wins FROM table_name_78 WHERE series = "formula nippon" AND position = "8th"
sql_create_context
CREATE TABLE table_10712301_5 ( licence_award_date VARCHAR, region VARCHAR )
What is the license award date for North East England?
SELECT licence_award_date FROM table_10712301_5 WHERE region = "North East England"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
患者彭金鑫出院诊断疾病名称不包含精神的在医院2214743的医疗就诊记录是什么编号?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '彭金鑫' AND t_kc21.MED_SER_ORG_NO = '2214743' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%精神%'
css
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Facilities ( apt_id I...
What is the booking start dates of the apartments with type code 'Duplex'? Bin the year into weekday interval with a bar chart, show by the y-axis in descending.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date) DESC
nvbench
CREATE TABLE table_40694 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text )
Peterson Gym is in what city?
SELECT "City" FROM table_40694 WHERE "Venue" = 'peterson gym'
wikisql
CREATE TABLE table_name_85 ( team VARCHAR, round VARCHAR, pole_position VARCHAR )
Before round 9, when Takashi Kogure held pole position, who was the team?
SELECT team FROM table_name_85 WHERE round < 9 AND pole_position = "takashi kogure"
sql_create_context
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
从00年3月11日直到2001年6月23日之间医疗机构8880467处理的新生儿门诊的就诊次数一共是多少次?
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '8880467' AND zzmzjzjlb.JZKSRQ BETWEEN '2000-03-11' AND '2001-06-23' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '8880467' AND fzzmzjzjlb.JZKSRQ BETWEEN '2000-03-11' AND '2001-06-23' AND fzzmzjzjlb.ZSEBZ > 0
css
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
How many questions have people with over 100,000 rep answered?.
SELECT DisplayName FROM Users WHERE Reputation >= 100000
sede
CREATE TABLE table_19072602_1 ( match_no INTEGER, team_usa VARCHAR )
What's the match number where Bill Hoffman plays for Team USA?
SELECT MIN(match_no) FROM table_19072602_1 WHERE team_usa = "Bill Hoffman"
sql_create_context
CREATE TABLE table_name_64 ( season INTEGER, venue VARCHAR, drivers VARCHAR )
What is the average Season when the venue was circuit de nevers magny-cours, and Drivers was more than 30?
SELECT AVG(season) FROM table_name_64 WHERE venue = "circuit de nevers magny-cours" AND drivers > 30
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW te...
患者98927870为检测指标229548从06年10月2日到2011年7月16日之内的医务人员工号与姓名都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_35246 ( "Distance" text, "Event" text, "Record" text, "Nationality" text, "Year" real, "Location" text )
Which nationality's distance was 500m before 2012, when the record was 1:37.071s?
SELECT "Nationality" FROM table_35246 WHERE "Distance" = '500m' AND "Year" < '2012' AND "Record" = '1:37.071s'
wikisql
CREATE TABLE table_41211 ( "Year" real, "Film" text, "Director" text, "Producer" text, "Writer" text )
Who is the writer of the film Run?
SELECT "Writer" FROM table_41211 WHERE "Film" = 'run'
wikisql
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 demographic (...
Give me the number of patients diagnosed with uncontrolled diabetes with ketoacidosis type i (juvenile type) who are younger than 43 years of age.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.long_title = "Diabetes with ketoacidosis, type I [juvenile type], uncontrolled"
mimicsql_data
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Find edit by a user with text.
SELECT PostId AS "post_link", * FROM PostHistory WHERE UserId = '##userId:int##' AND Text LIKE '%' + '##text##' + '%'
sede
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
Is it essential that I have ORALPATH 699 for my graduation ?
SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'ORALPATH' AND course.number = 699 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_23133482_1 ( games_w_l VARCHAR, player VARCHAR )
What are Arthur Ashe's games w-l?
SELECT games_w_l FROM table_23133482_1 WHERE player = "Arthur Ashe"
sql_create_context
CREATE TABLE table_56835 ( "Name" text, "COSPAR ID SATCAT \u2116" text, "Launch date (UTC)" text, "Launch vehicle" text, "Launch site" text, "Launch designation" text, "Longitude" text )
What is the COSPAR ID of the satellite with a titan iv(401)a launch vehicle?
SELECT "COSPAR ID SATCAT \u2116" FROM table_56835 WHERE "Launch vehicle" = 'titan iv(401)a'
wikisql
CREATE TABLE table_67137 ( "Strong's #" real, "Hebrew word" text, "Strong's Transliteration" text, "Strong's Words Compounded" text, "English Spelling" text )
What's the english word joshaphat in Strong's Transliteration?
SELECT "Strong's Transliteration" FROM table_67137 WHERE "English Spelling" = 'joshaphat'
wikisql
CREATE TABLE table_22098 ( "Rank" real, "Airport Name" text, "Location" text, "IATA Code" text, "Passengers" text, "% Chg. 2009/10" text )
If the amount of passengers is 15,505,566, what is the %/chg. for 2009/10?
SELECT "% Chg. 2009/10" FROM table_22098 WHERE "Passengers" = '15,505,566'
wikisql
CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE ref_product_categories ( product_category_code text...
How many characteristics does the product named 'laurel' have?
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "laurel"
spider
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int )
Show the musical nominee with award 'Bob Fosse' or 'Cleavant Derricks', and count them by a pie chart
SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee
nvbench
CREATE TABLE table_54466 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text, "Streak" text )
What is the record loss of R. Springer?
SELECT "Record" FROM table_54466 WHERE "Loss" = 'r. springer'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
did any 1 each vial : alteplase 2 mg ij solr ever been prescribed to patient 021-198501 since 2 years ago?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-198501')) AND medication.drugname = '1 each vial : alteplase 2 mg ij s...
eicu
CREATE TABLE table_629 ( "Tag ID" text, "Application" text, "Torque Rating" real, "1st" text, "2nd" text, "3rd" text, "4th" text, "5th" text, "6th" text, "Rev" text, "Input Splines" real, "Output Splines" real )
What application has a 6th ratio of 0.50:1 and 350 as a torque rating?
SELECT "Application" FROM table_629 WHERE "6th" = '0.50:1' AND "Torque Rating" = '350'
wikisql
CREATE TABLE table_name_78 ( byes VARCHAR, against VARCHAR, losses VARCHAR, sunrayia_fl VARCHAR )
What are the total byes for the Red Cliffs with more than 4 losses and more than 2422 against?
SELECT COUNT(byes) FROM table_name_78 WHERE losses > 4 AND sunrayia_fl = "red cliffs" AND against > 2422
sql_create_context
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_...
Show the relationship between account name and account id in a scatter chart.
SELECT account_id, account_name FROM Accounts
nvbench
CREATE TABLE table_74132 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
What is the highest amount of points?
SELECT MAX("Points") FROM table_74132
wikisql
CREATE TABLE table_name_68 ( capacity VARCHAR, name VARCHAR )
what is the capacity when the name is 1.2 16v?
SELECT capacity FROM table_name_68 WHERE name = "1.2 16v"
sql_create_context
CREATE TABLE table_20092 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" text, "Acquisition via" text )
Which school/club team has a player named Mark Sanford?
SELECT "School/Club Team" FROM table_20092 WHERE "Name" = 'Mark Sanford'
wikisql
CREATE TABLE table_26317 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
What was the production code for the episode directed by Michael Morris?
SELECT MIN("Production code") FROM table_26317 WHERE "Directed by" = 'Michael Morris'
wikisql
CREATE TABLE table_name_21 ( driver VARCHAR, capacity VARCHAR, total_time VARCHAR )
Which Driver has a Capacity smaller than 5700, and a Total Time of 08:29?
SELECT driver FROM table_name_21 WHERE capacity < 5700 AND total_time = "08:29"
sql_create_context
CREATE TABLE table_name_58 ( formed_from VARCHAR, type VARCHAR )
Name the formed that has type of 4-cor
SELECT formed_from FROM table_name_58 WHERE type = "4-cor"
sql_create_context
CREATE TABLE table_name_12 ( location VARCHAR, novelty VARCHAR )
What is the Location when the novelty is gen?
SELECT location FROM table_name_12 WHERE novelty = "gen"
sql_create_context
CREATE TABLE table_name_58 ( opponent VARCHAR, season VARCHAR, final_score VARCHAR )
What was the opponent in the 2008 09 season, with a final score of 2 3 l?
SELECT opponent FROM table_name_58 WHERE season = "2008–09" AND final_score = "2–3 l"
sql_create_context
CREATE TABLE table_17120964_5 ( man_of_the_match VARCHAR, date VARCHAR )
Name the man of the match for 24th
SELECT man_of_the_match FROM table_17120964_5 WHERE date = "24th"
sql_create_context
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
what are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?
SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000
nvbench