context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
what are some good restaurants on bethel island rd in bethel island ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_16432543_1 ( nickname VARCHAR, established VARCHAR )
Nickname of the school established in 1773
SELECT nickname FROM table_16432543_1 WHERE established = 1773
sql_create_context
CREATE TABLE table_14903627_1 ( mens_doubles VARCHAR, womens_doubles VARCHAR )
WHAT ARE THE NAMES OF THE MENS DOUBLES WHEN THE WOMENS DOUBLES WAS PIRET HAMER HELEN REINO?
SELECT mens_doubles FROM table_14903627_1 WHERE womens_doubles = "Piret Hamer Helen Reino"
sql_create_context
CREATE TABLE table_74696 ( "Player" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text, "Venue" text, "Date" text )
How many drops did Nicky Little have in Hong Kong?
SELECT "Drop" FROM table_74696 WHERE "Player" = 'nicky little' AND "Venue" = 'hong kong'
wikisql
CREATE TABLE table_41247 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text, "2011\u201312" text, "2012\u201313" text )
What is the result in 2008-09 that has a 2011-12 result of qf?
SELECT "2008\u201309" FROM table_41247 WHERE "2011\u201312" = 'qf'
wikisql
CREATE TABLE table_name_66 ( home_team VARCHAR, venue VARCHAR )
What is the home team's score at corio oval?
SELECT home_team AS score FROM table_name_66 WHERE venue = "corio oval"
sql_create_context
CREATE TABLE fgwyjzb ( 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, ...
从二零一一年七月二十九日到二零一五年一月三十一日,查询患者59339462的住院次数
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '59339462' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-07-29' AND '2015-01-31' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '59339462' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2011-07-29' AND '2015-01-31' AND fgwyjzb.CLINIC_TYPE = '住院...
css
CREATE TABLE table_name_51 ( year INTEGER, country_territory VARCHAR )
What's the average year lebanon won?
SELECT AVG(year) FROM table_name_51 WHERE country_territory = "lebanon"
sql_create_context
CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE student_course_e...
What are the student ID and login name of the student who are enrolled in the most courses?
SELECT T1.student_id, T2.login_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is language of subject id 3343?
SELECT demographic.language FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_23705 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Spanish title" text, "Director" text, "Result" text )
Who was the director of the film that was not nominated and had the Spanish title of play?
SELECT "Director" FROM table_23705 WHERE "Result" = 'Not Nominated' AND "Spanish title" = 'Play'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
在检测指标名称与检测指标结果定量单位上,与检验指标记录67375587183相同,且检测指标结果定量小于等于其的检验指标记录是哪些
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '67375587183') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '67375587183') AND JCZBJGDL <= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '67375587183')
css
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty ( facid number, lname text, fname text, ran...
Give me the number of faculty members who participate in an activity
SELECT COUNT(DISTINCT facid) FROM faculty_participates_in
spider
CREATE TABLE table_79896 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Who was the opponent at the game when the record was 22-13?
SELECT "Opponent" FROM table_79896 WHERE "Record" = '22-13'
wikisql
CREATE TABLE table_name_7 ( avg VARCHAR, long VARCHAR )
What is the average for the RB with an 8 yard long?
SELECT COUNT(avg) FROM table_name_7 WHERE long = 8
sql_create_context
CREATE TABLE table_71150 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
How many gold medals for bellbrook HS with less than 1 silver?
SELECT COUNT("Gold Medals") FROM table_71150 WHERE "Ensemble" = 'bellbrook hs' AND "Silver Medals" < '1'
wikisql
CREATE TABLE table_name_3 ( year INTEGER, engine VARCHAR, entrant VARCHAR )
How many years did John Player Lotus used Cosworth v8?
SELECT SUM(year) FROM table_name_3 WHERE engine = "cosworth v8" AND entrant = "john player lotus"
sql_create_context
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
What are the number of rooms for each bed type Show bar chart, I want to show by the x axis in ascending.
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType
nvbench
CREATE TABLE table_18123274_1 ( director VARCHAR, original_title VARCHAR )
Name the total number of director for oro diablo
SELECT COUNT(director) FROM table_18123274_1 WHERE original_title = "Oro Diablo"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, Li...
Test - top users reputation from India.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%India%' OR UPPER(Location) LIKE '%India%' OR Location LIKE '%India%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
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 )
Who has friends that are older than the average age? Print their friends and their ages as well using a pie chart.
SELECT friend, age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person)
nvbench
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar...
Is MATSCIE 526 having morning classes ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'MATSCIE' AND course.number = 526 AND semester.semester = 'WN' AND semester.semester_id = course_...
advising
CREATE TABLE mill ( name VARCHAR, LOCATION VARCHAR )
What are the names of the mills which are not located in 'Donceel'?
SELECT name FROM mill WHERE LOCATION <> 'Donceel'
sql_create_context
CREATE TABLE table_name_54 ( manager VARCHAR, current_club VARCHAR )
What is the name of the manager of the Atl tico Baleares?
SELECT manager FROM table_name_54 WHERE current_club = "atlético baleares"
sql_create_context
CREATE TABLE table_21265 ( "Athlete" text, "Event" text, "Swim (1.5km)" text, "Trans 1" text, "Bike (40km)" text, "Trans 2" text, "Run (10km)" text, "Total Time" text, "Rank" real )
How many athletes completed a trans 1 within 0:26?
SELECT COUNT("Athlete") FROM table_21265 WHERE "Trans 1" = '0:26'
wikisql
CREATE TABLE table_61708 ( "Pos." text, "Class" text, "Entrant" text, "Drivers" text, "Laps" real )
What were the highest laps for glenn seton gregg hansford?
SELECT MAX("Laps") FROM table_61708 WHERE "Drivers" = 'glenn seton gregg hansford'
wikisql
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), 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, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by time, and could you list by the y-axis in asc?
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE table_37181 ( "Year(s)" real, "Grand Final Television Commentator" text, "Grand Final Dual Television Commentator" text, "Spokesperson" text, "Semi Final Television Commentator" text, "Semi Final Dual Television Commentator" text )
What is the semi-final television commentator status in 1962 with an unknown spokesperson?
SELECT "Semi Final Television Commentator" FROM table_37181 WHERE "Spokesperson" = 'unknown' AND "Year(s)" = '1962'
wikisql
CREATE TABLE table_64263 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text )
What was the game when the record was 31-15?
SELECT "Game" FROM table_64263 WHERE "Record" = '31-15'
wikisql
CREATE TABLE table_26352332_4 ( years_produced VARCHAR, engine_family VARCHAR )
For the engine family MaxxForce 11, what is the years produced?
SELECT years_produced FROM table_26352332_4 WHERE engine_family = "MaxxForce 11"
sql_create_context
CREATE TABLE table_16699 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text )
who is the season result where margin is 51
SELECT "Season Result" FROM table_16699 WHERE "Margin" = '51'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose admission type is emergency and year of death is less than or equal to 2180?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year <= "2180.0"
mimicsql_data
CREATE TABLE table_29203 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 28 Aug" text )
What was the Sat 21 Aug time for the driver whose Thurs 26 Aug time was 20' 56.01 108.143mph?
SELECT "Sat 21 Aug" FROM table_29203 WHERE "Thurs 26 Aug" = '20'' 56.01 108.143mph'
wikisql
CREATE TABLE table_15026994_2 ( writer VARCHAR, viewing_figure VARCHAR )
What writers are associated with a viewing figure of 7.01 million?
SELECT writer FROM table_15026994_2 WHERE viewing_figure = "7.01 million"
sql_create_context
CREATE TABLE table_6566 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of silver medals of the team ranked 7 with more than 1 total medal?
SELECT COUNT("Silver") FROM table_6566 WHERE "Rank" = '7' AND "Total" > '1'
wikisql
CREATE TABLE table_62905 ( "Rank" real, "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text )
What is the highest Rank 1960 ?
SELECT MAX("Rank") FROM table_62905 WHERE "Years" = '1960—'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, c...
Bar chart x axis customer last name y axis how many customer last name, and sort from high to low by the y axis.
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY COUNT(customer_last_name) DESC
nvbench
CREATE TABLE table_name_9 ( winning_driver VARCHAR, race_name VARCHAR )
Which driver won the iv j.c.c. jersey road race?
SELECT winning_driver FROM table_name_9 WHERE race_name = "iv j.c.c. jersey road race"
sql_create_context
CREATE TABLE table_name_10 ( tie_no VARCHAR, away_team VARCHAR )
What shows for Tie no when Sheffield United was the Away team?
SELECT tie_no FROM table_name_10 WHERE away_team = "sheffield united"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
calculate the four year survival rate of the patients diagnosed with chr blood loss anemia.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
mimic_iii
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...
比较下医疗费明细支出记录22687525523中,药品单价和数目相乘是不是能得到药品的总花费
SELECT (SELECT t_kc22.QTY * t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '22687525523') = (SELECT t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '22687525523')
css
CREATE TABLE table_14345690_4 ( finished VARCHAR, exited VARCHAR )
Name the finished for exited day 13
SELECT finished FROM table_14345690_4 WHERE exited = "Day 13"
sql_create_context
CREATE TABLE table_name_64 ( distance VARCHAR, pilot VARCHAR )
What is Distance, when Pilot is 'Stanislaw Wujczak'?
SELECT distance FROM table_name_64 WHERE pilot = "stanislaw wujczak"
sql_create_context
CREATE TABLE table_78546 ( "Tujunga" text, "La Crescenta- Montrose" text, "Glendale" text, "La Ca\u00f1ada Flintridge" text, "Pasadena" text )
What is the figure for Tujunga when Pasadena is 134,941?
SELECT "Tujunga" FROM table_78546 WHERE "Pasadena" = '134,941'
wikisql
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, other_customer_details text ) CREATE TABLE customers_cards ( card_id number, customer_id number, card_type_code text, ...
Return the code of the card type that is most common.
SELECT card_type_code FROM customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_5 ( lost INTEGER, match INTEGER )
What is the sum of losses for teams with under 10 matches?
SELECT SUM(lost) FROM table_name_5 WHERE match < 10
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
在医院0879465中编码为06717706的病患出院科室名称包含运动的住院就诊记录分别是那几个?
SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '06717706' AND hz_info.YLJGDM = '0879465' AND wdmzjzjlb.CYKSMC LIKE '%运动%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_i...
css
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number...
since 2103 what are the top four most frequent diagnoses that patients were given within the same month after being diagnosed with resp obstr-inhal obj nec?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
哪些药品是治疗患有瘙痒症的病人的,想知道这些药品的编号和名称
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_NM = '瘙痒症'
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...
那些被门诊诊断为持久的妄想性障碍的人他们的补体C4的检查结果的参考值范围下限和上限具体是多少呢?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb....
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose insurance is private and diagnoses long title is shock, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.long_title = "Shock, unspecified"
mimicsql_data
CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number ) CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text )
List the countries that have more than one mountain.
SELECT country FROM mountain GROUP BY country HAVING COUNT(*) > 1
spider
CREATE TABLE table_5681 ( "Gauge" text, "Railway" text, "Class" text, "Works no." text, "Year" text, "Builder" text )
Which builder has a railway of Rhodesia Railways?
SELECT "Builder" FROM table_5681 WHERE "Railway" = 'rhodesia railways'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在门诊诊断为疾病X60.562的患者身上其抗凝血酶III的参考值范围下限和上限具体为多少数值?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN 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.JZZDBM = 'X60.562' AND jyjgzbb.JCZBMC = '抗凝血酶III'
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
how many hours have it been since the last time patient 025-50213 was diagnosed with low cardiac output state - biventricular assist device during their current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-50213...
eicu
CREATE TABLE table_26847237_1 ( home_team VARCHAR, opposition VARCHAR )
Who was the home team when the opposition was Buller?
SELECT home_team FROM table_26847237_1 WHERE opposition = "Buller"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Draw a scatter chart about the correlation between ACC_Percent and All_Games_Percent , and group by attribute Team_Name.
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY Team_Name
nvbench
CREATE TABLE table_12400 ( "Athlete" text, "Country" text, "Run 1" real, "Run 2" real, "Run 3" real, "Run 4" real, "Total" text )
Which Run 4 has a Country of united states, and an Athlete of bree schaaf emily azevedo, and a Run 3 smaller than 58.04?
SELECT SUM("Run 4") FROM table_12400 WHERE "Country" = 'united states' AND "Athlete" = 'bree schaaf emily azevedo' AND "Run 3" < '58.04'
wikisql
CREATE TABLE table_11900773_6 ( paper_type VARCHAR, design VARCHAR )
How many paper types did Ian Drolet design stamps on?
SELECT COUNT(paper_type) FROM table_11900773_6 WHERE design = "Ian Drolet"
sql_create_context
CREATE TABLE table_name_89 ( bodyweight INTEGER, snatch VARCHAR )
what is the average bodyweight when snatch is 80?
SELECT AVG(bodyweight) FROM table_name_89 WHERE snatch = 80
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
how many patients have had a proximal gastrectomy procedure?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'proximal gastrectomy'))
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
when was the last hospital admission time when patient 028-45936 was admitted via an recovery room?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '028-45936' AND patient.hospitaladmitsource = 'recovery room' ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CRE...
i'd like to know the price of FIRST class seats from ATLANTA to SAN FRANCISCO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
atis
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 lab ( subject_id text, hadm_id text, ...
count the number of patients whose drug code is lido2/5j and lab test fluid is urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LIDO2/5J" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
Visualize a bar chart for what are the different classes of races, and how many races correspond to each?, list by the y-axis from high to low.
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_70486 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the score for the game with an attendance greater than 33,658 and a record of 73-66?
SELECT "Score" FROM table_70486 WHERE "Attendance" > '33,658' AND "Record" = '73-66'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PendingFlags ( Id number, FlagTypeId ...
highest rated answers since a date.
SELECT A.* FROM Posts AS A INNER JOIN Posts AS Q ON A.ParentId = Q.Id INNER JOIN PostTags AS PT ON Q.Id = PT.PostId INNER JOIN Tags AS T ON PT.TagId = T.Id WHERE A.PostTypeId = 2 AND Q.PostTypeId = 1 AND A.Score >= 80 AND A.CreationDate >= CAST('2017-10-01' AS DATETIME) AND T.TagName = 'r' ORDER BY A.Score DESC
sede
CREATE TABLE table_27998152_1 ( fee VARCHAR, previous_club VARCHAR )
what is the fee for ankarag c previous club
SELECT fee FROM table_27998152_1 WHERE previous_club = "Ankaragücü"
sql_create_context
CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE TABLE university (...
What are the names of all the teams in the basketball competition, sorted by all home scores in descending order?
SELECT team_name FROM basketball_match ORDER BY all_home DESC
spider
CREATE TABLE table_67498 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text )
Which class Pos has a Team of jml team panoz?
SELECT "Class Pos." FROM table_67498 WHERE "Team" = 'jml team panoz'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
查询医疗机构2057773在07年3月15之后,住院就诊记录中有多少入院登记
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '20...
css
CREATE TABLE table_name_76 ( jockey VARCHAR, group VARCHAR )
Which jockey had a group of G3?
SELECT jockey FROM table_name_76 WHERE group = "g3"
sql_create_context
CREATE TABLE table_78244 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text )
Name the D 47 when it has a D 45 of d 32
SELECT "D 47" FROM table_78244 WHERE "D 45" = 'd 32'
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 )
What is the average age for each gender. Visualize by bar chart.
SELECT gender, AVG(age) FROM Person GROUP BY gender
nvbench
CREATE TABLE table_name_43 ( Id VARCHAR )
What shows for 1998 when 1996 is 1R, and 2002 is not held?
SELECT 1998 FROM table_name_43 WHERE 1996 = "1r" AND 2002 = "not held"
sql_create_context
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 diagnoses ( ...
get me the short title of diagnoses and days for which patient with patient id 87275 was hospitalized.
SELECT demographic.days_stay, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "87275"
mimicsql_data
CREATE TABLE table_16494599_5 ( position VARCHAR, player VARCHAR )
Which position did kevin edwards play for
SELECT position FROM table_16494599_5 WHERE player = "Kevin Edwards"
sql_create_context
CREATE TABLE zyb ( 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...
列出患者88247382医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额不少于6145.72元的
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '88247382' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6145.72) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '88247382' AND gyb.MED_CLINIC_ID IN (SELECT t_kc...
css
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...
what is the name of the specimen test that patient 025-44495 was last given since 11/2104?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2104...
eicu
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, ...
what flights go from LONG BEACH to ST. LOUIS
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 = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST....
atis
CREATE TABLE table_name_9 ( away_team VARCHAR, home_team VARCHAR )
What was the away team's score against Hawthorn?
SELECT away_team AS score FROM table_name_9 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE table_name_53 ( nhl_team VARCHAR, player VARCHAR )
Tell me the NHL team for mike gaffney
SELECT nhl_team FROM table_name_53 WHERE player = "mike gaffney"
sql_create_context
CREATE TABLE table_56389 ( "Runs" text, "Balls" text, "Batsman" text, "Versus" text, "Venue" text, "Date" text, "Strike Rate" text )
How many runs were scored when the strike rate was 101.42?
SELECT "Runs" FROM table_56389 WHERE "Strike Rate" = '101.42'
wikisql
CREATE TABLE table_name_13 ( location_attendance VARCHAR, date VARCHAR )
What was the location and attendance on the May 22 game?
SELECT location_attendance FROM table_name_13 WHERE date = "may 22"
sql_create_context
CREATE TABLE table_20319085_2 ( conference_record VARCHAR, season VARCHAR )
How many different conference records are there for season 2006?
SELECT COUNT(conference_record) FROM table_20319085_2 WHERE season = 2006
sql_create_context
CREATE TABLE table_234886_3 ( title VARCHAR, no_in_series VARCHAR )
What is the total number of titles for the episode numbered 29 in the series?
SELECT COUNT(title) FROM table_234886_3 WHERE no_in_series = 29
sql_create_context
CREATE TABLE table_202_276 ( id number, "year 1958" text, "title {the rebel" text, "role" text, "notes" text )
what year was he most featured in shows ?
SELECT "year 1958" FROM table_202_276 ORDER BY "notes" DESC LIMIT 1
squall
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 ) ...
has patient 23929 ever received any lab tests since 05/2102?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23929) AND STRFTIME('%y-%m', labevents.charttime) >= '2102-05'
mimic_iii
CREATE TABLE table_13845918_3 ( womens_doubles VARCHAR, year VARCHAR )
Name the number of women's doubles for 1986
SELECT COUNT(womens_doubles) FROM table_13845918_3 WHERE year = "1986"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
Top python answers, short time window.
SELECT u.Id AS "user_link", u.WebsiteUrl, t.TagName, SUM(Score) AS totscore FROM Posts AS p, PostTags AS pt, Tags AS t, Users AS u WHERE PostTypeId = 2 AND p.ParentId = pt.PostId AND pt.TagId = t.Id AND p.OwnerUserId = u.Id AND t.TagName = '##tag:string?python##' GROUP BY u.Id, u.WebsiteUrl, t.TagName ORDER BY totscore...
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE i...
what were the top three most common procedures in patients of age 60 or above in 2105?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', treatment.treatmenttime) = '2105' GROUP BY treatment.treatmentname...
eicu
CREATE TABLE table_35588 ( "Year" text, "Winners" text, "Score" text, "Runner-up" text, "Venue" text )
Who were the winners in 2010-2011?
SELECT "Winners" FROM table_35588 WHERE "Year" = '2010-2011'
wikisql
CREATE TABLE table_1914 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real )
how many geo id with 48.578664 are
SELECT COUNT("GEO ID") FROM table_1914 WHERE "Latitude" = '48.578664'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
在01年1月1日到21年9月10日内医疗机构4671519特需门诊的就诊记录数量一共有多少条?
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '4671519' AND JZKSRQ BETWEEN '2001-01-01' AND '2021-09-10' AND TXBZ > 0
css
CREATE TABLE table_name_70 ( session VARCHAR, circuit VARCHAR )
What was the session at the circuit of lowes motor speedway?
SELECT session FROM table_name_70 WHERE circuit = "lowes motor speedway"
sql_create_context
CREATE TABLE table_62400 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
What is the game site of the game with the san diego chargers as the opponent?
SELECT "Game site" FROM table_62400 WHERE "Opponent" = 'san diego chargers'
wikisql
CREATE TABLE table_19632728_1 ( original_air_date VARCHAR, episode__number VARCHAR )
When was the episode number 2 originally aired?
SELECT original_air_date FROM table_19632728_1 WHERE episode__number = 2
sql_create_context
CREATE TABLE table_name_18 ( venue VARCHAR, winner VARCHAR, year VARCHAR )
Where was the 1966 competition with a winner of Gary Cowan held?
SELECT venue FROM table_name_18 WHERE winner = "gary cowan" AND year = "1966"
sql_create_context
CREATE TABLE table_name_96 ( school VARCHAR, location VARCHAR, mascot VARCHAR )
Which School in Wabash has a Mascot of knights?
SELECT school FROM table_name_96 WHERE location = "wabash" AND mascot = "knights"
sql_create_context
CREATE TABLE table_26455614_1 ( entries INTEGER, winner VARCHAR )
What is the fewest recorded entrants against paris saint-germain?
SELECT MIN(entries) FROM table_26455614_1 WHERE winner = "Paris Saint-Germain"
sql_create_context