context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about All_Games_Percent over the Team_Name .
SELECT Team_Name, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_63160 ( "Source" text, "Date" text, "Jody Wagner" text, "Pat Edmonson" text, "Michael Signer" text, "Rich Savage" text, "Jon Bowerbank" text, "Undecided" text )
Which polling source gave Michael Signer 5%?
SELECT "Source" FROM table_63160 WHERE "Michael Signer" = '5%'
wikisql
CREATE TABLE table_7300 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text )
What is the Date when the Set 1 is 25 21, and the Score is 3 0, and the Time is 11:00?
SELECT "Date" FROM table_7300 WHERE "Set 1" = '25–21' AND "Score" = '3–0' AND "Time" = '11:00'
wikisql
CREATE TABLE table_48440 ( "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 sum of Game, when High Points is 'D. McKey (24)', and when Team is '@ Dallas Mavericks'?
SELECT SUM("Game") FROM table_48440 WHERE "High points" = 'd. mckey (24)' AND "Team" = '@ dallas mavericks'
wikisql
CREATE TABLE table_72475 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
What is the PA when the skip is Colleen Jones?
SELECT "PA" FROM table_72475 WHERE "Skip" = 'Colleen Jones'
wikisql
CREATE TABLE table_34246 ( "Champs" real, "Games" real, "Draw" real, "Lost" real, "Win/Lose Percentage" text )
Which Champs is the average one that has a Draw larger than 2, and Games smaller than 60?
SELECT AVG("Champs") FROM table_34246 WHERE "Draw" > '2' AND "Games" < '60'
wikisql
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 gender is m and procedure long title is other percutaneous procedures on biliary tract?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Other percutaneous procedures on biliary tract"
mimicsql_data
CREATE TABLE table_name_43 ( round INTEGER, player VARCHAR )
Which round was Dave Yovanovits picked?
SELECT MIN(round) FROM table_name_43 WHERE player = "dave yovanovits"
sql_create_context
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 patients have had intravenous diuretic - iv furosemide during the same hospital visit after the previous procedure of cultures?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cultures') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime,...
eicu
CREATE TABLE table_38524 ( "Quarterback" text, "Uniform No(s)" real, "Games Started" real, "Wins" real, "Losses" real, "Ties" real, "Winning Pct." real )
What is the highest winning pct from a team with wins less than 22, losses greater than 4, ties less than 2 and games started greater than 11?
SELECT MAX("Winning Pct.") FROM table_38524 WHERE "Losses" > '4' AND "Ties" < '2' AND "Games Started" > '11' AND "Wins" < '22'
wikisql
CREATE TABLE table_34881 ( "Geographic Unit" text, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011" real )
What is the average 2006 value with a 2010 value of 417.9 and a 2011 value greater than 426.7?
SELECT AVG("2006") FROM table_34881 WHERE "2010" = '417.9' AND "2011" > '426.7'
wikisql
CREATE TABLE table_19565 ( "Rank" real, "Country" text, "International tourist arrivals (2011)" text, "International tourist arrivals (2010)" text, "Change (2010 to 2011)" text, "Change (2009 to 2010)" text )
What are the international tourist arrivals in 2010 where change from 2010 to 2011 is +11.2% ?
SELECT "International tourist arrivals (2010)" FROM table_19565 WHERE "Change (2010 to 2011)" = '+11.2%'
wikisql
CREATE TABLE table_name_9 ( nat VARCHAR, name VARCHAR )
What is the nationality of Gavin Rae?
SELECT nat FROM table_name_9 WHERE name = "gavin rae"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight ( aircraft_code_sequence text, ...
i would like information on any flights from PITTSBURGH to SAN FRANCISCO leaving thursday evening
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 24 AND date_day.month_number = ...
atis
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, ...
Count the number of video games with Massively multiplayer online game type .
SELECT COUNT(*) FROM video_games WHERE gtype = "Massively multiplayer online game"
spider
CREATE TABLE table_name_78 ( against INTEGER, opposing_teams VARCHAR, venue VARCHAR, status VARCHAR )
What is the lowest Against, when Venue is 'Twickenham , London', when Status is 'Six Nations', and when Opposing Teams is 'France'?
SELECT MIN(against) FROM table_name_78 WHERE venue = "twickenham , london" AND status = "six nations" AND opposing_teams = "france"
sql_create_context
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...
provide the number of patients whose admission type is emergency and diagnoses long title is unspecified disease of sebaceous glands?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Unspecified disease of sebaceous glands"
mimicsql_data
CREATE TABLE table_71399 ( "Date" text, "Tournament" text, "Surface" text, "Tier" text, "Partner" text, "Opponents in the final" text, "Score" text )
Which tier of the tournament has Mont de Marson in it?
SELECT "Tier" FROM table_71399 WHERE "Tournament" = 'mont de marson'
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 office admission patients who were born before 2121?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2121"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what was the daily average intake of d51/2ns ivf that patient 006-195310 had received until 1638 days ago?
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195310')) AND intakeoutput.celllabel = 'd51/...
eicu
CREATE TABLE instructor ( salary VARCHAR )
List the information of all instructors ordered by their salary in ascending order.
SELECT * FROM instructor ORDER BY salary
sql_create_context
CREATE TABLE table_68009 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
Name the total number of overall for villanova and round less than 2
SELECT COUNT("Overall") FROM table_68009 WHERE "College" = 'villanova' AND "Round" < '2'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID 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, meter_700 text, Time text ) ...
Show me about the distribution of meter_200 and the average of ID , and group by attribute meter_200 in a bar chart, order total number in asc order.
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID)
nvbench
CREATE TABLE table_64911 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real )
What's the time of Britta Steffen in a lane less than 4?
SELECT SUM("Time") FROM table_64911 WHERE "Lane" < '4' AND "Name" = 'britta steffen'
wikisql
CREATE TABLE table_name_26 ( Id VARCHAR )
What 1951 has dne for 1948?
SELECT 1951 FROM table_name_26 WHERE 1948 = "dne"
sql_create_context
CREATE TABLE table_37249 ( "Version" text, "Length" text, "Album" text, "Remixed by" text, "Year" real )
Which Year is the lowest one that has a Length of 3:50?
SELECT MIN("Year") FROM table_37249 WHERE "Length" = '3:50'
wikisql
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number )
For each classroom, show the classroom number and find how many students are using it.
SELECT classroom, COUNT(*) FROM list GROUP BY classroom
spider
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, ...
how many married patients were admitted before the year 2200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2200"
mimicsql_data
CREATE TABLE table_16305 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
Who directed Dulcinea?
SELECT "Director" FROM table_16305 WHERE "Original title" = 'Dulcinea'
wikisql
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rati...
give me the best american in the bay area ?
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
restaurants
CREATE TABLE church ( church_id number, name text, organized_by text, open_date number, continuation_of text ) CREATE TABLE wedding ( church_id number, male_id number, female_id number, year number ) CREATE TABLE people ( people_id number, name text, country text, i...
Show all church names except for those that had a wedding in year 2015.
SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015
spider
CREATE TABLE table_34514 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" text )
Result of l 17 20 had what attendance?
SELECT "Attendance" FROM table_34514 WHERE "Result" = 'l 17–20'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
Unanswered questions in a tag by asker reputation. Find unanswered questions in a tag by asker reputation
SELECT Posts.Id AS "post_link", Posts.Tags AS "tags", Posts.Score, Posts.ViewCount, Posts.CreationDate, Users.LastAccessDate FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Tags.TagName = '##TagName##' AND Po...
sede
CREATE TABLE table_71032 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What date was the game with a score of 5 2, and a Loss of lilly (9 9)?
SELECT "Date" FROM table_71032 WHERE "Score" = '5–2' AND "Loss" = 'lilly (9–9)'
wikisql
CREATE TABLE table_name_31 ( date_of_birth VARCHAR, height VARCHAR )
What is Date of Birth, when Height is 'Head Coach: Adel Shamala'?
SELECT date_of_birth FROM table_name_31 WHERE height = "head coach: adel shamala"
sql_create_context
CREATE TABLE table_15530244_5 ( pos VARCHAR, race_1 VARCHAR )
Name the total number of positions for race 1 being 2
SELECT COUNT(pos) FROM table_15530244_5 WHERE race_1 = "2"
sql_create_context
CREATE TABLE table_59288 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
What is Score, when Date is 'Nov 28'?
SELECT "Score" FROM table_59288 WHERE "Date" = 'nov 28'
wikisql
CREATE TABLE table_66004 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
what is the notes for the athlete with the time of 7:38.87?
SELECT "Notes" FROM table_66004 WHERE "Time" = '7:38.87'
wikisql
CREATE TABLE table_24022 ( "Week" real, "Player" text, "Team" text, "Opponent" text, "Carries" real, "Yards" real, "Average" text, "Touchdowns" real )
What was the player's team's opponent for Week 12?
SELECT "Opponent" FROM table_24022 WHERE "Week" = '12'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
what is the number of patients whose discharge location is snf and diagnosed with primary disease complete heart block?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "COMPLETE HEART BLOCK"
mimicsql_data
CREATE TABLE table_name_55 ( series VARCHAR, date VARCHAR )
What is the series score of the game on April 16?
SELECT series FROM table_name_55 WHERE date = "april 16"
sql_create_context
CREATE TABLE table_name_72 ( nationality VARCHAR, pick__number VARCHAR )
What nationality is the #63 pick?
SELECT nationality FROM table_name_72 WHERE pick__number = "63"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )...
i want to go from SAN FRANCISCO to DENVER
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_62223 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What was the score on 31 January 1987 with tie number 1?
SELECT "Score" FROM table_62223 WHERE "Date" = '31 january 1987' AND "Tie no" = '1'
wikisql
CREATE TABLE table_29728787_1 ( olivier VARCHAR, la_roche VARCHAR )
When karl ridderbusch is the la roche who is the olivier?
SELECT olivier FROM table_29728787_1 WHERE la_roche = "Karl Ridderbusch"
sql_create_context
CREATE TABLE table_203_325 ( id number, "year" number, "title" text, "(english)" text, "ifpi israel certification" text, "label" text )
what album was released before kmo haruach ?
SELECT "title" FROM table_203_325 WHERE "year" < (SELECT "year" FROM table_203_325 WHERE "title" = 'kmo haruach') ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_69556 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What is the area with decile of 8, and a 25 roll?
SELECT "Area" FROM table_69556 WHERE "Decile" = '8' AND "Roll" = '25'
wikisql
CREATE TABLE table_30083499_1 ( team VARCHAR, tournament VARCHAR )
Which team was in the 2012 clausura tournament?
SELECT team FROM table_30083499_1 WHERE tournament = "2012 Clausura"
sql_create_context
CREATE TABLE table_1341663_26 ( first_elected INTEGER )
When was the earliest first election?
SELECT MIN(first_elected) FROM table_1341663_26
sql_create_context
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 allergy ( allergy...
when was the first time that patient 031-1337 received a sputum, expectorated microbiology test?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'sputum, expectorated' ORD...
eicu
CREATE TABLE table_name_95 ( venue VARCHAR, discipline VARCHAR )
What was the venue with a 3.3km c prologue discipline?
SELECT venue FROM table_name_95 WHERE discipline = "3.3km c prologue"
sql_create_context
CREATE TABLE table_20396_1 ( poles VARCHAR, season VARCHAR )
How many poles were there in season 2000?
SELECT poles FROM table_20396_1 WHERE season = 2000
sql_create_context
CREATE TABLE table_34005 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Name the date for 2004 afc asian cup qualifier
SELECT "Date" FROM table_34005 WHERE "Competition" = '2004 afc asian cup qualifier'
wikisql
CREATE TABLE table_551 ( "English Title/Translation" text, "Japanese Title" text, "Developer" text, "Publisher" text, "Genre" text, "Console(s)" text, "Initial Release Date" text )
What's the English translation of the Japanese title of the game Ranma : Chougi Rambuhen?
SELECT "English Title/Translation" FROM table_551 WHERE "Japanese Title" = 'Ranma ½: Chougi Rambuhen'
wikisql
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...
A bar chart shows the distribution of meter_600 and ID , order in asc by the ID.
SELECT meter_600, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
列出病人53441764医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额不低于4790.44元的
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '53441764' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4790.44) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '53441764' AN...
css
CREATE TABLE table_name_91 ( record VARCHAR, time VARCHAR )
Which record has 2:57 as the time?
SELECT record FROM table_name_91 WHERE time = "2:57"
sql_create_context
CREATE TABLE table_57511 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which driver has 12 laps and a grid of less than 10?
SELECT "Driver" FROM table_57511 WHERE "Laps" = '12' AND "Grid" < '10'
wikisql
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_...
show me all the flights to BALTIMORE after 1800 o'clock pm
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BALTIMORE' AND flight.departure_time > 1800 AND flight.to_airport = airport_service.airport_code
atis
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 ...
what has changed in atypical lymphocytes in patient 69480 second measured on the first hospital visit compared to the value first measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69480 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE...
Find the salaries of all distinct instructors that are less than the largest salary.
SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT MAX(salary) FROM instructor)
spider
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
how many hours has it been since patient 006-133605 was admitted to the icu?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-133605' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE table_name_54 ( opponent VARCHAR, series VARCHAR )
Who was the opponent with a series of 3-2?
SELECT opponent FROM table_name_54 WHERE series = "3-2"
sql_create_context
CREATE TABLE table_28768469_5 ( game INTEGER )
What is the most amount of games played this season?
SELECT MAX(game) FROM table_28768469_5
sql_create_context
CREATE TABLE table_14217 ( "Rank" real, "Heat" real, "Athlete" text, "Country" text, "Time" real )
What is the athlete muna lee lowest time?
SELECT MIN("Time") FROM table_14217 WHERE "Athlete" = 'muna lee'
wikisql
CREATE TABLE table_6821 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
When has a Visitor of bulls?
SELECT "Date" FROM table_6821 WHERE "Visitor" = 'bulls'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
favorite count and votes don't line up.
SELECT (SELECT COUNT(*) FROM Posts AS q WHERE q.FavoriteCount IS NULL AND q.PostTypeId = 1) AS fcount, (SELECT COUNT(*) FROM Posts AS q LEFT OUTER JOIN Votes AS v ON v.PostId = q.Id AND VoteTypeId = 5 WHERE v.Id IS NULL AND q.PostTypeId = 1) AS votecount
sede
CREATE TABLE table_39213 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the highest pick number of a defensive back with less than 136 overall points?
SELECT MAX("Pick #") FROM table_39213 WHERE "Overall" < '136' AND "Position" = 'defensive back'
wikisql
CREATE TABLE table_name_4 ( winning_score VARCHAR, margin_of_victory VARCHAR, tournament VARCHAR )
What was the winning score when the margin of victory was a playoff for the Tournament of safeco classic?
SELECT winning_score FROM table_name_4 WHERE margin_of_victory = "playoff" AND tournament = "safeco classic"
sql_create_context
CREATE TABLE table_name_91 ( record VARCHAR, score VARCHAR )
Which Record has a Score of 105-115?
SELECT record FROM table_name_91 WHERE score = "105-115"
sql_create_context
CREATE TABLE table_22669816_1 ( rnd VARCHAR, track VARCHAR )
What rounds did Phoenix International Raceway host?
SELECT rnd FROM table_22669816_1 WHERE track = "Phoenix International Raceway"
sql_create_context
CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, sequence_identity_to_human_protein text, Institution_id text ) CREATE TABLE building ( building_id text, Name text, Street_address text, ...
Please give me a bar chart showing institution types, along with the number of institutions for each type, could you show from low to high by the y axis?
SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY COUNT(*)
nvbench
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Post with given word in some of the past revision but not in the current ones.
SELECT DISTINCT p.Id AS "post_link", p.OwnerUserId AS "user_link", p.LastActivityDate, p.CreationDate, url = 'site://posts/' + CAST(p.Id AS TEXT) + '/revisions' FROM Posts AS p JOIN PostHistory AS ph ON (ph.PostId = p.Id) WHERE (ph.Text LIKE '%##word?Chebychev##%') AND NOT (p.Body LIKE '%##word##%') ORDER BY p.LastActi...
sede
CREATE TABLE table_name_89 ( margin VARCHAR, year VARCHAR )
Name the margin for 2002
SELECT margin FROM table_name_89 WHERE year = 2002
sql_create_context
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...
从06.11.28开始,截止到19.10.22,在参保人潘和正所有的结算里,10元以内小金额的结算次数总共有多少
SELECT COUNT(*) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '潘和正' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-28' AND '2019-10-22' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descri...
Select all tags from Posts under a certain Id.
SELECT Tags FROM Posts WHERE Id < 10000
sede
CREATE TABLE table_name_77 ( visitor VARCHAR, date VARCHAR )
Who was the visiting team on 12 March 2008?
SELECT visitor FROM table_name_77 WHERE date = "12 march 2008"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
what has been the total amount of input patient 25312 received on 12/29/last year?
SELECT SUM(inputevents_cv.amount) 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 = 25312)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(),...
mimic_iii
CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE match ( round number, location text, country text, date text, fastest_qualifying text, winning_pilot text, winning_aircraft text ) CREATE TABLE airport ( airport_id number, a...
What are the number of international and domestic passengers of the airport named London 'Heathrow'?
SELECT international_passengers, domestic_passengers FROM airport WHERE airport_name = "London Heathrow"
spider
CREATE TABLE table_7196 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text )
Which royal house has the name huai?
SELECT "Royal house" FROM table_7196 WHERE "Name" = 'huai'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
give me the number of patients whose discharge location is disc-tran cancer/chldrn h and admission year is less than 2200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND demographic.admityear < "2200"
mimicsql_data
CREATE TABLE table_name_82 ( pick INTEGER, name VARCHAR, round VARCHAR )
WHAT IS THE SUM OF PICK FOR DAVID TERRELL, WITH A ROUND SMALLER THAN 7?
SELECT SUM(pick) FROM table_name_82 WHERE name = "david terrell" AND round < 7
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, Owner...
No, this shouldn't be the accepted answer.
SELECT Id FROM Comments WHERE (LOWER(Text) LIKE '%this should be accepted%' OR LOWER(Text) LIKE '%this should be the accepted%') AND LENGTH(Text) <= 100 LIMIT 90
sede
CREATE TABLE Has_allergy ( lname VARCHAR, age VARCHAR, StuID VARCHAR, Allergy VARCHAR ) CREATE TABLE Student ( lname VARCHAR, age VARCHAR, StuID VARCHAR, Allergy VARCHAR )
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")
sql_create_context
CREATE TABLE Video_Games ( GameID INTEGER, GName VARCHAR(40), GType VARCHAR(40) ) CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), F...
Return a scatter chart showing the relationship between major id and maximum age.
SELECT Major, MAX(Age) FROM Student GROUP BY Major
nvbench
CREATE TABLE table_51200 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is the highest ERP W of the translator with a call sign of w284av?
SELECT MAX("ERP W") FROM table_51200 WHERE "Call sign" = 'w284av'
wikisql
CREATE TABLE table_203_818 ( id number, "kategori" text, "1995" text, "2004" text, "2005" text, "2006" text, "2007" text )
which award did hantu tinta and kuntilanak both receive ?
SELECT "kategori" FROM table_203_818 WHERE "1995" = 'hantu tinta'
squall
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
患者葛星光医保的个人账户总共被花了多少,时间是从11年4月5日到20年7月4日
SELECT SUM(t_kc24.PER_ACC_PAY) 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 '2011-04-05' AND '2020-07-04'
css
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABL...
Show all the distinct buildings that have faculty rooms.
SELECT DISTINCT building FROM faculty
spider
CREATE TABLE table_8625 ( "Discipline" text, "Championship" text, "Circuit" text, "Session" text, "Cause" text )
What was the discipline for the Championship of international championship for makes?
SELECT "Discipline" FROM table_8625 WHERE "Championship" = 'international championship for makes'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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,...
患者对应的住院就诊中开出的检验报告单59958686158上的姓名是什么?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ...
css
CREATE TABLE table_11630008_4 ( title VARCHAR, season_no VARCHAR )
What is the title for season 2?
SELECT title FROM table_11630008_4 WHERE season_no = 2
sql_create_context
CREATE TABLE table_4546 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What day did the VFL pay MCG with attendance of 16,300?
SELECT "Date" FROM table_4546 WHERE "Crowd" > '16,300' AND "Venue" = 'mcg'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_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_i...
did the first microbiological examination of patient 17462's urine in their last hospital visit find any organism?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_n...
mimic_iii
CREATE TABLE table_name_92 ( round INTEGER, event VARCHAR )
What is the highest round for UFC 109?
SELECT MAX(round) FROM table_name_92 WHERE event = "ufc 109"
sql_create_context
CREATE TABLE table_43854 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the week on December 10, 1989?
SELECT "Week" FROM table_43854 WHERE "Date" = 'december 10, 1989'
wikisql
CREATE TABLE table_name_41 ( block VARCHAR, name VARCHAR, spike VARCHAR, weight VARCHAR )
What is the total number of Block(s), when Spike is less than 341, when Weight is greater than 82, and when Name is Theodoros Baev?
SELECT COUNT(block) FROM table_name_41 WHERE spike < 341 AND weight > 82 AND name = "theodoros baev"
sql_create_context
CREATE TABLE table_28787871_3 ( production_code INTEGER, us_viewers__millions_ VARCHAR )
What is the highest production code of the episodes having a US viewership of exactly 2.3?
SELECT MAX(production_code) FROM table_28787871_3 WHERE us_viewers__millions_ = "2.3"
sql_create_context
CREATE TABLE table_50937 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
The highest position with more than 16 points and less than 7 concedes?
SELECT MAX("Position") FROM table_50937 WHERE "Points" > '16' AND "Conceded" < '7'
wikisql
CREATE TABLE table_35813 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real )
What was the rank of the 1983 team in the 250cc class?
SELECT "Rank" FROM table_35813 WHERE "Class" = '250cc' AND "Year" = '1983'
wikisql