context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_47 ( rank INTEGER, director VARCHAR )
what is the highest rank for director john woo?
SELECT MAX(rank) FROM table_name_47 WHERE director = "john woo"
sql_create_context
CREATE TABLE table_21734764_1 ( area__km²__2005 VARCHAR, administrative_division VARCHAR )
What is the area of cimahi city?
SELECT area__km²__2005 FROM table_21734764_1 WHERE administrative_division = "Cimahi City"
sql_create_context
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 ...
看一下患者44303121被门诊诊断为疾病B11.268时,甲状腺过氧化物酶抗体的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb...
css
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...
Visualize a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home.
SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATETIME, asset_disposed_date DATETIME, other_asset_details VARCHAR(255) ) CREATE TA...
List the number of enginners in a stacked bar chart The x-axis is last name and group by skill description, rank last_name in descending order.
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, last_name ORDER BY last_name DESC
nvbench
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id 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, ...
患者编号38491236在13年11月25日到2019年6月6日期间被开出的所有检查报告单的科室编号以及名称能列举出来吗?
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 = '38491236' AND jybgb.BGRQ BETWEEN '2013-11-25' AND '2019-...
css
CREATE TABLE table_74510 ( "Player" text, "Home runs" real, "Season total" real, "Year" real, "Team" text )
Tell me the highest home runs for cleveland indians years before 1931
SELECT MAX("Home runs") FROM table_74510 WHERE "Team" = 'cleveland indians' AND "Year" < '1931'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Count - iOS questions that contain <code>.
SELECT COUNT(Title) FROM Posts AS Question WHERE Question.Body LIKE '%<code>%' AND Question.Tags LIKE '%windows-phone%'
sede
CREATE TABLE table_name_93 ( points INTEGER, team VARCHAR, rank VARCHAR )
What is the sum of the points when Carlos drove for repsol honda in 8th place?
SELECT SUM(points) FROM table_name_93 WHERE team = "repsol honda" AND rank = "8th"
sql_create_context
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_...
Return the average price of products that have each category code in a bar chart, could you rank x axis in desc order?
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code DESC
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
list the top five most frequent drugs that the patients were prescribed with within 2 months after they were prescribed with zocor since 3 years ago.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'zocor' AND DATETIME(medication.drugstarttime) >= DA...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
when was the last time that patient 015-66570 was prescribed medication via an ivpb route since 104 months ago?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-66570')) AND medication.routeadmin = 'ivpb' AND DATETIME(m...
eicu
CREATE TABLE table_name_19 ( work VARCHAR, award VARCHAR )
Where Award is newcomer actress, what is the work?
SELECT work FROM table_name_19 WHERE award = "newcomer actress"
sql_create_context
CREATE TABLE table_18039 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
On what day was the team playing at milwaukee county stadium?
SELECT "Date" FROM table_18039 WHERE "Game site" = 'Milwaukee County Stadium'
wikisql
CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Nu...
For all storms with at least 1 death, compare the number of deaths by dates active with a bar graph.
SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1
nvbench
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Customers ( customer_i...
Stacked bar chart of the number of date account opened for with each other_account_details in each date account opened, display by the total number in descending please.
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY COUNT(date_account_opened) DESC
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
列举出病患苏兰娜在06年7月30日到19年10月4日内被开出的所有检验报告单的名称以及科室编号是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '苏...
css
CREATE TABLE table_2357201_1 ( playoffs VARCHAR, regular_season VARCHAR )
When Cleveland was 2nd, great lakes in the regular season what did they get to in the playoffs?
SELECT playoffs FROM table_2357201_1 WHERE regular_season = "2nd, Great Lakes"
sql_create_context
CREATE TABLE table_name_4 ( category VARCHAR, nominee VARCHAR )
Which category was Michael Stewart a nominee in?
SELECT category FROM table_name_4 WHERE nominee = "michael stewart"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the amount of name , and group by attribute name, and display by the y-axis in descending.
SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those products with a price between 60 and 120, a bar chart shows the distribution of name and manufacturer , rank from low to high by the Y.
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer
nvbench
CREATE TABLE table_name_97 ( frequency VARCHAR, launched VARCHAR )
What is the frequency of the station that was launched on 21 August 1994?
SELECT frequency FROM table_name_97 WHERE launched = "21 august 1994"
sql_create_context
CREATE TABLE table_61658 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm"...
WHAT IS THE 11AM WITH LOCAL PROGRAMS AT 4PM AND GENERAL HOSPITAL AT 3PM?
SELECT "11:00 am" FROM table_61658 WHERE "4:00 pm" = 'local programs' AND "3:00 pm" = 'general hospital'
wikisql
CREATE TABLE table_2970978_1 ( ave_attendance VARCHAR, ___ave_on_prev_season VARCHAR )
How many values of attendance occur when ave. on previous season is +645?
SELECT COUNT(ave_attendance) FROM table_2970978_1 WHERE ___ave_on_prev_season = "+645"
sql_create_context
CREATE TABLE table_11206916_1 ( average INTEGER, stadium VARCHAR )
The firs park stadium had the lowest average attendence of what?
SELECT MIN(average) FROM table_11206916_1 WHERE stadium = "Firs Park"
sql_create_context
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule...
List all directors along with the number of films directed by each director in a bar chart.
SELECT Directed_by, COUNT(*) FROM film GROUP BY Directed_by
nvbench
CREATE TABLE table_name_12 ( country VARCHAR, mountain VARCHAR, range VARCHAR, prominence__m_ VARCHAR, height__m_ VARCHAR )
Which Country has a Prominence (m) smaller than 1540, and a Height (m) smaller than 3530, and a Range of virunga mountains, and a Mountain of nyiragongo?
SELECT country FROM table_name_12 WHERE prominence__m_ < 1540 AND height__m_ < 3530 AND range = "virunga mountains" AND mountain = "nyiragongo"
sql_create_context
CREATE TABLE table_18584 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
who is the the incumbent with candidates being jack z. anderson (r) unopposed
SELECT "Incumbent" FROM table_18584 WHERE "Candidates" = 'Jack Z. Anderson (R) Unopposed'
wikisql
CREATE TABLE table_68716 ( "Name" text, "Years" text, "League" text, "FA Cup" text, "League Cup" text, "Europe" text, "Other [C ]" text, "Total" text )
The Europe listing of 00 0 0 (0) also has what listed as the total?
SELECT "Total" FROM table_68716 WHERE "Europe" = '00 0 0 (0)'
wikisql
CREATE TABLE table_name_52 ( position VARCHAR, player VARCHAR )
What position has siim ennemuist as the player?
SELECT position FROM table_name_52 WHERE player = "siim ennemuist"
sql_create_context
CREATE TABLE table_name_91 ( home_team VARCHAR, away_team VARCHAR )
Who was the home team when grimsby town was the away team?
SELECT home_team FROM table_name_91 WHERE away_team = "grimsby town"
sql_create_context
CREATE TABLE table_name_33 ( date VARCHAR, region VARCHAR )
What is Date, when Region is Yugoslavia?
SELECT date FROM table_name_33 WHERE region = "yugoslavia"
sql_create_context
CREATE TABLE table_1474099_6 ( season VARCHAR, goals VARCHAR, runners_up VARCHAR )
When the team scored 17 and Slavija placed second, what year was it?
SELECT season FROM table_1474099_6 WHERE goals = 17 AND runners_up = "Slavija"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
what are the five most frequent drugs that were prescribed within 2 months to the patients aged 60 or above after having been diagnosed with hepatic dysfunction - acute, until 2 years ago?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hepatic dysfunction - acute' AND DATETIME(diagnosi...
eicu
CREATE TABLE table_71811 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Which Visiting Team is on december 23?
SELECT "Visiting Team" FROM table_71811 WHERE "Date" = 'december 23'
wikisql
CREATE TABLE table_name_55 ( year INTEGER, sets VARCHAR, aces VARCHAR, opponent VARCHAR )
what's the most recent year that samantha stosur was the opponent with 20 aces and having played more than 2 sets?
SELECT MAX(year) FROM table_name_55 WHERE aces = 20 AND opponent = "samantha stosur" AND sets > 2
sql_create_context
CREATE TABLE table_49667 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2013 club" text )
Name the 2013 club which has a Name of ana grbac category:articles with hcards?
SELECT "2013 club" FROM table_49667 WHERE "Name" = 'ana grbac category:articles with hcards'
wikisql
CREATE TABLE table_65621 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer fee" text )
What is the transfer fee for the country of Nir?
SELECT "Transfer fee" FROM table_65621 WHERE "Country" = 'nir'
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 patient ( uniquep...
how many patients were diagnosed with hypercoagulable state - heparin induced thrombocytopenia in the same hospital visit in 2105 after they underwent oncology consultation?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oncology consultation' AND STRFTIME('%y', treatment.treatmenttime) = '210...
eicu
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score num...
Vote Count on each post Post.
SELECT Posts.Id, COUNT(Votes.Id) FROM Posts, Votes WHERE Votes.PostId = Posts.Id AND Votes.VoteTypeId = 1 AND TIME_TO_STR(Posts.CreationDate, '%Y') > 2010 GROUP BY Posts.Id
sede
CREATE TABLE Staff ( Staff_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(40), Other_Details VARCHAR(255) ) CREATE TABLE Hotels ( hotel_id INTEGER, star_rating_code CHAR(15), pets_allowed_yn CHAR(1), price_range real, other_hotel_details VARCHAR(255) ) CREATE TABLE Tourist...
Show the names and ids of tourist attractions that are visited at least two times with a bar chart, rank Y-axis in desc order.
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID DESC
nvbench
CREATE TABLE table_1341690_18 ( district VARCHAR, incumbent VARCHAR )
In which district is the incumbent John Breaux?
SELECT district FROM table_1341690_18 WHERE incumbent = "John Breaux"
sql_create_context
CREATE TABLE instructor ( name VARCHAR, dept_name VARCHAR, salary VARCHAR )
what is the name of the instructor who is in Statistics department and earns the lowest salary?
SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1
sql_create_context
CREATE TABLE table_28206 ( "Celebrity" text, "Known for" text, "Age" real, "Professional" text, "Series" real, "Place" text, "Dances" real, "Highest score" real, "Lowest score" real, "Aggregate" real, "Average" text )
How many dances did John Barnes have?
SELECT MIN("Dances") FROM table_28206 WHERE "Celebrity" = 'John Barnes'
wikisql
CREATE TABLE table_60080 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Country, when Score is '69-69=138', and when Player is 'Ian Poulter'?
SELECT "Country" FROM table_60080 WHERE "Score" = '69-69=138' AND "Player" = 'ian poulter'
wikisql
CREATE TABLE table_name_92 ( Id VARCHAR )
Which 2007 has a 2010 of A?
SELECT 2007 FROM table_name_92 WHERE 2010 = "a"
sql_create_context
CREATE TABLE table_name_90 ( league_cup_goals VARCHAR, total_goals VARCHAR, name VARCHAR )
How many League Cup Goals have 0 as the total goals, with delroy facey as the name?
SELECT COUNT(league_cup_goals) FROM table_name_90 WHERE total_goals = 0 AND name = "delroy facey"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe tex...
Posts on which to force Markdown re-rendering (Japanese.SE).
SELECT Id AS "post_link", CreationDate, LastActivityDate, ClosedDate FROM Posts WHERE Body LIKE '%*<em>%' OR Body LIKE '%*<strong>%' OR Body LIKE '%*<b>%' OR Body LIKE '%*<i>%' ORDER BY CreationDate DESC
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
report the number of patients admitted before 2173 who had calculated bicarbonate, whole blood lab test done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2173" AND lab.label = "Calculated Bicarbonate, Whole Blood"
mimicsql_data
CREATE TABLE table_name_59 ( base VARCHAR, company VARCHAR )
Which base has a company of Theatro Technis Karolos Koun?
SELECT base FROM table_name_59 WHERE company = "theatro technis karolos koun"
sql_create_context
CREATE TABLE table_58390 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home team score when the VFL played at Princes Park?
SELECT "Home team score" FROM table_58390 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_203_541 ( id number, "games" text, "host city" text, "dates" text, "nations" number, "participants" number, "events" number )
which games featured the least amount of events ?
SELECT "games" FROM table_203_541 ORDER BY "events" LIMIT 1
squall
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
Display a bar chart for how old is the average person for each job?, sort by the X in ascending.
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job
nvbench
CREATE TABLE table_27699 ( "Round" real, "Circuit" text, "Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Supporting" text )
What circuit was used on August 21?
SELECT "Circuit" FROM table_27699 WHERE "Date" = 'August 21'
wikisql
CREATE TABLE table_2818164_7 ( production_code VARCHAR, written_by VARCHAR )
What is the production code that was written by matt robinson?
SELECT production_code FROM table_2818164_7 WHERE written_by = "Matt Robinson"
sql_create_context
CREATE TABLE table_67475 ( "Matches" real, "Innings" real, "Not Outs" real, "Runs" real, "Average" real )
What's the total Innings that has Runs of 1598, and Matches less than 41?
SELECT COUNT("Innings") FROM table_67475 WHERE "Runs" = '1598' AND "Matches" < '41'
wikisql
CREATE TABLE table_name_38 ( away_team VARCHAR, tie_no VARCHAR )
Which Away team has a Tie no of 4?
SELECT away_team FROM table_name_38 WHERE tie_no = "4"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid numbe...
on their last hospital visit, what is the name of the organism found first blood culture microbiology test of patient 23721?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23721 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'blood culture' AND NOT m...
mimic_iii
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 lab ( labid numbe...
patient 010-20205 had undergone a cpap/peep therapy - titrate peep procedure at other hospitals since 2105?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '010-20205' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '010-20205' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
CREATE TABLE table_name_15 ( class VARCHAR, part_3 VARCHAR )
What is Class, when Part 2 is 'bl tu'?
SELECT class FROM table_name_15 WHERE part_3 = "blétu"
sql_create_context
CREATE TABLE table_63352 ( "Season" real, "Team" text, "League" text, "Games" text, "Total Tackles" text, "Solo" text, "TFL\u00b9" text, "Sacks" text, "Int." text )
what is the team when sacks is 0 and the season is earlier than 1998?
SELECT "Team" FROM table_63352 WHERE "Sacks" = '0' AND "Season" < '1998'
wikisql
CREATE TABLE staff_department_assignments ( staff_id number, department_id number, date_assigned_from time, job_title_code text, date_assigned_to time ) CREATE TABLE products ( product_id number, product_type_code text, product_name text, product_price number ) CREATE TABLE supplie...
What is the average price of clothes?
SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes'
spider
CREATE TABLE table_name_9 ( division VARCHAR, fa_cup VARCHAR, season VARCHAR )
What is the division in the season more recent than 2012 when the round of 16 was reached in the FA Cup?
SELECT COUNT(division) FROM table_name_9 WHERE fa_cup = "round of 16" AND season > 2012
sql_create_context
CREATE TABLE table_61826 ( "School" text, "Location" text, "Nickname(s)" text, "Colors" text, "Years Member" text )
What School has Colors of navy blue orange?
SELECT "School" FROM table_61826 WHERE "Colors" = 'navy blue orange'
wikisql
CREATE TABLE constructorResults ( constructorResultsId INTEGER, raceId INTEGER, constructorId INTEGER, points REAL, status TEXT ) CREATE TABLE seasons ( year INTEGER, url TEXT ) CREATE TABLE circuits ( circuitId INTEGER, circuitRef TEXT, name TEXT, location TEXT, countr...
Show the number of races that had any driver whose forename is Lewis in each year with a line chart, show in descending by the X-axis.
SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY year DESC
nvbench
CREATE TABLE table_31846 ( "Date" text, "Result" text, "Score" text, "Type" text, "Venue" text )
Tell me the score for international friendly 17 august 2013
SELECT "Score" FROM table_31846 WHERE "Type" = 'international friendly' AND "Date" = '17 august 2013'
wikisql
CREATE TABLE body_builder ( people_id VARCHAR, People_ID VARCHAR ) CREATE TABLE people ( people_id VARCHAR, People_ID VARCHAR )
How many persons are not body builders?
SELECT COUNT(*) FROM people WHERE NOT People_ID IN (SELECT People_ID FROM body_builder)
sql_create_context
CREATE TABLE table_256286_61 ( meas_num VARCHAR, description VARCHAR )
What is the measure number for the bill described as obscenity and sexual conduct bill?
SELECT meas_num FROM table_256286_61 WHERE description = "Obscenity and sexual conduct bill"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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 te...
列出患者70892680所有检验结果指标记录中的检测方法在2012年3月29日到2020年7月23日之间都是什么?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE users ( user_id number, role_code text, user_name text, user_login text, password text ) CREATE TABLE documents ( document_code text, document_structure_code text, document_type_code text, access_count number, document_name text ) CREATE TABLE roles ( role_code...
Find the description of the most popular role among the users that have logged in.
SELECT role_description FROM roles WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1)
spider
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
蜜炼川贝枇杷膏在医疗就诊35017294126中所属的三大目录类别分别是什么?
SELECT t_kc22.DIRE_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '35017294126' AND t_kc22.SOC_SRT_DIRE_NM = '蜜炼川贝枇杷膏'
css
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 ReviewTaskStates ( Id number, Name te...
Top 200 SO Users from Pune. Top 200 SO Users from Pune, Maharashtra, India
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%phoenix%' OR UPPER(Location) LIKE '%PHOENIX%' OR Location LIKE '%Phoenix%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_i...
what's the number of patients who were hospitalized during this year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transac...
Create a bar chart showing mean amount of transaction across transaction type code, rank Y-axis in asc order.
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY AVG(amount_of_transaction)
nvbench
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 prescriptions ( row_id number, subject_id number, h...
count the number of patients who since 2103 were diagnosed with lt eff nerv inj pelv/leg.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.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 = 'lt eff nerv inj pelv/leg') AND STRFTIME('%y', diagnoses_ic...
mimic_iii
CREATE TABLE table_77735 ( "ATHLETE" text, "FINAL" text, "LANE" real, "SEMI" real, "QUART" real, "HEAT" real )
When a lane of 4 has a QUART greater than 44.62, what is the lowest HEAT?
SELECT MIN("HEAT") FROM table_77735 WHERE "LANE" = '4' AND "QUART" > '44.62'
wikisql
CREATE TABLE table_52063 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On what date did an away team score 22.17 (149)?
SELECT "Date" FROM table_52063 WHERE "Away team score" = '22.17 (149)'
wikisql
CREATE TABLE table_name_47 ( d__max_ INTEGER, morse_taper_number INTEGER )
What is the minimum D (max) when the Morse Taper number is less than 0?
SELECT MIN(d__max_) FROM table_name_47 WHERE morse_taper_number < 0
sql_create_context
CREATE TABLE table_69665 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "125cc winner" text, "250cc winner" text, "MotoGP winner" text, "Report" text )
Name the circuit for round 18
SELECT "Circuit" FROM table_69665 WHERE "Round" = '18'
wikisql
CREATE TABLE table_name_83 ( week_7 VARCHAR, week_5 VARCHAR )
What kind of Week 7 has a Week 5 of evicted (day 15)?
SELECT week_7 FROM table_name_83 WHERE week_5 = "evicted (day 15)"
sql_create_context
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE participates_in ( stuid 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...
Find the number of activities Mark Giuliano is involved in.
SELECT COUNT(*) FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
spider
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...
从2010年12月18日起2020年6月3日结束的这段时间医院0444106的住院医疗记录的具体的数量是多些?
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '0444106' AND IN_HOSP_DATE BETWEEN '2010-12-18' AND '2020-06-03' AND CLINIC_TYPE = '住院'
css
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
What is the average age of captains in different classes?, and order mean age in asc order.
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age)
nvbench
CREATE TABLE table_name_10 ( award_ceremony VARCHAR, nominee VARCHAR )
What award ceremony was howard bay and patton campbell nominated?
SELECT award_ceremony FROM table_name_10 WHERE nominee = "howard bay and patton campbell"
sql_create_context
CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text...
How many parties of the time they took office, binning the took office into WEEKDAY interval, could you rank y-axis in ascending order?
SELECT Took_office, COUNT(Took_office) FROM party ORDER BY COUNT(Took_office)
nvbench
CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE author ( aid int, homepage varchar, name varchar, oid int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE journal ( h...
return me all the papers in PVLDB in ' University of Michigan ' .
SELECT publication.title FROM author, journal, organization, publication, writes WHERE journal.name = 'PVLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE table_44731 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text )
What is the price of 60 mbps downstream?
SELECT "Price" FROM table_44731 WHERE "Downstream" = '60 mbps'
wikisql
CREATE TABLE table_204_338 ( id number, "location" text, "coordinates" text, "type" text, "built" text, "details" text )
how many voronezh radars are in kaliningrad or in krasnodar ?
SELECT COUNT(*) FROM table_204_338 WHERE "location" IN ('kaliningrad', 'krasnodar')
squall
CREATE TABLE table_name_20 ( mascot VARCHAR, location VARCHAR )
What is bedford's mascot?
SELECT mascot FROM table_name_20 WHERE location = "bedford"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
what was the name of the allergy that had patient 006-195316 in 04/this year?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316')) AND DATETIME(allergy.allergytime, 'start of year') = DATETI...
eicu
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
患者63825529的842142指标在06年12月24日到11年5月11日期间是怎样的
SELECT * 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 jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_36839 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text )
Which Bats have Throws of r, and a DOB of 22 may 1973?
SELECT "Bats" FROM table_36839 WHERE "Throws" = 'r' AND "D.O.B." = '22 may 1973'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Posts containing a very short body. Posts containing a body that is less than 8 chars long
SELECT Id AS "post_link", REPLACE(REPLACE(Body, '<p>', ' '), '</p>', '') AS "body", Score FROM Posts WHERE LENGTH(Body) < 64 AND PostTypeId = 1
sede
CREATE TABLE table_78711 ( "Ending" text, "American" text, "British" text, "Australian" text, "Examples" text )
Which American has British of m?
SELECT "American" FROM table_78711 WHERE "British" = 'ɛm'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
住院看病号码是63852370020的出院科室代码以及名称都是什么?
SELECT CYKSDM, CYKSMC FROM zyjzjlb WHERE JZLSH = '63852370020'
css
CREATE TABLE table_name_27 ( entries INTEGER, driver VARCHAR, points VARCHAR )
What is the average number of entries driver Mark Webber, who has more than 1014.5 points, has?
SELECT AVG(entries) FROM table_name_27 WHERE driver = "mark webber" AND points > 1014.5
sql_create_context
CREATE TABLE table_train_149 ( "id" int, "prostate_specific_antigen_psa" float, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "fasting_serum_glucose" int, "vitamin_d" int, "NOUSE" float )
vitamin d level < 20
SELECT * FROM table_train_149 WHERE vitamin_d < 20
criteria2sql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
what is the name of the medication that patient 015-15167 was prescribed until 7 months ago for the first time?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-15167')) AND DATETIME(medication.drugstarttime) <= DATETIME(CUR...
eicu
CREATE TABLE table_61220 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What is the Date of the match with a Score of 0 6, 2 6 with Partner Marcella Mesker?
SELECT "Date" FROM table_61220 WHERE "Partner" = 'marcella mesker' AND "Score" = '0–6, 2–6'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_...
what are the flights from MEMPHIS to LAS VEGAS
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 = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VE...
atis