context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total...
Show me the proportion on what is the number of players who have points less than 30 for each position?
SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position
nvbench
CREATE TABLE table_62600 ( "Year" real, "Award Ceremony" text, "Category" text, "Nominee" text, "Result" text )
What was the result of the Best Actor in a Musical category?
SELECT "Result" FROM table_62600 WHERE "Category" = 'best actor in a musical'
wikisql
CREATE TABLE table_name_31 ( launched VARCHAR, time_elapsed VARCHAR )
What Launched has Time elapsed of 1991 days (5 yr, 5 mo, 12 d)?
SELECT launched FROM table_name_31 WHERE time_elapsed = "1991 days (5 yr, 5 mo, 12 d)"
sql_create_context
CREATE TABLE table_34201 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the record on April 8?
SELECT "Record" FROM table_34201 WHERE "Date" = 'april 8'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
what were the top four commonly used procedures that patients received in the same hospital visit after having received a vasodilating agent - iv - labetalol procedure the last year?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'vasod...
eicu
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, j...
What is the most popular paper this year in CVPR ?
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citingpaperid) FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'CVPR' GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citingpaperid) DESC
scholar
CREATE TABLE table_name_33 ( ends VARCHAR, transfer_fee VARCHAR )
What are the ends for the player with a transfer fee of loan?
SELECT ends FROM table_name_33 WHERE transfer_fee = "loan"
sql_create_context
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airline ( airline_co...
what is booking class C
SELECT DISTINCT fare_basis_code FROM fare_basis WHERE booking_class = 'C'
atis
CREATE TABLE table_name_2 ( downstream_rate VARCHAR, version VARCHAR, standard_name VARCHAR )
What's the downstream rate for the Itu g.992.2 having a version of ADSL?
SELECT downstream_rate FROM table_name_2 WHERE version = "adsl" AND standard_name = "itu g.992.2"
sql_create_context
CREATE TABLE table_25657 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "N.Z. viewers (thousand)" text )
What was the air date of the episod that had 456.58 thousand viewers?
SELECT "Original air date" FROM table_25657 WHERE "N.Z. viewers (thousand)" = '456.58'
wikisql
CREATE TABLE table_52394 ( "Rank" real, "Movie" text, "Year" real, "Studio(s)" text, "Opening Week Nett Gross" real )
What is the highest opening week net gross of the movie ranked higher than 5 from Reliance Entertainment?
SELECT MAX("Opening Week Nett Gross") FROM table_52394 WHERE "Rank" < '5' AND "Studio(s)" = 'reliance entertainment'
wikisql
CREATE TABLE table_35466 ( "Stage" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text )
What is teh stage with Daniele Bennati as the points classification and Giovanni VIsconti as the general classification?
SELECT "Stage" FROM table_35466 WHERE "Points classification" = 'daniele bennati' AND "General classification" = 'giovanni visconti'
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 microlab ( microl...
count how many hospital visits patient 021-239662 has in 2105.
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '021-239662' AND STRFTIME('%y', patient.hospitaladmittime) = '2105'
eicu
CREATE TABLE table_name_96 ( owner VARCHAR, frequency VARCHAR )
Who owns the fm 101.3 frequency?
SELECT owner FROM table_name_96 WHERE frequency = "fm 101.3"
sql_create_context
CREATE TABLE table_30565 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What country is Trent Yawney from?
SELECT "Nationality" FROM table_30565 WHERE "Player" = 'Trent Yawney'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
All posts by user ID.
SELECT Post.Id AS "post_link", Type.Name AS "type", Post.Score AS "score", Post.CreationDate AS "creationdate", COALESCE(Post.Tags, Parent.Tags) AS "tags" FROM Posts AS Post LEFT JOIN PostTypes AS Type ON Type.Id = Post.PostTypeId LEFT JOIN Posts AS Parent ON Parent.Id = Post.ParentId WHERE Post.OwnerUserId = '##UserID...
sede
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, s...
how many hours have passed since patient 1561 was admitted into the intensive care unit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE table_name_17 ( lithium VARCHAR, caesium VARCHAR )
what is the properties of lithium when caesium is ki (1.7)?
SELECT lithium FROM table_name_17 WHERE caesium = "ki (1.7)"
sql_create_context
CREATE TABLE table_39644 ( "Date" text, "2nd Bundesliga 16th" text, "3rd Liga 3rd" text, "Game 1" text, "Game 2" text )
What is the 3rd Liga from 2010-11?
SELECT "3rd Liga 3rd" FROM table_39644 WHERE "Date" = '2010-11'
wikisql
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
How old is each gender, on average Plot them as bar chart, I want to sort by the Y from high to low.
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age) DESC
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose diagnoses icd9 code is 44020 and lab test category is hematology?
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.icd9_code = "44020" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_name_71 ( viewers INTEGER, rank INTEGER )
How many Viewers have a Rank smaller than 2?
SELECT SUM(viewers) FROM table_name_71 WHERE rank < 2
sql_create_context
CREATE TABLE table_38221 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which college's round is more than 4, when the overall is less than 237 and Ted Cottrell was the name?
SELECT "College" FROM table_38221 WHERE "Round" > '4' AND "Overall" < '237' AND "Name" = 'ted cottrell'
wikisql
CREATE TABLE table_name_9 ( result VARCHAR, date VARCHAR, opponent VARCHAR, venue VARCHAR )
What was the result when Dundee were the Opponent at Venue A on 6 September 1986?
SELECT result FROM table_name_9 WHERE opponent = "dundee" AND venue = "a" AND date = "6 september 1986"
sql_create_context
CREATE TABLE table_68194 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
Which year has 200 laps?
SELECT "Year" FROM table_68194 WHERE "Laps" = '200'
wikisql
CREATE TABLE table_80088 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Name the score which has record of 73-83
SELECT "Score" FROM table_80088 WHERE "Record" = '73-83'
wikisql
CREATE TABLE table_name_13 ( place VARCHAR, score VARCHAR )
What is the Place of the Player with a Score of 68-73-66-74=281?
SELECT place FROM table_name_13 WHERE score = 68 - 73 - 66 - 74 = 281
sql_create_context
CREATE TABLE table_21406 ( "Province" text, "South Asians 2001" real, "% 2001" text, "South Asians 2011" real, "% 2011" text )
How many figures are given for total number of South Asians in 2001 for the area where they were 4.4% of population in 2011?
SELECT COUNT("South Asians 2001") FROM table_21406 WHERE "% 2011" = '4.4%'
wikisql
CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_date DATETIME, order_status_code VARCHAR(15)...
Show each state and the number of addresses in each state by a bar chart.
SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county
nvbench
CREATE TABLE table_name_53 ( premier_league VARCHAR, UEfa_cup VARCHAR, league_cup VARCHAR )
What is the total number of appearances in the premier league when there were 10 appearances at UEFA and less than 4 at league cup?
SELECT COUNT(premier_league) FROM table_name_53 WHERE UEfa_cup = 10 AND league_cup < 4
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d...
when did patient 73595 receive the revise sm bowel anastom for the first time until 3 years ago?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'revise sm bowel anastom') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73595) AND ...
mimic_iii
CREATE TABLE table_204_495 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text )
how many games had an attendance of more than 10,000 ?
SELECT COUNT(*) FROM table_204_495 WHERE "attendance" > 10000
squall
CREATE TABLE table_58972 ( "Provider" text, "Years" text, "Free or pay" text, "No. of channels" text, "Colour" text, "Digital" text, "Transmission" text )
What is the digital of Virgin [analogue]?
SELECT "Digital" FROM table_58972 WHERE "Provider" = 'virgin [analogue]'
wikisql
CREATE TABLE table_203_27 ( id number, "number" number, "serial no" number, "entered service" text, "withdrawn" text, "kilometres travelled" number )
when was number 4102 entered into service ?
SELECT "entered service" FROM table_203_27 WHERE "number" = 4102
squall
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
HTML5 thread volume with accepted answers by month.
SELECT COUNT(*) AS AnsweredVolume, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<html5%' OR Tags LIKE '%<html-canvas>%' OR Tags LIKE '%<xhtml5>%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND AcceptedAnswerId >...
sede
CREATE TABLE table_23062 ( "Team" text, "Division Titles" real, "Playoff Berths" real, "AFL Titles" real, "AFC Championships" real, "Super Bowl Championships" real )
What is the maximum number of AFC championships?
SELECT MAX("AFC Championships") FROM table_23062
wikisql
CREATE TABLE table_56388 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" text )
What is the sum of Sylvain Guintoli's laps?
SELECT SUM("Laps") FROM table_56388 WHERE "Rider" = 'sylvain guintoli'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give the title and description of diagnoses icd9 code 78630.
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "78630"
mimicsql_data
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, Par...
Find all images by user 2284240.
SELECT Id AS "post_link", * FROM Posts WHERE OwnerUserId = 2284240 AND Body LIKE '%i.stack.imgur.com%'
sede
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Return a bar chart about the distribution of All_Games and School_ID , and order by the X in descending please.
SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games DESC
nvbench
CREATE TABLE table_24136 ( "Rank" real, "Commodity" text, "Value (Int $1000)" real, "Production (MT)" real, "Quantity world rank" text, "Value world rank" text )
when the value (int $1000) is 409566, what is the commodity?
SELECT "Commodity" FROM table_24136 WHERE "Value (Int $1000)" = '409566'
wikisql
CREATE TABLE table_name_53 ( opponent VARCHAR, date VARCHAR )
Who is the opponent on November 14?
SELECT opponent FROM table_name_53 WHERE date = "november 14"
sql_create_context
CREATE TABLE table_31410 ( "Rank" real, "Country/Territory" text, "Miss Earth" text, "Miss Air" real, "Miss Water" real, "Miss Fire" real, "Semifinalists" real, "Total" real )
How many semifinalists has Romania had?
SELECT "Semifinalists" FROM table_31410 WHERE "Country/Territory" = 'Romania'
wikisql
CREATE TABLE table_13486 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real )
What is the sum of wins and the sum of losses less than 4 for teams larger than 20?
SELECT SUM("Wins") FROM table_13486 WHERE "Losses" < '4' AND "Goals Against" > '20'
wikisql
CREATE TABLE Ref_Attraction_Types ( Attraction_Type_Code CHAR(15), Attraction_Type_Description VARCHAR(255) ) CREATE TABLE Tourist_Attraction_Features ( Tourist_Attraction_ID INTEGER, Feature_ID INTEGER ) CREATE TABLE Street_Markets ( Market_ID INTEGER, Market_Details VARCHAR(255) ) CREATE TA...
Show the names and ids of tourist attractions that are visited at most once.
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of first_name and manager_id .
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, c...
For each faculty rank, show the number of faculty members who have it Show bar chart, and I want to list from high to low by the X.
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank DESC
nvbench
CREATE TABLE table_name_6 ( date VARCHAR, margin_of_victory VARCHAR )
What is the date of the 4 strokes margin of victory?
SELECT date FROM table_name_6 WHERE margin_of_victory = "4 strokes"
sql_create_context
CREATE TABLE table_45097 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is Record, when Game is '36'?
SELECT "Record" FROM table_45097 WHERE "Game" = '36'
wikisql
CREATE TABLE table_name_43 ( avg INTEGER, player VARCHAR, long VARCHAR )
How many yards did kevin swayne average, with a long carry over 7?
SELECT MIN(avg) FROM table_name_43 WHERE player = "kevin swayne" AND long > 7
sql_create_context
CREATE TABLE table_24444 ( "Class" text, "Weapon" text, "Caliber" text, "Type" text, "Weight (g)" text, "Range (m)" text, "Velocity (m/s)" text, "Impact Energy" text, "Shots" real )
How many calibers require the type LB/RN?
SELECT COUNT("Caliber") FROM table_24444 WHERE "Type" = 'LB/RN'
wikisql
CREATE TABLE table_9015 ( "Verb" text, "2 (VF)" text, "2 (F)" text, "3 (F)" text, "2/3 (P)" text )
WHICH 2/3 (P) has a 2 (VF) of dhutish?
SELECT "2/3 (P)" FROM table_9015 WHERE "2 (VF)" = 'তুই dhutish'
wikisql
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...
Many courses are taught by more than 2 professors , how many ?
SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, offering_instructor AS OFFERING_INSTRUCTOR_0, offering_instructor AS OFFERING_INSTRUCTOR_1, offering_instructor AS OFFERING_INSTRUCTOR_2 WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND OFFERING_INSTRUCTO...
advising
CREATE TABLE Order_Items ( order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(15) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Customer_...
Find the 'date became customers' of the customers whose ID is between 10 and 20, and count them by a bar chart, I want to show by the y axis in descending.
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
nvbench
CREATE TABLE station ( id VARCHAR, local_authority VARCHAR ) CREATE TABLE weekly_weather ( station_id VARCHAR )
Find the id and local authority of the station with has the highest average high temperature.
SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id ORDER BY AVG(high_temperature) DESC LIMIT 1
sql_create_context
CREATE TABLE table_31523 ( "Economy" text, "1980" real, "Gap from Thailand as of 1980 (times)" text, "1985" real, "1990" real, "1995" real, "2000" real, "2005" real, "2010" real, "2012" real, "Gap from Thailand as of 2012 (times)" text, "GDP as of 2012 after purchasing po...
What was the gap from Thailand as of 2012 for China?
SELECT "Gap from Thailand as of 2012 (times)" FROM table_31523 WHERE "Economy" = 'China'
wikisql
CREATE TABLE table_name_17 ( game VARCHAR, result VARCHAR, record VARCHAR )
How many games have a Result of l, and a Record of 2-6?
SELECT COUNT(game) FROM table_name_17 WHERE result = "l" AND record = "2-6"
sql_create_context
CREATE TABLE table_134729_3 ( target_city__market VARCHAR, city_of_license VARCHAR )
What market is Wessington Springs in
SELECT target_city__market FROM table_134729_3 WHERE city_of_license = "Wessington Springs"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE month ( ...
show me all the UA flights leaving DALLAS
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIRP...
atis
CREATE TABLE table_26253 ( "Year" text, "District-wide" real, "High schools" real, "Middle schools" real, "Elementary schools" real, "Other programs & adjustments" real )
Name the most district wide for 1639 other programs
SELECT MAX("District-wide") FROM table_26253 WHERE "Other programs & adjustments" = '1639'
wikisql
CREATE TABLE table_name_18 ( license VARCHAR, actual_version VARCHAR )
Which License has an Actual Vaersion of 9.0?
SELECT license FROM table_name_18 WHERE actual_version = "9.0"
sql_create_context
CREATE TABLE table_name_16 ( phoneme VARCHAR, realization VARCHAR )
Name the phoneme when the realizationis [ ]
SELECT phoneme FROM table_name_16 WHERE realization = "[ɑ]"
sql_create_context
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...
how many male patients are of american indian/alaska native ethnicity?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
mimicsql_data
CREATE TABLE table_23128 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What's the number of positions of the player playing in Minnesota North Stars?
SELECT COUNT("Position") FROM table_23128 WHERE "NHL team" = 'Minnesota North Stars'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
how many patients whose primary disease is s/p fall and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_70069 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many bronze had a total less than 4 and gold bigger than 1?
SELECT COUNT("Bronze") FROM table_70069 WHERE "Total" < '4' AND "Gold" > '1'
wikisql
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...
how many patients whose diagnoses icd9 code is 57401 and lab test category is blood gas?
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.icd9_code = "57401" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_24655 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Who was playing when the score was 5 7, 5 7?
SELECT "Opponents" FROM table_24655 WHERE "Score" = '5–7, 5–7'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
What days of the week does PHIL 157 meet ?
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_32722 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was Fitzroy's score when they were the home team?
SELECT "Home team score" FROM table_32722 WHERE "Home team" = 'fitzroy'
wikisql
CREATE TABLE table_4362 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Who is the partner with a runner-up outcome on April 6, 1992?
SELECT "Partner" FROM table_4362 WHERE "Outcome" = 'runner-up' AND "Date" = 'april 6, 1992'
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...
what is the number of patients whose admission year is less than 2170 and drug name is clopidogrel bisulfate?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.drug = "Clopidogrel Bisulfate"
mimicsql_data
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...
医院5070509有多少科室在门诊就诊中开出不少于26张检验报告单在2012年3月19日到2015年7月19日期间内?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
i would like to know the daily maximum amount of enteral formula volume/bolus amt (ml) that patient 033-22108 has received on their current hospital encounter.
SELECT MAX(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 = '033-22108' AND patient.hospitaldischargetime IS ...
eicu
CREATE TABLE table_61943 ( "Summoned" text, "Elected" text, "Assembled" text, "1st member" text, "2nd member" text )
What is 1st Member, when 2nd Member is 'William Benne', and when Elected is '1300/01'?
SELECT "1st member" FROM table_61943 WHERE "2nd member" = 'william benne' AND "Elected" = '1300/01'
wikisql
CREATE TABLE table_48134 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
what is the country when the iata is gva?
SELECT "Country" FROM table_48134 WHERE "IATA" = 'gva'
wikisql
CREATE TABLE table_40662 ( "Player" text, "Club" text, "League" real, "FA Cup" real, "FA Trophy" real, "League Cup" real, "Total" real )
Which League has a FA Cup larger than 0, and a Player of simon read, and a League Cup larger than 1?
SELECT MIN("League") FROM table_40662 WHERE "FA Cup" > '0' AND "Player" = 'simon read' AND "League Cup" > '1'
wikisql
CREATE TABLE table_17017 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What is the air date for the episode written by Wendy Battles and directed by Oz Scott
SELECT "Original air date" FROM table_17017 WHERE "Written by" = 'Wendy Battles' AND "Directed by" = 'Oz Scott'
wikisql
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 ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
tell me the total of patient 80555's output on the current intensive care unit visit?
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555) AND icustays.outtime IS NULL)
mimic_iii
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
when has patient 030-10559 last had the rbc minimum value in the last month?
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 = '030-10559')) AND lab.labname = 'rbc' AND DATETIME(lab.labresulttime, 'start of mont...
eicu
CREATE TABLE table_14942 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What gender is allowed to attend the school that has a decile of 6 and a roll that is less than 179?
SELECT "Gender" FROM table_14942 WHERE "Decile" = '6' AND "Roll" < '179'
wikisql
CREATE TABLE table_19991 ( "Condition/Parameter" text, "Coordinate velocity v dx/dt in units of c" text, "Velocity angle \u03b7 in i-radians" text, "Proper velocity w dx/d\u03c4 in units of c" text, "Lorentz factor \u03b3 dt/d\u03c4 = E/mc 2" text )
If the coordinate velocity v dx/dt in units of c is (e 2 1)/(e 2 + 1) 0.761, what is the velocity angle in i-radians?
SELECT "Velocity angle \u03b7 in i-radians" FROM table_19991 WHERE "Coordinate velocity v dx/dt in units of c" = '(e 2 − 1)/(e 2 + 1) ≅ 0.761'
wikisql
CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE student ( ID varchar(5...
Give me a bar chart for the total number of each dept name, and I want to list y axis from high to low order.
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, ...
i want to go from BOSTON to ATLANTA on monday
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 = 'ATLANTA' AND date_day.day_number = 21 AND date_day.month_number = 2 AND d...
atis
CREATE TABLE table_name_47 ( macedonian_population_in_vojvodina VARCHAR )
What is the total 1961 number of the plandi te Macedonian population with a 1981 value greater than 1027?
SELECT COUNT(1961) FROM table_name_47 WHERE macedonian_population_in_vojvodina = "plandište" AND 1981 > 1027
sql_create_context
CREATE TABLE table_name_29 ( location_attendance VARCHAR, date VARCHAR )
What was the Location/Attendance on Dec 2?
SELECT location_attendance FROM table_name_29 WHERE date = "dec 2"
sql_create_context
CREATE TABLE table_17697980_1 ( region_2 VARCHAR, dvd_title VARCHAR )
How many dvd titled 'series 5' were released having a release date or a non available date in region 2?
SELECT COUNT(region_2) FROM table_17697980_1 WHERE dvd_title = "Series 5"
sql_create_context
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...
count the number of patients whose year of death is less than or equal to 2111 and lab test name is cholesterol, ldl, calculated?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.label = "Cholesterol, LDL, Calculated"
mimicsql_data
CREATE TABLE table_71579 ( "Elector" text, "Order" text, "Title" text, "Elevated" text, "Elevator" text )
What's the Elevator that has Elevated: 1378, September 18, an Order of Cardinal-Priest, and an Elector of Poncello Orsini?
SELECT "Elevator" FROM table_71579 WHERE "Elevated" = '1378, september 18' AND "Order" = 'cardinal-priest' AND "Elector" = 'poncello orsini'
wikisql
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Count the number of captains that have each rank Visualize by bar chart, and show in desc by the Rank please.
SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY Rank DESC
nvbench
CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE publication_keyword ( ...
return me the paper after 2000 in PVLDB with more than 200 citations .
SELECT publication.title FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.citation_num > 200 AND publication.jid = journal.jid AND publication.year > 2000
academic
CREATE TABLE table_60955 ( "Event" text, "Time" text, "Nationality" text, "Date" text, "Meet" text, "Location" text )
What is Event, when Meet is 'World Championships', and when Time is '20.51'?
SELECT "Event" FROM table_60955 WHERE "Meet" = 'world championships' AND "Time" = '20.51'
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 scatter chart about the correlation between manufacturer and revenue , and group by attribute founder.
SELECT Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE table_59035 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Country of the Player with a To par of +1 and a Score of 75-69-73=217?
SELECT "Country" FROM table_59035 WHERE "To par" = '+1' AND "Score" = '75-69-73=217'
wikisql
CREATE TABLE table_63125 ( "Club" text, "League" text, "City/Town" text, "Stadium" text, "Capacity" real )
What is the total capacity for the Leicester Tigers?
SELECT COUNT("Capacity") FROM table_63125 WHERE "Club" = 'leicester tigers'
wikisql
CREATE TABLE Problem_Category_Codes ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80) ) CREATE TABLE Product ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Problem_Status_Codes ( problem_status_code VARCHAR(20), probl...
What is the number of entry descriptions of each problem?
SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description
nvbench
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...
how many patients with elective admission type had lab test item id 51274??
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51274"
mimicsql_data
CREATE TABLE table_57921 ( "Number & name" text, "Description" text, "Current status" text, "Livery" text, "Date" real )
What is the latest death with a description of BR-Built inspection saloon?
SELECT MAX("Date") FROM table_57921 WHERE "Description" = 'br-built inspection saloon'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar,...
i need to know if there are any direct flights from ST. PETERSBURG FLORIDA to TACOMA WASHINGTON leaving preferably tomorrow morning
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, state AS STATE_0, state AS STATE_1 WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA' AND date_day.day_number = 2...
atis
CREATE TABLE table_name_52 ( opponent VARCHAR, score VARCHAR )
Which opponent had a 113-124 score?
SELECT opponent FROM table_name_52 WHERE score = "113-124"
sql_create_context