context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who was hired before 2002-06-21, give me the comparison about the average of department_id over the hire_date bin hire_date by time by a bar chart, sort from high to low by the total number.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_75596 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the score of the match against duk-hee lee?
SELECT "Score" FROM table_75596 WHERE "Opponent" = 'duk-hee lee'
wikisql
CREATE TABLE table_19852975_3 ( season__number INTEGER, arties_disguises VARCHAR )
Name the season number for herr ostropolyer, pastry chef
SELECT MIN(season__number) FROM table_19852975_3 WHERE arties_disguises = "Herr Ostropolyer, pastry chef"
sql_create_context
CREATE TABLE table_48709 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Which Home Team has a Result of 124-101?
SELECT "Home Team" FROM table_48709 WHERE "Result" = '124-101'
wikisql
CREATE TABLE table_name_23 ( award VARCHAR, recipient VARCHAR )
What award was Hannah Gal the recipient of?
SELECT award FROM table_name_23 WHERE recipient = "hannah gal"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of revenue , and group by attribute name, I want to show Y-axis from high to low order.
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue DESC
nvbench
CREATE TABLE table_203_724 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
list each of the countries that have more than 4 in gold medals and also more than 3 in silver medals .
SELECT "nation" FROM table_203_724 WHERE "gold" > 4 AND "silver" > 3
squall
CREATE TABLE table_name_69 ( losses INTEGER, point_differential VARCHAR, points_for VARCHAR, games_played VARCHAR )
What is the highest number of losses that the team incurred while scoring less than 79 points in 10 games with a point differential less than 34?
SELECT MAX(losses) FROM table_name_69 WHERE points_for < 79 AND games_played = 10 AND point_differential < 34
sql_create_context
CREATE TABLE table_60787 ( "Year" real, "First member" text, "First party" text, "Second member" text, "Second party" text )
Who is the second member when RT Hon. Edward Stanley is the first member?
SELECT "Second member" FROM table_60787 WHERE "First member" = 'rt hon. edward stanley'
wikisql
CREATE TABLE mzb ( 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...
医疗就诊23814417831入院被确诊的是哪种疾病,疾病的编号是什么
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '23814417831' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '23814417831' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '23814417831' UNION SELECT mzb.IN_DIA...
css
CREATE TABLE Department ( DNO INTEGER, Division VARCHAR(2), DName VARCHAR(25), Room VARCHAR(5), Building VARCHAR(13), DPhone INTEGER ) CREATE TABLE Enrolled_in ( StuID INTEGER, CID VARCHAR(7), Grade VARCHAR(2) ) CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), C...
What is the relationship between Credits and DNO ?
SELECT Credits, DNO FROM Course ORDER BY Credits
nvbench
CREATE TABLE table_name_65 ( class VARCHAR, laps VARCHAR )
For what class is the laps 66?
SELECT class FROM table_name_65 WHERE laps = 66
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLO...
For all employees who have the letters D or S in their first name, visualize the relationship between employee_id and manager_id .
SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_63325 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who was the away team when Brighton & Hove Albion was home?
SELECT "Away team" FROM table_63325 WHERE "Home team" = 'brighton & hove albion'
wikisql
CREATE TABLE table_name_70 ( date VARCHAR, save VARCHAR, loss VARCHAR )
When is the Save of Ayala and a Loss of Olivares
SELECT date FROM table_name_70 WHERE save = "ayala" AND loss = "olivares"
sql_create_context
CREATE TABLE table_19428 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
Who was the Class AAAA champion in 2006-07?
SELECT "Class AAAA" FROM table_19428 WHERE "School Year" = '2006-07'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ...
[N] Billion Times a developer got help.
SELECT NUMBER_TO_STR(COUNT(*) / @billion, 'N2') + ' Billion Times a developer got help' AS "#_helped" FROM Posts LEFT JOIN Votes ON Posts.Id = Votes.PostId WHERE PostTypeId = 0 AND (Score <= 0)
sede
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...
how much does it cost for emtricitabine-tenofovir?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'emtricitabine-tenofovir')
mimic_iii
CREATE TABLE table_8724 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Country with the T3 Place Player with a Score of 71-76-71=218?
SELECT "Country" FROM table_8724 WHERE "Place" = 't3' AND "Score" = '71-76-71=218'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the amount of name , and group by attribute name, and show total number in asc order please.
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)
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, ...
what is the average cost of a hospital bill that includes a drug called 0.4 ml syringe : enoxaparin sodium 40 mg/0.4ml sc soln in 2105?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '0.4 ml syringe : enoxaparin sodium 40 mg/0.4ml...
eicu
CREATE TABLE table_47196 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
Which catalog has a date of 24 march 2006?
SELECT "Catalog" FROM table_47196 WHERE "Date" = '24 march 2006'
wikisql
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transa...
Show the card type codes and the number of transactions in a pie chart.
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code
nvbench
CREATE TABLE table_37461 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What game site has december 24, 2000 as a date?
SELECT "Game site" FROM table_37461 WHERE "Date" = 'december 24, 2000'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone...
please show me all the flights from INDIANAPOLIS to SAN DIEGO tomorrow
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 DIEGO' AND date_day.day_number = 20 AND date_day.month_number = 1 AND...
atis
CREATE TABLE table_name_21 ( location VARCHAR, promotor VARCHAR, opponent VARCHAR )
Which location has the promotor Frank Moloney, and the opponent Gennadiy Rasalev?
SELECT location FROM table_name_21 WHERE promotor = "frank moloney" AND opponent = "gennadiy rasalev"
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, give me the comparison about the average of revenue over the founder , and group by attribute founder by a bar chart.
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LNa...
Find the number of students living in each city with a bar chart, and display in ascending by the Y.
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_78827 ( "College or Campus Name" text, "Location" text, "District" text, "Affiliation" text, "Weblink" text )
What Weblink has a College or Campus Name of anna university college of engineering kanchipuram?
SELECT "Weblink" FROM table_78827 WHERE "College or Campus Name" = 'anna university college of engineering kanchipuram'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
give me the number of patients categorized under chemistry lab test who have benign neoplasm of skin of other and unspecified parts of face diagnoses.
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 = "Benign neoplasm of skin of other and unspecified parts of face" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
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,...
这个病人谢颖然均低于6128.49元药品在哪几次医疗记录中被开出的?列出医疗就诊编号都是多少?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '谢颖然' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6128.49)
css
CREATE TABLE table_72135 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who scored the most points in game 4?
SELECT "High points" FROM table_72135 WHERE "Game" = '4'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is minimum age of patients whose gender is m and year of birth is greater than 2078?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year > "2078"
mimicsql_data
CREATE TABLE table_61712 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Total Apps" text, "Total Goals" real )
How many FLT appearances for the player with less than 5 total goals, and 3 FA Cup appearances, 4 league goals, and plays MF?
SELECT "FLT Apps" FROM table_61712 WHERE "Total Goals" < '5' AND "FA Cup Apps" = '3' AND "Position" = 'mf' AND "League Goals" = '4'
wikisql
CREATE TABLE table_2679061_1 ( player VARCHAR, position VARCHAR, college_junior_club_team VARCHAR )
who is the player for the position defence and the college/junior/club team is ottawa 67's (ohl)?
SELECT player FROM table_2679061_1 WHERE position = "Defence" AND college_junior_club_team = "Ottawa 67's (OHL)"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE proced...
when has patient 77053 first had the maximum value of monocytes in 04/this year?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77053) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'monocytes') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE...
mimic_iii
CREATE TABLE table_18461045_1 ( kentucky VARCHAR, michigan VARCHAR )
What was the little league team from Kentucky when the little league team from Michigan was Grosse Pointe Farms-City LL Grosse Pointe Farms?
SELECT kentucky FROM table_18461045_1 WHERE michigan = "Grosse Pointe Farms-City LL Grosse Pointe Farms"
sql_create_context
CREATE TABLE table_26214389_3 ( Non VARCHAR, year VARCHAR )
If the year is 2001, what are the non qatari female?
SELECT Non AS qatari_female FROM table_26214389_3 WHERE year = 2001
sql_create_context
CREATE TABLE table_name_36 ( date VARCHAR, team VARCHAR, location_attendance VARCHAR, game VARCHAR )
What is the date of the game located in Madison Square Garden, when the team is Seattle and the game number is less than 6?
SELECT date FROM table_name_36 WHERE location_attendance = "madison square garden" AND game < 6 AND team = "seattle"
sql_create_context
CREATE TABLE table_77816 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the competition on 7 June 1999?
SELECT "Competition" FROM table_77816 WHERE "Date" = '7 june 1999'
wikisql
CREATE TABLE table_name_13 ( episode VARCHAR, viewers__in_millions_ VARCHAR )
What episode has 7.8 million viewers?
SELECT episode FROM table_name_13 WHERE viewers__in_millions_ = "7.8"
sql_create_context
CREATE TABLE table_59414 ( "Year" text, "Result" text, "Matches" text, "Wins" text, "Draws" text, "Losses" text )
What was the result in 2008?
SELECT "Result" FROM table_59414 WHERE "Year" = '2008'
wikisql
CREATE TABLE table_78329 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What was the highest Pick # for the College of Simon Fraser?
SELECT MAX("Pick #") FROM table_78329 WHERE "College" = 'simon fraser'
wikisql
CREATE TABLE table_3312 ( "Position" real, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Corrected time d:hh:mm:ss" text )
How many yachts show a corrected time d:hh:mm:ss is 4:00:05:35?
SELECT COUNT("Yacht") FROM table_3312 WHERE "Corrected time d:hh:mm:ss" = '4:00:05:35'
wikisql
CREATE TABLE table_15855 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
What school did the player that has been in Toronto from 2010-2012 go to?
SELECT "School/Club Team" FROM table_15855 WHERE "Years in Toronto" = '2010-2012'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate tim...
what is the minimum amount of total hospital cost including oth mult lb-in hosp w cs until 1 year ago?
SELECT MIN(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 = 'oth mult lb-in hosp w cs')) AND DATETIME(cost.chargetime) <= DA...
mimic_iii
CREATE TABLE table_3847 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
Which location and what was the attendance when lebron james (10) had the high assists?
SELECT "Location Attendance" FROM table_3847 WHERE "High assists" = 'LeBron James (10)'
wikisql
CREATE TABLE table_56570 ( "County" text, "Year Founded" text, "County Seat" text, "2010 Census Population" real, "July 1, 2012 Population Estimate." real, "Area (Sq. Mi.)" real, "Land Area (Sq. Mi.)" real )
Which is the total number in the 2010 Census in Oconee County where the area in square miles was less than 674?
SELECT SUM("2010 Census Population") FROM table_56570 WHERE "County" = 'oconee county' AND "Area (Sq. Mi.)" < '674'
wikisql
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text )
Show the date and the corresponding sales of the journal which did not have any of the listed editors serving on the committee by a bar chart, and rank X-axis in ascending order.
SELECT T1.Date, T1.Sales FROM journal EXCEPT SELECT T1.Date, T1.Theme, T1.Sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.Journal_ID = T2.Journal_ID ORDER BY T1.Date
nvbench
CREATE TABLE table_63750 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the total with silver being less than 0, less than 1 gold, and 3 bronze?
SELECT SUM("Total") FROM table_63750 WHERE "Bronze" = '3' AND "Gold" < '1' AND "Silver" < '0'
wikisql
CREATE TABLE table_name_70 ( wins VARCHAR, matches VARCHAR, success_rate VARCHAR )
What was the win for 4 matches with a success rate of 25%?
SELECT wins FROM table_name_70 WHERE matches = "4" AND success_rate = "25%"
sql_create_context
CREATE TABLE table_61981 ( "Draw" real, "Language" text, "Artist" text, "English translation" text, "Place" real, "Points" real )
Can you tell me the English translation that has the Artist of camillo felgen?
SELECT "English translation" FROM table_61981 WHERE "Artist" = 'camillo felgen'
wikisql
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...
Show me minimal weight by sex in a histogram, rank in desc by the bars.
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_8778 ( "Tournament" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "Career SR" text )
What is the 1988 result that has a 1994 result of A, and 3r as the 1987 result?
SELECT "1988" FROM table_8778 WHERE "1994" = 'a' AND "1987" = '3r'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, ...
tell me patient 56009's hospital admission time until 2100?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 56009 AND STRFTIME('%y', admissions.admittime) <= '2100'
mimic_iii
CREATE TABLE table_7609 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Which Score has a Away team of walthamstow avenue?
SELECT "Score" FROM table_7609 WHERE "Away team" = 'walthamstow avenue'
wikisql
CREATE TABLE table_1137718_2 ( rd INTEGER, date VARCHAR )
Which rd. occurred on 22 October?
SELECT MIN(rd) FROM table_1137718_2 WHERE date = "22 October"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) 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, meter_700 text, Time text ) CREATE...
Return a scatter chart about the correlation between ID and meter_100 .
SELECT ID, meter_100 FROM swimmer
nvbench
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, ...
在44721490827的医疗就诊中,超限价自付金额高于6355.19元的药品被开出了哪些,把清单列出来
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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 = '44721490827' AND t_kc22.OVE_SELF_AMO > 6355.19
css
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Give me the comparison about meter_100 over the meter_400 , I want to show bars in descending order please.
SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_400 DESC
nvbench
CREATE TABLE table_44677 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text, "Transfer fee" text, "Source" text )
Who is moving to Metalurh Donetsk?
SELECT "Name" FROM table_44677 WHERE "Moving to" = 'metalurh donetsk'
wikisql
CREATE TABLE table_203_537 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
what was the number of times czech republic played against germany ?
SELECT COUNT(*) FROM table_203_537 WHERE "opponent" = 'germany'
squall
CREATE TABLE table_13897690_1 ( rank INTEGER )
What is the smallest rank number of those used to rank the islands?
SELECT MIN(rank) FROM table_13897690_1
sql_create_context
CREATE TABLE table_28779 ( "Year (Ceremony)" text, "English title" text, "Arabic title" text, "Director" text, "Result" text )
When hany abu-assad category:articles with hcards is the director what is the result?
SELECT "Result" FROM table_28779 WHERE "Director" = 'Hany Abu-Assad Category:Articles with hCards'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and rank by the Y-axis from low to high.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_9770 ( "Episode #" text, "Original airdate (UK)" text, "Episode title" text, "Doctor Who episode" text, "Webcast link" text )
Which Doctor Who episode has a Original airdate (UK) of dvd only?
SELECT "Doctor Who episode" FROM table_9770 WHERE "Original airdate (UK)" = 'dvd only'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of code , and group by attribute name, I want to list from high to low by the bar.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_name_79 ( place VARCHAR, to_par VARCHAR, score VARCHAR )
What is the Place of Player with To par of +6 and Score of 78-70-74=222?
SELECT place FROM table_name_79 WHERE to_par = "+6" AND score = 78 - 70 - 74 = 222
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBase...
When Does Martijn Pieters Sleep?.
SELECT TIME_TO_STR(CreationDate, '%I') AS "hour", COUNT(*) AS "frequency" FROM Posts WHERE OwnerUserId = '##UserID##' GROUP BY TIME_TO_STR(CreationDate, '%I')
sede
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 jybgb ( BBCJBW text, BBDM tex...
在医院6828719中列出患者14284593就诊科室名称不包含心血管病的全部门诊就诊记录的流水号都是什么?
SELECT txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '14284593' AND hz_info.YLJGDM = '6828719' AND NOT txmzjzjlb.JZKSMC LIKE '%心血管病%' UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOIN ftxmzjzjlb ON hz_inf...
css
CREATE TABLE artist ( Famous_Title VARCHAR, Artist_ID VARCHAR ) CREATE TABLE volume ( Artist_ID VARCHAR, Weeks_on_Top INTEGER )
Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2
sql_create_context
CREATE TABLE table_name_54 ( type VARCHAR, satellite VARCHAR )
Which type is a satellite of GPS IIIA-2?
SELECT type FROM table_name_54 WHERE satellite = "gps iiia-2"
sql_create_context
CREATE TABLE table_22066 ( "Story No." text, "Episode" real, "Title" text, "Directed by" text, "Written by" text, "UK viewers (million)" text, "AI (%)" real, "Original air date" text, "Production code" text )
Name the least ai %
SELECT MIN("AI (%)") FROM table_22066
wikisql
CREATE TABLE table_10118 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "Location Attendance" text, "Record" text )
What is the location attendance of the game with Kobe Bryant (18) with the highest points on November 18?
SELECT "Location Attendance" FROM table_10118 WHERE "High points" = 'kobe bryant (18)' AND "Date" = 'november 18'
wikisql
CREATE TABLE table_71504 ( "Member countries" text, "Population" text, "Area (km\u00b2)" text, "GDP (billion US$)" text, "GDP per capita (US$)" text )
What is the area of the nation with GDP per capita (US$) of 11,929?
SELECT "Area (km\u00b2)" FROM table_71504 WHERE "GDP per capita (US$)" = '11,929'
wikisql
CREATE TABLE table_70276 ( "Start Date/Time" text, "Duration" text, "End Time" text, "Spacecraft" text, "Crew" text )
What is the duration of the flight with end time of 21:06?
SELECT "Duration" FROM table_70276 WHERE "End Time" = '21:06'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
when was the last time that was patient 027-82318 had the maximum calcium during their current hospital visit?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'calcium' ...
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 do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the last_name by a bar chart, display by the Y in descending please.
SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC
nvbench
CREATE TABLE table_59442 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text )
what is the name moving to atl tico minero?
SELECT "Name" FROM table_59442 WHERE "Moving to" = 'atlético minero'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose death status is 0 and procedure short title is exc/des hrt les,endovasc?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Exc/des hrt les,endovasc"
mimicsql_data
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, ...
Which are the upper elective courses offered for CS ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_203_40 ( id number, "p.s. #" number, "school name" text, "neighborhood" text, "low grade" text, "high grade" number, "year closed" text, "building status" text )
what is the total number of schools that are now vacant ?
SELECT COUNT("school name") FROM table_203_40 WHERE "building status" = 'vacant'
squall
CREATE TABLE table_27219 ( "Round" text, "Opposition" text, "Time" text, "Date" text, "Home/Away" text, "Venue" text, "Score" text, "Result/Margin" text, "Broadcaster" text, "TV" text, "Ladder Position" text )
Where was the game played when the score was 14.16 (100)-12.12 (84)?
SELECT "Venue" FROM table_27219 WHERE "Score" = '14.16 (100)-12.12 (84)'
wikisql
CREATE TABLE table_24918268_2 ( opponent VARCHAR, date VARCHAR )
Who are the opponents for games on Sunday, June 9?
SELECT opponent FROM table_24918268_2 WHERE date = "Sunday, June 9"
sql_create_context
CREATE TABLE table_name_44 ( name VARCHAR, killed VARCHAR, country VARCHAR )
Which rampage killed 8 in Israel?
SELECT name FROM table_name_44 WHERE killed = "8" AND country = "israel"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
tell me the first value of creatinine in a lab test of patient 30307 in 10/this year?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30307) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE...
mimic_iii
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
How frequently does THTREMUS 370 meet for class ?
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
advising
CREATE TABLE table_44040 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text )
What is the name of the person with a 2008 club of Nc Bejaia?
SELECT "Name" FROM table_44040 WHERE "2008 club" = 'nc bejaia'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE T...
Up and downvotes for site users.
SELECT DisplayName, Reputation, UpVotes, DownVotes, UpVotes + DownVotes AS TotalVotes, ROUND(UpVotes * 1.0 / (DownVotes + UpVotes) * 100.0, 1) AS UpvotePercentage FROM Users WHERE UpVotes + DownVotes > 0 ORDER BY ROUND(UpVotes * 1.0 / (DownVotes + UpVotes) * 100.0, 1)
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
what was the total amount of blood loss that patient 022-82169 had on 10/23/2102.
SELECT SUM(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 = '022-82169')) AND intakeoutput.celllabel = 'blood...
eicu
CREATE TABLE table_54571 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
If the Away team score was 14.10 (94), which Date was that?
SELECT "Date" FROM table_54571 WHERE "Away team score" = '14.10 (94)'
wikisql
CREATE TABLE song ( artist_name VARCHAR, rating VARCHAR ) CREATE TABLE artist ( artist_name VARCHAR, country VARCHAR )
What are the names and countries of origin for the artists who produced the top three highly rated songs.
SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3
sql_create_context
CREATE TABLE table_79664 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text )
What is the Circuit in the ATCC Round 1 Series with Winner Jim Richards?
SELECT "Circuit" FROM table_79664 WHERE "Winner" = 'jim richards' AND "Series" = 'atcc round 1'
wikisql
CREATE TABLE table_name_64 ( date VARCHAR, visitor VARCHAR )
Name the date with chicago visiting
SELECT date FROM table_name_64 WHERE visitor = "chicago"
sql_create_context
CREATE TABLE table_78234 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
What is the lowest evening score of the contestant with an evening gown less than 8.938, from Texas, and with an average less than 8.846 has?
SELECT MIN("Interview") FROM table_78234 WHERE "Evening Gown" < '8.938' AND "State" = 'texas' AND "Average" < '8.846'
wikisql
CREATE TABLE table_35014 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real )
What's the total Lost with Games that's less than 4?
SELECT SUM("Lost") FROM table_35014 WHERE "Games" < '4'
wikisql
CREATE TABLE table_27727 ( "Number" real, "Name" text, "Vertices" text, "Hypotenuse 0 c" text, "Vertical 0 b" text, "Horizontal 0 a" text )
Name the hypotenuse for vertices ymf
SELECT "Hypotenuse 0 c" FROM table_27727 WHERE "Vertices" = '月山泛 ΔYMF'
wikisql
CREATE TABLE table_14496232_2 ( mixed_doubles VARCHAR, tour VARCHAR )
Name the mixed doubles when tour is hong kong super series
SELECT mixed_doubles FROM table_14496232_2 WHERE tour = "Hong Kong Super Series"
sql_create_context
CREATE TABLE table_10015132_7 ( nationality VARCHAR, years_in_toronto VARCHAR )
what nationality is the player who played from 1997-98
SELECT nationality FROM table_10015132_7 WHERE years_in_toronto = "1997-98"
sql_create_context
CREATE TABLE table_11955 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
What score occurred when the save was ||27,108||63 44?
SELECT "Score" FROM table_11955 WHERE "Save" = '||27,108||63–44'
wikisql