context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_592 ( id number, "#" number, "title" text, "type" text, "opening\ndate" text, "closing\ndate" text, "performances" number, "comment" text )
how many combined performances have the top three longest running broadway shows had ?
SELECT SUM("performances") FROM table_204_592 WHERE "#" <= 3
squall
CREATE TABLE table_29405 ( "Pronoun" text, "Present" text, "1st" text, "2nd" text, "perfect" text, "aorist" text, "imperfect" text, "pluperfect" text )
Which pronoun has e biti / bi e in first person?
SELECT "Pronoun" FROM table_29405 WHERE "1st" = 'će biti / biće'
wikisql
CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE student ...
What is the course description and number of credits for QM-261?
SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261'
spider
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
那些已经被门诊诊断为维生素B缺乏病的病患们的检测指标514736的平均数值以及最值都是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '维生素B缺乏病' AND jyjgzbb.JCZBDM = '514736'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
provide the average age of female patients who stayed in the hospital for 23 days.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay = "23"
mimicsql_data
CREATE TABLE table_65135 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
Which position was picked before 63, for Oklahoma College?
SELECT "Position" FROM table_65135 WHERE "Pick" < '63' AND "College" = 'oklahoma'
wikisql
CREATE TABLE table_name_28 ( date VARCHAR, circuit VARCHAR )
When was the circuit portland international raceway?
SELECT date FROM table_name_28 WHERE circuit = "portland international raceway"
sql_create_context
CREATE TABLE table_name_16 ( lost INTEGER, played INTEGER )
What is the average lost of games played of more than 9?
SELECT AVG(lost) FROM table_name_16 WHERE played > 9
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
Ratio of number of accepted answer by users with rep. > threshold to all accepted answers.
WITH AcceptedAnswers AS (SELECT aa.* FROM Posts AS p INNER JOIN Posts AS aa ON aa.Id = p.AcceptedAnswerId), UsersWITHAcceptedAnswers AS (SELECT u.Reputation, COUNT(*) AS AcceptedAnswerCount FROM AcceptedAnswers AS aa INNER JOIN Users AS u ON u.Id = aa.OwnerUserId GROUP BY u.Id, u.Reputation), HighRepUsers AS (SELECT * ...
sede
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
从07-7-22到15-4-15,哪几位工号及姓名的医务人员在患者韩嘉玉就诊时为其提供检测指标303131服务的
(SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND j...
css
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 medication ( medi...
was there any record of the microbiology test for the blood, venipuncture of patient 031-3355 on the first hospital visit?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala...
eicu
CREATE TABLE table_13450 ( "Position" text, "Gymnast" text, "A Score" real, "B Score" real, "Total" real )
what is the b score when the a score is 6.9?
SELECT "B Score" FROM table_13450 WHERE "A Score" = '6.9'
wikisql
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 admission type and primary disease of subject id 2560?
SELECT demographic.admission_type, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_72543 ( "Series #" real, "Season #" real, "Title" text, "Story by" text, "Teleplay by" text, "Directed by" text, "Original air date" text )
Who is the teleplay by when the director is Rob Bailey?
SELECT "Teleplay by" FROM table_72543 WHERE "Directed by" = 'Rob Bailey'
wikisql
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE player ( Player_ID int, name text, Position text, Club...
List the positions of players whose average number of points scored by that position is larger than 20, compare the number of positions, and I want to rank in asc by the the number of position.
SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position)
nvbench
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
top 500 stackoverflow users thailand.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Thailand%' LIMIT 500
sede
CREATE TABLE table_name_16 ( opponent VARCHAR, date VARCHAR )
Who was the opponent at the game held on December 24, 2005?
SELECT opponent FROM table_name_16 WHERE date = "december 24, 2005"
sql_create_context
CREATE TABLE table_24489942_10 ( points VARCHAR, nationality VARCHAR )
Name the points for switzerland
SELECT points FROM table_24489942_10 WHERE nationality = "Switzerland"
sql_create_context
CREATE TABLE table_21980_1 ( january__ VARCHAR, july__°c_ VARCHAR )
What is the total number of January ( C) temperatures when the July ( C) temperatures were 23/15?
SELECT COUNT(january__) AS °c_ FROM table_21980_1 WHERE july__°c_ = "23/15"
sql_create_context
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...
provide the number of patients whose days of hospital stay is greater than 0 and diagnoses long title is pulmonary collapse?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "0" AND diagnoses.long_title = "Pulmonary collapse"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
provide the lab test category of subject id 6983.
SELECT lab."CATEGORY" FROM lab WHERE lab.subject_id = "6983"
mimicsql_data
CREATE TABLE table_1473672_7 ( position VARCHAR, nhl_team VARCHAR )
the california golden seals that where drafted by nhl teams played what positions
SELECT position FROM table_1473672_7 WHERE nhl_team = "California Golden Seals"
sql_create_context
CREATE TABLE table_18658 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what happened during the election for Richard M. Kleberg?
SELECT "Result" FROM table_18658 WHERE "Incumbent" = 'Richard M. Kleberg'
wikisql
CREATE TABLE table_44435 ( "Year" real, "Date held" text, "Winner" text, "Events won by KCL" real, "Events won by KCLMS" real )
What is the average value for events won by KCL in a year earlier than 2004?
SELECT AVG("Events won by KCL") FROM table_44435 WHERE "Year" < '2004'
wikisql
CREATE TABLE table_65620 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer fee" text )
What is the name listed for the country that has a status of loaned and a moving to listed as leyton orient?
SELECT "Name" FROM table_65620 WHERE "Status" = 'loaned' AND "Moving to" = 'leyton orient'
wikisql
CREATE TABLE table_9955 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ($)" text )
What is the Country of the Player with a Score of 73-70-71-71=285?
SELECT "Country" FROM table_9955 WHERE "Score" = '73-70-71-71=285'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, ...
潘乐山这位患者的补体C3在2003年5月12日到2009年10月10日期间的情况
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_204_187 ( id number, "type" text, "power\n[w]" text, "relative cost" number, "input range\n[v]" text, "energy storage" text, "features" text )
how many volts can the flyback handle at most ?
SELECT "input range\n[v]" FROM table_204_187 WHERE "type" = 'flyback'
squall
CREATE TABLE table_name_68 ( marriage VARCHAR, became_duchess VARCHAR )
Which Marriage has a Became Duchess of 12 december 1666?
SELECT marriage FROM table_name_68 WHERE became_duchess = "12 december 1666"
sql_create_context
CREATE TABLE table_21001903_2 ( mens_singles VARCHAR, womens_singles VARCHAR, tour VARCHAR )
when womens singles is wang yihan and tour is french super series, what were the men's singles?
SELECT mens_singles FROM table_21001903_2 WHERE womens_singles = "Wang Yihan" AND tour = "French Super Series"
sql_create_context
CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) 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_len...
Bar chart x axis color y axis the number of color, sort in desc by the x-axis.
SELECT color, COUNT(color) FROM photos GROUP BY color ORDER BY color DESC
nvbench
CREATE TABLE table_name_96 ( country VARCHAR, to_par VARCHAR )
Which Country has a To par of e?
SELECT country FROM table_name_96 WHERE to_par = "e"
sql_create_context
CREATE TABLE table_17325937_5 ( high_assists VARCHAR, date VARCHAR )
What was the high assists on November 14?
SELECT high_assists FROM table_17325937_5 WHERE date = "November 14"
sql_create_context
CREATE TABLE table_22236 ( "Candidates" text, "Votes Khuzestan" real, "% of votes Khuzestan" text, "Votes Nationally" real, "% of votes nationally" text )
How many votes Khuzestan were there when the percentage was 34.50?
SELECT MIN("Votes Khuzestan") FROM table_22236 WHERE "% of votes Khuzestan" = '34.50'
wikisql
CREATE TABLE table_28057 ( "Release" text, "# of discs" real, "Region 1" text, "Region 2" text, "Region 4" text )
Which release had 6 DVDs?
SELECT "Release" FROM table_28057 WHERE "# of discs" = '6'
wikisql
CREATE TABLE table_name_12 ( games VARCHAR, finals VARCHAR, w_league VARCHAR )
How many games does the player with 1 (0) finals and a w-league of 28 (1) have?
SELECT games FROM table_name_12 WHERE finals = "1 (0)" AND w_league = "28 (1)"
sql_create_context
CREATE TABLE table_204_596 ( id number, "year" number, "winners" text, "score" text, "runners up" text, "notes" text )
who had the most wins : shelfield athletic or sutton coldfield town ?
SELECT "winners" FROM table_204_596 WHERE "winners" IN ('shelfield athletic', 'sutton coldfield town') GROUP BY "winners" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_12547903_3 ( location VARCHAR, callsign VARCHAR )
How many places featured the DXCL Callsign?
SELECT COUNT(location) FROM table_12547903_3 WHERE callsign = "DXCL"
sql_create_context
CREATE TABLE table_44635 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text )
What is the title for Hui that ruled from 864 BC?
SELECT "Title" FROM table_44635 WHERE "Name" = 'hui' AND "From" = '864 bc'
wikisql
CREATE TABLE table_name_69 ( away_team VARCHAR, home_team VARCHAR )
Name the away team for essendon
SELECT away_team FROM table_name_69 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE txmzjzjlb ( 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, MZZYZDZ...
38758660的患者之前会有哪些不良反应
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_59603 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
Which Opposing team had an Against smaller Than 5?
SELECT "Opposing Teams" FROM table_59603 WHERE "Against" < '5'
wikisql
CREATE TABLE table_16930 ( "Venue" text, "Hosted" real, "Average" real, "Highest" real, "Lowest" real, "Total" real, "Last Year" text, "Up/Down" text )
What was the attendance last year at Manuka Oval?
SELECT "Last Year" FROM table_16930 WHERE "Venue" = 'Manuka Oval'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
For those employees who did not have any job in the past, give me the trend about commission_pct over hire_date .
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_17356 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
what's the location attendance where record is 14 39
SELECT "Location Attendance" FROM table_17356 WHERE "Record" = '14–39'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
when did it last happen until 610 days ago that the arterial bp [diastolic] of patient 28966 was greater than 82.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 = 28966)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_20420 ( "Episode Number" real, "Air Date" text, "Guest Host" text, "Musical Guest (Song performed)" text, "Who knows the most about the guest host? panelists" text )
On what date were Gary Lucy and Susie Verrico the panelists.
SELECT "Air Date" FROM table_20420 WHERE "Who knows the most about the guest host? panelists" = 'Gary Lucy and Susie Verrico'
wikisql
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text )
Calculate the number of actors in each duration of actors using a bar chart, rank from low to high by the names please.
SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration ORDER BY Duration
nvbench
CREATE TABLE table_10707142_2 ( report VARCHAR, circuit VARCHAR )
what is the report called where the circuit took place at the nazareth speedway?
SELECT report FROM table_10707142_2 WHERE circuit = "Nazareth Speedway"
sql_create_context
CREATE TABLE table_name_35 ( lost_to VARCHAR, year VARCHAR )
Which the Lost to is in 2000
SELECT lost_to FROM table_name_35 WHERE year = 2000
sql_create_context
CREATE TABLE table_1341453_7 ( district VARCHAR, incumbent VARCHAR )
What district is bill thomas from?
SELECT district FROM table_1341453_7 WHERE incumbent = "Bill Thomas"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
give me the number of patients whose admission type is urgent and lab test fluid is urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Urine"
mimicsql_data
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 of the patients diagnosed with icd9 code 7098 died in or before the year 2132?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2132.0" AND diagnoses.icd9_code = "7098"
mimicsql_data
CREATE TABLE table_name_4 ( frequency INTEGER, callsign VARCHAR )
What's the highest frequency of the KBDR callsign?
SELECT MAX(frequency) FROM table_name_4 WHERE callsign = "kbdr"
sql_create_context
CREATE TABLE table_name_48 ( third_place VARCHAR, fourth_placed VARCHAR, number_of_clubs VARCHAR, winners VARCHAR )
Who was in third place when the Winner was Dalian Shide, Chongqing Longxin was 4th and 14 clubs?
SELECT third_place FROM table_name_48 WHERE number_of_clubs = 14 AND winners = "dalian shide" AND fourth_placed = "chongqing longxin"
sql_create_context
CREATE TABLE table_47957 ( "Cycle" real, "Premiere date" text, "Winner" text, "Runner-up" text, "Number of contestants" text, "International Destinations" text )
What is the lowest Cycle, when Number Of Contestants is 11, and when International Destinations is Paris Gran Canaria?
SELECT MIN("Cycle") FROM table_47957 WHERE "Number of contestants" = '11' AND "International Destinations" = 'paris gran canaria'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
how did patient 002-64535 first get admitted to the hospital this year?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '002-64535' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_44930 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What is Score in The Final, when Date is '1981'?
SELECT "Score in the final" FROM table_44930 WHERE "Date" = '1981'
wikisql
CREATE TABLE table_18710512_3 ( date VARCHAR, single VARCHAR )
What year was 'moped girls' released?
SELECT date FROM table_18710512_3 WHERE single = "Moped Girls"
sql_create_context
CREATE TABLE table_test_21 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "tachycardia" int, "body_weight" float, "renal_disease" bool, "anaemia" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic_shock" bool, ...
hypertension defined as blood pressure > 180 / 110 mm hg ( systolic bp > 180 mm hg and / or diastolic bp > 110 mm hg ) on repeated measurements during current admission prior to randomization
SELECT * FROM table_test_21 WHERE hypertension = 1 OR (systolic_blood_pressure_sbp > 180 OR diastolic_blood_pressure_dbp > 110)
criteria2sql
CREATE TABLE table_203_739 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
in the 2003 summer universiade , which three countries had at least 18 bronze medals ?
SELECT "nation" FROM table_203_739 WHERE "bronze" >= 18
squall
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of manager_id bin hire_date by time in a bar chart, I want to display Y-axis in descending order.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_76983 ( "Poll source" text, "Dates administered" text, "Jim DeMint (R)" text, "Alvin Greene (D)" text, "Tom Clements (G)" text, "Other" text, "Undecided" text )
What was the vote for Alvin Green when Jim DeMint was 62%?
SELECT "Alvin Greene (D)" FROM table_76983 WHERE "Jim DeMint (R)" = '62%'
wikisql
CREATE TABLE table_18847 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Jockey" text, "Winner/2nd" text )
On what date did Northerly place 6th?
SELECT "Date" FROM table_18847 WHERE "Result" = '6th'
wikisql
CREATE TABLE table_41033 ( "Year" real, "Song" text, "Canada Singles" text, "US Hot 100" text, "US A.C." text )
What is th US A.C. in 1985 with a US hot 100 of 57?
SELECT "US A.C." FROM table_41033 WHERE "Year" = '1985' AND "US Hot 100" = '57'
wikisql
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...
在2609401号医院里从06年7月2日截止到21年1月28日这期间不是麻醉科负责的医疗就诊记录一共都是那些啊?
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2609401' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-07-02' AND '2021-01-28' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2609401' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-07-02' AND '2021-01-28' AND t_kc21.MED_ORG_DEPT_NM = '麻醉科'
css
CREATE TABLE table_48733 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which Team has a Record of 32 50?
SELECT "Team" FROM table_48733 WHERE "Record" = '32–50'
wikisql
CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE time_slot ( time_slot_id varchar(4), ...
Bar chart of how many building from each building
SELECT building, COUNT(building) FROM department GROUP BY building
nvbench
CREATE TABLE table_38290 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
What shows for Try bonus when the points against are 451?
SELECT "Try bonus" FROM table_38290 WHERE "Points against" = '451'
wikisql
CREATE TABLE table_22078972_2 ( us_viewers__millions_ VARCHAR, no_in_series VARCHAR )
How many millions of people in the US saw the episode with series number 103?
SELECT us_viewers__millions_ FROM table_22078972_2 WHERE no_in_series = 103
sql_create_context
CREATE TABLE table_62938 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Round" text )
What round was on 11/11/1992?
SELECT "Round" FROM table_62938 WHERE "Date" = '11/11/1992'
wikisql
CREATE TABLE table_test_31 ( "id" int, "ejection_fraction_ef" int, "macular_disease" bool, "systemic" bool, "alt" float, "iud" bool, "condom_with_spermicide" bool, "gender" string, "meropenem" bool, "non_q_wave_myocardial_infarction" bool, "hbcab" bool, "unstable_angina" ...
patients who have at least 2 of the following risk factors: hypertension; type ii diabetes mellitus ;chronic kidney disease ; prior history of myocardial infarction or angina pectoris ; prior history of cerebral infarction ; peripheral arterial disease
SELECT * FROM table_test_31 WHERE (CASE WHEN hypertension = 1 THEN 1 ELSE 0 END + CASE WHEN diabetic = 'ii' THEN 1 ELSE 0 END + CASE WHEN mellitus = 1 THEN 1 ELSE 0 END + CASE WHEN kidney_disease = 1 THEN 1 ELSE 0 END + CASE WHEN myocardial_infarction = 1 OR angina = 1 THEN 1 ELSE 0 END + CASE WHEN cerebral_infarction ...
criteria2sql
CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE competition ( Competition_ID int, Year real, ...
What is the proportion of types of every competition?
SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type
nvbench
CREATE TABLE table_14631 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average silver medals a team ranked 12 with less than 2 bronze has?
SELECT AVG("Silver") FROM table_14631 WHERE "Rank" = '12' AND "Bronze" < '2'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
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, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time by a bar chart, and show by the y-axis in ascending.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE airline ( airline_code varchar, airline_name text, note 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...
show me the flights from BOSTON to OAKLAND
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND...
atis
CREATE TABLE table_name_55 ( attendance VARCHAR, points VARCHAR, date VARCHAR )
What was the attendance for the March 6 game, where one of the teams had 53 points.
SELECT attendance FROM table_name_55 WHERE points = 53 AND date = "march 6"
sql_create_context
CREATE TABLE table_15741 ( "Discipline" text, "2003 Cadiz" text, "2007 Cascais" text, "2011 Perth" text, "2014 Santander" text )
WHich is 2014 Santander included 2011 Perth of 470?
SELECT "2014 Santander" FROM table_15741 WHERE "2011 Perth" = '470'
wikisql
CREATE TABLE table_72241 ( "#" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text )
who are all the visitor with a record of 25 18
SELECT "Visitor" FROM table_72241 WHERE "Record" = '25–18'
wikisql
CREATE TABLE table_964 ( "IN No." real, "County Name" text, "Establishment Date (SW Indiana) (History) (Statehood)" text, "County Seat" text, "Time Zone" text, "Population (2010) (Rank)" text, "Area sq mi (km 2 ) (Rank)" text, "Twps" real, "ZIP code Prefix(es)" text, "% of Bounda...
When the % of boundary by water is 63% what is the overall number of zip code prefix(es)?
SELECT COUNT("ZIP code Prefix(es)") FROM table_964 WHERE "% of Boundary by water" = '63%'
wikisql
CREATE TABLE table_37068 ( "Season" real, "Team" text, "Games" real, "Wins" real, "Losses" real, "Ties" real )
Which Losses have a Season larger than 1941, and a Team of hamilton wildcats, and Ties of 0?
SELECT "Losses" FROM table_37068 WHERE "Season" > '1941' AND "Team" = 'hamilton wildcats' AND "Ties" = '0'
wikisql
CREATE TABLE table_15041 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What was the average points for Hopkins before 1956?
SELECT AVG("Points") FROM table_15041 WHERE "Entrant" = 'hopkins' AND "Year" < '1956'
wikisql
CREATE TABLE table_name_27 ( model VARCHAR, years VARCHAR )
What is the model that was made in the years 2011 2012-?
SELECT model FROM table_name_27 WHERE years = "2011 2012-"
sql_create_context
CREATE TABLE table_6551 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
What is the road team of game 6 with Philadelphia as the home team?
SELECT "Road Team" FROM table_6551 WHERE "Home Team" = 'philadelphia' AND "Game" = 'game 6'
wikisql
CREATE TABLE table_32566 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What team has Windy Hill as their home venue
SELECT "Home team score" FROM table_32566 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
了解一下29461728这个病人的上臂各项指标检验的结果
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE table_256286_19 ( passed VARCHAR, description VARCHAR )
What was the passing result for the measure with a description of bus and truck operating license bill?
SELECT passed FROM table_256286_19 WHERE description = "Bus and Truck Operating License Bill"
sql_create_context
CREATE TABLE table_18950 ( "Trim" text, "Engine" text, "Displacement" text, "Power" text, "Torque" text, "Transmission" text, "Fuel Mileage (latest EPA mpg - US )" text )
what's the transmbeingsion with trim being xe (2009)
SELECT "Transmission" FROM table_18950 WHERE "Trim" = 'XE (2009)'
wikisql
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
两千年十二月二十一日到一六年十二月二日,患者尤清润的二氧化碳情况是怎样的
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
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, ...
10566129443的医疗就诊中药品6821的报销三大类别具体是哪个
SELECT t_kc22.DIRE_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '10566129443' AND t_kc22.SOC_SRT_DIRE_CD = '6821'
css
CREATE TABLE table_name_96 ( away_team VARCHAR )
What is Richmond's away team score versus Geelong?
SELECT away_team AS score FROM table_name_96 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX 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, J...
69939554这个病人被门诊诊断为脑外伤所致精神障碍,他做的胱抑素C2代的结果定量及其单位分别是啥
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_name_52 ( label VARCHAR, date VARCHAR )
Which label has a date of 1987?
SELECT label FROM table_name_52 WHERE date = "1987"
sql_create_context
CREATE TABLE table_15353 ( "Media market name" text, "Callsign" text, "Analog" text, "Digital" text, "Affiliation" text )
what is the callsign for analog 19?
SELECT "Callsign" FROM table_15353 WHERE "Analog" = '19'
wikisql
CREATE TABLE table_54823 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which team played against the away team that scored 5.5 (35)?
SELECT "Home team" FROM table_54823 WHERE "Away team score" = '5.5 (35)'
wikisql
CREATE TABLE gyb ( 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...
9352968这个医院涉及的医疗费总额不超过7970.17元的科室有多少?时间范围是零三年四月九日到零五年一月三十一日
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '9352968' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-04-09' AND '2005-01-31' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 7970.17 UNION SELECT gyb.MED_ORG_DEPT_CD FR...
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
54831539211的检验报告单对应的是什么项目代码和名称
SELECT jybgb.JYXMDM, jybgb.JYXMMC FROM jybgb WHERE jybgb.BGDH = '54831539211'
css
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 manufacturer , and group by attribute name, and visualize them by a bar chart, and display from high to low by the Name.
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
Is RCNSCI 270 Core ?
SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'RCNSCI' AND course.number = 270 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_9558 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text )
What is the car number for Jeff Simmons on the Rahal Letterman team?
SELECT "Car No." FROM table_9558 WHERE "Team" = 'rahal letterman' AND "Driver" = 'jeff simmons'
wikisql