context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_29135051_3 ( guest_s_ VARCHAR, ratings VARCHAR )
who guest starred on the episode with a 1.44m rating
SELECT guest_s_ FROM table_29135051_3 WHERE ratings = "1.44m"
sql_create_context
CREATE TABLE table_11545282_7 ( years_for_jazz VARCHAR, player VARCHAR )
How many years did Paul Griffin play for the Jazz?
SELECT COUNT(years_for_jazz) FROM table_11545282_7 WHERE player = "Paul Griffin"
sql_create_context
CREATE TABLE table_name_4 ( genre VARCHAR, type VARCHAR, developer_s_ VARCHAR )
What type of 3D game did Valve Corporation release?
SELECT genre FROM table_name_4 WHERE type = "3d" AND developer_s_ = "valve corporation"
sql_create_context
CREATE TABLE table_16799784_8 ( year_named INTEGER, latitude VARCHAR )
In what year was the feature at a 33.3S latitude named?
SELECT MAX(year_named) FROM table_16799784_8 WHERE latitude = "33.3S"
sql_create_context
CREATE TABLE table_204_443 ( id number, "week" number, "date" text, "opponent" text, "result" text, "game site" text, "attendance" number, "bye" text )
total number of attendees at the two games against the new england patriots during the season
SELECT SUM("attendance") FROM table_204_443 WHERE "opponent" = 'new england patriots'
squall
CREATE TABLE table_name_62 ( type VARCHAR, position VARCHAR, location VARCHAR )
what is the type when the position is ambassador and the location is rabat?
SELECT type FROM table_name_62 WHERE position = "ambassador" AND location = "rabat"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
provide the number of patients whose death status is 0 and diagnoses icd9 code is 4260?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "4260"
mimicsql_data
CREATE TABLE table_name_16 ( country VARCHAR, olympics VARCHAR, name VARCHAR )
Which country in the 2008 summer olympics is vadim devyatovskiy from?
SELECT country FROM table_name_16 WHERE olympics = "2008 summer olympics" AND name = "vadim devyatovskiy"
sql_create_context
CREATE TABLE table_204_100 ( id number, "date" text, "name of ship" text, "nationality" text, "tonnage" number, "fate" text )
what is the difference in tonnage between the heaviest and the lightest ships ?
SELECT MAX("tonnage") - MIN("tonnage") FROM table_204_100
squall
CREATE TABLE table_name_43 ( opponents VARCHAR, partner VARCHAR, date VARCHAR )
Tell me the opponents for mashona washington november 21, 2009
SELECT opponents FROM table_name_43 WHERE partner = "mashona washington" AND date = "november 21, 2009"
sql_create_context
CREATE TABLE table_name_28 ( away_team VARCHAR, home_team VARCHAR )
who is the away team when the home team is sydney spirit?
SELECT away_team FROM table_name_28 WHERE home_team = "sydney spirit"
sql_create_context
CREATE TABLE table_66474 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
What power has A as the class, and 93.7 as the frequency?
SELECT "Power" FROM table_66474 WHERE "Class" = 'a' AND "Frequency" = '93.7'
wikisql
CREATE TABLE table_name_13 ( australian_marquee VARCHAR, captain VARCHAR )
What Australian Marquee team is Michael Beauchamp a captain of?
SELECT australian_marquee FROM table_name_13 WHERE captain = "michael beauchamp"
sql_create_context
CREATE TABLE table_1480455_1 ( population__2005_ VARCHAR, population_density___km_2__ VARCHAR )
What is the total number of population in the year 2005 where the population density 35.9 (/km 2)?
SELECT COUNT(population__2005_) FROM table_1480455_1 WHERE population_density___km_2__ = "35.9"
sql_create_context
CREATE TABLE table_204_576 ( id number, "year" number, "best" text, "location" text, "date" text, "world rank" text )
which location has the best time other than brussels ?
SELECT "location" FROM table_204_576 WHERE "location" <> 'brussels' ORDER BY "best" LIMIT 1
squall
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...
find the drug name of drug code nalo4i.
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NALO4I"
mimicsql_data
CREATE TABLE table_31057 ( "Episode" real, "Airdate" text, "Iron Chef" text, "Challenger" text, "Theme Ingredient" text, "Winner" text )
What date did the episode air when guy grossi won?
SELECT "Airdate" FROM table_31057 WHERE "Winner" = 'Guy Grossi'
wikisql
CREATE TABLE table_28262 ( "AB - Angry boar" text, "B - Bishop" text, "BA - Running Bear" text, "BB - Blind Bear" text, "BC - Beast Cadet" text )
what is b - bishop where ab - angry boar is vw - vertical wolf?
SELECT "B - Bishop" FROM table_28262 WHERE "AB - Angry boar" = 'VW - Vertical Wolf'
wikisql
CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id text, movie_id text ) CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide nu...
How many movie directors are there?
SELECT COUNT(DISTINCT director) FROM movie
spider
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End...
Plot the number of payment method code by grouped by payment method code as a bar graph, and list by the total number from high to low.
SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(Payment_Method_Code) DESC
nvbench
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 bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, sort by the X-axis from high to low.
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_1997759_1 ( location VARCHAR, last_flew VARCHAR )
at what location is the last flew on 11 june 2000
SELECT location FROM table_1997759_1 WHERE last_flew = "11 June 2000"
sql_create_context
CREATE TABLE table_189598_7 ( population_density__per_km²_ VARCHAR, name VARCHAR )
When buffalo narrows is the name how many measurements of population density per kilometer squared are there?
SELECT COUNT(population_density__per_km²_) FROM table_189598_7 WHERE name = "Buffalo Narrows"
sql_create_context
CREATE TABLE table_25375093_1 ( season VARCHAR, position VARCHAR )
Name the season for position 4th
SELECT COUNT(season) FROM table_25375093_1 WHERE position = "4th"
sql_create_context
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 (...
what is the number of patients who died in or before 2122 and lab test is prot.electrophoresis urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2122.0" AND lab.label = "Prot. Electrophoresis, Urine"
mimicsql_data
CREATE TABLE table_name_37 ( score VARCHAR, attendance VARCHAR )
What is the score of the game with 1,125 people in attendance?
SELECT score FROM table_name_37 WHERE attendance = "1,125"
sql_create_context
CREATE TABLE table_name_69 ( nominee_s_ VARCHAR, year VARCHAR, result VARCHAR )
Which nominees won before year 2005?
SELECT nominee_s_ FROM table_name_69 WHERE year < 2005 AND result = "won"
sql_create_context
CREATE TABLE table_name_18 ( opponent VARCHAR, date VARCHAR )
What is Opponent, when Date is 8 April 1999?
SELECT opponent FROM table_name_18 WHERE date = "8 april 1999"
sql_create_context
CREATE TABLE table_name_44 ( player VARCHAR, to_par VARCHAR, country VARCHAR )
Who is the player from Spain that has a +2 to par?
SELECT player FROM table_name_44 WHERE to_par = "+2" AND country = "spain"
sql_create_context
CREATE TABLE table_65764 ( "Ship name" text, "Year built" real, "Length" text, "Crew" real, "Guests" real, "Staterooms" real, "Comments" text )
What is the total for guests with a ship name of rv indochina, and a crew smaller than 28?
SELECT COUNT("Guests") FROM table_65764 WHERE "Ship name" = 'rv indochina' AND "Crew" < '28'
wikisql
CREATE TABLE table_name_60 ( venue VARCHAR, runs VARCHAR )
During runs 332, what was the venue?
SELECT venue FROM table_name_60 WHERE runs = "332"
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Give me the comparison about the average of meter_100 over the Nationality , and group by attribute Nationality by a bar chart, and sort by the names from high to low.
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 tex...
since 2104, what are the top three most frequent lab tests ordered for patients in the same hospital encounter after having received 1 int mam-cor art bypass?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
mimic_iii
CREATE TABLE table_name_17 ( zone_2008 VARCHAR, services VARCHAR, station VARCHAR )
Which Zone 2008 has Services of greater anglia, and a Station of cheshunt?
SELECT zone_2008 FROM table_name_17 WHERE services = "greater anglia" AND station = "cheshunt"
sql_create_context
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 prescriptions...
Calculate the average age of unmarried patients born after the year 2097
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2097"
mimicsql_data
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
郑阳荣这位患者自09.9.3起,到10.3.27止,常去的医院是哪家
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '郑阳荣' AND qtb.IN_HOSP_DATE BETWEEN '2009-09-03' AND '2010-03-27' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '郑阳荣' AND gyb.IN_HOSP_DATE BETWEEN '2009-09-03' AND '2010-03-27' GROUP BY gy...
css
CREATE TABLE table_40166 ( "School" text, "Location" text, "Enrolment" real, "Founded" real, "Denomination" text, "Boys/Girls" text, "Day/Boarding" text, "Year Entered Competition" real, "School Colors" text )
Which boys' school wears Royal Blue and Gold and entered the competition in 1929?
SELECT "School" FROM table_40166 WHERE "Boys/Girls" = 'boys' AND "Year Entered Competition" = '1929' AND "School Colors" = 'royal blue and gold'
wikisql
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
What is the minimum weights for people of each sex? Show a bar chart, sort from low to high by the x-axis.
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE table_name_14 ( theme VARCHAR, year VARCHAR, issue_price VARCHAR )
What theme is associated with a year before 2006 and Issue Price of $25.22?
SELECT theme FROM table_name_14 WHERE year < 2006 AND issue_price = "$25.22"
sql_create_context
CREATE TABLE table_79078 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is Venue, when Status is 'Test Match', and when Against is '12'?
SELECT "Venue" FROM table_79078 WHERE "Status" = 'test match' AND "Against" = '12'
wikisql
CREATE TABLE table_328 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
What player attended Loyola Marymount?
SELECT "Player" FROM table_328 WHERE "School/Club Team/Country" = 'Loyola Marymount'
wikisql
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,...
在2008年8月15日到2019年6月21日期间卖出了多少药品2815总金额达到多少钱?
SELECT SUM(t_kc22.QTY), SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '2815' AND t_kc22.STA_DATE BETWEEN '2008-08-15' AND '2019-06-21'
css
CREATE TABLE table_43253 ( "Tournament" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What 2002 tournament has 2008 career statistics?
SELECT "2002" FROM table_43253 WHERE "2008" = 'career statistics'
wikisql
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...
定点医疗机构中医疗就诊65701713769的编码是多少?
SELECT t_kc21.FLX_MED_ORG_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '65701713769'
css
CREATE TABLE table_35312 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the Location Attendance when the Date was February 27?
SELECT "Location Attendance" FROM table_35312 WHERE "Date" = 'february 27'
wikisql
CREATE TABLE table_name_23 ( rating VARCHAR, viewers__households_in_millions_ VARCHAR )
What was the rating of the season that had 18.17 million household viewers?
SELECT rating FROM table_name_23 WHERE viewers__households_in_millions_ = "18.17"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
what is the length of stay of patient 002-56583 for the last intensive care unit stay?
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-56583') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_22871239_5 ( high_rebounds VARCHAR, _number VARCHAR )
How many high rebound catagories are listed for game number 5?
SELECT COUNT(high_rebounds) FROM table_22871239_5 WHERE _number = 5
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
all votes and accepts users have cast for all your posts.
SELECT TotalUpVotes = SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END), TotalDownVotes = SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END), Accepts = SUM(CASE WHEN VoteTypeId = 1 THEN 1 ELSE 0 END) FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE p.OwnerUserId = '##UserId##'
sede
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...
病患凤慧捷有过多少次检查是在03年3月14日到17年6月9日之间做的?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '凤慧捷' AND t_kc22.STA_DATE BETWEEN '2003-03-14' AND '2017-06-09' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_42284 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What was 2011, when 2005 was 2R, and when 2003 was 2R?
SELECT "2011" FROM table_42284 WHERE "2005" = '2r' AND "2003" = '2r'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
how many days has it been since the last time patient 011-55642's procedure during the current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55642'...
eicu
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Return a bar chart about the distribution of name and ID , display from low to high by the x axis.
SELECT name, ID FROM swimmer ORDER BY name
nvbench
CREATE TABLE table_15941 ( "Season" real, "Timeslot ( ET )" text, "Season premiere" text, "Season finale" text, "TV season" text, "Rank" text, "Viewers (millions)" text )
What is the season year where the rank is 39?
SELECT "TV season" FROM table_15941 WHERE "Rank" = '39'
wikisql
CREATE TABLE table_name_55 ( fiscal_year INTEGER, headquarters VARCHAR, employees VARCHAR )
What is the average Fiscal Year of the firm Headquartered in noida, with less than 85,335 employees?
SELECT AVG(fiscal_year) FROM table_name_55 WHERE headquarters = "noida" AND employees < 85 OFFSET 335
sql_create_context
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
Create a pie chart showing how many country across country.
SELECT Country, COUNT(Country) FROM artist GROUP BY Country
nvbench
CREATE TABLE table_78850 ( "Main contestant" text, "Co-contestant (Yaar vs. Pyaar)" text, "Date performed" text, "Scores by each individual judge" text, "Total score/week" text, "Position" text, "Status" text )
Who is the main contestant with scores by each individual judge of 8 + 7 + 7 = 21?
SELECT "Main contestant" FROM table_78850 WHERE "Scores by each individual judge" = '8 + 7 + 7 = 21'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
show me the number of white ethnic background patients who have the diagnoses of portal hypertension.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Portal hypertension"
mimicsql_data
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, ...
Group and count the years played to draw a bar chart, list y axis in descending order.
SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played ORDER BY COUNT(Years_Played) DESC
nvbench
CREATE TABLE table_54229 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Loser" text, "Location" text )
Who was the loser at Municipal Stadium after 1970?
SELECT "Loser" FROM table_54229 WHERE "Location" = 'municipal stadium' AND "Year" > '1970'
wikisql
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 manufacturer , and group by attribute headquarter, show y-axis from high to low order.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
get me the number of patients with procedure icd9 code 8854 who were admitted before the year 2170.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2170" AND procedures.icd9_code = "8854"
mimicsql_data
CREATE TABLE table_name_50 ( attendance VARCHAR, visitor VARCHAR )
Name the total number in attendance for when the bulls visited
SELECT COUNT(attendance) FROM table_name_50 WHERE visitor = "bulls"
sql_create_context
CREATE TABLE table_61692 ( "Date From" text, "Date To" text, "Position" text, "Name" text, "From" text )
What is the date for Watford and player Lionel Ainsworth?
SELECT "Date To" FROM table_61692 WHERE "From" = 'watford' AND "Name" = 'lionel ainsworth'
wikisql
CREATE TABLE table_dev_60 ( "id" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "renal_disease" bool, "allergy_to_aspirin" bool, "creatinine_clearance_cl" float, "allergy_to_clopidogrel" bool, "allergy_to_heparin" bool, "platelet_count" float, "thrombocytopenia" flo...
known allergy or contraindication to fibrinolytics or aspirin or heparin or clopidogrel
SELECT * FROM table_dev_60 WHERE allergy_to_fibrinolytics = 1 OR allergy_to_aspirin = 1 OR allergy_to_heparin = 1 OR allergy_to_clopidogrel = 1
criteria2sql
CREATE TABLE table_44387 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
Which Record has a Visitor of pittsburgh, and a Score of 4 0?
SELECT "Record" FROM table_44387 WHERE "Visitor" = 'pittsburgh' AND "Score" = '4–0'
wikisql
CREATE TABLE table_29067 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real )
What is the home team where the San Jose state is the visiting team?
SELECT "Home team" FROM table_29067 WHERE "Visiting team" = 'San Jose State'
wikisql
CREATE TABLE table_name_24 ( round VARCHAR, margin VARCHAR )
which round has a margin of 178?
SELECT round FROM table_name_24 WHERE margin = "178"
sql_create_context
CREATE TABLE table_65195 ( "Rank" text, "Country" text, "Jerseys" real, "Giro wins" real, "Points" real, "Young rider" real, "Most recent cyclist" text, "Most recent date" text, "Different holders" real )
what is the giro wins when jerseys is 2, country is portugal and young rider is more than 0?
SELECT SUM("Giro wins") FROM table_65195 WHERE "Jerseys" = '2' AND "Country" = 'portugal' AND "Young rider" > '0'
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 products with a price between 60 and 120, return a scatter chart about the correlation between price and manufacturer .
SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120
nvbench
CREATE TABLE table_name_78 ( lner_class VARCHAR )
What is the 1914 NER class with a d17/2 LNER class?
SELECT 1914 AS _ner_class FROM table_name_78 WHERE lner_class = "d17/2"
sql_create_context
CREATE TABLE table_10815 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
In the venue Corio Oval, who was the away team?
SELECT "Away team" FROM table_10815 WHERE "Venue" = 'corio oval'
wikisql
CREATE TABLE table_37583 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text )
What is the average Pick for the Pasco, Wa school?
SELECT AVG("Pick") FROM table_37583 WHERE "School" = 'pasco, wa'
wikisql
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, draw a bar chart about the distribution of headquarter and the average of price , and group by attribute headquarter, list by the y-axis from high to low please.
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Price) DESC
nvbench
CREATE TABLE table_3826 ( "Season" text, "Competition" text, "Stage" text, "Result" text, "Opponent" text, "Scorers" text )
What is the result of the game where the opponent is Innsbrucker Kilmarnock CSK VVS Samara?
SELECT "Result" FROM table_3826 WHERE "Opponent" = 'Innsbrucker Kilmarnock CSK VVS Samara'
wikisql
CREATE TABLE table_15731 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
On what date did they have a record of 12-17?
SELECT "Date" FROM table_15731 WHERE "Record" = '12-17'
wikisql
CREATE TABLE table_name_2 ( laps VARCHAR, time VARCHAR )
What was the total number of Laps for the rider whose time was +7.951?
SELECT COUNT(laps) FROM table_name_2 WHERE time = "+7.951"
sql_create_context
CREATE TABLE table_41565 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Assists" real )
Which player has the fewest assists and played 2 games or fewer?
SELECT MIN("Assists") FROM table_41565 WHERE "Games" < '2'
wikisql
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_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
what exactly does the periph t cell lym abdom stand for?
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'periph t cell lym abdom' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'periph t cell lym abdom'
mimic_iii
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top 100 StackOverflow users from Nigeria.
SELECT Id, DisplayName AS "display_name", Reputation, WebsiteUrl AS Website, Location FROM Users WHERE Location LIKE '%Nigeria%' ORDER BY Reputation DESC LIMIT 100
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...
列出在04年11月22日到10年5月4日内患者柳清昶被开出的所有检验报告单的科室号码是什么?科室名称叫什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
从02年6月25日至21年1月22日期间,病患鲁嘉歆被开出的所有检验报告单的检验报告单号都有哪些?
SELECT jybgb.BGDH 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 = '鲁嘉歆' AND jybg...
css
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...
查询在2000年4月22日到2014年2月2日的这段时间里医院5633728的检验科科室涉及的医疗费总额
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5633728' AND t_kc21.MED_ORG_DEPT_NM = '检验科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-22' AND '2014-02-02'
css
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
在06-12-21到15-08-04的就诊结算日期内,把患者褚力言所有医疗就诊记录的编号给列出来
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '褚力言' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-12-21' AND '2015-08-04'
css
CREATE TABLE table_5833 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What was the score of the game that led to a 7-5 record?
SELECT "Score" FROM table_5833 WHERE "Record" = '7-5'
wikisql
CREATE TABLE table_name_53 ( chassis VARCHAR, year VARCHAR, pts VARCHAR )
Which chassis is more recent than 1972 and has more than 0 Pts. ?
SELECT chassis FROM table_name_53 WHERE year > 1972 AND pts > 0
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZ...
病患76177334在08年7月12日到09年7月19日内的全部检测结果指标记录的检查员为39427347的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH 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.YLJ...
css
CREATE TABLE table_name_85 ( venue VARCHAR, score VARCHAR, h_a_n VARCHAR, pos VARCHAR )
Which venue has a neutral H/A/N, lower than position 3 and a score of 141?
SELECT venue FROM table_name_85 WHERE h_a_n = "neutral" AND pos < 3 AND score = "141"
sql_create_context
CREATE TABLE table_46082 ( "Name" text, "Born-Died" text, "Term start" text, "Term end" text, "Political Party" text )
What is Born-Died, when Term End is 19 January 1943?
SELECT "Born-Died" FROM table_46082 WHERE "Term end" = '19 january 1943'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
ANAT 403 is taught when in the week ?
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_5577 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
What is the total Points for the Opponent of @ New Jersey Devils and a Game bigger than 7?
SELECT SUM("Points") FROM table_5577 WHERE "Opponent" = '@ new jersey devils' AND "Game" > '7'
wikisql
CREATE TABLE table_19753079_36 ( result VARCHAR, district VARCHAR )
Name the result for north carolina 7
SELECT result FROM table_19753079_36 WHERE district = "North Carolina 7"
sql_create_context
CREATE TABLE table_41684 ( "Club" text, "Played" 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 )
What is the number of tries for when the try bonus is 0?
SELECT "Tries For" FROM table_41684 WHERE "Try Bonus" = '0'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
病人韦嘉泽有多少次医院是在03年3月16日到12年1月12日内去的?
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韦嘉泽' AND mzjzjlb.JZKSRQ BETWEEN '2003-03-16' AND '2012-01-12') + (SELECT COUNT(*) FROM person_info J...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and year of death is less than or equal to 2115?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dod_year <= "2115.0"
mimicsql_data
CREATE TABLE table_76011 ( "Publication" text, "Country" text, "Accolade" text, "Year" real, "Rank" text )
Which year's rank was #4 when the country was the US?
SELECT "Year" FROM table_76011 WHERE "Rank" = '#4' AND "Country" = 'us'
wikisql
CREATE TABLE table_43604 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
what is the score on 22 february 1993?
SELECT "Score" FROM table_43604 WHERE "Date" = '22 february 1993'
wikisql
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...
查一下患者32686638之前的所有住院诊断记录
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '32686638'
css
CREATE TABLE table_70393 ( "Overall place" text, "Yacht name" text, "Skipper" text, "Points" text, "Combined elapsed time" text )
Which Overall place has a Yacht name of lg flatron?
SELECT "Overall place" FROM table_70393 WHERE "Yacht name" = 'lg flatron'
wikisql
CREATE TABLE table_name_16 ( total INTEGER, to_par VARCHAR )
What is the maximum total when the To par is +3?
SELECT MAX(total) FROM table_name_16 WHERE to_par = "+3"
sql_create_context