instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the week 3 for team o... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many votes did both the conservative party and the rainbow dream ticket party rece... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which boat was laid down on the same day as ha... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many airco dh .4 '... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team when Hawthorn was the home... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the frequency mhz with city of li... | SELECT "Frequency MHz" FROM table_19053 WHERE "City of license" = 'Chattanooga, Tennessee' | wikisql |
CREATE TABLE table_name_74 (
country VARCHAR,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
... | 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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... | SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "42963" | mimicsql_data |
CREATE TABLE table_name_73 (
date VARCHAR,
game VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following qu... | 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_... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Time has a Year of 1984?
| SELECT time FROM table_name_77 WHERE year = 1984 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '67577996810' AND NOT jybgb.KSMC LIKE '%科%' | css |
CREATE TABLE table_259 (
"University Name" text,
"Acronym" text,
"Date founded" real,
"Website" text,
"Official registration notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,... | 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables... | 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_... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provide... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | 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 ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the 2007 actor from Moscow for the shipwreck of ... | 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
)
-- Using valid SQLite, answer the following questions for the... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Set 5 with a S... | 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
)
-- Using valid SQLite, answer the following questions for the tables prov... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1981 value of the Macedonian population with a 197... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many yardage figures ... | 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... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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 |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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_da... | 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 (((date_day.day_number = 7 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = ... | atis |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Po... | SELECT u.UpVotes + u.DownVotes FROM Users AS u WHERE u.Id = '566193' | sede |
CREATE TABLE table_name_39 (
round VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round has an opponent of Freiburg?
| SELECT round FROM table_name_39 WHERE opponent = "freiburg" | sql_create_context |
CREATE TABLE customers (
payment_method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which payment method is used by most customers?
| SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '18795530' AND MED_SER_ORG_NO = '0561875' AND NOT IN_DIAG_DIS_NM LIKE '%分裂%' | css |
CREATE TABLE table_69876 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score for the game on May 4?
| SELECT "Score" FROM table_69876 WHERE "Date" = 'may 4' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
c... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'orthopedics consultation') | eicu |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | SELECT EMAIL, SALARY FROM employees | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.