context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_35575 ( "Date" text, "Territory" text, "Screens" real, "Rank" real, "Gross" text )
What is the highest rank of the day with a gross of $38,916 and more than 6 screens?
SELECT MAX("Rank") FROM table_35575 WHERE "Gross" = '$38,916' AND "Screens" > '6'
wikisql
CREATE TABLE table_name_57 ( top_10 INTEGER, cuts_made VARCHAR, top_25 VARCHAR, top_5 VARCHAR )
Which Top-10 has a Top-25 smaller than 18, and a Top-5 of 6, and a Cuts made smaller than 20?
SELECT MAX(top_10) FROM table_name_57 WHERE top_25 < 18 AND top_5 = 6 AND cuts_made < 20
sql_create_context
CREATE TABLE table_10013 ( "1997\u201398" text, "1998\u201399" text, "1999\u201300" text, "2000\u201301" text, "2001\u201302" text, "2002\u201303" text, "2003\u201304" text, "2004\u201305" text, "2005\u201306" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309"...
What is the 2003-04 of the 1998-99 of IlIev Wreh?
SELECT "2003\u201304" FROM table_10013 WHERE "1998\u201399" = 'iliev wreh'
wikisql
CREATE TABLE table_name_99 ( having__things_ VARCHAR, interacting__settings_ VARCHAR )
Name the having things for privacy, intimate spaces of togetherness
SELECT having__things_ FROM table_name_99 WHERE interacting__settings_ = "privacy, intimate spaces of togetherness"
sql_create_context
CREATE TABLE pilot_record ( Record_ID int, Pilot_ID int, Aircraft_ID int, Date text ) CREATE TABLE aircraft ( Aircraft_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertrain text, Fuel_Propulsion text ) CREATE TABLE pilot ( Pilot_ID int, ...
Bar graph to show the total number from different nationality, sort total number in desc order.
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
what are the three most frequently administered laboratory tests for patients who were previously diagnosed with hx of leukemia nos in the same hospital visit, in 2105?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE table_name_30 ( viewers VARCHAR, rank VARCHAR )
What is the total number of Viewers when the rank is #40?
SELECT COUNT(viewers) FROM table_name_30 WHERE rank = "#40"
sql_create_context
CREATE TABLE table_name_73 ( finish VARCHAR, start INTEGER )
What finish has a start smaller than 25?
SELECT finish FROM table_name_73 WHERE start < 25
sql_create_context
CREATE TABLE table_40015 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
On what date was the result Eng by 1 wkt?
SELECT "Date" FROM table_40015 WHERE "Result" = 'eng by 1 wkt'
wikisql
CREATE TABLE table_15766 ( "Shirt No" real, "Player" text, "Birth Date" text, "Weight" real, "Height" real )
Shirt number of 18, and a Height larger than 195 has how much weight?
SELECT COUNT("Weight") FROM table_15766 WHERE "Shirt No" = '18' AND "Height" > '195'
wikisql
CREATE TABLE table_name_18 ( finish VARCHAR, to_par VARCHAR )
What is the finish when the to par is +18?
SELECT finish FROM table_name_18 WHERE to_par = "+18"
sql_create_context
CREATE TABLE table_4698 ( "Tournament" text, "2007" text, "2009" text, "2010" text, "2011" text )
What was the result in 2007 when the 2011 was F and 2009 was W?
SELECT "2007" FROM table_4698 WHERE "2011" = 'f' AND "2009" = 'w'
wikisql
CREATE TABLE table_name_15 ( winning_team VARCHAR, circuit VARCHAR, winning_driver VARCHAR, pole_position VARCHAR )
For the race held at the Cleveland Burke Lakefront Airport circuit, with winning driver Emerson Fittipaldi and pole position Michael Andretti, what was the winning team?
SELECT winning_team FROM table_name_15 WHERE winning_driver = "emerson fittipaldi" AND pole_position = "michael andretti" AND circuit = "cleveland burke lakefront airport"
sql_create_context
CREATE TABLE table_name_61 ( attendance INTEGER, week VARCHAR )
What was the average attendance in week 2?
SELECT AVG(attendance) FROM table_name_61 WHERE week = 2
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...
what is the number of patients whose diagnoses icd9 code is 78552 and lab test fluid is joint fluid?
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 = "78552" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_23496 ( "Ostrich" text, "Hamerkop" text, "Hadeda Ibis" text, "African Spoonbill" text, "Whitefaced Duck" text, "Knobbilled Duck" text )
What is the African Spoonbill when the Ostrich is Brown-hooded Kingfisher?
SELECT "African Spoonbill" FROM table_23496 WHERE "Ostrich" = 'Brown-hooded Kingfisher'
wikisql
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE writes ( paperid int, ...
how many ras bodik papers are in popl ?
SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'ras bodik' AND venue.venueid = paper.venueid AND venue.venuename = 'popl' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_name_32 ( place VARCHAR, country VARCHAR )
What place was the player from Italy in ?
SELECT place FROM table_name_32 WHERE country = "italy"
sql_create_context
CREATE TABLE table_41854 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity in use" text )
In which yearly change was there a capacity of 78.4% and a rank smaller than 3?
SELECT "Annual change" FROM table_41854 WHERE "Rank" < '3' AND "Capacity in use" = '78.4%'
wikisql
CREATE TABLE table_31001 ( "Movies" text, "December 25" text, "December 26" text, "December 27" text, "December 28" text, "December 25-28 total" text, "Total 2-week Gross" text )
What is the figure for December 27 for ang tanging ina mo (last na 'to!)?
SELECT "December 27" FROM table_31001 WHERE "Movies" = 'Ang Tanging Ina Mo (Last na ''To!)'
wikisql
CREATE TABLE table_15429 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Which team has far rabat as the team 1?
SELECT "Team 2" FROM table_15429 WHERE "Team 1" = 'far rabat'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is maximum days of hospital stay of patients whose year of birth is greater than 2053?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2053"
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...
在2011年3月17日到2021年8月5日内医院1125582有多少科室涉及医疗费总额不超过8850.12元?
SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '1125582' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-03-17' AND '2021-08-05' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 8850.12) AS T
css
CREATE TABLE table_22448 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
What is the least number of poins for San Lorenzo?
SELECT MIN("Points") FROM table_22448 WHERE "Team" = 'San Lorenzo'
wikisql
CREATE TABLE table_name_52 ( rank INTEGER, team VARCHAR, rebounds VARCHAR )
What is the highest rank team akasvayu girona had with less than 311 rebounds?
SELECT MAX(rank) FROM table_name_52 WHERE team = "akasvayu girona" AND rebounds < 311
sql_create_context
CREATE TABLE table_67837 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
yes or no for the sydney with yes for melbourne, no for perth, no for auckland and no for gold coast?
SELECT "Sydney" FROM table_67837 WHERE "Melbourne" = 'yes' AND "Perth" = 'no' AND "Auckland" = 'no' AND "Gold Coast" = 'no'
wikisql
CREATE TABLE table_42733 ( "Mission" text, "Date" text, "Launch site" text, "Motor" text, "Apogee" text )
Which Mission has a Apogee of 705 km?
SELECT "Mission" FROM table_42733 WHERE "Apogee" = '705 km'
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...
Among patients admitted to emergency, how many of them were born before the year 1821?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dob_year < "1821"
mimicsql_data
CREATE TABLE table_203_561 ( id number, "pos" number, "team" text, "total" number, "high" number, "low" number, "average" number, "change" text )
the team to finish first after denso sc
SELECT "team" FROM table_203_561 WHERE "pos" = (SELECT "pos" FROM table_203_561 WHERE "team" = 'denso sc') + 1
squall
CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_to time ) CREATE TABLE ref_calendar ( calendar_date time, day_number number ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, do...
What is the day Number and date of all the documents?
SELECT T2.day_number, T1.date_stored FROM all_documents AS T1 JOIN ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
spider
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
Next Winter , who will be teaching Research for Natural Sciences ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN cou...
advising
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE VoteTypes ( Id number, Name text...
Find answers by Dan Yand to duplicate questions.
SELECT p.ParentId, p.Id AS "post_link", p.Title, pp.Title FROM Posts AS p JOIN Posts AS pp ON p.ParentId = pp.Id JOIN PostHistory AS ph ON ph.PostId = pp.Id WHERE p.PostTypeId = 2 AND p.OwnerUserId = 8620333 AND ph.PostHistoryTypeId = 10 AND ph.Comment = 101
sede
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
show me the flights from BOSTON to DENVER on 8 2
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 2 AND date_day.month_number = 8 AND dat...
atis
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, ...
please give me flights available from BALTIMORE to PHILADELPHIA
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL...
atis
CREATE TABLE table_60065 ( "Team 1" text, "Score" text, "Team 2" text, "1st round" text, "2nd round" text )
What was the Score of the match with USL Dunkerque (d2) as Team 2?
SELECT "Score" FROM table_60065 WHERE "Team 2" = 'usl dunkerque (d2)'
wikisql
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title...
Parsing papers from ACL 2014 using Jeopardy! Questions
SELECT DISTINCT paper.paperid FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase, venue WHERE dataset.datasetname = 'Jeopardy! Questions' AND keyphrase.keyphrasename = 'Parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = p...
scholar
CREATE TABLE table_65428 ( "Season" text, "1st round" text, "2nd round" text, "3rd round" text, "Finals" text )
NAME THE Finals which has a 1st round of w, 3 1, mis?
SELECT "Finals" FROM table_65428 WHERE "1st round" = 'w, 3–1, mis'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0...
For those employees who was hired before 2002-06-21, give me the comparison about the average of department_id over the hire_date bin hire_date by weekday by a bar chart, and list y-axis in desc order.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_8214 ( "Date" text, "Ship" text, "Nationality" text, "Tonnage" real, "Fate" text )
What is Ship, when Nationality is 'Syria', and when Date is '26 June 1943', and when Tonnage is '80'?
SELECT "Ship" FROM table_8214 WHERE "Nationality" = 'syria' AND "Date" = '26 june 1943' AND "Tonnage" = '80'
wikisql
CREATE TABLE table_49421 ( "Club" text, "City" text, "Stadium" text, "Capacity" real, "2007\u201308 season" text )
What was the stadium in which the 2007-08 season placement was 8th in Serie c1/a?
SELECT "Stadium" FROM table_49421 WHERE "2007\u201308 season" = '8th in serie c1/a'
wikisql
CREATE TABLE table_40672 ( "AIRLINES" text, "IATA" text, "ICAO" text, "CALLSIGN" text, "COMMENCED OPERATIONS" real )
Who is the callsign that has ICAO of SCO?
SELECT "CALLSIGN" FROM table_40672 WHERE "ICAO" = 'sco'
wikisql
CREATE TABLE table_31365 ( "Position" text, "Singer" text, "2nd Evening" text, "3rd Evening" text, "4th Evening" text, "5th Evening" text )
How many singers got 2nd place in the 4th evening?
SELECT COUNT("2nd Evening") FROM table_31365 WHERE "4th Evening" = '2nd place'
wikisql
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_DIRE_CD text, MED_DIRE_NM text,...
列出对于病人80270684医疗记录里医疗费总额高于3516.12元的入院诊断疾病编号是什么?其名称叫什么?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '80270684' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3516.12)
css
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...
count the number of patients with private insurance who had implant of pulsation balloon.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Pulsation balloon implan"
mimicsql_data
CREATE TABLE table_2865020_5 ( points INTEGER, average VARCHAR )
What is the minimum number of points for teams averaging 1.412?
SELECT MIN(points) FROM table_2865020_5 WHERE average = "1.412"
sql_create_context
CREATE TABLE table_36959 ( "Outcome" text, "Date" text, "Location" text, "Surface" text, "Opponent in final" text, "Score" text )
Name the date with outcome of winner and score of 4 6 6 2 7 6 (7 4)
SELECT "Date" FROM table_36959 WHERE "Outcome" = 'winner' AND "Score" = '4–6 6–2 7–6 (7–4)'
wikisql
CREATE TABLE table_51755 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team plays at victoria park?
SELECT "Home team" FROM table_51755 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_70392 ( "Overall place" text, "Yacht name" text, "Skipper" text, "Points" text, "Combined elapsed time" text )
Which points have an Overall place of 9=, and a Skipper of nick fenton?
SELECT "Points" FROM table_70392 WHERE "Overall place" = '9=' AND "Skipper" = 'nick fenton'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
new users count by Day Of Week.
SELECT TIME_TO_STR(CreationDate, '%A') AS DOW, COUNT(Id) FROM Users GROUP BY TIME_TO_STR(CreationDate, '%A')
sede
CREATE TABLE table_49455 ( "Year" real, "Album" text, "Artist" text, "Song" text, "Note" text )
Which album had the note tape [tape echo]?
SELECT "Album" FROM table_49455 WHERE "Note" = 'tape [tape echo]'
wikisql
CREATE TABLE table_28211213_1 ( affiliation VARCHAR, institution VARCHAR )
How many affiliations does the University of Toledo have?
SELECT COUNT(affiliation) FROM table_28211213_1 WHERE institution = "University of Toledo"
sql_create_context
CREATE TABLE table_62175 ( "Date" text, "Round" real, "Pair" text, "Ages" text, "Dance" text, "Song" text )
How old were Mitchell & Jessica when they danced the Cha-Cha-Cha?
SELECT "Ages" FROM table_62175 WHERE "Dance" = 'cha-cha-cha' AND "Pair" = 'mitchell & jessica'
wikisql
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) )
How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges. Plot them as pie chart.
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose ethnicity is black/haitian and drug name is phenylephrine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug = "Phenylephrine"
mimicsql_data
CREATE TABLE table_203_793 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
how many international goals did juan g mez gonz lez score against yugoslavia ?
SELECT COUNT(*) FROM table_203_793 WHERE "opponent" = 'yugoslavia'
squall
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 ...
我想知道病人79373971在2004年4月25日到2019年4月28日内开出的所有检验报告单的科室编码以及名称都是哪些?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '79373971' AND jybgb.BGRQ BETWEEN '2004-04-25' AND '2019-...
css
CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text ) CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, ...
List each test result and its count in descending order of count.
SELECT test_result, COUNT(*) FROM student_tests_taken GROUP BY test_result ORDER BY COUNT(*) DESC
spider
CREATE TABLE table_name_77 ( stadium VARCHAR, club VARCHAR )
Which stadium has Seongnam Ilhwa Chunma?
SELECT stadium FROM table_name_77 WHERE club = "seongnam ilhwa chunma"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, ...
what is the seating capacity of the 757
SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = '757'
atis
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int...
Which area did I score the most C- 's in ?
SELECT DISTINCT DERIVED_TABLEalias0.DERIVED_FIELDalias1 FROM (SELECT AREAalias0.area, COUNT(*) INNER JOIN student_record ON student_record.course_id = AREAalias0.course_id WHERE student_record.grade LIKE 'C-' AND student_record.student_id = 1 GROUP BY AREAalias0.area) AS DERIVED_TABLEalias0 WHERE DERIVED_TABLEalias0.DE...
advising
CREATE TABLE table_70918 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
With less than 7 Silver medals, how many Gold medals did Canada receive?
SELECT MAX("Gold") FROM table_70918 WHERE "Nation" = 'canada' AND "Silver" < '7'
wikisql
CREATE TABLE table_name_85 ( claimed_sales VARCHAR, genre VARCHAR )
What is the number of claimed sales in the rock genre?
SELECT claimed_sales FROM table_name_85 WHERE genre = "rock"
sql_create_context
CREATE TABLE table_name_96 ( time_retired VARCHAR, driver VARCHAR, grid VARCHAR, laps VARCHAR )
I want the time/retired with grid less than 22 and Laps less than 33 for john surtees
SELECT time_retired FROM table_name_96 WHERE grid < 22 AND laps < 33 AND driver = "john surtees"
sql_create_context
CREATE TABLE table_name_18 ( place VARCHAR, country VARCHAR )
What is the Place of the Player from New Zealand?
SELECT place FROM table_name_18 WHERE country = "new zealand"
sql_create_context
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
What is the last name of each student who is not allergic to any type of food? Count them with a bar chart, and could you rank from high to low by the total number please?
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName ORDER BY COUNT(LName) DESC
nvbench
CREATE TABLE table_63402 ( "Position" real, "Gymnast" text, "A Score" real, "B Score" real, "Total" real )
What is the Position of the person with a total less than 16.65 and an A score of 7.4?
SELECT MIN("Position") FROM table_63402 WHERE "Total" < '16.65' AND "A Score" = '7.4'
wikisql
CREATE TABLE fielding_postseason ( player_id text, year number, team_id text, league_id text, round text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, tp number, pb number, sb number, cs number ) CREATE TAB...
What are the first name and last name of the players whose death record is empty?
SELECT name_first, name_last FROM player WHERE death_year = ''
spider
CREATE TABLE table_25668962_1 ( us_viewers__million_ VARCHAR, production_code VARCHAR )
How many million U.S. viewers watched the episode with a production code of 1arc03?
SELECT us_viewers__million_ FROM table_25668962_1 WHERE production_code = "1ARC03"
sql_create_context
CREATE TABLE table_name_81 ( away_captain VARCHAR, venue VARCHAR )
Who was the away captain for matches played at Trent Bridge?
SELECT away_captain FROM table_name_81 WHERE venue = "trent bridge"
sql_create_context
CREATE TABLE enzyme ( id VARCHAR, enzyme_id VARCHAR ) CREATE TABLE medicine_enzyme_interaction ( id VARCHAR, enzyme_id VARCHAR )
How many enzymes do not have any interactions?
SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction)
sql_create_context
CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date time, job_id text, salary number, commission_pct number, manager_id number, department_id number ) CREATE TABLE regions ( region_id number, region_n...
What are the names of departments that have at least one employee.
SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id
spider
CREATE TABLE table_26324 ( "Episode number Production number" text, "Title" text, "Original airing" text, "Rating" text, "Share" real, "Rating/share (18\u201349)" text, "Total viewers (in millions)" text )
What was the reating share when the total viewers was 11.49 million?
SELECT "Rating/share (18\u201349)" FROM table_26324 WHERE "Total viewers (in millions)" = '11.49'
wikisql
CREATE TABLE table_name_51 ( home VARCHAR, points VARCHAR, score VARCHAR )
Points of 31, and a Score of 1 - 5 is what home?
SELECT home FROM table_name_51 WHERE points = 31 AND score = "1 - 5"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
what are the five most frequently ordered laboratory tests for patients who have been diagnosed with left bb block nec previously during the same hospital visit, since 1 year ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE table_47732 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
Which Game has a Score of 101-109 (ot)?
SELECT AVG("Game") FROM table_47732 WHERE "Score" = '101-109 (ot)'
wikisql
CREATE TABLE table_name_21 ( date VARCHAR, city VARCHAR )
What date was the game in Minneapolis?
SELECT date FROM table_name_21 WHERE city = "minneapolis"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what's the number of patients who were hospitalized since 1 year ago?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-1 year')
eicu
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, seq...
Draw a bar chart of type versus the total number, I want to sort x axis in desc order.
SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY Type DESC
nvbench
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
Show name and distance for all aircrafts by a bar chart.
SELECT name, distance FROM aircraft
nvbench
CREATE TABLE table_32589 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Kickoff Time" text, "Attendance" text )
What is the result of the game after week 5 against the st. louis rams?
SELECT "Result" FROM table_32589 WHERE "Week" > '5' AND "Opponent" = 'st. louis rams'
wikisql
CREATE TABLE table_30444 ( "Stadium" text, "Capacity" real, "City" text, "Country" text, "Tenant" text, "Opening" text )
Name the country for athens
SELECT COUNT("Country") FROM table_30444 WHERE "City" = 'Athens'
wikisql
CREATE TABLE table_15636 ( "Rank" real, "Team" text, "Country" text, "Value ($M)" real, "% change on year" real, "Revenue ($M)" real )
Which team has a value less than 377 million in Germany with a rank of 17?
SELECT "Team" FROM table_15636 WHERE "Value ($M)" < '377' AND "Country" = 'germany' AND "Rank" = '17'
wikisql
CREATE TABLE table_37556 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Which Score has a Date of 13 april 1997?
SELECT "Score" FROM table_37556 WHERE "Date" = '13 april 1997'
wikisql
CREATE TABLE table_204_132 ( id number, "year" number, "location" text, "men's individual" text, "women's individual" text, "men's team" text, "women's team" text, "mixed team" text, "ref" number )
how many different locations are there ?
SELECT COUNT(DISTINCT "location") FROM table_204_132
squall
CREATE TABLE table_69811 ( "Year" text, "Men's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Which year has a Men's doubles of marcus ellis peter mills?
SELECT "Year" FROM table_69811 WHERE "Men's doubles" = 'marcus ellis peter mills'
wikisql
CREATE TABLE table_name_18 ( date VARCHAR, home_team VARCHAR )
What was the date of the game where Geelong was the home team?
SELECT date FROM table_name_18 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text )
Visualize a bar chart for how many authors submit to the workshop, sort Author in descending order please.
SELECT Author, COUNT(Author) FROM submission GROUP BY Author ORDER BY Author DESC
nvbench
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
Number of days where Max rep has been achieved.
WITH Vals AS (SELECT v.CreationDate, SUM(CASE WHEN vt.Id = 1 THEN 15 WHEN p.PostTypeId = 2 AND vt.Id = 2 THEN 10 WHEN p.PostTypeId = 1 AND vt.Id = 2 THEN 5 WHEN vt.Id = 3 THEN -2 ELSE 0 END) AS DailyRep FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE Own...
sede
CREATE TABLE table_name_27 ( date VARCHAR, winning_driver VARCHAR )
What date was the winning driver Antonio Ascari?
SELECT date FROM table_name_27 WHERE winning_driver = "antonio ascari"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, ...
在2004年8月14日到2017年5月20日内有多少医生接诊了名叫柏梦竹的患者?
SELECT COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '柏梦竹' AND mzjzjlb.JZKSRQ BETWEEN '2004-08-14' AND '2017-05-20'
css
CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) CREATE TABLE pilot ( Pilot_Id int(11), Name varchar(50), Age int(11) ) CREATE TABLE airport_aircraft...
What are the descriptions for the aircrafts, and count them by a pie chart
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description
nvbench
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 hz_info ( KH text, KLX number...
查询下检测指标名称和结果定量单位跟记录62265952103相同但结果定量小于记录62265952103的检验指标记录
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '62265952103') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '62265952103') AND jyjgzbb.JCZBJGDL < (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '62265952103')
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what is days of hospital stay and discharge time of subject name bessie giordano?
SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.name = "Bessie Giordano"
mimicsql_data
CREATE TABLE table_11895 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the Home team of geelong played, what was their lowest Crowd number?
SELECT MIN("Crowd") FROM table_11895 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
Which patients were ordered a rbc csf lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "RBC, CSF"
mimicsql_data
CREATE TABLE table_name_83 ( game INTEGER, record VARCHAR )
Which Game is the highest one that has a Record of 4-3-6?
SELECT MAX(game) FROM table_name_83 WHERE record = "4-3-6"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the number of patients who had (aorto)coronary bypass of two coronary arteries and were admitted for more than 10 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "10" AND procedures.long_title = "(Aorto)coronary bypass of two coronary arteries"
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...
在2008年4月28日到2018年10月12日之间参保人韦逸馨门诊手术费一共是多少?
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '韦逸馨' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-04-28' AND '2018-10-12' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb...
css
CREATE TABLE table_name_5 ( race_2 VARCHAR, driver VARCHAR )
What is Race 2, when Driver is 'Paul Radisich'?
SELECT race_2 FROM table_name_5 WHERE driver = "paul radisich"
sql_create_context
CREATE TABLE table_17521433_1 ( average VARCHAR, evening_gown VARCHAR )
What was the average score for the country with the evening gown score of 9.100?
SELECT COUNT(average) FROM table_17521433_1 WHERE evening_gown = "9.100"
sql_create_context