context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_28628309_9 ( player VARCHAR, category VARCHAR )
What is the name of the player when the category is 3-pt field goal percentage?
SELECT player FROM table_28628309_9 WHERE category = "3-pt field goal percentage"
sql_create_context
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
how many chinese restaurants are there in the bay area ?
SELECT COUNT(*) FROM geographic, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'chinese'
restaurants
CREATE TABLE table_52920 ( "Year" real, "Show" text, "Season" real, "Episode title" text, "Episode" real )
Which show had a part 3 before 2011?
SELECT "Show" FROM table_52920 WHERE "Year" < '2011' AND "Episode title" = 'part 3'
wikisql
CREATE TABLE table_3776 ( "Province" text, "Formed date" text, "Formed from" text, "Dissolution date" text, "Reason" text )
How many provinces are named Wellington?
SELECT COUNT("Formed date") FROM table_3776 WHERE "Province" = 'Wellington'
wikisql
CREATE TABLE table_15406 ( "Name" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What is the lowest grid that Paul Tracy had when he had over 4 points?
SELECT MIN("Grid") FROM table_15406 WHERE "Name" = 'paul tracy' AND "Points" > '4'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport_service ( city_code varchar, ...
what flight from BOSTON to ATLANTA arrives earliest in ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
atis
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...
what is the avaerage of patients whose admission location is phys referral/normal deli and have stayed in the hospital for 29 days?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.days_stay = "29"
mimicsql_data
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...
Return a bar chart about the distribution of meter_600 and meter_100 , and rank by the Y in descending.
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100 DESC
nvbench
CREATE TABLE table_25873 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
When carmelo anthony (39) has the highest amount of points where is the location and what is the attendance?
SELECT "Location Attendance" FROM table_25873 WHERE "High points" = 'Carmelo Anthony (39)'
wikisql
CREATE TABLE table_3442 ( "Actor/Actress" text, "Character" text, "First Appearance" text, "Last Appearance" text, "Duration" text, "Total" real )
Who was the actor/actress with a last appearance of 1 january 2010 and total is 20 and character is vanessa 'nessa' jenkins?
SELECT "Actor/Actress" FROM table_3442 WHERE "Last Appearance" = '1 January 2010' AND "Total" = '20' AND "Character" = 'Vanessa ''Nessa'' Jenkins'
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, ...
Find meter_300 and ID , and visualize them by a bar chart, and show bar in asc order.
SELECT meter_300, ID FROM swimmer ORDER BY meter_300
nvbench
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...
A bar chart that computes the total number of wines with a price is bigger than 100. Next, Bin the year into the weekday interval.
SELECT Year, COUNT(Year) FROM wine WHERE Price > 100
nvbench
CREATE TABLE table_name_38 ( silver INTEGER, bronze VARCHAR, rank VARCHAR, total VARCHAR )
On average, what is the number of silver medals for nations ranking higher than 7, with a total of 6 medals and fewer than 2 bronze medals?
SELECT AVG(silver) FROM table_name_38 WHERE rank > 7 AND total = 6 AND bronze < 2
sql_create_context
CREATE TABLE table_40732 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the date of the game held at the Al-Rashid Stadium, Dubai?
SELECT "Date" FROM table_40732 WHERE "Venue" = 'al-rashid stadium, dubai'
wikisql
CREATE TABLE table_name_96 ( election VARCHAR )
Which 2nd Party has an Election of 1837?
SELECT 2 AS nd_party FROM table_name_96 WHERE election = "1837"
sql_create_context
CREATE TABLE performance ( Date VARCHAR, LOCATION VARCHAR )
What are the dates and locations of performances?
SELECT Date, LOCATION FROM performance
sql_create_context
CREATE TABLE table_20991 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
Name the max top 5 for 5.0 avg finish
SELECT MAX("Top 5") FROM table_20991 WHERE "Avg. Finish" = '5.0'
wikisql
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int,...
Fetch me the most cited publications for Artificial Intelligence
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citingpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Artificial Intelligence' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpa...
scholar
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
Which nation has the most nuclear plants under construction?
SELECT country FROM nuclear_power_plants WHERE status = "Under Construction" GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
geonucleardata
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
统计年龄高于22岁的患者医疗记录的平均医疗费总额是多少钱?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE > 22)
css
CREATE TABLE table_name_1 ( school_club_team VARCHAR, draft VARCHAR )
Which team had a 2008-3 2008 draft?
SELECT school_club_team FROM table_name_1 WHERE draft = "2008-3 2008"
sql_create_context
CREATE TABLE table_67014 ( "Round" real, "Pick" real, "Name" text, "Position" text, "College" text )
In what round smaller than 10, was the center les studdard picked in?
SELECT MIN("Pick") FROM table_67014 WHERE "Position" = 'center' AND "Name" = 'les studdard' AND "Round" < '10'
wikisql
CREATE TABLE table_name_78 ( type_of_game VARCHAR, results¹ VARCHAR )
what type of game has the resuts of 1:0?
SELECT type_of_game FROM table_name_78 WHERE results¹ = "1:0"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
what are the five most commonly ordered drugs for patients who received physiotherapy of chest previously during the same hospital visit, this year?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'physiotherapy o...
eicu
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
count the number of times patient 23858 has been given a tpn d15.0 until 75 months ago.
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23858)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d15.0' A...
mimic_iii
CREATE TABLE table_29101 ( "Series #" real, "Episode #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text )
What was the original air date for episode number 96 in the series?
SELECT "Original airdate" FROM table_29101 WHERE "Series #" = '96'
wikisql
CREATE TABLE table_22871316_6 ( high_rebounds VARCHAR, high_assists VARCHAR )
Who did the high rebounds in the game in which Brandon Jennings (8) did the high assists?
SELECT high_rebounds FROM table_22871316_6 WHERE high_assists = "Brandon Jennings (8)"
sql_create_context
CREATE TABLE table_50155 ( "Season" text, "Player" text, "School" text, "Position" text, "Class" text )
What is Player, when Class is 'senior', when Position is 'shooting guard', and when School is 'Bradley'?
SELECT "Player" FROM table_50155 WHERE "Class" = 'senior' AND "Position" = 'shooting guard' AND "School" = 'bradley'
wikisql
CREATE TABLE table_15529 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director" text )
What is the English title for years after 1981 originating from Argentina?
SELECT "English title" FROM table_15529 WHERE "Year" > '1981' AND "Country" = 'argentina'
wikisql
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( ...
I want to see trend of the number of season by season, and order by the X-axis in ascending.
SELECT Season, COUNT(Season) FROM game GROUP BY Season ORDER BY Season
nvbench
CREATE TABLE Sportsinfo ( StuID VARCHAR, onscholarship VARCHAR ) CREATE TABLE Student ( Lname VARCHAR, StuID VARCHAR )
Show last names for all student who are on scholarship.
SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'
sql_create_context
CREATE TABLE table_25213 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
Who was the driver in 1986?
SELECT "Driver" FROM table_25213 WHERE "Year" = '1986'
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, give me the comparison about the sum of price over the headquarter , and group by attribute headquarter by a bar chart.
SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_59531 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is the average Against, when Status is '2007 Rugby World Cup', and when Opposing Teams is 'U.S.A.'?
SELECT AVG("Against") FROM table_59531 WHERE "Status" = '2007 rugby world cup' AND "Opposing Teams" = 'u.s.a.'
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevent...
what are the top four most frequent specimen tests a patient had within 2 months after being diagnosed with ped cycl acc-ped cyclist since 2105?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_72910 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What is the verb meaning of the word with part 2 'bant'?
SELECT "Verb meaning" FROM table_72910 WHERE "Part 2" = 'bant'
wikisql
CREATE TABLE table_name_3 ( k_league_classic VARCHAR, teams INTEGER )
What K League classic had less than 10 teams?
SELECT k_league_classic FROM table_name_3 WHERE teams < 10
sql_create_context
CREATE TABLE table_41804 ( "Number" text, "Proto-Austronesian" text, "Proto-Malayo-Polynesian" text, "Proto-Oceanic" text, "Proto-Polynesian" text )
Which Proto-Oceanic has a Proto-Polynesian of *lima?
SELECT "Proto-Oceanic" FROM table_41804 WHERE "Proto-Polynesian" = '*lima'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
If I need to fulfill the ULCS requirement , what 's the easiest class I can take ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co...
advising
CREATE TABLE table_62539 ( "Year" text, "Arizona" text, "California" text, "Colorado" text, "Nevada" text, "New Mexico" text, "Oklahoma" text, "Texas" text, "Utah" text )
What's the value for utah when texas is humphrey?
SELECT "Utah" FROM table_62539 WHERE "Texas" = 'humphrey'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Posts ( ...
Closures and reopenings attributed to an user.
SELECT PH.PostId, P.Title FROM PostHistory AS PH INNER JOIN Posts AS P ON P.Id = PH.PostId WHERE PH.UserId = '##UserId##' AND PH.PostHistoryTypeId = 10 ORDER BY P.CreationDate
sede
CREATE TABLE table_name_86 ( artist VARCHAR, label VARCHAR, standard_number VARCHAR )
Which Artist has the Label of Columbia and the Standard number of COCC-72073?
SELECT artist FROM table_name_86 WHERE label = "columbia" AND standard_number = "cocc-72073"
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 (...
give me the number of patients whose marital status is married and procedure long title is non-invasive mechanical ventilation?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Non-invasive mechanical ventilation"
mimicsql_data
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
Top React-Native users in Turkey.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE table_65339 ( "Draw" real, "Entrant" text, "Brand" text, "Order" text, "Eliminated by" text, "Time" text )
What is the average draw number of an entrant with a time of 22:29?
SELECT AVG("Draw") FROM table_65339 WHERE "Time" = '22:29'
wikisql
CREATE TABLE table_78836 ( "Class" text, "Number(s)" text, "Quantity" real, "Year(s) of Manufacture" text, "Type" text )
Which Class has a Year(s) of Manufacture of 1899?
SELECT "Class" FROM table_78836 WHERE "Year(s) of Manufacture" = '1899'
wikisql
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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABL...
What courses are the prerequisites to SM 217 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_name_51 ( team VARCHAR, driver VARCHAR, engine VARCHAR, manufacturer VARCHAR )
What Team has the Engine of Chevrolet 6.0 V8, the Manufacturer of Opel, and the Driver Chris Jackson?
SELECT team FROM table_name_51 WHERE engine = "chevrolet 6.0 v8" AND manufacturer = "opel" AND driver = "chris jackson"
sql_create_context
CREATE TABLE table_20902 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
Who picked a player from Weber State?
SELECT "CFL Team" FROM table_20902 WHERE "College" = 'Weber State'
wikisql
CREATE TABLE table_21564794_3 ( championships_in_st_louis VARCHAR, sport VARCHAR )
How many championships were won for arena football?
SELECT championships_in_st_louis FROM table_21564794_3 WHERE sport = "Arena Football"
sql_create_context
CREATE TABLE table_name_75 ( position VARCHAR, years_for_rockets VARCHAR )
What is the position for the Rockets years of 2004-05?
SELECT position FROM table_name_75 WHERE years_for_rockets = "2004-05"
sql_create_context
CREATE TABLE table_202_15 ( id number, "year" number, "title" text, "role" text, "notes" text )
when was mandy patinkin nominated for the saturn award for best supporting actor ?
SELECT "year" FROM table_202_15 WHERE "notes" = 'nominated-saturn award for best supporting actor'
squall
CREATE TABLE table_60480 ( "Edition" text, "Round" text, "Date" text, "Surface" text, "Opponent" text, "Result" text )
Who was the opponent when the result was 7 6 (7 5) , 6 3?
SELECT "Opponent" FROM table_60480 WHERE "Result" = '7–6 (7–5) , 6–3'
wikisql
CREATE TABLE table_9091 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Can you tell me the Team that has the Date of march 17?
SELECT "Team" FROM table_9091 WHERE "Date" = 'march 17'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
how many times was the valium prescribed this month for patient 022-199074?
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074')) AND medication.drugname = 'valium' AND DATETIME(medication.drugs...
eicu
CREATE TABLE table_40493 ( "Rank" real, "City" text, "Airport" text, "Passengers" real, "Carriers" text )
What city had a rank before 3 and primary carrier JetBlue Airways?
SELECT "City" FROM table_40493 WHERE "Rank" < '3' AND "Carriers" = 'jetblue airways'
wikisql
CREATE TABLE table_24057191_2 ( end_date VARCHAR, average_viewers__millions_ VARCHAR )
How many different end dates are there for the series seen by 4.2 million people?
SELECT COUNT(end_date) FROM table_24057191_2 WHERE average_viewers__millions_ = "4.2"
sql_create_context
CREATE TABLE table_1671401_3 ( winnings VARCHAR, starts VARCHAR )
name all the winnings that the start appears to be 7
SELECT winnings FROM table_1671401_3 WHERE starts = 7
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, na...
Is there a EECS class that meets on a day other than Friday ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'EECS' AND semester.semester = 'WN' AND s...
advising
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 job_history ( EMPLOYEE...
For those employees who was hired before 2002-06-21, return a line chart about the change of commission_pct over hire_date , and could you sort by the x-axis from low to high?
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE
nvbench
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, ...
New Users by Date (last 30 days).
SELECT CAST(CreationDate AS DATE) AS "date", COUNT(Id) AS "new_users" FROM Users WHERE CreationDate >= DATEADD(d, -30, GETDATE()) GROUP BY CAST(CreationDate AS DATE) ORDER BY CAST(CreationDate AS DATE) DESC
sede
CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_to time ) CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_detail...
What are all the calendar dates and day Numbers?
SELECT calendar_date, day_number FROM ref_calendar
spider
CREATE TABLE table_name_29 ( venue VARCHAR, tournament VARCHAR )
Where was the Olympic Games held?
SELECT venue FROM table_name_29 WHERE tournament = "olympic games"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
在00年3月18日到21年5月7日这段时间参保编号为32352612的患者门诊手术费用是多些?
SELECT SUM(t_kc22.AMOUNT) 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_ID = '32352612' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-03-18' AND '2021-05-07' AND t_kc22.MED_I...
css
CREATE TABLE table_204_568 ( id number, "pennant" text, "name" text, "hull builder" text, "ordered" text, "laid down" text, "launched" text, "accepted into service" text, "commissioned" text, "est. building cost" text, "fate" text )
how many ships were built after ardent ?
SELECT COUNT(*) FROM table_204_568 WHERE "commissioned" > (SELECT "commissioned" FROM table_204_568 WHERE "name" = 'ardent')
squall
CREATE TABLE table_name_75 ( batting_style VARCHAR, bowling_style VARCHAR, birth_date VARCHAR )
What is the batting style of the person who has a right arm medium pace bowling style and a birth date of 10 February 1910 (aged 29)?
SELECT batting_style FROM table_name_75 WHERE bowling_style = "right arm medium pace" AND birth_date = "10 february 1910 (aged 29)"
sql_create_context
CREATE TABLE table_67486 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" text )
The Decile of 6 has which corresponding Years?
SELECT "Years" FROM table_67486 WHERE "Decile" = '6'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, ...
Top SO users from Algeria.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bangla%' OR UPPER(Location) LIKE '%BANGLA%' ORDER BY Reputation DESC
sede
CREATE TABLE table_20061872_1 ( year__ceremony_ VARCHAR, original_title VARCHAR )
When was the film H r har du ditt liv used in nomination?
SELECT year__ceremony_ FROM table_20061872_1 WHERE original_title = "Här har du ditt liv"
sql_create_context
CREATE TABLE table_20880 ( "Player" text, "VFL Games" real, "VFL Club(s)" text, "Rank held at time of death" text, "Date of death" text, "Location" text )
How many VFL games were located off Goodenough Island Milne Bay?
SELECT "VFL Games" FROM table_20880 WHERE "Location" = 'off Goodenough Island Milne Bay'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskSt...
How Many Edits Have I made?.
SELECT COUNT(PostHistoryTypeId) FROM PostHistory WHERE UserId = @UserId AND PostHistoryTypeId > 3 AND PostHistoryTypeId < 6
sede
CREATE TABLE table_name_1 ( characters VARCHAR, construction VARCHAR, name__wade_giles_ VARCHAR )
Who has a Construction of 1870, foochow navy yard, and a Name (Wade Giles) of fu-hsing?
SELECT characters FROM table_name_1 WHERE construction = "1870, foochow navy yard" AND name__wade_giles_ = "fu-hsing"
sql_create_context
CREATE TABLE table_1965650_8 ( college_junior_club_team VARCHAR, player VARCHAR )
What cub team or college did Bob Law come from?
SELECT college_junior_club_team FROM table_1965650_8 WHERE player = "Bob Law"
sql_create_context
CREATE TABLE table_1749 ( "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 )
What is the total amount of points when the given won is 9?
SELECT "Points" FROM table_1749 WHERE "Won" = '9'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
count the number of patients whose admission location is trsf within this facility and year of birth is less than 2087?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2087"
mimicsql_data
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
for patients who were prescribed calcium carbonate, what were the five most frequently prescribed drugs at the same time,?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'calcium carbonate') AS t1 JOIN (SELECT admissions.subject_id, pre...
mimic_iii
CREATE TABLE table_name_74 ( date VARCHAR, attendance INTEGER )
When was the Browns' game that over 36,796 attended?
SELECT date FROM table_name_74 WHERE attendance > 36 OFFSET 796
sql_create_context
CREATE TABLE table_63903 ( "Year" real, "Main" text, "Hessen" text, "Rhein" text, "Saar" text )
Who was the Hessen the year that Saar was FK Pirmasens?
SELECT "Hessen" FROM table_63903 WHERE "Saar" = 'fk pirmasens'
wikisql
CREATE TABLE table_44366 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was the score of Wally Armstrong?
SELECT "Score" FROM table_44366 WHERE "Player" = 'wally armstrong'
wikisql
CREATE TABLE table_35388 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the overall number for Louisiana Tech college, and a pick more than 10?
SELECT SUM("Overall") FROM table_35388 WHERE "College" = 'louisiana tech' AND "Pick #" > '10'
wikisql
CREATE TABLE table_name_58 ( tyre VARCHAR, entrant VARCHAR, rounds VARCHAR )
Motor Racing Developments used which tire in rounds 3-12?
SELECT tyre FROM table_name_58 WHERE entrant = "motor racing developments" AND rounds = "3-12"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
give the number of patients with diagnoses icd9 code e8120 and drug routeis td.
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.icd9_code = "E8120" AND prescriptions.route = "TD"
mimicsql_data
CREATE TABLE table_1381 ( "Year" real, "January" text, "February" text, "March" text, "April" text, "May" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text, "Annual Additions(in millions)" text, "...
What septembers are 17.1 in December?
SELECT "December" FROM table_1381 WHERE "September" = '17.1'
wikisql
CREATE TABLE table_56793 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the highest crowd at mcg?
SELECT MAX("Crowd") FROM table_56793 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_203_7 ( id number, "pos." number, "artist" text, "single" text, "year" number, "sales" number, "peak" number )
candle in the wind had how many more sales than freed from desire ?
SELECT (SELECT "sales" FROM table_203_7 WHERE "single" = '"candle in the wind"') - (SELECT "sales" FROM table_203_7 WHERE "single" = '"freed from desire"')
squall
CREATE TABLE table_28498999_4 ( country VARCHAR, player VARCHAR )
What country is charley hoffman from?
SELECT country FROM table_28498999_4 WHERE player = "Charley Hoffman"
sql_create_context
CREATE TABLE table_name_81 ( result VARCHAR, competition VARCHAR )
Tell me the result for 2010 fifa world cup qualification
SELECT result FROM table_name_81 WHERE competition = "2010 fifa world cup qualification"
sql_create_context
CREATE TABLE table_67909 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
What is the 2007 value at the 2012 Grand Slam Tournaments?
SELECT "2007" FROM table_67909 WHERE "2012" = 'grand slam tournaments'
wikisql
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE has_allergy ( stuid number, allergy text )
Find the last name and age of the student who has allergy to both milk and cat.
SELECT lname, age FROM student WHERE stuid IN (SELECT stuid FROM has_allergy WHERE allergy = "Milk" INTERSECT SELECT stuid FROM has_allergy WHERE allergy = "Cat")
spider
CREATE TABLE table_2187178_1 ( crew_chief VARCHAR, driver_s_ VARCHAR )
Name the crew chief for ricky craven
SELECT crew_chief FROM table_2187178_1 WHERE driver_s_ = "Ricky Craven"
sql_create_context
CREATE TABLE table_name_70 ( away VARCHAR, score VARCHAR )
What is the Away with a Score that is 46-82?
SELECT away FROM table_name_70 WHERE score = "46-82"
sql_create_context
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 TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
Return a bar chart about the distribution of Time and ID , could you show by the X-axis from high to low please?
SELECT Time, ID FROM swimmer ORDER BY Time DESC
nvbench
CREATE TABLE table_name_96 ( week_5 VARCHAR, week_3 VARCHAR )
When Cathi O'Malley was featured in Week 3, who was the cyber girl for Week 5?
SELECT week_5 FROM table_name_96 WHERE week_3 = "cathi o'malley"
sql_create_context
CREATE TABLE customer_contact_channels ( channel_code VARCHAR, customer_id VARCHAR )
List all the contact channel codes that were used less than 5 times.
SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5
sql_create_context
CREATE TABLE table_72502 ( "Shirt No" real, "Nationality" text, "Player" text, "Birth Date" text, "Height" real, "Position" text )
What is Maksim Botin's position?
SELECT "Position" FROM table_72502 WHERE "Player" = 'Maksim Botin'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
what is the date of birth for patient 16368?
SELECT patients.dob FROM patients WHERE patients.subject_id = 16368
mimic_iii
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
Show the name and age for all male people who don't have a wedding with a bar chart, list from low to high by the Y-axis.
SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Age
nvbench
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, ...
when was the last time patient 17398 was having less than 10.0 respiratory rate?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat...
mimic_iii
CREATE TABLE table_63220 ( "Season" text, "Pitcher" text, "Decision" text, "Opponent" text, "Location" text )
Who is the pitcher from the 1983 season in location Kingdome?
SELECT "Pitcher" FROM table_63220 WHERE "Location" = 'kingdome' AND "Season" = '1983'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many black/haitian american patients had the drug name collagenase ointment
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug = "Collagenase Ointment"
mimicsql_data