context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid num...
has tpn d17.5 been administered to patient 29666 in 04/this year?
SELECT COUNT(*) > 0 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 = 29666)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d17....
mimic_iii
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...
how many patients are below 51 years of age and admitted before the year 2177?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "51" AND demographic.admityear < "2177"
mimicsql_data
CREATE TABLE table_name_46 ( loser VARCHAR, result VARCHAR, winner VARCHAR, location VARCHAR )
What is the name of the Loser when the winner was new england patriots, and a Location of giants stadium, and a Result of 30 28?
SELECT loser FROM table_name_46 WHERE winner = "new england patriots" AND location = "giants stadium" AND result = "30–28"
sql_create_context
CREATE TABLE table_name_81 ( drawn VARCHAR, team VARCHAR, lost VARCHAR )
How many draws took place for team Corinthians with more than 5 losses?
SELECT COUNT(drawn) FROM table_name_81 WHERE team = "corinthians" AND lost > 5
sql_create_context
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, ...
list the number of newborn patients who are female.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "NEWBORN"
mimicsql_data
CREATE TABLE table_name_34 ( season INTEGER, runner_s__up VARCHAR )
What was the season that the runner -up was Tenley Molzahn?
SELECT SUM(season) FROM table_name_34 WHERE runner_s__up = "tenley molzahn"
sql_create_context
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, give me the comparison about the average of manufacturer over the founder , and group by attribute founder by a bar chart, and could you sort Y-axis in ascending order?
SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Manufacturer)
nvbench
CREATE TABLE table_name_17 ( score VARCHAR, attendance VARCHAR )
What was the score when 2441 people were in attendance?
SELECT score FROM table_name_17 WHERE attendance = 2441
sql_create_context
CREATE TABLE table_19744915_3 ( scoreboard VARCHAR, karen VARCHAR )
what is the scoreboard when karen was 4.5
SELECT scoreboard FROM table_19744915_3 WHERE karen = "4.5"
sql_create_context
CREATE TABLE table_name_57 ( name VARCHAR, length VARCHAR )
Which name is 51.89 (2.043) long?
SELECT name FROM table_name_57 WHERE length = "51.89 (2.043)"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is days of hospital stay of subject id 1121?
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "1121"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what is the number of days elapsed since patient 033-22108's intensive care unit admission?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '033-22108' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE table_4845 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the highest crowd size at Windy Hill?
SELECT MAX("Crowd") FROM table_4845 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_49089 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of Rank, when Bronze is less than 1, when Nation is Switzerland (SUI), and when Total is less than 2?
SELECT SUM("Rank") FROM table_49089 WHERE "Bronze" < '1' AND "Nation" = 'switzerland (sui)' AND "Total" < '2'
wikisql
CREATE TABLE table_21093403_1 ( locale VARCHAR, shot_pct VARCHAR )
Where was the shot pct 78?
SELECT locale FROM table_21093403_1 WHERE shot_pct = 78
sql_create_context
CREATE TABLE table_51848 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the average grid that has a Constructor of brm, tony maggs, and a Laps larger than 102?
SELECT AVG("Grid") FROM table_51848 WHERE "Constructor" = 'brm' AND "Driver" = 'tony maggs' AND "Laps" > '102'
wikisql
CREATE TABLE table_79941 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
Which label is dated February 14, 2002?
SELECT "Label" FROM table_79941 WHERE "Date" = 'february 14, 2002'
wikisql
CREATE TABLE table_18244 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
In the district called Tennessee 6, how many in total of first elected are there?
SELECT COUNT("First elected") FROM table_18244 WHERE "District" = 'Tennessee 6'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
Give the number of patietns whose religion is Romanian East. Orth and who were born before the year the 2078.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "ROMANIAN EAST. ORTH" AND demographic.dob_year < "2078"
mimicsql_data
CREATE TABLE table_name_65 ( round INTEGER, nationality VARCHAR, overall VARCHAR )
What is the total round with an overall of 199 with sweden?
SELECT SUM(round) FROM table_name_65 WHERE nationality = "sweden" AND overall = 199
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
what are the hospital admission times of patient 015-100195 in 2105?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '015-100195' AND STRFTIME('%y', patient.hospitaladmittime) = '2105'
eicu
CREATE TABLE table_29314 ( "Stage" real, "Stage winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Asian rider classification" text, "Team classification" text )
Which mountains classification is listed under stage 3?
SELECT "Mountains classification" FROM table_29314 WHERE "Stage" = '3'
wikisql
CREATE TABLE table_20248 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Name the 20 questions for 8-04
SELECT "20 Questions" FROM table_20248 WHERE "Date" = '8-04'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
这个被门诊诊断为疾病F42.715的患者的检测指标677145参考值范围的下限与上限是什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE table_13030 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Which Outcome has a Score in the final of 3 6, 1 6?
SELECT "Outcome" FROM table_13030 WHERE "Score in the final" = '3–6, 1–6'
wikisql
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, ...
从06年2月1日起,截止到07年12月20日,有多少科室在5659309这个医院涉及的医疗费总额不多于6358.78元
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5659309' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-02-01' AND '2007-12-20' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 6358.78 UNION SELECT fgwyjzb...
css
CREATE TABLE table_77289 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School" text )
Who was the player who was pick number 147?
SELECT "Player" FROM table_77289 WHERE "Pick" = '147'
wikisql
CREATE TABLE table_train_227 ( "id" int, "gender" string, "diabetic" string, "allergic_to_study_products" bool, "hba1c" float, "a1c" float, "age" float, "NOUSE" float )
have an hba1c lvel < 9 % at screening
SELECT * FROM table_train_227 WHERE hba1c < 9
criteria2sql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of manager_id over hire_date .
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, d...
What are the dates in which the mean sea level pressure was between 303 and 31, and count them by a bar chart, order in ascending by the Y-axis.
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date)
nvbench
CREATE TABLE table_6005 ( "Release date" text, "Country" text, "Classifaction" text, "Publisher" text, "Format" text, "Region" text, "Language" text, "Sound" text, "Subtitles" text )
What country has deltamac (hk) as the publisher?
SELECT "Country" FROM table_6005 WHERE "Publisher" = 'deltamac (hk)'
wikisql
CREATE TABLE table_name_74 ( league_cup_apps INTEGER, league_cup_goals VARCHAR, name VARCHAR )
What's the most league cup apps for Jimmy Lawson having 0 league cup goals?
SELECT MAX(league_cup_apps) FROM table_name_74 WHERE league_cup_goals = 0 AND name = "jimmy lawson"
sql_create_context
CREATE TABLE table_2511876_1 ( reg_season VARCHAR, year VARCHAR )
Mame the reg season for 2001
SELECT reg_season FROM table_2511876_1 WHERE year = 2001
sql_create_context
CREATE TABLE table_72454 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "2007 Result" text )
How many election results are there from the 19th district?
SELECT COUNT("2007 Result") FROM table_72454 WHERE "District" = '19th'
wikisql
CREATE TABLE table_name_55 ( marplan VARCHAR, gallup VARCHAR )
What is Marplan, when Gallup is 1.5%
SELECT marplan FROM table_name_55 WHERE gallup = "1.5%"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在门诊诊断为疾病X60.562的患者身上其抗凝血酶III的参考值范围下限和上限具体为多少数值?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'X60.562' AND jyjgzbb.JCZBMC = '抗凝血酶III'
css
CREATE TABLE table_15366768_1 ( element VARCHAR, isotopic_mass___u__ VARCHAR )
What is the name of the element with isotopic mass of 158.925 34(2)?
SELECT element FROM table_15366768_1 WHERE isotopic_mass___u__ = "158.925 34(2)"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
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 intakeoutput ( in...
how old is patient 006-50368 on their first hospital encounter?
SELECT patient.age FROM patient WHERE patient.uniquepid = '006-50368' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
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...
在2013年8月20日到2016年5月24日期间病患金新翰在医疗机构3186559做过的检查有多少次?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '金新翰' AND t_kc22.STA_DATE BETWEEN '2013-08-20' AND '2016-05-24' AND t_kc21.MED_SER_ORG_NO = '3186559' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_10 ( year_joined INTEGER, location VARCHAR )
When did crawfordsville join?
SELECT MAX(year_joined) FROM table_name_10 WHERE location = "crawfordsville"
sql_create_context
CREATE TABLE table_name_86 ( season VARCHAR, player VARCHAR )
In what season did Bob Pratt play?
SELECT season FROM table_name_86 WHERE player = "bob pratt"
sql_create_context
CREATE TABLE table_69735 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the least bronze for silver being less than 0
SELECT MIN("Bronze") FROM table_69735 WHERE "Silver" < '0'
wikisql
CREATE TABLE table_991 ( "Name" text, "Population (2002 census)" real, "Population (2007 estimation)" real, "Population (2011 census)" real, "Area (km\u00b2)" text, "Density (pop/km\u00b2)" text )
What is the area in kilometers squared the population density is 137.61?
SELECT "Area (km\u00b2)" FROM table_991 WHERE "Density (pop/km\u00b2)" = '137.61'
wikisql
CREATE TABLE table_54013 ( "Round" text, "Pick" text, "Player" text, "Position" text, "Nationality" text, "Team" text, "College" text )
What round has a position of F/C from Iowa College?
SELECT "Round" FROM table_54013 WHERE "Position" = 'f/c' AND "College" = 'iowa'
wikisql
CREATE TABLE table_32555 ( "Week" text, "Date" text, "Location" text, "Opponent" text, "Result" text )
When does week 11 start?
SELECT "Date" FROM table_32555 WHERE "Week" = '11'
wikisql
CREATE TABLE table_55259 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Which tournament had a score of 6 4, 4 6, 7 5?
SELECT "Tournament" FROM table_55259 WHERE "Score" = '6–4, 4–6, 7–5'
wikisql
CREATE TABLE table_69701 ( "Date" text, "Opponents" text, "Result F\u2013A" text, "Attendance" real, "Group position" text )
Result F A of 5 0 had what group position?
SELECT "Group position" FROM table_69701 WHERE "Result F\u2013A" = '5–0'
wikisql
CREATE TABLE table_name_59 ( area__km_2__ INTEGER, population__2011_ VARCHAR )
What is the sum of the area in km with a population of 110 in 2011?
SELECT SUM(area__km_2__) FROM table_name_59 WHERE population__2011_ = 110
sql_create_context
CREATE TABLE table_58834 ( "7:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "2:30 pm" text, "3:30 pm" text, "4:30 pm" text, "5:00 pm" text, "6:30 pm" text )
What shows for 3:30 pm when 2:00 pm is local programs?
SELECT "6:30 pm" FROM table_58834 WHERE "2:00 pm" = 'local programs'
wikisql
CREATE TABLE table_44916 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
What was the highest attendance against Real Juventud?
SELECT MAX("Attendance") FROM table_44916 WHERE "Away" = 'real juventud'
wikisql
CREATE TABLE table_68906 ( "Rank" real, "Country/Region" text, "Population" real, "Area (km 2 )" real, "Density (Pop. per km 2 )" real )
What is the rank of the region with an area larger than 41,526, a density greater than 345, and a population larger than 48,456,369?
SELECT COUNT("Rank") FROM table_68906 WHERE "Area (km 2 )" > '41,526' AND "Density (Pop. per km 2 )" > '345' AND "Population" > '48,456,369'
wikisql
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
For each phone, show its names and total number of stocks Visualize by bar chart, and rank by the bars in desc please.
SELECT Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name ORDER BY Name DESC
nvbench
CREATE TABLE table_name_16 ( first_us_tour_cast VARCHAR, original_broadway_cast VARCHAR )
What shows as the First US Tour Cast when the Original Broadway Cast was Sarah Bolt?
SELECT first_us_tour_cast FROM table_name_16 WHERE original_broadway_cast = "sarah bolt"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
count the number of patients who received physical therapy consult within 2 months after being diagnosed until 2103 with atelectasis/collapse.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atelectasis/collapse' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2103') AS t1 JOIN (SELECT patient.uniq...
eicu
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, find name and the sum of revenue , and group by attribute name, and visualize them by a bar chart, I want to sort Y-axis in asc order.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE channel ( channel_id number, name text, owner text, share_in_percent number, rating_in_percent number ) CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE program ( program_id number, name text, origin text, launc...
find the name of the program that was launched most recently.
SELECT name FROM program ORDER BY launch DESC LIMIT 1
spider
CREATE TABLE table_19662 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Name the womens singles for raina tzvetkova petya nedelcheva
SELECT "Womens singles" FROM table_19662 WHERE "Womens doubles" = 'Raina Tzvetkova Petya Nedelcheva'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name te...
Find first undeleted question on a site.
SELECT MIN(Id) AS "post_link" FROM Posts
sede
CREATE TABLE table_204_910 ( id number, "rank" number, "name" text, "nationality" text, "result" number, "notes" text )
how long was manisha dey 's jump ?
SELECT "result" FROM table_204_910 WHERE "name" = 'manisha dey'
squall
CREATE TABLE table_name_88 ( place VARCHAR, country VARCHAR, player VARCHAR )
Which place has United States as the country and Craig Wood as the player?
SELECT place FROM table_name_88 WHERE country = "united states" AND player = "craig wood"
sql_create_context
CREATE TABLE table_name_12 ( opponent VARCHAR, record VARCHAR )
Which Opponent has a Record of 65-95?
SELECT opponent FROM table_name_12 WHERE record = "65-95"
sql_create_context
CREATE TABLE table_42171 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the greatest position when the points are less than 21, and the played greater than 14?
SELECT MAX("Position") FROM table_42171 WHERE "Points" < '21' AND "Played" > '14'
wikisql
CREATE TABLE table_19018191_5 ( l_g VARCHAR, player VARCHAR )
Name the lg for ermengol
SELECT l_g FROM table_19018191_5 WHERE player = "Ermengol"
sql_create_context
CREATE TABLE table_62996 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
Which college did the player who went to the Boston Patriots go to?
SELECT "College" FROM table_62996 WHERE "Team" = 'boston patriots'
wikisql
CREATE TABLE table_11888 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
In the game where the home team is collingwood, what is the score of the away team?
SELECT "Away team score" FROM table_11888 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
count the number of patients whose year of death is less than or equal to 2148 and procedure long title is other percutaneous procedures on biliary tract?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2148.0" AND procedures.long_title = "Other percutaneous procedures on biliary tract"
mimicsql_data
CREATE TABLE table_1290 ( "Airline" text, "ICAO" text, "IATA" text, "Callsign" text, "Commenced operations" real, "Fleet size" real, "Headquarters" text )
What is the fleet size of the airline which has a callsign of cool red?
SELECT MIN("Fleet size") FROM table_1290 WHERE "Callsign" = 'COOL RED'
wikisql
CREATE TABLE table_30431 ( "Club name" text, "Name of team song" text, "Basis for team song" text, "First used as team song" text, "Writer/composer" text )
Name the team that has a song writer named larry spokes.
SELECT "Club name" FROM table_30431 WHERE "Writer/composer" = 'Larry Spokes'
wikisql
CREATE TABLE table_train_256 ( "id" int, "mini_mental_state_examination_mmse" int, "language" string, "mild_cognitive_impairment" bool, "moca_score" int, "dementia" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
bmi 20 _ 30 kg / m2
SELECT * FROM table_train_256 WHERE body_mass_index_bmi >= 20 AND body_mass_index_bmi <= 30
criteria2sql
CREATE TABLE table_204_421 ( id number, "name" text, "nationality" text, "position" text, "spartak career" text, "appearances" number, "goals" number )
which player has the highest number of goals ?
SELECT "name" FROM table_204_421 ORDER BY "goals" DESC LIMIT 1
squall
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number,...
What are the most viewed questions for a given multiple tags with time range?.
SELECT TOP(100) AS ViewCount, Score, Tags, Id AS "post_link" FROM Posts WHERE Id IN (SELECT PostId FROM PostTags WHERE TagId IN ((SELECT Id FROM Tags WHERE TagName IN (@TagString1, @TagString2)))) AND CreationDate > GETDATE() - '##Days##' AND CreationDate < GETDATE() - '##Olddays##' ORDER BY ViewCount DESC
sede
CREATE TABLE table_11254821_2 ( points_awarded__platinum_ INTEGER, points_awarded__gold_ VARCHAR )
How many platinum points were awarded when 6 gold points were awarded?
SELECT MAX(points_awarded__platinum_) FROM table_11254821_2 WHERE points_awarded__gold_ = 6
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
门诊给08451089这个病人诊断为高血压病,看看编号为516626的这个检测指标的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.Y...
css
CREATE TABLE table_41499 ( "Tournament" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text )
What tournament has q2 as the 2004?
SELECT "Tournament" FROM table_41499 WHERE "2004" = 'q2'
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...
Show me about the distribution of ACC_Regular_Season and All_Games_Percent in a bar chart, and could you order in desc by the names please?
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC
nvbench
CREATE TABLE table_name_95 ( rank INTEGER, points INTEGER )
What is the rank of the player with less than 34 points?
SELECT SUM(rank) FROM table_name_95 WHERE points < 34
sql_create_context
CREATE TABLE table_name_38 ( opponent VARCHAR, result VARCHAR )
What was the Opponent in the game with a Result of L 24 14?
SELECT opponent FROM table_name_38 WHERE result = "l 24–14"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, ...
Are there any courses I should take prior to taking MATSCIE 693 that would help me ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MATSCIE' AND number = 693
advising
CREATE TABLE table_31179 ( "Athlete" text, "Event" text, "Elimination Poule" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text, "Final" text )
What was the round of 16 result for felipe saucedo?
SELECT "Round of 16" FROM table_31179 WHERE "Athlete" = 'Felipe Saucedo'
wikisql
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
How many voting records do we have?
SELECT COUNT(*) FROM voting_record
spider
CREATE TABLE table_name_90 ( surface VARCHAR, score VARCHAR )
What was the surface of the game that resulted in a final score of 6-1 7-5?
SELECT surface FROM table_name_90 WHERE score = "6-1 7-5"
sql_create_context
CREATE TABLE table_23495048_2 ( height__mtr_ VARCHAR, contestant VARCHAR )
How many meters tall is Ulrike Wolful?
SELECT height__mtr_ FROM table_23495048_2 WHERE contestant = "Ulrike Wolful"
sql_create_context
CREATE TABLE table_name_18 ( week INTEGER, opponent VARCHAR )
What is the biggest week with an opponent of washington redskins?
SELECT MAX(week) FROM table_name_18 WHERE opponent = "washington redskins"
sql_create_context
CREATE TABLE table_203_13 ( id number, "year" number, "champion" text, "score" text, "runner-up" text, "coach" text )
how many years did boston college win with john kelley as coach ?
SELECT COUNT("year") FROM table_203_13 WHERE "champion" = 'boston college' AND "coach" = 'john "snooks" kelley'
squall
CREATE TABLE table_name_91 ( opponents VARCHAR, competition VARCHAR, score VARCHAR )
Who was the opponent at the League Cup competition with a score of 3-1?
SELECT opponents FROM table_name_91 WHERE competition = "league cup" AND score = "3-1"
sql_create_context
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 is the number of patients whose age is less than 31 and drug name is sodium fluoride (dental gel)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.drug = "Sodium Fluoride (Dental Gel)"
mimicsql_data
CREATE TABLE table_74148 ( "Institution" text, "Team" text, "City" text, "Province" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Endowment" text, "Football stadium" text, "Capacity" real )
What is the year founded for the team Dinos?
SELECT MAX("Founded") FROM table_74148 WHERE "Team" = 'Dinos'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id nu...
when was the last time on the first icu visit patient 24547 was measured for a arterial bp [diastolic] that was greater than 66.0?
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 = 24547) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (...
mimic_iii
CREATE TABLE Candidates ( candidate_id INTEGER, candidate_details VARCHAR(255) ) CREATE TABLE Courses ( course_id VARCHAR(100), course_name VARCHAR(120), course_description VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Candidate_Assessments ( candidate_id INTEGER, qualificati...
For all course_name from courses table, group by the course name and count them with a bar chart, and display Y-axis from high to low order.
SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY COUNT(course_name) DESC
nvbench
CREATE TABLE table_name_70 ( role VARCHAR, film VARCHAR )
What was the Last Samurai role?
SELECT role FROM table_name_70 WHERE film = "the last samurai"
sql_create_context
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...
医疗就诊48065637468对应的门诊号或者是住院号分别是什么?
SELECT t_kc21.CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '48065637468'
css
CREATE TABLE Settlements ( Amount_Settled INTEGER )
What is the total amount of settlement made for all the settlements?
SELECT SUM(Amount_Settled) FROM Settlements
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give me the number of patients whose gender is f?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F"
mimicsql_data
CREATE TABLE table_75067 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average for silver when bronze is less than 1, and gold is more than 0?
SELECT AVG("Silver") FROM table_75067 WHERE "Bronze" < '1' AND "Gold" > '0'
wikisql
CREATE TABLE table_10445 ( "Team" text, "Head Coach" text, "President" text, "Home Ground" text, "Location" text )
Who is the head coach of the team located in Mudgeeraba?
SELECT "Head Coach" FROM table_10445 WHERE "Location" = 'mudgeeraba'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose age is less than 85 and days of hospital stay is greater than 27?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "85" AND demographic.days_stay > "27"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
patient 006-50099 was prescribed furosemide 80 mg po tabs until 13 months 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 = '006-50099')) AND medication.drugname = 'furosemide 80 mg po tabs' AND DATE...
eicu
CREATE TABLE table_71901 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
For all games with calgary as home, what is the average number of attendees?
SELECT AVG("Attendance") FROM table_71901 WHERE "Home" = 'calgary'
wikisql
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, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
门诊给编号为63047610这个患者诊断为躁狂型分裂情感性障碍,看看超敏甲状腺球蛋白的结果定量还有单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '躁狂型分裂情感性障碍' AND hz_info....
css