context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_53 ( id number, "date" text, "result" text, "opponent" text, "event" text, "location" text, "method" text, "round" number, "time" text )
how many events did grigorian attend in 2010 ?
SELECT COUNT("event") FROM table_204_53 WHERE "date" = 2010
squall
CREATE TABLE table_name_44 ( qual VARCHAR, rank VARCHAR, year VARCHAR )
What is the qual for rank 18 in 1964?
SELECT qual FROM table_name_44 WHERE rank = "18" AND year = "1964"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose ethnicity is hispanic/latino - puerto rican and year of birth is less than 2197?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2197"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
what are the four most commonly ordered microbiology tests for patients who had received external pacemaker before within the same month since 2105?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'external pacemaker' AND STRFTIME('%y', treat...
eicu
CREATE TABLE table_62133 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text )
What is the party affiliation of Virginia Foxx?
SELECT "Party" FROM table_62133 WHERE "Incumbent" = 'virginia foxx'
wikisql
CREATE TABLE table_51963 ( "Train No." text, "Train Name" text, "Origin" text, "Destination" text, "Frequency" text )
What is the frequency of the Chennai Egmore Dibrugarh Express to Dibrugarh?
SELECT "Frequency" FROM table_51963 WHERE "Destination" = 'dibrugarh' AND "Train Name" = 'chennai egmore dibrugarh express'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
when was patient 030-21071's first maximum mch a month before?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-21071')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of mont...
eicu
CREATE TABLE table_224837_4 ( date_successor_seated VARCHAR, reason_for_change VARCHAR )
Name the date successor seated for contested election; served until february 14, 1794
SELECT date_successor_seated FROM table_224837_4 WHERE reason_for_change = "Contested election; served until February 14, 1794"
sql_create_context
CREATE TABLE table_73518 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the team for january 4
SELECT "Team" FROM table_73518 WHERE "Date" = 'January 4'
wikisql
CREATE TABLE table ( h VARCHAR, c__max_ VARCHAR )
Name the h when c max is 99
SELECT h FROM table WHERE c__max_ = 99
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time, and display by the y axis in descending.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE table_28000 ( "Episode #" real, "The W\u00f8rd" text, "Guest" text, "Introductory phrase" text, "Original airdate" text, "Production code" real )
Who were the guests for the episode with an original airdate of december 07?
SELECT "Guest" FROM table_28000 WHERE "Original airdate" = 'December 07'
wikisql
CREATE TABLE table_name_51 ( position VARCHAR, pick VARCHAR, round VARCHAR )
What is position of the player with a pick number greater than 315 and a round of 30?
SELECT position FROM table_name_51 WHERE pick > 315 AND round = 30
sql_create_context
CREATE TABLE table_name_6 ( player VARCHAR, college VARCHAR )
What Player is from Iowa State?
SELECT player FROM table_name_6 WHERE college = "iowa state"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
Can you name for me the classes that can be taken as MDE next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_i...
advising
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fli...
which airlines fly from BOSTON to WASHINGTON but stopover in some other city
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTO...
atis
CREATE TABLE table_7139 ( "Model number" text, "Frequency" text, "L2 cache" text, "Multi 1" text, "Voltage" real, "Socket" text, "Release date" text, "Order part number" text )
Which model number has an order part number of TMDML44BKX5LD?
SELECT "Model number" FROM table_7139 WHERE "Order part number" = 'tmdml44bkx5ld'
wikisql
CREATE TABLE table_name_43 ( medal VARCHAR, name VARCHAR, games VARCHAR )
Which Medal had a Name of f lix s nchez, and a Games of 2012 london?
SELECT medal FROM table_name_43 WHERE name = "félix sánchez" AND games = "2012 london"
sql_create_context
CREATE TABLE table_65434 ( "Date" text, "Location" text, "Lineup" text, "Assist/pass" text, "Score" text, "Result" text, "Competition" text )
What date was the result 3-1 in Hague?
SELECT "Date" FROM table_65434 WHERE "Result" = '3-1' AND "Location" = 'hague'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what number of patients under the age of 27 underwent the lab test for creatine kinase (ck)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "27" AND lab.label = "Creatine Kinase (CK)"
mimicsql_data
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...
患者46318635的医疗记录中,有过哪些医疗费总额超过2893.35元的信息,把入院诊断疾病编码和名称说一下
SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '46318635' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2893.35)
css
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 whose discharge location is snf and diagnoses long title is schizoaffective disorder, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.long_title = "Schizoaffective disorder, unspecified"
mimicsql_data
CREATE TABLE table_43793 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text )
Name the No. 10 which has a No. 8 of jackson, and a No. 9 of jayden?
SELECT "No. 10" FROM table_43793 WHERE "No. 8" = 'jackson' AND "No. 9" = 'jayden'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, ...
Return a scatter chart showing the relationship between major id and minimum age.
SELECT Major, MIN(Age) FROM Student GROUP BY Major
nvbench
CREATE TABLE table_name_3 ( team_2 VARCHAR )
What was the 1st leg when Team 2 was Aurora?
SELECT 1 AS st_leg FROM table_name_3 WHERE team_2 = "aurora"
sql_create_context
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40...
Show the average transaction amount for different transaction types.
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code
nvbench
CREATE TABLE table_name_39 ( losses INTEGER, byes VARCHAR, wins VARCHAR, against VARCHAR )
How many losses for the team with less than 4 wins, more than 0 byes and 2510 against?
SELECT AVG(losses) FROM table_name_39 WHERE wins < 4 AND against = 2510 AND byes > 0
sql_create_context
CREATE TABLE table_225093_4 ( district VARCHAR, vacator VARCHAR )
Which district has John Culpepper (f) as the vacator?
SELECT district FROM table_225093_4 WHERE vacator = "John Culpepper (F)"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, ...
please list all the flights from BOSTON to SAN FRANCISCO leaving before 1000
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1000 AND flight.to_airport = AIRPORT_SERVICE_1...
atis
CREATE TABLE table_2379 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
Name the original title for not nominated result with report on death
SELECT "Original title" FROM table_2379 WHERE "Result" = 'Not Nominated' AND "Film title used in nomination" = 'Report on Death'
wikisql
CREATE TABLE table_1274 ( "School" text, "Nickname" text, "Colors" text, "League" text, "Class" text, "Division" text )
What league does Delaware Military Academy belong to
SELECT "League" FROM table_1274 WHERE "School" = 'Delaware Military Academy'
wikisql
CREATE TABLE table_name_50 ( artist VARCHAR, place VARCHAR, percentage VARCHAR )
What Artist has a Place of 3 or less with a Percentage of 38.60%?
SELECT artist FROM table_name_50 WHERE place < 3 AND percentage = "38.60%"
sql_create_context
CREATE TABLE table_name_31 ( position INTEGER, drawn VARCHAR, points_1 VARCHAR, goals_for VARCHAR )
what is the position when the points 1 is less than 36, goals for is less than 40 and drawn is less than 9?
SELECT SUM(position) FROM table_name_31 WHERE points_1 < 36 AND goals_for < 40 AND drawn < 9
sql_create_context
CREATE TABLE table_name_7 ( school_club_team VARCHAR, pick VARCHAR )
Which School/Club Team has a Pick of 198?
SELECT school_club_team FROM table_name_7 WHERE pick = 198
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE TABLE faculty ( facid number, lname text, fname text, ...
Find the name of the department that has the biggest number of students minored in?
SELECT T1.dname FROM department AS T1 JOIN minor_in AS T2 ON T1.dno = T2.dno GROUP BY T2.dno ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
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 department_id over the job_id , and group by attribute job_id, I want to display in desc by the sum department id.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_name_75 ( visitor VARCHAR, date VARCHAR )
Who was the visitor on October 31?
SELECT visitor FROM table_name_75 WHERE date = "october 31"
sql_create_context
CREATE TABLE table_name_10 ( party VARCHAR, member VARCHAR )
Which party is sydney sampson a member of?
SELECT party FROM table_name_10 WHERE member = "sydney sampson"
sql_create_context
CREATE TABLE table_42279 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" real, "Team" text )
What did the Dallara chassis with a 5 start in 2006 finish?
SELECT "Finish" FROM table_42279 WHERE "Chassis" = 'dallara' AND "Start" = '5' AND "Year" = '2006'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of job_id and salary , rank by the X-axis in asc.
SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID
nvbench
CREATE TABLE table_31381 ( "Value" text, "Dimensions" text, "Main Color" text, "Obverse" text, "Reverse" text, "Watermark" text, "Date of issue" text )
How many different dates of issue are the for the coin with kumsusan memorial palace on the obverse?
SELECT COUNT("Date of issue") FROM table_31381 WHERE "Obverse" = 'Kumsusan Memorial Palace'
wikisql
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 )
Draw a bar chart for what are the different ship flags, and how many ships have each?, rank by the X-axis in desc.
SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY Flag DESC
nvbench
CREATE TABLE table_name_62 ( years VARCHAR, character VARCHAR )
What years have joyce couwenberg as the character?
SELECT years FROM table_name_62 WHERE character = "joyce couwenberg"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
when was the last measuring of respiration of patient 004-64091 yesterday?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091')) AND NOT vitalperiodic.respiration IS N...
eicu
CREATE TABLE table_2651755_1 ( independent_regional_force VARCHAR, democratic_coalition VARCHAR )
Who is the independent regional force when democratic coalition is (r) jorge tarud ( ppd )?
SELECT independent_regional_force FROM table_2651755_1 WHERE democratic_coalition = "(R) Jorge Tarud ( PPD )"
sql_create_context
CREATE TABLE table_48778 ( "Title" text, "Season" real, "Director" text, "Teleplay" text, "First Broadcast" text )
What is Teleplay, when Director is 'George McCowan', when Season is less than 1.1400000000000001, and when First Broadcast is April 3, 1981?
SELECT "Teleplay" FROM table_48778 WHERE "Director" = 'george mccowan' AND "Season" < '1.1400000000000001' AND "First Broadcast" = 'april 3, 1981'
wikisql
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
For each director, how many reviews have they received Visualize by bar chart, and order in asc by the names.
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY director
nvbench
CREATE TABLE table_name_38 ( airport VARCHAR )
Which 2011 has an Airport of bole international airport?
SELECT MAX(2011) FROM table_name_38 WHERE airport = "bole international airport"
sql_create_context
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 All_Road and All_Games_Percent in a bar chart, and rank by the Y in asc.
SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
nvbench
CREATE TABLE table_60085 ( "Year" real, "Round" real, "Pick" real, "Overall" real, "Player name" text, "Position" text, "AFL team" text )
What is the smallest Pick with Overall larger than 17, a Player name of dave adams category:articles with hcards, and a Year larger than 1963?
SELECT MIN("Pick") FROM table_60085 WHERE "Overall" > '17' AND "Player name" = 'dave adams category:articles with hcards' AND "Year" > '1963'
wikisql
CREATE TABLE table_9826 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text )
What is GPU Frequency, when Model Number is Atom N435?
SELECT "GPU frequency" FROM table_9826 WHERE "Model number" = 'atom n435'
wikisql
CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CRE...
What is the student capacity and type of gender for the dorm whose name as the phrase Donor in it?
SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'
spider
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...
门诊诊断患者冯弘毅患有心脏病,他做的检测白介素-6的结果定量是什么?对应的单位呢
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 ...
css
CREATE TABLE table_name_23 ( number INTEGER, player VARCHAR, yards VARCHAR )
What is Larry Centers' average number when there were less than 600 yards?
SELECT AVG(number) FROM table_name_23 WHERE player = "larry centers" AND yards < 600
sql_create_context
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...
罗列出从00年10月18日到2005年2月27日内患者04312120所有检验结果指标记录的检测人为孙幼安的检验指标流水序号是多少?
(SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE h...
css
CREATE TABLE 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...
医院3761566所有就诊的记录里依不同的科室计算一下在医保统筹基金的花费和总医疗费用的平均比值
SELECT t_kc21.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '3761566' GROUP BY t_kc21.MED_ORG_DEPT_NM
css
CREATE TABLE table_name_3 ( penanced VARCHAR, number_of_autos_da_fé_with_known_sentences VARCHAR )
How many were penanced when the number with known sentences was 71 (1600 1773)?
SELECT penanced FROM table_name_3 WHERE number_of_autos_da_fé_with_known_sentences = "71 (1600–1773)"
sql_create_context
CREATE TABLE table_40501 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text )
What is the Team with a Score that is w 101 97 (2ot)?
SELECT "Team" FROM table_40501 WHERE "Score" = 'w 101–97 (2ot)'
wikisql
CREATE TABLE table_52601 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Trofeo Fast Team" text )
Which General classification has a Stage of 7?
SELECT "General classification" FROM table_52601 WHERE "Stage" = '7'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id numbe...
in 2105, patient 28600 has made an admission?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 28600 AND STRFTIME('%y', admissions.admittime) = '2105'
mimic_iii
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
since 37 months ago, what was the last drug patient 005-77687 was prescribed via the imv route?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND medication.routeadmin = 'imv' AND DATETIME(medicat...
eicu
CREATE TABLE table_43940 ( "Rank" text, "Event" text, "Place" text, "Name" text, "Prize" text )
What is Prize, when Name is 'Valdemar Kwaysser'?
SELECT "Prize" FROM table_43940 WHERE "Name" = 'valdemar kwaysser'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is the number of patients on pb route of drug administration who are diagnosed with hypothyroidism nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hypothyroidism NOS" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_10416 ( "7:00 PM" text, "8:00 PM" text, "8:30 PM" text, "9:00 PM" text, "9:30 PM" text, "10:00 PM" text )
9:30 PM when the 8:00 PM is l'auberge du chien noir?
SELECT "9:30 PM" FROM table_10416 WHERE "8:00 PM" = 'l''auberge du chien noir'
wikisql
CREATE TABLE table_1341604_39 ( candidates VARCHAR, incumbent VARCHAR )
What are the candidates in the district whose incumbent is Gus Yatron?
SELECT candidates FROM table_1341604_39 WHERE incumbent = "Gus Yatron"
sql_create_context
CREATE TABLE table_name_97 ( outcome VARCHAR, opponent_in_final VARCHAR )
Name the outcome for aliz cornet janette hus rov being opponent in final
SELECT outcome FROM table_name_97 WHERE opponent_in_final = "alizé cornet janette husárová"
sql_create_context
CREATE TABLE table_24955 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
Name the most rank for 2 gold
SELECT MIN("Rank") FROM table_24955 WHERE "Gold" = '2'
wikisql
CREATE TABLE table_204_161 ( id number, "name" text, "1968 cf\ndesignator" text, "place of\nmanufacture" text, "primary\nrole(s)" text, "service\nperiod" text, "#\nused" number )
number of models manufactured in france
SELECT COUNT("name") FROM table_204_161 WHERE "place of\nmanufacture" = 'france'
squall
CREATE TABLE table_name_84 ( yacht VARCHAR, syndicate VARCHAR )
Which Yacht Club is part of the America 3 Foundation syndicate on the America 3 yacht?
SELECT yacht AS Club FROM table_name_84 WHERE syndicate = "america 3 foundation" AND yacht = "america 3"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Show weight from each date of birth, list X in desc order.
SELECT Date_of_Birth, Weight FROM people ORDER BY Date_of_Birth DESC
nvbench
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 ...
列出患者水兴平入院科室名称不包含免疫的住院就诊记录在医院5237390中有什么?
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE salary ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, salary INTEGER ) CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUMERIC ) CREATE TABLE batting_postseason ( year INTEGER, r...
I want to see trend of the number of yearid by yearid, and display x-axis in ascending order.
SELECT yearid, COUNT(yearid) FROM hall_of_fame ORDER BY yearid
nvbench
CREATE TABLE table_74668 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the home team for punt road oval?
SELECT "Home team" FROM table_74668 WHERE "Venue" = 'punt road oval'
wikisql
CREATE TABLE table_name_4 ( district_residence VARCHAR, name VARCHAR )
Name of choice b. Randell is the name of which District Residence?
SELECT district_residence FROM table_name_4 WHERE name = "choice b. randell"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, H...
在就诊患者52907506443治疗时用了什么名称里不包含哌的药品标价多少钱?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT 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 = '52907506443' AND NOT t_kc22.SOC_SRT_DIRE_NM LIKE '%哌%'
css
CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_festival ( id...
What is the famous release date of the artist with the oldest age?
SELECT famous_release_date FROM artist ORDER BY age DESC LIMIT 1
spider
CREATE TABLE table_41386 ( "Publication" text, "Country" text, "Accolade" text, "Year" real, "Rank" text )
Which rank has canada as the country?
SELECT "Rank" FROM table_41386 WHERE "Country" = 'canada'
wikisql
CREATE TABLE table_5427 ( "Locale" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
What's Ontario's highest Ends Lost?
SELECT MAX("Ends Lost") FROM table_5427 WHERE "Locale" = 'ontario'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Find the Unikitties!(For The Bridge). Made to annoy nobody!
SELECT Users.Id AS "user_link", Reputation, Views AS "profile_views" FROM Users WHERE NOT AccountId IS NULL AND Users.DisplayName LIKE 'Uni%' ORDER BY DisplayName DESC LIMIT 1000
sede
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, ...
患者27615170在13年4月2日到21年3月6日内被开出的所有检验报告单的科室编码以及名称都是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb 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 person_info_hz_info.KH = hz_info...
css
CREATE TABLE table_name_30 ( runner_up VARCHAR, tournament VARCHAR )
Tell me the runner-up for majorca
SELECT runner_up FROM table_name_30 WHERE tournament = "majorca"
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...
Users rep versus downvote ratio.
SELECT LOG10(Reputation) AS Rep, CAST(CAST(UpVotes AS FLOAT) / CAST(DownVotes AS FLOAT) AS FLOAT(10, 2)) AS Ratio FROM Users WHERE DownVotes >= 1 AND UpVotes + DownVotes > 1 AND Reputation > 10 AND Id > 0 ORDER BY 'ratio' DESC
sede
CREATE TABLE table_27514362_7 ( pos VARCHAR, car_make VARCHAR, driver VARCHAR )
What is the finish position for cars by Pontiac driven by Bobby Hamilton?
SELECT pos FROM table_27514362_7 WHERE car_make = "Pontiac" AND driver = "Bobby Hamilton"
sql_create_context
CREATE TABLE table_38012 ( "Name" text, "Life" text, "Age at death" text, "First contact with Hitler" text, "Relationship" text )
When did the woman who died at 31 first contact Hitlers?
SELECT "First contact with Hitler" FROM table_38012 WHERE "Age at death" = '31'
wikisql
CREATE TABLE table_204_997 ( id number, "#" text, "title" text, "celebrity guest(s)" text, "directed by" text, "written by" text, "original airdate" text )
which episode aired after marion the superfluous feed character ?
SELECT "title" FROM table_204_997 WHERE id = (SELECT id FROM table_204_997 WHERE "title" = '"marion the superfluous feed character"') + 1
squall
CREATE TABLE table_name_67 ( lost VARCHAR, points VARCHAR )
What lost has 86 points?
SELECT lost FROM table_name_67 WHERE points = "86"
sql_create_context
CREATE TABLE table_name_75 ( silver INTEGER, rank VARCHAR, gold VARCHAR )
What is the hioghest amount of silver medals for a nation ranked higher than 19 and less than 2 gold medals?
SELECT MAX(silver) FROM table_name_75 WHERE rank = "19" AND gold < 2
sql_create_context
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 All_Neutral and ACC_Percent in a bar chart.
SELECT All_Neutral, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
what are the three year survival rates of patients who had been prescribed lisinopril 2.5 mg po tabs after having been diagnosed with valvular insufficiency - tricuspid valve?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_name_27 ( winner_nominee_s_ VARCHAR, year VARCHAR )
Who were the winner and nominees in 2001?
SELECT winner_nominee_s_ FROM table_name_27 WHERE year = 2001
sql_create_context
CREATE TABLE table_68750 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What is the total attendance at games with a score of 4-2?
SELECT COUNT("Attendance") FROM table_68750 WHERE "Score" = '4-2'
wikisql
CREATE TABLE table_2774 ( "Episode" text, "Location" text, "Headliner" text, "Comedians" text, "Airdate" text )
Who were the comedians during the episode located in Birmingham Hippodrome?
SELECT "Comedians" FROM table_2774 WHERE "Location" = 'Birmingham Hippodrome'
wikisql
CREATE TABLE table_33636 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" text )
What was the Browns record after they played the game at the Paul Brown stadium?
SELECT "Record" FROM table_33636 WHERE "Stadium" = 'paul brown stadium'
wikisql
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Return a bar chart on what is the average age for each gender?, and rank by the y-axis from low to high.
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age)
nvbench
CREATE TABLE table_43741 ( "Season" real, "Overall" real, "Slalom" text, "Giant Slalom" real, "Super G" text, "Downhill" text, "Combined" text )
What season had a downhill of 35 and overall greater than 21?
SELECT COUNT("Season") FROM table_43741 WHERE "Downhill" = '35' AND "Overall" > '21'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number...
Top 100 users from Bangladesh.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR UPPER(Location) LIKE '%bd' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_67422 ( "Company" text, "Type" text, "Principal activities" text, "Incorporated in" text, "Group's Equity Shareholding (10 March 2010)" text )
Name the incorporated for principal activites of travel agency
SELECT "Incorporated in" FROM table_67422 WHERE "Principal activities" = 'travel agency'
wikisql
CREATE TABLE table_18734298_1 ( no_in_series VARCHAR, directed_by VARCHAR )
How many series were directed by Rob Renzetti?
SELECT COUNT(no_in_series) FROM table_18734298_1 WHERE directed_by = "Rob Renzetti"
sql_create_context
CREATE TABLE film ( Film_ID VARCHAR ) CREATE TABLE film_market_estimation ( Film_ID VARCHAR )
What is the title of the film that has the highest high market estimation.
SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1
sql_create_context
CREATE TABLE table_38607 ( "Team" text, "Recopa 1995" text, "Supercopa 1995" text, "CONMEBOL 1995" text, "Copa Libertadores 1996" text )
Which Team has a round 1 CONMEBOL 1995?
SELECT "Team" FROM table_38607 WHERE "CONMEBOL 1995" = 'round 1'
wikisql