context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_51417 (
"Year" real,
"Event" text,
"Record" text,
"Athlete" text,
"Nationality" text
) | Which athlete performed before 1984 in an 800 m event? | SELECT "Athlete" FROM table_51417 WHERE "Year" < '1984' AND "Event" = '800 m' | wikisql |
CREATE TABLE table_46153 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | Who was the opponent in Game 44? | SELECT "Opponent" FROM table_46153 WHERE "Game" = '44' | wikisql |
CREATE TABLE table_name_14 (
silver VARCHAR,
team VARCHAR,
gold VARCHAR
) | How many silver when the team is northwest territories and gold is less than 34? | SELECT COUNT(silver) FROM table_name_14 WHERE team = "northwest territories" AND gold < 34 | sql_create_context |
CREATE TABLE table_name_94 (
opponent VARCHAR,
score VARCHAR,
surface VARCHAR
) | Who is the opponent when the score was 6 4, 6 2 and the surface was clay? | SELECT opponent FROM table_name_94 WHERE score = "6–4, 6–2" AND surface = "clay" | sql_create_context |
CREATE TABLE table_61339 (
"Women" text,
"Country" text,
"Season" text,
"Victories" real,
"Downhill" text,
"Super G" text,
"Giant Slalom" text,
"Slalom" text,
"Combined" text
) | Can you tell me the Giant Slalom that has the Combined of 1, and the Country of united states, and the Victories larger than 11? | SELECT "Giant Slalom" FROM table_61339 WHERE "Combined" = '1' AND "Country" = 'united states' AND "Victories" > '11' | wikisql |
CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizo... | List the total points of gymnasts in descending order of floor exercise points. | SELECT total_points FROM gymnast ORDER BY floor_exercise_points DESC | spider |
CREATE TABLE table_60693 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the score of the game that home team birmingham city played? | SELECT "Score" FROM table_60693 WHERE "Home team" = 'birmingham city' | wikisql |
CREATE TABLE table_40268 (
"Year" text,
"Team" text,
"Comp" text,
"Long" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text,
"Lost" text
) | What is the comp when the ryds is 2? | SELECT "Comp" FROM table_40268 WHERE "RYds" = '2' | wikisql |
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE lapTimes (
raceId INTEGER,
driverId INTEGER,
lap INTEGER,
position INTEGER,
time TEXT,
milliseconds INTEGER
)
CREATE TAB... | Show the number of races that had any driver whose forename is Lewis in each year with a line chart, sort in ascending by the x-axis. | SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY year | nvbench |
CREATE TABLE table_75057 (
"Team" text,
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text,
"Week 8 Final" text
) | Name the week 3 for team of mark/jennifer | SELECT "Week 3" FROM table_75057 WHERE "Team" = 'mark/jennifer' | wikisql |
CREATE TABLE table_202_271 (
id number,
"party" text,
"candidate" text,
"votes" number,
"%" number,
"\u00b1%" number
) | how many votes did both the conservative party and the rainbow dream ticket party receive ? | SELECT SUM("votes") FROM table_202_271 WHERE "party" IN ('conservative', 'rainbow dream ticket') | squall |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Which courses in Advanced Portuguese satisfy the requirement for Core ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Advanced Portuguese%' OR course.description LIKE '%Advanced Portuguese%' OR course.name LIKE '%A... | advising |
CREATE TABLE table_204_522 (
id number,
"boat #" text,
"name" text,
"builder" text,
"laid down" text,
"launched" text,
"completed" text,
"fate" text
) | which boat was laid down on the same day as ha-202 ? | SELECT "name" FROM table_204_522 WHERE "name" <> 'ha-202' AND "laid down" = (SELECT "laid down" FROM table_204_522 WHERE "name" = 'ha-202') | squall |
CREATE TABLE table_204_161 (
id number,
"name" text,
"1968 cf\ndesignator" text,
"place of\nmanufacture" text,
"primary\nrole(s)" text,
"service\nperiod" text,
"#\nused" number
) | how many airco dh .4 's did the uk use in their period of service ? | SELECT "#\nused" FROM table_204_161 WHERE "name" = 'airco dh.4' | squall |
CREATE TABLE table_1776 (
"Parish ( Prestegjeld )" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" real,
"Location of the Church" text
) | Name the total number for sub parish sokn for 1865 | SELECT COUNT("Sub-Parish (Sokn)") FROM table_1776 WHERE "Year Built" = '1865' | wikisql |
CREATE TABLE table_name_77 (
date VARCHAR,
against VARCHAR,
opposing_teams VARCHAR
) | What day was the opposing team Australia and the against 25? | SELECT date FROM table_name_77 WHERE against = 25 AND opposing_teams = "australia" | sql_create_context |
CREATE TABLE table_name_83 (
record VARCHAR,
date VARCHAR
) | What was the record on Feb 25? | SELECT record FROM table_name_83 WHERE date = "feb 25" | sql_create_context |
CREATE TABLE table_33069 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the away team when Hawthorn was the home team? | SELECT "Away team score" FROM table_33069 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_19053 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Height m ( ft )" text,
"FCC info" text,
"Notes" text
) | what's the frequency mhz with city of license being chattanooga, tennessee | SELECT "Frequency MHz" FROM table_19053 WHERE "City of license" = 'Chattanooga, Tennessee' | wikisql |
CREATE TABLE table_name_74 (
country VARCHAR,
year_s__won VARCHAR
) | What country won in 2004? | SELECT country FROM table_name_74 WHERE year_s__won = "2004" | sql_create_context |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | Return a bar chart on how many wines are there for each grape?, and I want to list the total number in desc order. | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_79351 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many draws did Mortlake have when the losses were more than 5? | SELECT COUNT("Draws") FROM table_79351 WHERE "Losses" > '5' AND "Club" = 'mortlake' | 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_Address_History (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
... | Show me a bar chart with the product name and their frequency, and show by the y axis in desc please. | SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY COUNT(product_name) DESC | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
... | 二零零五年二月二十七日到二零一零年四月三十日,编号为0357577的医院中多少科室在门诊就诊中开出了12张以上的检验报告单 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B... | css |
CREATE TABLE table_204_959 (
id number,
"club" text,
"founded" number,
"nickname" text,
"location" text,
"home ground" text,
"entered competition" number,
"most recent promotion" number
) | how many clubs entered competition after 1945 ? | SELECT COUNT("club") FROM table_204_959 WHERE "entered competition" > 1945 | squall |
CREATE TABLE table_41410 (
"Name" text,
"Status" text,
"Authors" text,
"Location" text,
"Notes" text
) | Where has a Name of zhongornis? | SELECT "Location" FROM table_41410 WHERE "Name" = 'zhongornis' | wikisql |
CREATE TABLE table_76987 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the To par of the Player with a Score of 73-70-71-72=286? | SELECT "To par" FROM table_76987 WHERE "Score" = '73-70-71-72=286' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | Date of first question with Bounty. | SELECT PostId, MIN(CreationDate) AS DaDate FROM (SELECT PostId, CreationDate FROM Votes WHERE NOT BountyAmount IS NULL AND VoteTypeId = 8) AS B GROUP BY PostId ORDER BY DaDate LIMIT 10 | sede |
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 admission type of subject id 42963? | SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "42963" | mimicsql_data |
CREATE TABLE table_name_73 (
date VARCHAR,
game VARCHAR,
score VARCHAR
) | What date has a game smaller than 4, and a score of 116-114? | SELECT date FROM table_name_73 WHERE game < 4 AND score = "116-114" | sql_create_context |
CREATE TABLE table_name_16 (
champion VARCHAR,
llws VARCHAR,
city VARCHAR
) | Which champion has a Group Stage LLWS in Russellville? | SELECT champion FROM table_name_16 WHERE llws = "group stage" AND city = "russellville" | sql_create_context |
CREATE TABLE table_53263 (
"NATO member" text,
"Aircraft carriers" text,
"Battleships" text,
"Cruisers" text,
"Escorts" text,
"Submarines" text,
"Torpedo boat squadrons" text,
"s Motor ship / s Naval trawler" text,
"Grand Total" real
) | How many ships for the nation with grand total of 20? | SELECT "s Motor ship / s Naval trawler" FROM table_53263 WHERE "Grand Total" = '20' | wikisql |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_... | can you tell me the cheapest one way fare from BOSTON to SAN FRANCISCO | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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_... | atis |
CREATE TABLE table_name_42 (
silver VARCHAR,
year VARCHAR
) | How many silver medals were won in 1938? | SELECT silver FROM table_name_42 WHERE year = "1938" | sql_create_context |
CREATE TABLE available_policies (
policy_type_code VARCHAR
) | Which policy type has the most records in the database? | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what is the maximum hospital cost for a patient suffering from acute respiratory failure - due to atelectasis this year? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to atelectas... | eicu |
CREATE TABLE table_name_76 (
opponent_in_the_final VARCHAR,
partner VARCHAR
) | What Opponent in the final had a Partner of Gast n Etlis? | SELECT opponent_in_the_final FROM table_name_76 WHERE partner = "gastón etlis" | sql_create_context |
CREATE TABLE table_name_77 (
time VARCHAR,
year VARCHAR
) | What Time has a Year of 1984? | SELECT time FROM table_name_77 WHERE year = 1984 | sql_create_context |
CREATE TABLE table_259 (
"University Name" text,
"Acronym" text,
"Date founded" real,
"Website" text,
"Official registration notes" text
) | What is the acronym used for Beirut Arab University? | SELECT "Acronym" FROM table_259 WHERE "University Name" = 'Beirut Arab University' | wikisql |
CREATE TABLE table_name_96 (
laps INTEGER,
bike VARCHAR,
grid VARCHAR
) | How many total laps were ridden when the grid was 7 and the rider rode the Honda CBR600RR? | SELECT SUM(laps) FROM table_name_96 WHERE bike = "honda cbr600rr" AND grid = 7 | sql_create_context |
CREATE TABLE table_58398 (
"Event Name" text,
"Established" real,
"Category" text,
"Sub Category" text,
"Main Venue" text
) | How many Established groups have a multicultural sub category? | SELECT COUNT("Established") FROM table_58398 WHERE "Sub Category" = 'multicultural' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | until 4 years ago, did patient 027-53836 go to an er? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '027-53836' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-4 year') | eicu |
CREATE TABLE table_28188239_1 (
incumbent VARCHAR,
district VARCHAR
) | How many incumbents are in district la-1? | SELECT COUNT(incumbent) FROM table_28188239_1 WHERE district = "LA-1" | sql_create_context |
CREATE TABLE table_70616 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
) | Name the term in office for liberal and state of sa for ian mclachlan | SELECT "Term in office" FROM table_70616 WHERE "Party" = 'liberal' AND "State" = 'sa' AND "Member" = 'ian mclachlan' | wikisql |
CREATE TABLE table_name_66 (
margin_of_victory VARCHAR,
winning_score VARCHAR
) | When the Winning score was 9 (69-72-68-70=279), what was the Margin of victory? | SELECT margin_of_victory FROM table_name_66 WHERE winning_score = –9(69 - 72 - 68 - 70 = 279) | sql_create_context |
CREATE TABLE table_name_1 (
wheel_arrangement VARCHAR,
year_made VARCHAR
) | What wheel arrangement was made in 1910? | SELECT wheel_arrangement FROM table_name_1 WHERE year_made = "1910" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | until 08/2105, how many times was prescribed potassium phosphate 3 mmol/ml15 ml inj to patient 022-151182? | 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-151182')) AND medication.drugname = 'potassium phosphate 3 mmol/ml15 ml in... | eicu |
CREATE TABLE table_42150 (
"Location" text,
"Aircraft" text,
"Tail number" text,
"Aircraft damage" text,
"Fatalities" text
) | What is the location for the an-12b aircraft? | SELECT "Location" FROM table_42150 WHERE "Aircraft" = 'an-12b' | wikisql |
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE medicine (
id number,
name text,... | List the names and the locations that the enzymes can make an effect. | SELECT name, location FROM enzyme | spider |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Tags that shouldn't be used. | SELECT t.TagName, p.Body AS Excerpt, DATEDIFF(d, p.LastEditDate, GETDATE()) AS DaysNotEdited FROM Tags AS t INNER JOIN Posts AS p ON t.ExcerptPostId = p.Id WHERE p.Body LIKE 'DO NOT USE%' COLLATE Latin1_General_CI_AI ORDER BY p.LastEditDate | sede |
CREATE TABLE table_name_53 (
round INTEGER,
name VARCHAR
) | what is the highest round for anthony gonzalez? | SELECT MAX(round) FROM table_name_53 WHERE name = "anthony gonzalez" | sql_create_context |
CREATE TABLE table_name_68 (
result VARCHAR,
road_team VARCHAR,
date VARCHAR
) | WHAT IS THE RESULT WITH THE BOSTON ROAD TEAM, ON APRIL 23? | SELECT result FROM table_name_68 WHERE road_team = "boston" AND date = "april 23" | sql_create_context |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname va... | Is there a paper on multiuser receiver and decision feedback ? | SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('multiuser receiver', 'decision feedback') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1 | scholar |
CREATE TABLE table_62713 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Rank" text,
"Wins" real
) | What is the name of the machine that ranked 4th and has 2 wins? | SELECT "Machine" FROM table_62713 WHERE "Rank" = '4th' AND "Wins" = '2' | wikisql |
CREATE TABLE table_204_978 (
id number,
"position" number,
"nation" number,
"number" number,
"name" text,
"soproni liga" number,
"uefa cup" number,
"hungarian cup" number,
"league cup" number,
"total" number
) | whom is listed first on the chart ? | SELECT "name" FROM table_204_978 WHERE id = 1 | squall |
CREATE TABLE customer_payments (
customer_id number,
datetime_payment time,
payment_method_code text,
amount_payment number
)
CREATE TABLE customers (
customer_id number,
customer_address_id number,
customer_status_code text,
date_became_customer time,
date_of_birth time,
first_... | What are the last names that are used by customers and staff? | SELECT last_name FROM customers INTERSECT SELECT last_name FROM staff | spider |
CREATE TABLE table_36370 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" text,
"Class" text,
"FCC info" text
) | What is the average Frequency MHz that is on farwell, texas? | SELECT AVG("Frequency MHz") FROM table_36370 WHERE "City of license" = 'farwell, texas' | wikisql |
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
) | What are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director? | SELECT DISTINCT T3.name, T2.title, T1.stars FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid JOIN reviewer AS T3 ON T1.rid = T3.rid WHERE T2.director = T3.name | spider |
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rati... | what are some good restaurants in the yosemite and mono lake area for french food ? | SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'yosemite and mono lake area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE table_name_86 (
driver VARCHAR,
class VARCHAR,
navigator VARCHAR
) | Who was the driver of the vehicle having class of CM22 and navigator of Macneall? | SELECT driver FROM table_name_86 WHERE class = "cm22" AND navigator = "macneall" | sql_create_context |
CREATE TABLE table_30922 (
"Stage" real,
"Winner" text,
"General classification" text,
"Mountains Classification" text,
"Points classification" text,
"Sprints Classification" text,
"Team Classification" text
) | Name the general classification for steven kruijswijk | SELECT "General classification" FROM table_30922 WHERE "Winner" = 'Steven Kruijswijk' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在79056847817的这次医疗就诊中,为病人葛清怡的检验报告做审核的人员姓名及工号 | SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '79056847817' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '79056847817' | css |
CREATE TABLE table_name_95 (
total VARCHAR,
set_1 VARCHAR
) | What is the total when the set 1 is 21 25? | SELECT total FROM table_name_95 WHERE set_1 = "21–25" | sql_create_context |
CREATE TABLE table_name_60 (
total_fertility_rate VARCHAR,
deaths INTEGER
) | What was the total fertility rate that had a death rate larger than 7.8? | SELECT total_fertility_rate FROM table_name_60 WHERE deaths > 7.8 | sql_create_context |
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
)
... | How many patients who stayed in the hospital for more than 7 days have a bilirubin lab test done? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab.label = "Bilirubin" | mimicsql_data |
CREATE TABLE table_24466191_1 (
flaps INTEGER
) | Name the least flaps | SELECT MIN(flaps) FROM table_24466191_1 | sql_create_context |
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advis... | Find the name of the club that has the most female students. | SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_51640 (
"Year" real,
"Franchise" text,
"League" text,
"Percentage" real,
"Finish" text
) | What is the average Year for the Finish of lost 2001 alcs and the Percentage is over 0.716? | SELECT AVG("Year") FROM table_51640 WHERE "Finish" = 'lost 2001 alcs' AND "Percentage" > '0.716' | wikisql |
CREATE TABLE table_77486 (
"Actor in London, 2002" text,
"Actor in New York, 2006" text,
"Actor in Moscow, 2007" text,
"Voyage" text,
"Shipwreck" text
) | Who was the 2007 actor from Moscow for the shipwreck of Leonty Ibayev? | SELECT "Actor in Moscow, 2007" FROM table_77486 WHERE "Shipwreck" = 'leonty ibayev' | 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, show me about the distribution of name and price , and group by attribute founder in a bar chart, I want to rank by the y axis from low to high please. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price | nvbench |
CREATE TABLE table_name_44 (
country VARCHAR,
opponent VARCHAR
) | What country had an opponent of Sampdoria? | SELECT country FROM table_name_44 WHERE opponent = "sampdoria" | sql_create_context |
CREATE TABLE table_name_16 (
race_name VARCHAR,
winning_team VARCHAR,
pole_position VARCHAR
) | What race did the team Mi-Jack Conquest racing win with a pole position of andreas wirth? | SELECT race_name FROM table_name_16 WHERE winning_team = "mi-jack conquest racing" AND pole_position = "andreas wirth" | sql_create_context |
CREATE TABLE table_62228 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | what is the round when the position is (c)? | SELECT MAX("Round") FROM table_62228 WHERE "Position" = '(c)' | wikisql |
CREATE TABLE table_41195 (
"Game" real,
"Date" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Result (sets)" text,
"Result (Pts)" text
) | What is the Set 5 with a Set 3 that is 25-23 and a Set 4 that is 23-25? | SELECT "Set 5" FROM table_41195 WHERE "Set 3" = '25-23' AND "Set 4" = '23-25' | wikisql |
CREATE TABLE table_16103 (
"Date" text,
"Album name" text,
"Track" text,
"Track title" text,
"Lyricist" text,
"Music genre/style" text,
"Major instrument(s)" text,
"Lyrics theme/style" text,
"Duration" text
) | What is the name of the track that lasts 5:30? | SELECT "Track title" FROM table_16103 WHERE "Duration" = '5:30' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | among the patients diagnosed with hypercalcemia - moderate, calculate the two year survival probability. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE table_11359 (
"Year" real,
"Organization" text,
"Award" text,
"Work" text,
"Result" text
) | Where Award is best actress and Work is first kiss, what is the average Year? | SELECT AVG("Year") FROM table_11359 WHERE "Award" = 'best actress' AND "Work" = 'first kiss' | wikisql |
CREATE TABLE table_name_47 (
internet_explorer VARCHAR,
firefox VARCHAR
) | What was the internet explorer % when firefox was 24.98%? | SELECT internet_explorer FROM table_name_47 WHERE firefox = "24.98%" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
su... | what are the three most frequent drugs prescribed to the female patients 30s after they have been diagnosed with hypertension nos until 1 year ago in the same hospital visit? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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_204_70 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
) | what is the difference in pick numbers between greg schaum and ed bauer ? | SELECT ABS((SELECT "pick #" FROM table_204_70 WHERE "player" = 'greg schaum') - (SELECT "pick #" FROM table_204_70 WHERE "player" = 'ed bauer')) | squall |
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... | Visualize the relationship between Team_ID and ACC_Percent , and group by attribute ACC_Home. | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home | nvbench |
CREATE TABLE table_220 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | Which races did Paul Greifzu win? | SELECT "Race Name" FROM table_220 WHERE "Winning driver" = 'Paul Greifzu' | wikisql |
CREATE TABLE table_56171 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
) | What is the lowest regular GP Larry Courville, who has a PI GP smaller than 0, has? | SELECT MIN("Reg GP") FROM table_56171 WHERE "Player" = 'larry courville' AND "Pl GP" < '0' | 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... | give me the number of patients whose marital status is widowed and drug route is oral? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "ORAL" | mimicsql_data |
CREATE TABLE table_45667 (
"Macedonian population in Vojvodina" text,
"1961" real,
"Number 1971" real,
"1981" real,
"1991" real,
"2002" real
) | What is the 1981 value of the Macedonian population with a 1971 number greater than 192 and a 1991 of 1748? | SELECT "1981" FROM table_45667 WHERE "Number 1971" > '192' AND "1991" = '1748' | wikisql |
CREATE TABLE table_62207 (
"Date From" text,
"Date To" text,
"Pos." text,
"Name" text,
"Moving To" text
) | When was ron-robert zieler loaned out until ? | SELECT "Date To" FROM table_62207 WHERE "Name" = 'ron-robert zieler' | wikisql |
CREATE TABLE table_52855 (
"Station Number" text,
"District" text,
"Location" text,
"Type" text,
"Appliances" text,
"Registrations" text
) | What is the appliance at the station in St Neots? | SELECT "Appliances" FROM table_52855 WHERE "Location" = 'st neots' | wikisql |
CREATE TABLE table_22989 (
"Name" text,
"Completions" real,
"Attempts" real,
"Completion %" text,
"Yards" real,
"Touchdowns" real,
"Interceptions" real,
"QB Rating" text
) | How many yardage figures for the player with 72.3 QB rating? | SELECT COUNT("Yards") FROM table_22989 WHERE "QB Rating" = '72.3' | wikisql |
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... | My top comments (eligible for Pundit badge). Show comments with 10 or more upvotes | SELECT ROW_NUMBER() OVER (ORDER BY Score) AS rownum, PostId AS "post_link", Score, Text FROM Comments WHERE UserId = '##userid##' ORDER BY Score DESC | sede |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airline (
airline_code... | show me the flights from TORONTO to CINCINNATI | 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCIN... | atis |
CREATE TABLE table_name_81 (
number_of_electorates__2009_ INTEGER,
name VARCHAR
) | What is Beohari's highest number of electorates? | SELECT MAX(number_of_electorates__2009_) FROM table_name_81 WHERE name = "beohari" | sql_create_context |
CREATE TABLE table_204_922 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | name all the nations that did not win any gold medals . | SELECT "nation" FROM table_204_922 WHERE "gold" = 0 | squall |
CREATE TABLE table_11656578_2 (
area_km²__1998_ VARCHAR,
abbreviation VARCHAR
) | How big (in km2) is the voivodenship also known by the abbreviation KN? | SELECT area_km²__1998_ FROM table_11656578_2 WHERE abbreviation = "kn" | sql_create_context |
CREATE TABLE table_train_80 (
"id" int,
"mini_mental_state_examination_mmse" int,
"uncontrolled_diabetes" bool,
"glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int,
"cornell_scale_for_depression_in_dementia_csdd" int,
"clinical_dementia_rating_cdr" float,
"age" float,
"NOUSE" float
) | cdr score > or equal to 0.5 and < or equal to1 | SELECT * FROM table_train_80 WHERE clinical_dementia_rating_cdr >= 0.5 AND clinical_dementia_rating_cdr <= 1 | criteria2sql |
CREATE TABLE table_29566606_11 (
programme VARCHAR,
original_channel_s_ VARCHAR
) | Which programs were originally broadcast on CITV? | SELECT programme FROM table_29566606_11 WHERE original_channel_s_ = "CITV" | sql_create_context |
CREATE TABLE table_22338 (
"City of license /Market" text,
"Station" text,
"Channel ( TV / RF )" text,
"Owned Since" real,
"Affiliation" text
) | What station is affiliated with kmgh-tv? | SELECT "Affiliation" FROM table_22338 WHERE "Station" = 'KMGH-TV' | wikisql |
CREATE TABLE table_533 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What was the first series in this list that Jack Orman wrote? | SELECT MIN("Series #") FROM table_533 WHERE "Written by" = 'Jack Orman' | 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, visualize a bar chart about the distribution of name and revenue , and group by attribute founder, and could you list in descending by the y axis? | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue DESC | nvbench |
CREATE TABLE table_name_74 (
wins INTEGER,
reds_season VARCHAR,
finish VARCHAR,
win_percentage VARCHAR
) | What was the lowest wins in a season less than 1915 with a 7th finish and 0.429 win %? | SELECT MIN(wins) FROM table_name_74 WHERE finish = "7th" AND win_percentage > 0.429 AND reds_season < 1915 | sql_create_context |
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst text,
packst t... | Which country is the safest in terms of the pesticide concentration found in imported foods? | SELECT T1.country FROM sampledata15 AS T1 JOIN resultsdata15 AS T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.country ORDER BY SUM(T2.concen) LIMIT 1 | pesticide |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.