context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Student_Course_Enro...
What are the number of the completion dates of all the tests that have result 'Fail'?
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail"
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
what was the first id of patient 56201's ward this year?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56201) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_69205 ( "2003/ 04" text, "2004/ 05" text, "2007/ 08" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
What was held in 2009/10 when 2004/05 was Variant Format Tournaments?
SELECT "2009/ 10" FROM table_69205 WHERE "2004/ 05" = 'variant format tournaments'
wikisql
CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE teaches ( id text, course_id text, se...
Find the names of all instructors in Comp. Sci. department with salary > 80000.
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000
spider
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
Give the number of patients that survived and who were admitted before the year 2174.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear < "2174"
mimicsql_data
CREATE TABLE table_name_80 ( crowd VARCHAR, away_team VARCHAR )
What was the attendance when Footscray played as the away team?
SELECT COUNT(crowd) FROM table_name_80 WHERE away_team = "footscray"
sql_create_context
CREATE TABLE table_name_90 ( declination___j2000__ VARCHAR, ngc_number INTEGER )
what is the declination (j2000) when the ngc number is higher than 3593?
SELECT declination___j2000__ FROM table_name_90 WHERE ngc_number > 3593
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
Show me a bar chart for what are the department names and how many employees work in each of them?, could you list from low to high by the Y-axis?
SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME ORDER BY COUNT(*)
nvbench
CREATE TABLE table_71045 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text )
Name the category for prix uip berlin
SELECT "Category" FROM table_71045 WHERE "Nominating Festival" = 'prix uip berlin'
wikisql
CREATE TABLE table_67415 ( "2000" text, "2004" text, "2009" text, "2013" text, "Total" real )
What shows for 209 when the 2000 is , and a Total of 3, and a 2004 of 9th?
SELECT "2009" FROM table_67415 WHERE "2000" = '–' AND "Total" = '3' AND "2004" = '9th'
wikisql
CREATE TABLE mission ( mission_id number, ship_id number, code text, launched_year number, location text, speed_knots number, fate text ) CREATE TABLE ship ( ship_id number, name text, type text, nationality text, tonnage number )
List the name of ships that are not involved in any mission
SELECT name FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM mission)
spider
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
What are the last year of the parties whose theme is 'Spring' or 'Teqnology'? Bin the last year into weekday interval and count them, and could you display y-axis in descending order please?
SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" ORDER BY COUNT(Last_year) DESC
nvbench
CREATE TABLE table_8553 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
what is the date that the away team is aldershot?
SELECT "Date" FROM table_8553 WHERE "Away team" = 'aldershot'
wikisql
CREATE TABLE table_14752049_2 ( international_tourist_arrivals__2011_ VARCHAR, country VARCHAR )
How many international tourist arrivals were in Senegal in 2011?
SELECT international_tourist_arrivals__2011_ FROM table_14752049_2 WHERE country = "Senegal"
sql_create_context
CREATE TABLE table_16383772_1 ( enrollment INTEGER, school VARCHAR )
Name the maximum enrollment for niagara university
SELECT MAX(enrollment) FROM table_16383772_1 WHERE school = "Niagara University"
sql_create_context
CREATE TABLE table_49350 ( "Average population (x 1000)" text, "Live births 1" text, "Deaths 1" text, "Natural change 1" text, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real )
what is the natural change (per 1000) when the crude death rate (per 1000) is 10?
SELECT "Natural change (per 1000)" FROM table_49350 WHERE "Crude death rate (per 1000)" = '10'
wikisql
CREATE TABLE table_74635 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the venue of the game on 20 November 2002?
SELECT "Venue" FROM table_74635 WHERE "Date" = '20 november 2002'
wikisql
CREATE TABLE table_6742 ( "Buechel & Manhart spelling (pronunciation)" text, "Ullrich" text, "Brandon University" text, "Deloria & Boas" text, "Dakota Mission" text, "Rood & Taylor" text, "Riggs" text, "Williamson" text, "University of Minnesota" text, "White Hat" text )
Dakota Mission of t, and a Deloria & Boas of t , and a Ullrich of t had what white hat?
SELECT "White Hat" FROM table_6742 WHERE "Dakota Mission" = 't' AND "Deloria & Boas" = 'tʽ' AND "Ullrich" = 'tȟ'
wikisql
CREATE TABLE table_20016 ( "Region" text, "Start datum" text, "Target datum" text, "c_x ( Metre )" text, "c_y (Metre)" text, "c_z (Metre)" text, "s ( ppm )" text, "r x ( Arcsecond )" text, "r y ( Arcsecond )" text, "r z ( Arcsecond )" text )
How many values of r z(arcsecond) are associated with a target datum of Ireland 1965?
SELECT "r z ( Arcsecond )" FROM table_20016 WHERE "Target datum" = 'Ireland 1965'
wikisql
CREATE TABLE table_name_60 ( venue VARCHAR, competition VARCHAR )
What venue has euro 2004 q. as the competition?
SELECT venue FROM table_name_60 WHERE competition = "euro 2004 q."
sql_create_context
CREATE TABLE table_1973 ( "Graphics mode" real, "Char cells" text, "Pixels" text, "Hardware colours" real, "used (KB)" real, "map" text, "Type" text )
What is the used (kb) when the graphics mode is 4?
SELECT MIN("used (KB)") FROM table_1973 WHERE "Graphics mode" = '4'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
what was patient 031-23724's weight the last time in 08/last year?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-...
eicu
CREATE TABLE table_2679061_10 ( college_junior_club_team VARCHAR, nhl_team VARCHAR )
What is the name of the college/junior/club team of the Buffalo Sabres?
SELECT college_junior_club_team FROM table_2679061_10 WHERE nhl_team = "Buffalo Sabres"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
were there any results of microbiological tests on patient 64292's direct antigen test for varicella-zoster virus since 1 year ago?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64292) AND microbiologyevents.spec_type_desc = 'direct antigen test for varicella-zoster virus' AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), ...
mimic_iii
CREATE TABLE table_41573 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text )
What is Winner, when Week is 8 May, when Semi Finalists is Helena Sukov Mary Pierce, and when Runner-Up is Conchita Mart nez Patricia Tarabini?
SELECT "Winner" FROM table_41573 WHERE "Week of" = '8 may' AND "Semi finalists" = 'helena suková mary pierce' AND "Runner-up" = 'conchita martínez patricia tarabini'
wikisql
CREATE TABLE table_name_30 ( position VARCHAR, surname VARCHAR )
Which Position did Ruzic play?
SELECT position FROM table_name_30 WHERE surname = "ruzic"
sql_create_context
CREATE TABLE Addresses ( line_1 VARCHAR, address_id VARCHAR ) CREATE TABLE Student_Addresses ( monthly_rental INTEGER, address_id VARCHAR )
What are the line 1 and average monthly rentals of all student addresses?
SELECT T1.line_1, AVG(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id
sql_create_context
CREATE TABLE table_name_66 ( spacecraft VARCHAR, end_time VARCHAR )
What spacecraft had an EVA that ended at 17:28?
SELECT spacecraft FROM table_name_66 WHERE end_time = "17:28"
sql_create_context
CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, product_category_code VARCHAR(20), date_product_first_available DATETIME, date_product_discontinued DATETIME, product_name VARCHAR(80), product_description VARCHAR(255), product_price DECIMAL(19,4) ) CREATE TABLE Com...
what are all the different product names, and how many complains has each received?, and order from high to low by the Y please.
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_42 ( home_team VARCHAR, match_no VARCHAR )
Who is the Home Team for Match No. 23?
SELECT home_team FROM table_name_42 WHERE match_no = "23"
sql_create_context
CREATE TABLE table_name_29 ( name VARCHAR, round VARCHAR )
Tell me the name for round of e
SELECT name FROM table_name_29 WHERE round = "e"
sql_create_context
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
how many times was the linear rep lid lacer procedure carried out during a year before?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'linear rep lid lacer') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_name_83 ( opponent VARCHAR, method VARCHAR )
who is the opponent when the method is submission (rear naked choke) at 4:02 of round 2?
SELECT opponent FROM table_name_83 WHERE method = "submission (rear naked choke) at 4:02 of round 2"
sql_create_context
CREATE TABLE table_name_69 ( player VARCHAR, pick__number VARCHAR, mls_team VARCHAR )
Name the player for fc dallas pick number less than 3
SELECT player FROM table_name_69 WHERE pick__number < 3 AND mls_team = "fc dallas"
sql_create_context
CREATE TABLE table_28672 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
who wrote the episode having joe daniello as director with production code 6ajn05?
SELECT "Written by" FROM table_28672 WHERE "Directed by" = 'Joe Daniello' AND "Production code" = '6AJN05'
wikisql
CREATE TABLE table_3117 ( "Venue" text, "Hosted" real, "Average" real, "Highest" real, "Lowest" real, "Total" real, "Last Year" text, "Up/Down" text )
How many values of hosted have a highest value of 42659?
SELECT COUNT("Hosted") FROM table_3117 WHERE "Highest" = '42659'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
列出在医院0345841中患者吕香馨不包含室的就诊科室名称所有门诊就诊记录的流水号是什么?
SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '吕香馨' AND hz_info.YLJGDM = '0345841' AND NOT txmzjzjlb.JZKSMC LIKE '%室%' UNION SELECT ftxmzjzj...
css
CREATE TABLE table_name_74 ( year VARCHAR, notes VARCHAR )
Which Year has Notes of 87.17 m?
SELECT year FROM table_name_74 WHERE notes = "87.17 m"
sql_create_context
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 wdmzjzjlb ( HXPLC number, HZX...
病患40717294诊断为I86.192疾病时在门诊检测指标763289的结果定量及其单位各是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE table_name_70 ( pick__number INTEGER, league_from VARCHAR )
What is the lowest pick number for the Russian Major League?
SELECT MIN(pick__number) FROM table_name_70 WHERE league_from = "russian major league"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
Which 300 -level classes are being taught in Spring and Summer term ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou...
advising
CREATE TABLE table_name_52 ( rank VARCHAR, bronze VARCHAR, silver VARCHAR )
what is the rank when bronze is less than 1 and silver is less than 1?
SELECT rank FROM table_name_52 WHERE bronze < 1 AND silver < 1
sql_create_context
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE t...
Bar chart x axis location y axis the average of number of platforms, and rank total number in descending order.
SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location ORDER BY AVG(Number_of_Platforms) DESC
nvbench
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATET...
Show me about the distribution of login_name and author_id in a bar chart.
SELECT login_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE m...
in the last hospital encounter when patient 031-23724 last got a microbiology test?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_name_15 ( away_team VARCHAR )
What was the score of essendon when they were the away team?
SELECT away_team AS score FROM table_name_15 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE table_name_21 ( driver VARCHAR, laps VARCHAR, grid VARCHAR, constructor VARCHAR )
Who drove the renault that went over 23 laps and had a grid under 11?
SELECT driver FROM table_name_21 WHERE grid < 11 AND constructor = "renault" AND laps > 23
sql_create_context
CREATE TABLE table_65972 ( "Rank" real, "Player" text, "From" text, "Transfer Fee (\u20ac millions)" text, "Year" real )
Where was Alex Song signed from after 2010?
SELECT "From" FROM table_65972 WHERE "Year" > '2010' AND "Player" = 'alex song'
wikisql
CREATE TABLE table_37719 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall WC points (Rank)" text )
Which 2nd (m) is the lowest one that has a Rank larger than 3, and a 1st (m) larger than 140.5?
SELECT MIN("2nd (m)") FROM table_37719 WHERE "Rank" > '3' AND "1st (m)" > '140.5'
wikisql
CREATE TABLE qtb ( 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...
花费的医疗费总额不少于1973.76元的次数在患者72169223的医疗记录有多少,其有什么编号的病是入院诊断出来的,叫啥名?
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '72169223' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1973.76) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '72169223' AND gyb.MED_CLINIC_ID IN (SELECT t_kc...
css
CREATE TABLE table_name_62 ( outcome VARCHAR, partner VARCHAR )
What was the outcome of the final with a partner of Brett Steven?
SELECT outcome FROM table_name_62 WHERE partner = "brett steven"
sql_create_context
CREATE TABLE table_name_22 ( score VARCHAR, date VARCHAR )
What was the score on March 4?
SELECT score FROM table_name_22 WHERE date = "march 4"
sql_create_context
CREATE TABLE table_71538 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Earnings ( $ )" real )
Which player has a score of 74-74-73-70=291?
SELECT "Player" FROM table_71538 WHERE "Score" = '74-74-73-70=291'
wikisql
CREATE TABLE claims_processing ( claim_processing_id number, claim_id number, claim_outcome_code text, claim_stage_id number, staff_id number ) CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE claims_processing_stages ( claim_stage_id number, next_c...
Which customers have an insurance policy with the type code 'Deputy'? Give me the customer details.
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy"
spider
CREATE TABLE table_69878 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "Career SR" text )
What is the Career SR of the year that held the masters series Sr tournament
SELECT "Career SR" FROM table_69878 WHERE "Tournament" = 'masters series sr'
wikisql
CREATE TABLE Staff ( staff_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, product_category_code VARCHAR(20), date_product_...
What is the average price of the products for each category, I want to show from high to low by the mean product price please.
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY AVG(product_price) DESC
nvbench
CREATE TABLE table_75954 ( "Tournament" text, "2006" text, "2009" text, "2012" text, "2013" text )
What shows for 2013 when the 2012 is 2r, and a 2009 is 2r?
SELECT "2013" FROM table_75954 WHERE "2012" = '2r' AND "2009" = '2r'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
what is the five most common procedure given to patients with age 20s the last year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE table_name_66 ( time VARCHAR, notes VARCHAR, country VARCHAR )
What is the Time of the Great Britain players with Notes of SA/B?
SELECT time FROM table_name_66 WHERE notes = "sa/b" AND country = "great britain"
sql_create_context
CREATE TABLE table_name_87 ( total VARCHAR, year_s__won VARCHAR, to_par VARCHAR )
What is the total for 1986 with a to par higher than 6?
SELECT COUNT(total) FROM table_name_87 WHERE year_s__won = "1986" AND to_par > 6
sql_create_context
CREATE TABLE table_36005 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
Which Attendance has a Tie # of 15?
SELECT "Attendance" FROM table_36005 WHERE "Tie no" = '15'
wikisql
CREATE TABLE table_8233 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
What is the date of game 3 with Boston as the road team?
SELECT "Date" FROM table_8233 WHERE "Road Team" = 'boston' AND "Game" = 'game 3'
wikisql
CREATE TABLE table_name_53 ( took_office VARCHAR, vice INTEGER )
When did the vice president with a vice over 6 take office?
SELECT took_office FROM table_name_53 WHERE vice > 6
sql_create_context
CREATE TABLE table_45643 ( "Ceremony" text, "Award" text, "Category" text, "Name" text, "Outcome" text )
Which ceremony has the best lyricist category?
SELECT "Ceremony" FROM table_45643 WHERE "Category" = 'best lyricist'
wikisql
CREATE TABLE table_2620 ( "Office" text, "Type" text, "Location" text, "Elected" text, "Term began" text, "Term ended" text )
When did the term begin that ended January 3, 1995?
SELECT "Term began" FROM table_2620 WHERE "Term ended" = 'January 3, 1995'
wikisql
CREATE TABLE table_name_78 ( place VARCHAR, score VARCHAR )
What was the place for the player whose final score was 71-69=140?
SELECT place FROM table_name_78 WHERE score = 71 - 69 = 140
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
患者58997444在二00五年七月十四日到二0一四年三月十三日期间,最常找的医生是哪位
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '58997444' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-07-14' AND '2014-03-13' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_64393 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
What is the average number of losses for teams with under 4 losses and under 21 points?
SELECT AVG("Drawn") FROM table_64393 WHERE "Lost" < '4' AND "Points" < '21'
wikisql
CREATE TABLE table_63478 ( "District" real, "Incumbent" text, "2008 Status" text, "Democratic" text, "Republican" text, "Green" text )
Who was the Republican in the district more than 4?
SELECT "Republican" FROM table_63478 WHERE "District" > '4'
wikisql
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE DEPARTMENT ( DEPT_CODE var...
A pie chart about what is the total credit does each department offer?
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_20978 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Falcons points" real, "Opponents" real, "Record" text, "Attendance" real )
What is the total number of opponents for the game recorded as 1-3?
SELECT COUNT("Opponent") FROM table_20978 WHERE "Record" = '1-3'
wikisql
CREATE TABLE table_69222 ( "Edition" text, "Round" text, "Date" text, "Partnering" text, "Against" text, "Surface" text, "Opponents" text, "Result" text )
On what surface did Poland play as the against team?
SELECT "Surface" FROM table_69222 WHERE "Against" = 'poland'
wikisql
CREATE TABLE table_43322 ( "Competition" text, "Ladder Position" text, "Coach" text, "Captain(s)" text, "Details" text )
Who is the coach of the 2012 Gold Coast Titans season?
SELECT "Coach" FROM table_43322 WHERE "Details" = '2012 gold coast titans season'
wikisql
CREATE TABLE table_2006661_1 ( scott VARCHAR, species VARCHAR )
Name the scott for chloropsis hardwickii
SELECT scott FROM table_2006661_1 WHERE species = "Chloropsis hardwickii"
sql_create_context
CREATE TABLE table_77315 ( "Position" real, "Driver / Passenger" text, "Equipment" text, "Bike No" real, "Points" real )
What is the Equipment that has a Point bigger than 256, and a Position of 3?
SELECT "Equipment" FROM table_77315 WHERE "Points" > '256' AND "Position" = '3'
wikisql
CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Assets_in_Events ( Asset_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHAR(255) ) CREATE TABLE Finances ( Finance_ID INTEGER, Other_Details VARCHAR(255) ...
What is the total number of different types of codes of products?, and show Y-axis in ascending order.
SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(Product_Type_Code)
nvbench
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
what is patient 028-70851's age when they came to the hospital last time?
SELECT patient.age FROM patient WHERE patient.uniquepid = '028-70851' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
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 those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the sum of salary , and group by attribute job_id, and could you list in asc by the y axis please?
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(SALARY)
nvbench
CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, company_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), other_details VARCHAR(255) ) CREATE TABLE Part_Faults ( part_fault_id INTEGER, part_id INTEGER, fault_short_name VARCHAR(20), fault_description VARCHAR(255), ...
Give me a histogram for which parts have more than 2 faults? Show the part name and id, and show by the y axis from low to high.
SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_id
nvbench
CREATE TABLE table_26239 ( "Episode Title" text, "Song(s) Title" text, "Writer" text, "Singer(s)" text, "Album(s)" text )
What album was the song It's going so badly on?
SELECT "Album(s)" FROM table_26239 WHERE "Song(s) Title" = 'It''s Going So Badly'
wikisql
CREATE TABLE table_27988559_1 ( directed_by VARCHAR, no_in_season VARCHAR )
Who directed episode 2 of the season?
SELECT directed_by FROM table_27988559_1 WHERE no_in_season = 2
sql_create_context
CREATE TABLE table_30581 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What is the postion when the nhl team is los angeles kings?
SELECT "Position" FROM table_30581 WHERE "NHL team" = 'Los Angeles Kings'
wikisql
CREATE TABLE table_40348 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Score on 11 march 2001?
SELECT "Score" FROM table_40348 WHERE "Date" = '11 march 2001'
wikisql
CREATE TABLE Office_locations ( building_id VARCHAR, company_id VARCHAR ) CREATE TABLE Companies ( name VARCHAR, id VARCHAR ) CREATE TABLE buildings ( name VARCHAR, id VARCHAR )
List the name of a building along with the name of a company whose office is in the building.
SELECT T3.name, T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what's the average hospital cost if there is opioid dependence-remiss since 2105?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'opioid dependence-remiss')) AND STRFTIME('%y', cost.chargetime)...
mimic_iii
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...
get me the number of patients transferred within their own facility with unique drug code ketr30i.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.formulary_drug_cd = "KETR30I"
mimicsql_data
CREATE TABLE table_name_51 ( date VARCHAR, status VARCHAR, against VARCHAR )
What day was the against 22 and the status tour match?
SELECT date FROM table_name_51 WHERE status = "tour match" AND against = 22
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
列出患者74086370医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额超过4198.44元的
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '74086370' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4198.44)
css
CREATE TABLE table_23929 ( "County" text, "Obama#" real, "Obama%" text, "McCain#" real, "McCain%" text )
In what county did McCain get 57.8%?
SELECT "County" FROM table_23929 WHERE "McCain%" = '57.8%'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
New accounts per day (moving average).
WITH accountsByDate AS (SELECT DATE(u.CreationDate) AS "date", COUNT(*) AS numUsers FROM Users AS u GROUP BY DATE(u.CreationDate)) SELECT a."date", AVG(a.numUsers) OVER (ORDER BY a."date" ROWS BETWEEN '##MovingAvg:int?20##' PRECEDING AND CURRENT ROW) FROM accountsByDate AS a WHERE a."date" >= '2016-01-01'
sede
CREATE TABLE table_name_73 ( score VARCHAR, visitor VARCHAR )
Name the score for columbus visitor
SELECT score FROM table_name_73 WHERE visitor = "columbus"
sql_create_context
CREATE TABLE table_name_66 ( time VARCHAR, record VARCHAR )
What is the time where the record is 10-1?
SELECT time FROM table_name_66 WHERE record = "10-1"
sql_create_context
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 who had pressure ulcer, stage iv, calculate the number of those who had abnormal delta test results.
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.long_title = "Pressure ulcer, stage IV" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_255205_1 ( joined VARCHAR, institution VARCHAR )
How many joined Manchester University?
SELECT joined FROM table_255205_1 WHERE institution = "Manchester University"
sql_create_context
CREATE TABLE table_31318 ( "Year" text, "Conductor" text, "Opera House or Orchestra" text, "Label" text, "Countess" text, "Count" text, "Flamand" text, "Olivier" text, "La Roche" text, "Clairon" text )
When hermann uhde is the count who is the conductor?
SELECT "Conductor" FROM table_31318 WHERE "Count" = 'Hermann Uhde'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id numbe...
what is patient 71559's monthly minimum glucose level until 03/2103?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71559) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND STRFTIME('%y-%m', labevents.charttime) <= '2103-03' GROUP BY ...
mimic_iii
CREATE TABLE table_name_50 ( score VARCHAR, date VARCHAR )
What score was on 13 June 2004?
SELECT score FROM table_name_50 WHERE date = "13 june 2004"
sql_create_context
CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, ...
weekday
SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID
nvbench
CREATE TABLE table_20524090_1 ( mccain_percentage VARCHAR, county VARCHAR )
What percentage of the vote did McCain win in Waynesboro (city)?
SELECT mccain_percentage FROM table_20524090_1 WHERE county = "Waynesboro (city)"
sql_create_context
CREATE TABLE table_37258 ( "Club" text, "Total points" text, "Bonus points" text, "Match points" text, "Games" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Diff" text )
What are the total points that had 68 match points, 9 bonus points and 30 games?
SELECT "Total points" FROM table_37258 WHERE "Games" = '30' AND "Bonus points" = '9' AND "Match points" = '68'
wikisql