instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'cpk') | eicu |
CREATE TABLE table_name_67 (
runner_s__up VARCHAR,
margin_of_victory VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the tournament played Nov 13, 1988, ending with a margin of victory of 5 strokes, who was the runner-up?
| SELECT runner_s__up FROM table_name_67 WHERE margin_of_victory = "5 strokes" AND date = "nov 13, 1988" | sql_create_context |
CREATE TABLE table_name_81 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament has a 3r in 1983?
| SELECT tournament FROM table_name_81 WHERE 1983 = "3r" | sql_create_context |
CREATE TABLE table_204_596 (
id number,
"year" number,
"winners" text,
"score" text,
"runners up" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team was the winner of the first final ?
| SELECT "winners" FROM table_204_596 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_name_99 (
pick INTEGER,
position VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest pick for a defensive back at Drake?
| SELECT MIN(pick) FROM table_name_99 WHERE position = "defensive back" AND school = "drake" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2111.0" AND procedures.long_title = "Other endoscopy of small intestine" | mimicsql_data |
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 person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = zyjybgb.JZLSH_ZYJZJLB WHERE zyjybgb.BGDH = '94625... | css |
CREATE TABLE table_69387 (
"Year" text,
"Champion" text,
"Runner-Up" text,
"3rd Place" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the runner-up which has 3rd place of terry hollands
| SELECT "Runner-Up" FROM table_69387 WHERE "3rd Place" = 'terry hollands' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_860 (
"Season" real,
"Winner" text,
"BYU-UU score" text,
"BYU-USU score" text,
"UU-USU score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the maximum season with byu-usu score being 29 7
| SELECT MAX("Season") FROM table_860 WHERE "BYU-USU score" = '29–7' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
Owne... | SELECT * FROM Posts WHERE PostTypeId = 3 | sede |
CREATE TABLE table_name_7 (
bike VARCHAR,
rider VARCHAR,
grid VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of bike had a grid less than 23, an accident under time, and Graeme Gowland as a rider?
| SELECT bike FROM table_name_7 WHERE grid < 23 AND time = "accident" AND rider = "graeme gowland" | sql_create_context |
CREATE TABLE table_name_60 (
call_sign VARCHAR,
erp_w VARCHAR,
city_of_license VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the call sign of the translator with an ERP W greater than 38 and a city license from Great Falls, Montana?
| SELECT call_sign FROM table_name_60 WHERE erp_w > 38 AND city_of_license = "great falls, montana" | sql_create_context |
CREATE TABLE table_58426 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is Bill Robinzine?
| SELECT "Nationality" FROM table_58426 WHERE "Player" = 'bill robinzine' | wikisql |
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... | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '76143414' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-08-24' AND '2019-03-19' AND t_kc22.MED_I... | css |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_dista... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 21 AND date_day.month_number... | atis |
CREATE TABLE diagnoses (
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND diagnoses.icd9_code = "56983" | mimicsql_data |
CREATE TABLE table_name_23 (
accolade VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the accolade for the rank of 497?
| SELECT accolade FROM table_name_23 WHERE rank = 497 | sql_create_context |
CREATE TABLE table_17971 (
"Round" real,
"Circuit" text,
"Date" text,
"Length" text,
"Pole Position" text,
"GT3 Winner" text,
"GTC Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the circuit for 9 september and gt3 winner... | SELECT "Circuit" FROM table_17971 WHERE "Date" = '9 September' AND "GT3 Winner" = 'Hector Lester Allan Simonsen' | wikisql |
CREATE TABLE table_15692 (
"Date" text,
"Score" text,
"Location" text,
"Competition" text,
"Serial No." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The competition that took place on 4 Apr 1997 ended with what as the score?
| SELECT "Score" FROM table_15692 WHERE "Date" = '4 apr 1997' | wikisql |
CREATE TABLE table_40738 (
"City/State" text,
"Members" text,
"Team" text,
"First round" text,
"Final round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What City/State did the Atlanta Hawks (retired) team play for?
| SELECT "City/State" FROM table_40738 WHERE "Team" = 'atlanta hawks (retired)' | wikisql |
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text
)
CREATE TABLE ... | SELECT T1.cust_name, T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING SUM(T2.amount) > 5000 | spider |
CREATE TABLE table_2438 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whe... | SELECT "Tournament Venue (City)" FROM table_2438 WHERE "Conference Player of the Year" = 'Larry Smith , Alcorn State' | wikisql |
CREATE TABLE table_21721351_18 (
pick__number INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pick # for player david grannis?
| SELECT MAX(pick__number) FROM table_21721351_18 WHERE player = "David Grannis" | sql_create_context |
CREATE TABLE table_name_51 (
county VARCHAR,
precincts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which County has Precincts of 90/90?
| SELECT county FROM table_name_51 WHERE precincts = "90/90" | sql_create_context |
CREATE TABLE table_14389 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score on May 18?
| SELECT "Score" FROM table_14389 WHERE "Date" = 'may 18' | wikisql |
CREATE TABLE table_2401326_1 (
others_percentage VARCHAR,
others_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of the votes were for others in the county where 462 people voted that way?
| SELECT others_percentage FROM table_2401326_1 WHERE others_number = 462 | sql_create_context |
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY COUNT(Nationality) DESC | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ca in situ oral cav/phar" AND prescriptions.route = "IM" | mimicsql_data |
CREATE TABLE table_name_73 (
date VARCHAR,
time__seconds_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date has a time of (seconds) 42.172?
| SELECT date FROM table_name_73 WHERE time__seconds_ = 42.172 | sql_create_context |
CREATE TABLE gas_station (
location VARCHAR,
Representative_Name VARCHAR,
station_id VARCHAR
)
CREATE TABLE station_company (
company_id VARCHAR,
station_id VARCHAR
)
CREATE TABLE company (
company_id VARCHAR,
Assets_billion VARCHAR
)
-- Using valid SQLite, answer the following questions... | SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2137" AND lab.label = "Fibrinogen, Functional" | mimicsql_data |
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
i... | SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY transaction_type_code DESC | nvbench |
CREATE TABLE table_17349 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the date where visit... | SELECT "Date" FROM table_17349 WHERE "Visitor" = 'Phoenix Suns' AND "Record" = '31–30' | wikisql |
CREATE TABLE election (
District VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all the distinct districts for elections.
| SELECT DISTINCT District FROM election | sql_create_context |
CREATE TABLE table_2391 (
"Episode" real,
"First Air Date" text,
"Rating (18\u201349)" text,
"Share (18\u201349)" real,
"Viewers (millions)" text,
"Rank (timeslot)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of rank tim... | SELECT COUNT("Rank (timeslot)") FROM table_2391 WHERE "Rating (18\u201349)" = '3.1' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.formulary_drug_cd = "BENZ1I" | mimicsql_data |
CREATE TABLE table_69545 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the match played on 14 October 1998, resulting in more than 10 goals?
| SELECT "Score" FROM table_69545 WHERE "Date" = '14 october 1998' AND "Goal" > '10' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT DISTINCT pname FROM player WHERE pname LIKE '%a%' | spider |
CREATE TABLE table_name_74 (
county VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which County has a Location of edinburgh?
| SELECT county FROM table_name_74 WHERE location = "edinburgh" | sql_create_context |
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
surname TEXT,
dob TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE seasons (
year INTEGER,
url TEXT
)
CREATE TABLE results (
resultId INTEGER,
raceId INTEGER,
driverId... | 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 DESC | nvbench |
CREATE TABLE table_name_16 (
score VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the game of the Player in Place 4?
| SELECT score FROM table_name_16 WHERE place = "4" | sql_create_context |
CREATE TABLE table_name_18 (
draws INTEGER,
wins VARCHAR,
losses VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest draws for teams having under 2 losses, more than 4 wins, and a position under 4?
| SELECT MIN(draws) FROM table_name_18 WHERE losses < 2 AND position < 4 AND wins > 4 | sql_create_context |
CREATE TABLE table_name_95 (
year INTEGER,
playoffs VARCHAR,
open_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the latest year that Real Colorado Foxes did not qualify for the playoffs but make it to Open Cup 2nd Round?
| SELECT MAX(year) FROM table_name_95 WHERE playoffs = "did not qualify" AND open_cup = "2nd round" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Int inser lead atri-vent" | mimicsql_data |
CREATE TABLE table_48471 (
"Name" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Time/Retired, when Team is 'Team Vodafone', and when Grid is greater than 4?
| SELECT "Time/Retired" FROM table_48471 WHERE "Team" = 'team vodafone' AND "Grid" > '4' | wikisql |
CREATE TABLE table_name_90 (
home_team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team on June 9?
| SELECT home_team FROM table_name_90 WHERE date = "june 9" | sql_create_context |
CREATE TABLE table_40643 (
"School" text,
"Conference" text,
"Record (Conf)" text,
"Berth" text,
"Last NCAA Appearance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the recorded conference that was a Wac Conference?
| SELECT "Record (Conf)" FROM table_40643 WHERE "Conference" = 'wac' | wikisql |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "1" AND procedures.long_title = "Injection or infusion of cancer chemotherapeutic substance" | mimicsql_data |
CREATE TABLE table_26258348_4 (
winning_constructor VARCHAR,
fastest_lap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many winning constructor catagories are there when Mark Webber had the fastest lap?
| SELECT COUNT(winning_constructor) FROM table_26258348_4 WHERE fastest_lap = "Mark Webber" | sql_create_context |
CREATE TABLE table_203_189 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the least number of meters habte jifar has run ?
| SELECT "notes" FROM table_203_189 ORDER BY "notes" LIMIT 1 | squall |
CREATE TABLE table_31980 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the highest Laps for grid less than 22 and riderS of ruben xaus
| SELECT MAX("Laps") FROM table_31980 WHERE "Grid" < '22' AND "Rider" = 'ruben xaus' | wikisql |
CREATE TABLE table_204_654 (
id number,
"year" number,
"song" text,
"u.s." number,
"u.s.\nr&b" number,
"u.s.\nac" number,
"uk" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest position a song from bonafi... | SELECT MIN("u.s.") FROM table_204_654 WHERE "album" = 'bonafide' | squall |
CREATE TABLE table_1670921_2 (
batting_partners VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What batting partners were the most successful in 2004?
| SELECT batting_partners FROM table_1670921_2 WHERE season = "2004" | sql_create_context |
CREATE TABLE table_name_28 (
tie_no VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Liverpool as a home team as listed what in the Tie no column?
| SELECT tie_no FROM table_name_28 WHERE home_team = "liverpool" | sql_create_context |
CREATE TABLE table_25148 (
"Year" real,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the margin for 4 shot deficit
| SELECT "Margin" FROM table_25148 WHERE "54 holes" = '4 shot deficit' | wikisql |
CREATE TABLE table_6633 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" text,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What transfer window has bra as the... | SELECT "Transfer window" FROM table_6633 WHERE "Country" = 'bra' AND "Transfer fee" = '£3.4m' | wikisql |
CREATE TABLE table_name_48 (
venue VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what venue was the 1978 FIFA world cup qualification played in?
| SELECT venue FROM table_name_48 WHERE competition = "1978 fifa world cup qualification" | sql_create_context |
CREATE TABLE table_71924 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lap number for the rank of 13?
| SELECT "Laps" FROM table_71924 WHERE "Rank" = '13' | wikisql |
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... | SELECT Title, Id, Score, ViewCount FROM Posts WHERE Score >= '##MinScore:int##' LIMIT 100 | sede |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start ... | mimic_iii |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
... | 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 lab.patientunitstayid FROM lab WHERE lab.labname = 'digoxin')) GROUP BY cost.patienthealthsystemstayid) AS t1 | eicu |
CREATE TABLE table_name_81 (
away_captain VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the away captain for Kingsmead?
| SELECT away_captain FROM table_name_81 WHERE venue = "kingsmead" | 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 WHERE demographic.diagnosis = "STEMI" AND demographic.age < "20" | mimicsql_data |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug_type = "ADDITIVE" | 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... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'aortic aneurysm - thoracic' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) | eicu |
CREATE TABLE routes (
dst_apid VARCHAR
)
CREATE TABLE airports (
name VARCHAR,
apid VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the busiest destination airport that runs most number of routes in China.
| SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_34575 (
"Country name" text,
"Russian name" text,
"Cyrillic code" text,
"Latin 3-letter code" text,
"Latin 2-letter code" text,
"Numeric code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country name with a nume... | SELECT "Country name" FROM table_34575 WHERE "Numeric code" < '580' AND "Latin 2-letter code" = 'dk' | wikisql |
CREATE TABLE nuclear_power_plants (
id text,
name text,
latitude text,
longitude text,
country text,
status text,
reactortype text,
reactormodel text,
constructionstartat text,
operationalfrom text,
operationalto text,
capacity text,
lastupdatedat text,
source tex... | SELECT country FROM nuclear_power_plants GROUP BY country ORDER BY SUM(name) DESC LIMIT 3 | geonucleardata |
CREATE TABLE table_name_27 (
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place was Gary Player after two rounds?
| SELECT place FROM table_name_27 WHERE player = "gary player" | sql_create_context |
CREATE TABLE table_17259 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage (Proof)" text,
"Issue Price (Proof)" text,
"Mintage (BU)[ clarification needed ]" text,
"Issue Price (BU)[ clarification needed ]" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Mintage (BU)[ clarification needed ]" FROM table_17259 WHERE "Artist" = 'Royal Canadian Mint Staff' AND "Issue Price (Proof)" = '$54.95' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-250' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p... | eicu |
CREATE TABLE table_5280 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which suzuki gsx-r1000 k7 has the highest time of retirement?
| SELECT MAX("Grid") FROM table_5280 WHERE "Time" = 'retirement' AND "Bike" = 'suzuki gsx-r1000 k7' | wikisql |
CREATE TABLE table_name_55 (
tournament VARCHAR,
opponent_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament has raffaella reggi listed as the opponent in the final?
| SELECT tournament FROM table_name_55 WHERE opponent_in_the_final = "raffaella reggi" | sql_create_context |
CREATE TABLE table_78128 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college has a position of defensive line and Grant high school?
| SELECT "College" FROM table_78128 WHERE "Position" = 'defensive line' AND "School" = 'grant high school' | wikisql |
CREATE TABLE table_34744 (
"Year" text,
"Regular Season Champion(s)" text,
"Record" text,
"Tournament Champion" text,
"Tournament venue" text,
"Tournament city" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When has a Record of 9 1, and a Tourn... | SELECT "Year" FROM table_34744 WHERE "Record" = '9–1' AND "Tournament Champion" = 'duke' | wikisql |
CREATE TABLE table_204_276 (
id number,
"record" text,
"date" text,
"result" text,
"opponent" text,
"location" text,
"method" text,
"round" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- on which date was the match with the smallest nu... | SELECT "date" FROM table_204_276 ORDER BY "round" LIMIT 1 | squall |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "ASIAN" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '029-27704' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE table_name_6 (
founded INTEGER,
club VARCHAR,
capacity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many foundeds have stade tunisien as the club, with a capacity greater than 18,000?
| SELECT SUM(founded) FROM table_name_6 WHERE club = "stade tunisien" AND capacity > 18 OFFSET 000 | sql_create_context |
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 T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_25356350_2 (
series__number VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes are written by Lew Schneider?
| SELECT COUNT(series__number) FROM table_25356350_2 WHERE written_by = "Lew Schneider" | sql_create_context |
CREATE TABLE table_33465 (
"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.
-- What is the listed crowd when the home team's sc... | SELECT "Crowd" FROM table_33465 WHERE "Home team score" = '9.7 (61)' | wikisql |
CREATE TABLE table_65945 (
"Score" text,
"Shooter" text,
"Date" text,
"Comp" text,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the Shooter with a Comp of OG?
| SELECT "Score" FROM table_65945 WHERE "Comp" = 'og' | wikisql |
CREATE TABLE table_35147 (
"Tournament" text,
"1998" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Career SR" text,
"Caree... | SELECT "2011" FROM table_35147 WHERE "Career Win-Loss" = '7–10' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 44625) AND STRFTIME('%y', procedures_icd.charttime) <= '2102' ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE fligh... | SELECT DISTINCT flight.airline_code, MIN(flight.departure_time) FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code ... | atis |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id num... | SELECT * FROM Posts WHERE Tags LIKE '%python%' AND CreationDate BETWEEN '2019-01-01' AND '2019-02-01' | sede |
CREATE TABLE table_name_72 (
ends_lost VARCHAR,
shot_pct VARCHAR,
ends_won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ends lost when shot % is 88 and ends won are 31?
| SELECT COUNT(ends_lost) FROM table_name_72 WHERE shot_pct = 88 AND ends_won = 31 | sql_create_context |
CREATE TABLE table_47064 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What catalog uses the stereo compact cassette format?
| SELECT "Catalog" FROM table_47064 WHERE "Format" = 'stereo compact cassette' | wikisql |
CREATE TABLE table_3420 (
"Player" text,
"G" real,
"Solo TK" real,
"Asst. TK" real,
"Total TK" real,
"Sack" text,
"YdL" real,
"INT" real,
"Yards" real,
"ForFum" real,
"FumRec" real,
"TD" real
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT MAX("INT") FROM table_3420 WHERE "Player" = 'Maake Kemoeatu' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '34105919' AND jybgb.BGRQ BETWEEN '2007-08-19' AND '2009-05-22'... | css |
CREATE TABLE table_name_94 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Footscray's score as the away team?
| SELECT away_team AS score FROM table_name_94 WHERE away_team = "footscray" | sql_create_context |
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,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZSEBZ = '5701953' AND ftxmzjzjlb.JZKSRQ BETWEEN '2003-04-08' AND '2014-07-28' | css |
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT COUNT(DISTINCT cname) FROM tryout | spider |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.