context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_47 ( genre VARCHAR, developer_s_ VARCHAR )
Which Genre has a Developer(s) of naughty dog?
SELECT genre FROM table_name_47 WHERE developer_s_ = "naughty dog"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, u...
what is last weight of patient 015-7988 until 35 months ago.
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-7988') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-35 month') ORDER BY patient.unitad...
eicu
CREATE TABLE table_name_49 ( erp_w INTEGER, call_sign VARCHAR )
What is the Sum of ERP W, when Call Sign is K216GA?
SELECT SUM(erp_w) FROM table_name_49 WHERE call_sign = "k216ga"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Age real, Height real, Hometown text ) CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real...
Visualize a pie chart with how many gymnasts are from each hometown?
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
nvbench
CREATE TABLE table_78170 ( "Season" real, "Belonging league" text, "Matches" real, "league point" real, "Draw" real, "Lose" real, "Goal difference" real, "Point" real, "Lost point" real, "Final rank" real )
Tell me the highest matches for point 43 and final rank less than 7
SELECT MAX("Matches") FROM table_78170 WHERE "Point" = '43' AND "Final rank" < '7'
wikisql
CREATE TABLE table_41604 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
What is the Original air date for the episode directed by lev l. spiro, with a Production code of 07-00-109?
SELECT "Original air date" FROM table_41604 WHERE "Directed by" = 'lev l. spiro' AND "Production code" = '07-00-109'
wikisql
CREATE TABLE table_64638 ( "Name" text, "LWAT" real, "100+" real, "140+" real, "180s" real )
What's the total 140+ when the 100+ is 173?
SELECT COUNT("140+") FROM table_64638 WHERE "100+" = '173'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
在编号是26537481的那位病号的医疗记录中有多些次购买了比4534.41元还多的药品?对应了什么医疗就诊编号?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '26537481' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4534.41)
css
CREATE TABLE table_17442 ( "Date" text, "Winning Team" text, "Score" text, "Winning Pitcher" text, "Losing Pitcher" text, "Attendance" real, "Location" text )
Who is the losing pitcher when the winning pitcher is roy oswalt?
SELECT "Losing Pitcher" FROM table_17442 WHERE "Winning Pitcher" = 'Roy Oswalt'
wikisql
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, ...
what is the daily minimum of output (ml)-chest tube #1 pleural right anterior;lower output of patient 006-167444 until 6 months ago?
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444')) AND intakeoutput.celllabel = 'outp...
eicu
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, ...
在04年4月23日到10年10月25日内名叫马兴生的患者自费的金额比2352.85元高的药品量有多少?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '马兴生' AND t_kc22.STA_DATE BETWEEN '2004-04-23' AND '2010-10-25' AND t_kc22.SELF_PAY_AMO > 2352.85
css
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients had a diagnosis long title hyperacusis with a sl drug route?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Hyperacusis" AND prescriptions.route = "SL"
mimicsql_data
CREATE TABLE table_1348989_2 ( TV VARCHAR, season VARCHAR )
In what TV season did the 3rd season air?
SELECT TV AS season FROM table_1348989_2 WHERE season = "3rd"
sql_create_context
CREATE TABLE table_76228 ( "Alianza wins" real, "Draws" real, "U wins" real, "Alianza goals" real, "U goals" real )
What is the lowest Draws, when Alianza Goals is less than 317, when U Goals is less than 3, and when Alianza Wins is less than 2?
SELECT MIN("Draws") FROM table_76228 WHERE "Alianza goals" < '317' AND "U goals" < '3' AND "Alianza wins" < '2'
wikisql
CREATE TABLE table_13855 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
Released on April 12, 1968 in LP format, what was the catalog?
SELECT "Catalog" FROM table_13855 WHERE "Format" = 'lp' AND "Date" = 'april 12, 1968'
wikisql
CREATE TABLE table_name_15 ( instrumental VARCHAR, dative VARCHAR )
What is the instrumental for the dative shen?
SELECT instrumental FROM table_name_15 WHERE dative = "shen"
sql_create_context
CREATE TABLE table_49935 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Who is the player from the United States and a place of t2?
SELECT "Player" FROM table_49935 WHERE "Country" = 'united states' AND "Place" = 't2'
wikisql
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NU...
How many professors whose office is located in DRE 102 are hired in each month? Return a bar chart, and show y-axis in desc order.
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102' ORDER BY COUNT(EMP_HIREDATE) DESC
nvbench
CREATE TABLE table_41821 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text )
Who is the home team when the score is 81-80?
SELECT "Home" FROM table_41821 WHERE "Score" = '81-80'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
provide the number of patients whose drug code is bag and lab test category is chemistry?
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 = "BAG" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationD...
Closed or downvoted questions without comments.
SELECT Posts.Id, Posts.Score FROM Posts WHERE (Score < 0 OR NOT ClosedDate IS NULL) AND (SELECT COUNT(*) FROM Comments WHERE Comments.PostId = Posts.Id) = 0
sede
CREATE TABLE table_78026 ( "Code" real, "Type" text, "Name" text, "Area (km 2 )" real, "Population" real, "Regional County Municipality" text, "Region" real )
What is the km2 area for the population of 311?
SELECT AVG("Area (km 2 )") FROM table_78026 WHERE "Population" = '311'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_s...
show me the flights from PITTSBURGH to SAN FRANCISCO on friday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 25 AND date_day.month_number = 6...
atis
CREATE TABLE table_50865 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text )
WHo is the Winner of andre agassi Finalist?
SELECT "Winner" FROM table_50865 WHERE "Finalist" = 'andre agassi'
wikisql
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHA...
Show the sum of account details for different statement details in a pie chart.
SELECT Statement_Details, SUM(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details
nvbench
CREATE TABLE table_23315271_2 ( winning_team VARCHAR, winning_driver VARCHAR )
Who is the winning team when max busnelli is the winning driver?
SELECT winning_team FROM table_23315271_2 WHERE winning_driver = "Max Busnelli"
sql_create_context
CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of...
Find the number of funiture types produced by each manufacturer as well as the company names Show bar chart, and show by the Y-axis in ascending.
SELECT Name, COUNT(*) FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.Manufacturer_ID = t2.Manufacturer_ID GROUP BY t1.Manufacturer_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_76 ( manufacturer VARCHAR, year_made VARCHAR )
What manufacturer has a year made of 1883?
SELECT manufacturer FROM table_name_76 WHERE year_made = "1883"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me the comparison about ACC_Percent over the All_Road by a bar chart, show bar in desc order.
SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE drivers ( driverid VARCHAR, surname VARCHAR ) CREATE TABLE results ( driverid VARCHAR, raceid VARCHAR ) CREATE TABLE races ( raceid VARCHAR, year INTEGER )
What is the id and last name of the driver who participated in the most races after 2010?
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
把2001年4月5日到2004年7月31日期间患者59317342的主要就医医院是哪家查看一下
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '59317342' AND IN_HOSP_DATE BETWEEN '2001-04-05' AND '2004-07-31' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_64501 ( "Track" text, "Song Title" text, "Writer(s)" text, "Original Artist" text, "Original Release" real, "Length" text )
What is the original Release date of the Track written by Dallas Frazier?
SELECT "Original Release" FROM table_64501 WHERE "Writer(s)" = 'dallas frazier'
wikisql
CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text )
Count the number of entrepreneurs.
SELECT COUNT(*) FROM entrepreneur
spider
CREATE TABLE table_23014476_1 ( bush__percentage VARCHAR, county VARCHAR )
Name the number of bush % for elko
SELECT COUNT(bush__percentage) FROM table_23014476_1 WHERE county = "Elko"
sql_create_context
CREATE TABLE table_name_92 ( neighborhood VARCHAR, branch VARCHAR )
What is Neighborhood, when Branch is Hollywood Library?
SELECT neighborhood FROM table_name_92 WHERE branch = "hollywood library"
sql_create_context
CREATE TABLE table_21055 ( "Poll Source" text, "Dates administered" text, "Democrat: Carl Levin" text, "Republican: Jack Hoogendyk" text, "Lead Margin" real )
What was the smallest lead margin when the source of polls came from Strategic Vision and Democrat Carl Levin had 57%?
SELECT MIN("Lead Margin") FROM table_21055 WHERE "Poll Source" = 'Strategic Vision' AND "Democrat: Carl Levin" = '57%'
wikisql
CREATE TABLE table_name_62 ( week INTEGER, game_site VARCHAR )
What was the earliest week the Titans played at Ford Field?
SELECT MIN(week) FROM table_name_62 WHERE game_site = "ford field"
sql_create_context
CREATE TABLE table_41723 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text, "Attendance" text )
Where the away team is Bradford City, who is the home team?
SELECT "Home team" FROM table_41723 WHERE "Away team" = 'bradford city'
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 urgent and diagnoses long title is ostium secundum type atrial septal defect?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Ostium secundum type atrial septal defect"
mimicsql_data
CREATE TABLE table_191105_2 ( music_by VARCHAR, performed_by VARCHAR )
When zachary sanders is the performer how many people is the music by?
SELECT COUNT(music_by) FROM table_191105_2 WHERE performed_by = "Zachary Sanders"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
在2019-07-16之前,患者任斯伯有哪些住院就诊的检验报告单?看一下住院就诊的流水号
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '任斯伯' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2019-07-16' UNI...
css
CREATE TABLE table_name_17 ( laps VARCHAR, constructor VARCHAR, grid VARCHAR )
What is the number of laps for the honda vehicle, with a grid of 13?
SELECT laps FROM table_name_17 WHERE constructor = "honda" AND grid = "13"
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, visualize a bar chart about the distribution of name and manufacturer , and group by attribute name, and I want to list y axis from low to high order please.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Manufacturer
nvbench
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC...
列出患者水兴平入院科室名称不包含免疫的住院就诊记录在医院5237390中有什么?
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_75725 ( "Pos." real, "Team" text, "Wins" real, "Ties" real, "Losses" real, "Goals" text, "Diff." text, "Points" text )
What is the most wins when the number of losses was less than 4 and there was more than 0 ties?
SELECT MAX("Wins") FROM table_75725 WHERE "Losses" < '4' AND "Ties" > '0'
wikisql
CREATE TABLE table_14912 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What record had an alca-271 cd?
SELECT "Region" FROM table_14912 WHERE "Format" = 'cd' AND "Catalog" = 'alca-271'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, ...
Show me about the distribution of meter_200 and the amount of meter_200 , and group by attribute meter_200 in a bar chart, I want to sort the number of meter 200 in ascending order.
SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY COUNT(meter_200)
nvbench
CREATE TABLE table_name_12 ( bronze INTEGER, rank VARCHAR, total VARCHAR, silver VARCHAR )
I want the average bronze for total of 19 and silver of 8 with rank of 31
SELECT AVG(bronze) FROM table_name_12 WHERE total = 19 AND silver = 8 AND rank = "31"
sql_create_context
CREATE TABLE table_name_97 ( year_joined INTEGER, enrollment VARCHAR, school VARCHAR )
Which Year Joined has an Enrollment smaller than 726, and a School of tri-west?
SELECT MAX(year_joined) FROM table_name_97 WHERE enrollment < 726 AND school = "tri-west"
sql_create_context
CREATE TABLE table_11368 ( "Nat." text, "Name" text, "Since" real, "Goals" real, "Ends" real, "Transfer fee" text )
What is the average Ends with a Since of 2003, and a Name with m rquez?
SELECT AVG("Ends") FROM table_11368 WHERE "Since" = '2003' AND "Name" = 'márquez'
wikisql
CREATE TABLE table_79916 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
In which women's doubles did Wang Junjie play men's singles?
SELECT "Women's doubles" FROM table_79916 WHERE "Men's singles" = 'wang junjie'
wikisql
CREATE TABLE table_36068 ( "Place" text, "Player" text, "Nation" text, "Score" text, "To par" text, "Money ( $ )" real )
What is the to par that has more than $122,591 in Sweden and had Annika S renstam play?
SELECT "To par" FROM table_36068 WHERE "Money ( $ )" > '122,591' AND "Nation" = 'sweden' AND "Player" = 'annika sörenstam'
wikisql
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
List the number of winery of the wines whose price is bigger than 100 in a bar chart, could you display in descending by the total number please?
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery ORDER BY COUNT(Winery) DESC
nvbench
CREATE TABLE table_31004 ( "Movies" text, "December 25" text, "December 26" text, "December 27" text, "December 28" text, "December 25-28 total" text, "Total 2-week Gross" text )
What film earmed p3.2 million on December 25?
SELECT "Movies" FROM table_31004 WHERE "December 25" = 'P3.2 million'
wikisql
CREATE TABLE table_dev_2 ( "id" int, "nutrient_absorption" bool, "systolic_blood_pressure_sbp" int, "active_metabolic" bool, "hepatic_disease" bool, "surgery" bool, "diastolic_blood_pressure_dbp" int, "gastrointestinal_disease" bool, "organ_failure" bool, "NOUSE" float )
subject states that he / she has current hepatic disease.
SELECT * FROM table_dev_2 WHERE hepatic_disease = 1
criteria2sql
CREATE TABLE table_21850 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many points categories are there when the losing bonus is 2 and points for are 642?
SELECT COUNT("Points") FROM table_21850 WHERE "Losing bonus" = '2' AND "Points for" = '642'
wikisql
CREATE TABLE table_70753 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the smallest amount of points for parmalat forti ford entrant later than 1995?
SELECT MIN("Points") FROM table_70753 WHERE "Entrant" = 'parmalat forti ford' AND "Year" > '1995'
wikisql
CREATE TABLE table_26218124_1 ( founded VARCHAR, stadium VARCHAR )
How many clubs were founded in the westfalenstadion stadium?
SELECT COUNT(founded) FROM table_26218124_1 WHERE stadium = "Westfalenstadion"
sql_create_context
CREATE TABLE table_name_96 ( nationality VARCHAR, jersey_number_s_ VARCHAR )
What is the nationality of the person with number 27?
SELECT nationality FROM table_name_96 WHERE jersey_number_s_ = "27"
sql_create_context
CREATE TABLE table_name_86 ( record VARCHAR, method VARCHAR, location VARCHAR )
What is the record when the method is decision and the location is Martigues, France?
SELECT record FROM table_name_86 WHERE method = "decision" AND location = "martigues, france"
sql_create_context
CREATE TABLE table_name_16 ( league VARCHAR, year VARCHAR )
Name the league for 1994
SELECT league FROM table_name_16 WHERE year = "1994"
sql_create_context
CREATE TABLE table_201_43 ( id number, "name" text, "canton" text, "district" text, "area\n(km2)" number, "population\n(as of 2005)" number, "date of law" text )
which canton falls under the date of law of 24 february 1843 and has a population of 3,966 ?
SELECT "canton" FROM table_201_43 WHERE "date of law" = '24 february 1843' AND "population\n(as of 2005)" = '3966'
squall
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight_fare ...
list departure times from DENVER to PHILADELPHIA which are later than 1000 o'clock and earlier than 1400
SELECT DISTINCT flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 1400 AND flight.departure_time >= 1000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' ...
atis
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Bar chart x axis date of birth y axis height, order by the y axis in ascending.
SELECT Date_of_Birth, Height FROM people ORDER BY Height
nvbench
CREATE TABLE table_65453 ( "Lane" real, "Name" text, "Nationality" text, "React" real, "Time" real )
Name the average React of the Time smaller than 20.05 in jamaica with a Lane larger than 5?
SELECT AVG("React") FROM table_65453 WHERE "Time" < '20.05' AND "Nationality" = 'jamaica' AND "Lane" > '5'
wikisql
CREATE TABLE table_name_76 ( played VARCHAR, difference VARCHAR, against VARCHAR )
What is the total number played with a difference of 22 and less than 34 against?
SELECT COUNT(played) FROM table_name_76 WHERE difference = "22" AND against < 34
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...
从零八年六月十六日到一八年四月三十日,患者70128907就诊时接受检查的次数
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '70128907' AND t_kc22.STA_DATE BETWEEN '2008-06-16' AND '2018-04-30' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '7...
css
CREATE TABLE table_62802 ( "Time" text, "Show Name" text, "Local/Networked" text, "Ad Freq" text, "News Freq" text )
Which time has a local/networked value of Local, ad frequency of every 20 minutes, and news frequency of n/a after 7PM news?
SELECT "Time" FROM table_62802 WHERE "Local/Networked" = 'local' AND "Ad Freq" = '20 minutes' AND "News Freq" = 'n/a after 7pm news'
wikisql
CREATE TABLE table_name_48 ( game VARCHAR, team VARCHAR )
What is Game, when Team is 'Philadelphia
SELECT game FROM table_name_48 WHERE team = "philadelphia"
sql_create_context
CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text )
Draw a bar chart of name versus age, and I want to list in desc by the x axis.
SELECT Name, Age FROM editor ORDER BY Name DESC
nvbench
CREATE TABLE table_204_690 ( id number, "election" number, "party name" text, "total votes" number, "share of votes" text, "seats" number, "share of seats" text, "party leader(s)" text, "notes" text )
how many elections saw the share of votes more than 15 % ?
SELECT COUNT("election") FROM table_204_690 WHERE "share of votes" > 15
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
what was the first time patient 65582 this month received a lab test?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.charttime LIMIT 1
mimic_iii
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
what is the name of the treatment which has been given to patient 005-77687 two times in the last month?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
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, ...
疼痛科有多少住院人数,在2001.4.12到2007.7.20期间
SELECT COUNT(*) FROM zyjzjlb WHERE JZKSMC = '疼痛科' AND RYDJSJ BETWEEN '2001-04-12' AND '2007-07-20'
css
CREATE TABLE table_18721 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the result for william j. driver
SELECT "Result" FROM table_18721 WHERE "Incumbent" = 'William J. Driver'
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 PostTypes ( Id number, Name text ) C...
Top viewed questions by year.
SELECT Id AS "post_link", ViewCount FROM Posts AS p WHERE YEAR(CreationDate) = '##year?2016##' AND PostTypeId = 1 ORDER BY ViewCount DESC LIMIT 10
sede
CREATE TABLE table_229917_2 ( date__ddmmyyyy_ VARCHAR, tail_number VARCHAR )
When did the airplane with tail number RA-85282 crash?
SELECT date__ddmmyyyy_ FROM table_229917_2 WHERE tail_number = "RA-85282"
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_CLINIC_ID text, MED_DIRE_CD tex...
这个病人谢颖然均低于6128.49元药品在哪几次医疗记录中被开出的?列出医疗就诊编号都是多少?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '谢颖然' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6128.49) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '谢颖然' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUN...
css
CREATE TABLE table_49528 ( "Year" text, "Designated Grand Prix" text, "Track" text, "250 cc" text, "350 cc" text, "500 cc" text, "Report" text )
Who won the 350cc at Sachsenring?
SELECT "350 cc" FROM table_49528 WHERE "Track" = 'sachsenring'
wikisql
CREATE TABLE table_name_12 ( Id VARCHAR )
What is 2001, when 1999 is '2R', and when 1992 is '3R'?
SELECT 2001 FROM table_name_12 WHERE 1999 = "2r" AND 1992 = "3r"
sql_create_context
CREATE TABLE table_train_145 ( "id" int, "gender" string, "white_blood_cell_count_wbc" int, "elevated_intraocular_pressure" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "stroke" bool, "platelets" int, "intraocular_pressure" int, "hematologic_disease" boo...
hematology: white blood cells ( wbc ) < 300000 / l; platelets < 100000 / l; hemoglobin < 10 g / dl.
SELECT * FROM table_train_145 WHERE hematologic_disease = 1 OR (white_blood_cell_count_wbc < 300000 OR platelets < 100000 OR hemoglobin_a1c_hba1c < 10)
criteria2sql
CREATE TABLE table_name_56 ( yards INTEGER, avg INTEGER )
Which has and average less than 3 and the lowest yards?
SELECT MIN(yards) FROM table_name_56 WHERE avg < 3
sql_create_context
CREATE TABLE table_203_539 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" number )
which competition was shi dongpeng in before the world junior championships ?
SELECT "competition" FROM table_203_539 WHERE "year" < (SELECT "year" FROM table_203_539 WHERE "competition" = 'world junior championships') ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_76734 ( "School" text, "Locality" text, "Ages" text, "Capacity" real, "Ofsted" real )
Which Ofsted has a School of marple hall school, and a Capacity larger than 1711?
SELECT MIN("Ofsted") FROM table_76734 WHERE "School" = 'marple hall school' AND "Capacity" > '1711'
wikisql
CREATE TABLE table_name_29 ( crowd VARCHAR, home_team VARCHAR )
When the home team was carlton how many people were in the crowd?
SELECT crowd FROM table_name_29 WHERE home_team = "carlton"
sql_create_context
CREATE TABLE table_name_48 ( opera VARCHAR, firefox VARCHAR )
What opera has 19.87% as the firefox?
SELECT opera FROM table_name_48 WHERE firefox = "19.87%"
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...
名叫俞欣怡的病人在01年1月29日到2014年9月27日期间被开出的所有检验报告单的科室编码以及名称分别叫什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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.JZ...
css
CREATE TABLE table_5407 ( "Number" real, "Name" text, "Position" text, "Date of birth" text, "Height" text )
What is Senyi N'Diaye's Position?
SELECT "Position" FROM table_5407 WHERE "Name" = 'senyi n''diaye'
wikisql
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...
what is two year survival rate of patients diagnosed with pneumococcal septicemia?
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 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 table_12343 ( "17th c." text, "American" text, "British" text, "Australian" text, "Examples" text )
What is Australian, when Examples is 'elysium, emeritus, epitome, erotica'?
SELECT "Australian" FROM table_12343 WHERE "Examples" = 'elysium, emeritus, epitome, erotica'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id...
what is the one thing patient 7533 was diagnosed with in the last hospital visit for the last time?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7533 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DE...
mimic_iii
CREATE TABLE table_43098 ( "Week" real, "Date" text, "Opponent" text, "Time" text, "Game Site" text, "Result/Score" text, "Record" text, "Match Report" text )
Which game site has a recap as the match report for week 7?
SELECT "Game Site" FROM table_43098 WHERE "Match Report" = 'recap' AND "Week" = '7'
wikisql
CREATE TABLE table_name_18 ( acquired VARCHAR, player VARCHAR )
In what year was player Bruce Graham acquired?
SELECT acquired FROM table_name_18 WHERE player = "bruce graham"
sql_create_context
CREATE TABLE table_1233026_4 ( club VARCHAR )
What is the 1st leg when club is a.c. libertas?
SELECT 1 AS st_leg FROM table_1233026_4 WHERE club = "A.C. Libertas"
sql_create_context
CREATE TABLE table_16816 ( "model" text, "max. motive power" text, "max. torque at rpm" text, "engine displacement" text, "engine type" text, "engine configuration & notes 0-100km/h" text )
How many have are model 2.4 awd?
SELECT COUNT("engine type") FROM table_16816 WHERE "model" = '2.4 AWD'
wikisql
CREATE TABLE table_203_809 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
what is the number of the rank of the team on october 7 ?
SELECT "rank#" FROM table_203_809 WHERE "date" = 'october 7'
squall
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
A scatter chart shows the correlation between ACC_Percent and All_Games_Percent , and group by attribute ACC_Regular_Season.
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
name of the drug that patient 035-4312 is allergic to since 92 months ago?
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4312')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), '-...
eicu
CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Description VARCHAR(30) ) CREATE TABLE Affiliated_With ( Physician INTEGER, Depart...
A bar chart for listing the number of the names of patients who have made appointments.
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name
nvbench
CREATE TABLE table_45968 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text )
What is the Score of game 35?
SELECT "Score" FROM table_45968 WHERE "Game" = '35'
wikisql