context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_67 ( scores_by_each_individual_judge VARCHAR, status VARCHAR, co_contestant__yaar_vs_pyaar_ VARCHAR )
What Scores by each individual judge has a Status of current, and a Co-contestant (Yaar vs. Pyaar) of krushna abhishek?
SELECT scores_by_each_individual_judge FROM table_name_67 WHERE status = "current" AND co_contestant__yaar_vs_pyaar_ = "krushna abhishek"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
The long tail of answers. This is in response to this question on Statistics meta - http://meta.stats.stackexchange.com/q/2083/1036 I suspect our site still does not have a large number of users, comparing the tail to other sites
SELECT OwnerUserId, COUNT(*) AS TotalAnswers FROM Posts WHERE PostTypeId = 2 GROUP BY OwnerUserId ORDER BY TotalAnswers DESC
sede
CREATE TABLE table_45545 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text )
Which High points have a Record of 27 29?
SELECT "High points" FROM table_45545 WHERE "Record" = '27–29'
wikisql
CREATE TABLE table_name_51 ( height_ft__m_ VARCHAR, year VARCHAR )
How tall is the structure built in 1907?
SELECT height_ft__m_ FROM table_name_51 WHERE year = 1907
sql_create_context
CREATE TABLE table_18242 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What was the final result for Les Aspin?
SELECT "Result" FROM table_18242 WHERE "Incumbent" = 'Les Aspin'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
what were the five most commonly taken laboratory tests in a year before for patients aged 30s?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(labevents.chartti...
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
Calculate the maximum age of english speaking patients who have pituitary bleed as the primary disease.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "PITUITARY BLEED"
mimicsql_data
CREATE TABLE table_name_21 ( opponent VARCHAR, date VARCHAR )
Who is the Opponent on January 7?
SELECT opponent FROM table_name_21 WHERE date = "january 7"
sql_create_context
CREATE TABLE table_name_43 ( player VARCHAR, finish VARCHAR, country VARCHAR )
Which player from England finished in T41?
SELECT player FROM table_name_43 WHERE finish = "t41" AND country = "england"
sql_create_context
CREATE TABLE table_name_45 ( wins VARCHAR, races VARCHAR, titles VARCHAR )
What is the total number of wins for riders with fewer than 56 races and more than 0 titles?
SELECT COUNT(wins) FROM table_name_45 WHERE races < 56 AND titles > 0
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
从2001年6月3日开始2019年7月2日之内新生儿的门诊就诊记录数量在医疗机构2084494中一共有多少?
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '2084494' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-06-03' AND '2019-07-02' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '2084494' AND fzzmzjzjlb.JZKSRQ BETWEEN '2001-06-03' AND '2019-07-02' AND fzzmzjzjlb.ZSEBZ > 0
css
CREATE TABLE table_204_729 ( id number, "year" text, "show" text, "role" text, "channel" text, "notes" text )
what is the last show listed ?
SELECT "show" FROM table_204_729 ORDER BY id DESC LIMIT 1
squall
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 ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime tim...
show me patient 4092's total input on the last intensive care unit 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 = 4092) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1)
mimic_iii
CREATE TABLE table_name_9 ( home_team VARCHAR, away_team VARCHAR )
Who is the team that played away team watford?
SELECT home_team FROM table_name_9 WHERE away_team = "watford"
sql_create_context
CREATE TABLE table_name_15 ( date VARCHAR, attendance INTEGER )
On what date was the attendance more than 17,652?
SELECT date FROM table_name_15 WHERE attendance > 17 OFFSET 652
sql_create_context
CREATE TABLE table_55397 ( "English name" text, "Original name" text, "Area in km\u00b2" real, "Population at 2010 Census" real, "Number of settlements and villages" real )
There are less than 11 settlements in Kecamatan Bogor Tengah, what is the area in km ?
SELECT SUM("Area in km\u00b2") FROM table_55397 WHERE "Original name" = 'kecamatan bogor tengah' AND "Number of settlements and villages" < '11'
wikisql
CREATE TABLE table_21531764_2 ( senior_us_senator VARCHAR, governor VARCHAR )
Who was the senior US senator in the state whose governor was D. Patrick?
SELECT senior_us_senator FROM table_21531764_2 WHERE governor = "D. Patrick"
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...
在00年2月9日到00年5月14日期间,90720666的参保人门诊西药费有多少元
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '90720666' AND t_kc22.STA_DATE BETWEEN '2000-02-09' AND '2000-05-14' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_6 ( tournament VARCHAR, date VARCHAR )
Which Tournament has a Date of 22 january 1979?
SELECT tournament FROM table_name_6 WHERE date = "22 january 1979"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
Ljudi iz bosne na SO.
SELECT u.DisplayName, u.Location FROM Users AS u WHERE u.Location LIKE '%Bosnia%' ORDER BY u.Location
sede
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
4198073医院有多少科室在2005年1月17日到2012年1月10日期间的门诊就诊中开出了不超过30张检验报告单
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B...
css
CREATE TABLE table_16619 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Featured character(s)" text, "Original air date" text, "U.S. viewers (million)" text )
Which titles have 18.73 u.s. viewers.
SELECT "Title" FROM table_16619 WHERE "U.S. viewers (million)" = '18.73'
wikisql
CREATE TABLE table_name_35 ( played INTEGER, drawn VARCHAR, against VARCHAR )
What is the sum of Played when the drawn is less than 2 and against is more than 29?
SELECT SUM(played) FROM table_name_35 WHERE drawn < 2 AND against > 29
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 countries ( COUNTRY_ID...
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday, and sort by the Y-axis in desc.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
i need to RENTAL CAR at TAMPA
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'TAMPA' AND ground_service.airport_code = airport.airport_code AND ground_service.transport_type...
atis
CREATE TABLE table_name_27 ( fleet_size VARCHAR, easa__eu_ VARCHAR )
What is the Fleet Size when the EASA (EU) is no?
SELECT fleet_size FROM table_name_27 WHERE easa__eu_ = "no"
sql_create_context
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 procedures ( ...
what is the number of government health insurance patients who had biopsy of tonsils and adenoids procedure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Biopsy of tonsils and adenoids"
mimicsql_data
CREATE TABLE table_name_4 ( round VARCHAR, position VARCHAR, overall VARCHAR )
What is the total round for a wide receiver with an overall of more than 145?
SELECT COUNT(round) FROM table_name_4 WHERE position = "wide receiver" AND overall > 145
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...
what are the three most frequently ordered lab tests for patients that have already been diagnosed with pneumothorax during the same hospital visit, in 2103?
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumothorax' AND...
eicu
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, a scatter chart shows the correlation between manufacturer and revenue , and group by attribute name.
SELECT T1.Manufacturer, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
how many patients are diagnosed with primary disease gastrointestinal bleed and admitted before the year 2124?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND demographic.admityear < "2124"
mimicsql_data
CREATE TABLE table_39637 ( "Score" text, "Opposition" text, "Venue" text, "City" text, "Year" real )
What year was in Aigburth?
SELECT MAX("Year") FROM table_39637 WHERE "Venue" = 'aigburth'
wikisql
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
Please draw a bar chart to show the total number of different color, could you rank Y-axis from low to high order?
SELECT color, COUNT(color) FROM photos GROUP BY color ORDER BY COUNT(color)
nvbench
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Show the total number from each rank, and list the total number from high to low order.
SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_79665 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text )
What is the Team of Winner Mark Skaife in ATCC Round 7?
SELECT "Team" FROM table_79665 WHERE "Winner" = 'mark skaife' AND "Series" = 'atcc round 7'
wikisql
CREATE TABLE table_28872 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Who was the ran as an incumbent leader first in 1818?
SELECT "Incumbent" FROM table_28872 WHERE "First elected" = '1818'
wikisql
CREATE TABLE table_name_58 ( player VARCHAR, pick VARCHAR, round VARCHAR )
What Player was picked after Round 2 with a Pick number larger than 33?
SELECT player FROM table_name_58 WHERE pick > 33 AND round > 2
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
把2016年5月31日到2017年11月13日期间患者78050010总共花了多少医保金额查看一下
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '78050010' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-05-31' AND '2017-11-13'
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( i...
what are patient 002-44624's gender?
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '002-44624'
eicu
CREATE TABLE table_name_22 ( team_1 VARCHAR )
WHAT IS THE 2ND LEG WITH TEAM 1 OF SPORTING?
SELECT 2 AS nd_leg FROM table_name_22 WHERE team_1 = "sporting"
sql_create_context
CREATE TABLE table_name_63 ( name VARCHAR, region VARCHAR, date_of_reclassification VARCHAR )
WHose Name has a Region of kansai on 2012-04-01 ( core city )?
SELECT name FROM table_name_63 WHERE region = "kansai" AND date_of_reclassification = "2012-04-01 ( core city )"
sql_create_context
CREATE TABLE table_name_29 ( match_report VARCHAR, opponents VARCHAR, venue VARCHAR )
What is the match report for the game played at forthbank stadium against stirling albion?
SELECT match_report FROM table_name_29 WHERE opponents = "stirling albion" AND venue = "forthbank stadium"
sql_create_context
CREATE TABLE table_name_87 ( win__number INTEGER, points VARCHAR, winner VARCHAR, playoff_result VARCHAR )
What is the highest Win #, when Winner is 'Knoxville Cherokees', when Playoff Result is 'Lost 1st Round ( LOU )', and when Points is less than 94?
SELECT MAX(win__number) FROM table_name_87 WHERE winner = "knoxville cherokees" AND playoff_result = "lost 1st round ( lou )" AND points < 94
sql_create_context
CREATE TABLE table_64140 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" text )
What is the Location of the Competition with a Rank-Final of 10?
SELECT "Location" FROM table_64140 WHERE "Rank-Final" = '10'
wikisql
CREATE TABLE table_28438 ( "Sd" real, "Rk" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text )
What is the lowest points won from player victoria azarenka?
SELECT MIN("Points won") FROM table_28438 WHERE "Player" = 'Victoria Azarenka'
wikisql
CREATE TABLE table_name_70 ( frequency VARCHAR, state VARCHAR, call_sign VARCHAR )
What is the frequency of the radio station in Indiana that has a call sign of WGNR?
SELECT frequency FROM table_name_70 WHERE state = "indiana" AND call_sign = "wgnr"
sql_create_context
CREATE TABLE team ( name VARCHAR, team_id VARCHAR ) CREATE TABLE salary ( salary INTEGER, team_id VARCHAR )
What is the highest salary among each team? List the team name, id and maximum salary.
SELECT T1.name, T1.team_id, MAX(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id
sql_create_context
CREATE TABLE table_178381_1 ( parish__prestegjeld_ VARCHAR, church_name VARCHAR )
In what parish is the Askrova Bedehuskapell church?
SELECT parish__prestegjeld_ FROM table_178381_1 WHERE church_name = "Askrova bedehuskapell"
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...
从2003年7月21日开始至2018年7月27日结束医疗机构1161667的检查费一共花了多少元?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '1161667' AND t_kc22.STA_DATE BETWEEN '2003-07-21' AND '2018-07-27' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_18539 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What was the candidates for hardie scott
SELECT "Candidates" FROM table_18539 WHERE "Incumbent" = 'Hardie Scott'
wikisql
CREATE TABLE table_8786 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What country has 302 as the total?
SELECT "Country" FROM table_8786 WHERE "Total" = '302'
wikisql
CREATE TABLE table_19412902_2 ( pos INTEGER )
What is the lowest position?
SELECT MAX(pos) FROM table_19412902_2
sql_create_context
CREATE TABLE table_47277 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
WHAT IS THE 2010 PERFORMANCE THAT HAD 2009 0F 0, AND FINALS TOURNAMENT?
SELECT "2010" FROM table_47277 WHERE "2009" = '0' AND "Tournament" = 'finals'
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 minimum days of hospital stay of patients who were born after year 2066?
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2066"
mimicsql_data
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, ...
想知道被门诊诊断为K44.X89这个疾病的那些病人的籍贯代码、名称以及相应人数
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.JZZDBM = 'K44.X89' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE table_77242 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
What was the surface in 1996?
SELECT "Surface" FROM table_77242 WHERE "Year" = '1996'
wikisql
CREATE TABLE table_22500 ( "Athlete" text, "Class" text, "Event" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text, "Final/ Bronze medal match" text )
How many round of 32 results are followed by Polidori ( Ita ) w 6-1, 3-6, 6-3 in the round of 16?
SELECT COUNT("Round of 32") FROM table_22500 WHERE "Round of 16" = 'Polidori ( ITA ) W 6-1, 3-6, 6-3'
wikisql
CREATE TABLE table_67545 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
On October 1, 1995 with Dora Djilianova as a partner, what was the outcome of the match?
SELECT "Outcome" FROM table_67545 WHERE "Partner" = 'dora djilianova' AND "Date" = 'october 1, 1995'
wikisql
CREATE TABLE table_name_84 ( class VARCHAR, city_of_license VARCHAR )
What is the Class where City of license is lake oconee, ga?
SELECT class FROM table_name_84 WHERE city_of_license = "lake oconee, ga"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid ...
how many of the current patients are 30s?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 30 AND 39
eicu
CREATE TABLE table_name_63 ( laps INTEGER, time_retired VARCHAR, grid VARCHAR )
What is the average lap total for grids under 19 and a Time/Retired of +4 laps?
SELECT AVG(laps) FROM table_name_63 WHERE time_retired = "+4 laps" AND grid < 19
sql_create_context
CREATE TABLE table_50788 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is Time, when Event is 'GCM: Demolition 1'?
SELECT "Time" FROM table_50788 WHERE "Event" = 'gcm: demolition 1'
wikisql
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
Please tell me the total star ratings of each movie title using a pie chart.
SELECT title, SUM(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title
nvbench
CREATE TABLE table_43980 ( "Season" real, "Team 1" text, "Score" text, "Team 2" text, "Venue" text )
What year did Bangkok University and Chunnam Dragons have a score of 0-0?
SELECT SUM("Season") FROM table_43980 WHERE "Team 1" = 'bangkok university' AND "Score" = '0-0' AND "Team 2" = 'chunnam dragons'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
Tell me the number of patients with diagnoses icd9 code v1083 who had an other body fluid lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V1083" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_46107 ( "Year" real, "English title" text, "Danish title" text, "Director" text, "Result" text )
Who is the Director of the Olsen Gang Sees Red?
SELECT "Director" FROM table_46107 WHERE "English title" = 'the olsen gang sees red'
wikisql
CREATE TABLE table_name_98 ( event_name VARCHAR, pole_winner VARCHAR, race_winner VARCHAR )
Tell me the event name for michael mcdowell and billy leslie
SELECT event_name FROM table_name_98 WHERE pole_winner = "michael mcdowell" AND race_winner = "billy leslie"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, pat...
tell me what patient 008-10139's total stool output is on last month/22?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-10139')) AND intakeoutput.celllabel = 'stool...
eicu
CREATE TABLE table_77678 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
who is the constructor when the laps is more than 72 and the driver is eddie irvine?
SELECT "Constructor" FROM table_77678 WHERE "Laps" > '72' AND "Driver" = 'eddie irvine'
wikisql
CREATE TABLE table_27155678_2 ( accession_number VARCHAR, sequence_similarity VARCHAR )
Name the accession number for sequence similarity being 54
SELECT accession_number FROM table_27155678_2 WHERE sequence_similarity = 54
sql_create_context
CREATE TABLE table_name_51 ( surface VARCHAR, week VARCHAR )
what is the surface for the week of october 25?
SELECT surface FROM table_name_51 WHERE week = "october 25"
sql_create_context
CREATE TABLE t_kc21 ( 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, ...
患者孙永安被开出的药品均不超过6580.96元在哪几次医疗记录中?列出有哪些医疗就诊编号?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '孙永安' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 6580.96)
css
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and manufacturer , and group by attribute name, and list by the names from high to low.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE CUSTOMER ( CustomerId VARCHAR, FirstName VARCHAR ) CREATE TABLE INVOICE ( InvoiceDate VARCHAR, CustomerId VARCHAR )
Find all invoice dates corresponding to customers with first name Astrid and last name Gruber.
SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
68219114345这个门诊就诊的医生有哪些?首诊医生和其他接诊医生的工号是什么
SELECT mzjzjlb.ZZYSGH, mzjzjlb.QTJZYSGH FROM mzjzjlb WHERE mzjzjlb.JZLSH = '68219114345'
css
CREATE TABLE mzb ( CLINIC_ID 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, INSU_TYPE text, IN...
这个患者32981516过去有什么疾病吗?
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '32981516' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '32981516' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_ID = '32981516' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG...
css
CREATE TABLE table_22460085_1 ( original_south_korean_performer VARCHAR, original_manchester_performer VARCHAR )
Who was the origianal south korean performer when Adebayo Bolaji performed in Manchester?
SELECT original_south_korean_performer FROM table_22460085_1 WHERE original_manchester_performer = "Adebayo Bolaji"
sql_create_context
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
Tell me the trend using a line chart to show the total number of the station over the installation date, show by the x axis from high to low.
SELECT installation_date, COUNT(installation_date) FROM station GROUP BY installation_date ORDER BY installation_date DESC
nvbench
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
What is the name of the bank branch that has lent the greatest amount?
SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY SUM(T2.amount) DESC LIMIT 1
spider
CREATE TABLE table_74294 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" real, "Earnings (\u20ac)" real )
Which player made exactly 26 starts?
SELECT "Player" FROM table_74294 WHERE "Starts" = '26'
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 jyjgzbb ( BGDH text, BGRQ tim...
患者75486371在医疗机构7090006的门诊就诊过多少次?在零一年十一月十日到一六年九月十六日的这几年里
SELECT COUNT(*) FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_in...
css
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
医疗就诊65393641940中用到的药品307316-q,该药品的医疗机构三大目录编码及名称是什么
SELECT MED_DIRE_CD, MED_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '65393641940' AND SOC_SRT_DIRE_CD = '307316-q'
css
CREATE TABLE table_26690 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
Who replaced on the date of appointment 2 november 2010?
SELECT "Replaced by" FROM table_26690 WHERE "Date of appointment" = '2 November 2010'
wikisql
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 ) ...
find the number of hispanic/latino-puerto rican ethnic background patients who were born before 2071.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2071"
mimicsql_data
CREATE TABLE table_22083044_2 ( event VARCHAR, fastest_lap VARCHAR, pole_position VARCHAR )
How many times did Tim Macrow and Joey Foster both got the fastest lap and pole position respectively?
SELECT COUNT(event) FROM table_22083044_2 WHERE fastest_lap = "Tim Macrow" AND pole_position = "Joey Foster"
sql_create_context
CREATE TABLE table_5002 ( "Outcome" text, "Date" text, "Surface" text, "Partnered with" text, "Opponents in Final" text, "Score in Final" text )
On what Date was the Score in Final 6 3, 6 3?
SELECT "Date" FROM table_5002 WHERE "Score in Final" = '6–3, 6–3'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is drug code of drug name nitroglycerin sl?
SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Nitroglycerin SL"
mimicsql_data
CREATE TABLE table_name_40 ( heat INTEGER, time VARCHAR, lane VARCHAR )
What is the lowest heat that had a time of 1:02.85 in a lane larger than 7?
SELECT MIN(heat) FROM table_name_40 WHERE time = "1:02.85" AND lane > 7
sql_create_context
CREATE TABLE table_204_575 ( id number, "place" number, "position" text, "number" number, "name" text, "league one" number, "fa cup" number, "league cup" number, "football league trophy" number, "total" number )
who is the only person to have more than 4 assists ?
SELECT "name" FROM table_204_575 WHERE "total" > 4
squall
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients were born before year 2146 with the procedure icd9 code 9755?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2146" AND procedures.icd9_code = "9755"
mimicsql_data
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val...
what is the name of the drug which patient 1798 was prescribed within 2 days after receiving a suture of artery procedure until 2 months ago?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 1798 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = '...
mimic_iii
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...
what is the number of patients less than 43 years who have drug code gaba100?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "43" AND prescriptions.formulary_drug_cd = "GABA100"
mimicsql_data
CREATE TABLE table_42695 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Date" text, "Round" real, "Notes" text )
What was the result of the match held when his record was 7-0-0?
SELECT "Result" FROM table_42695 WHERE "Record" = '7-0-0'
wikisql
CREATE TABLE table_15699 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What were the total number of points when the amount of goals scored was less than 20?
SELECT COUNT("Points") FROM table_15699 WHERE "Goals Scored" < '20'
wikisql
CREATE TABLE table_63761 ( "play" text, "author" text, "company" text, "base" text, "country" text )
What country had the play Cyclops?
SELECT "country" FROM table_63761 WHERE "play" = 'cyclops'
wikisql
CREATE TABLE table_2840500_6 ( nhl_team VARCHAR, player VARCHAR )
Which team picked Blaine Russell?
SELECT nhl_team FROM table_2840500_6 WHERE player = "Blaine Russell"
sql_create_context
CREATE TABLE table_44908 ( "Year" real, "Coach" text, "Captain" text, "Club Champion" text, "Leading goalkicker" text, "Player's Player" text, "Iron Man Award" text, "Community Award" text, "Most Professional" text, "Most Improved" text, "NEAFL Player of the Year" text )
Which Year has a Community Award of jarrod harbrow?
SELECT SUM("Year") FROM table_44908 WHERE "Community Award" = 'jarrod harbrow'
wikisql
CREATE TABLE table_29664 ( "Episode Air Date" text, "Audition City" text, "Audition Date" text, "Audition Venue" text, "Guest Fourth Judge" text )
List all episode air dates where Luiza Possi was the guest fourth judge?
SELECT "Episode Air Date" FROM table_29664 WHERE "Guest Fourth Judge" = 'Luiza Possi'
wikisql
CREATE TABLE table_62115 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What type of surface did they play on 23 October 2000?
SELECT "Surface" FROM table_62115 WHERE "Date" = '23 october 2000'
wikisql
CREATE TABLE match_result ( rank number, club_id number, gold number, big_silver number, small_silver number, bronze number, points number ) CREATE TABLE club ( club_id number, club_name text, region text, start_year number ) CREATE TABLE player ( player_id number, ...
Please show the most common occupation of players.
SELECT occupation FROM player GROUP BY occupation ORDER BY COUNT(*) DESC LIMIT 1
spider