instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_6 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has an opponent gan teik chai lin woon fui?
| SELECT score FROM table_name_6 WHERE opponent = "gan teik chai lin woon fui" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | SELECT * FROM Users AS u INNER JOIN Badges AS b ON u.Id = b.UserId WHERE u.Id = 8574934 LIMIT 1000 | sede |
CREATE TABLE table_name_76 (
chicken_wing VARCHAR,
steal_intercept_ball VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Chicken wing has no steal/intercept ball?
| SELECT chicken_wing FROM table_name_76 WHERE steal_intercept_ball = "no" | sql_create_context |
CREATE TABLE table_name_97 (
home_team VARCHAR,
road_team VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home Team has a Road Team of rochester, and a Result of 71-78?
| SELECT home_team FROM table_name_97 WHERE road_team = "rochester" AND result = "71-78" | sql_create_context |
CREATE TABLE table_10420426_1 (
podiums VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the podium for 144 points?
| SELECT podiums FROM table_10420426_1 WHERE points = 144 | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arriv... | 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, fare_basis 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_name = ... | atis |
CREATE TABLE table_43970 (
"Pilot" text,
"Date" text,
"Place" text,
"Weapon" text,
"Effect" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Place, when Weapon is '35mm/Small arms fire'?
| SELECT "Place" FROM table_43970 WHERE "Weapon" = '35mm/small arms fire' | wikisql |
CREATE TABLE table_61848 (
"Poison/Klesha" text,
"Sanskrit" text,
"Pali" text,
"Tibetan" text,
"Alternate translations" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the poison/klesha word for moha avijja in pali?
| SELECT "Poison/Klesha" FROM table_61848 WHERE "Pali" = 'moha avijja' | wikisql |
CREATE TABLE table_63391 (
"Year" real,
"Competition Description" text,
"Location" text,
"Apparatus" text,
"Rank-Final" real,
"Score-Final" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score-Final has a Rank-Final of 2, and a Year smalle... | SELECT SUM("Score-Final") FROM table_63391 WHERE "Rank-Final" = '2' AND "Year" < '2008' | wikisql |
CREATE TABLE table_name_71 (
in_service INTEGER,
vessel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest listed In service for a vessel of xavery czernicki class?
| SELECT MIN(in_service) FROM table_name_71 WHERE vessel = "xavery czernicki class" | sql_create_context |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(... | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type | nvbench |
CREATE TABLE table_22063 (
"Story No." text,
"Episode" real,
"Title" text,
"Directed by" text,
"Written by" text,
"UK viewers (million)" text,
"AI (%)" real,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "Original air date" FROM table_22063 WHERE "AI (%)" = '83' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.a... | mimic_iii |
CREATE TABLE table_name_39 (
no_5 VARCHAR,
no_6 VARCHAR,
no_2 VARCHAR,
no_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is No. 5, when No. 2 is Olivia, when No. 4 is Ava, and when No. 6 is Abigail?
| SELECT no_5 FROM table_name_39 WHERE no_2 = "olivia" AND no_4 = "ava" AND no_6 = "abigail" | sql_create_context |
CREATE TABLE table_name_47 (
b_score INTEGER,
position VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the average B Score that has the Position of 2nd, and the Total smaller than 15.525?
| SELECT AVG(b_score) FROM table_name_47 WHERE position = "2nd" AND total < 15.525 | sql_create_context |
CREATE TABLE table_name_82 (
mountains_classification VARCHAR,
general_classification VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the mountains classification of Stage 7 when Kim Kirchen was the general classification?
| SELECT mountains_classification FROM table_name_82 WHERE general_classification = "kim kirchen" AND stage = "7" | sql_create_context |
CREATE TABLE table_name_7 (
home VARCHAR,
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the game on 11 March 2008 with a visiting team of Bucks, who was the home team?
| SELECT home FROM table_name_7 WHERE visitor = "bucks" AND date = "11 march 2008" | sql_create_context |
CREATE TABLE table_name_13 (
population INTEGER,
_percentage_lds VARCHAR,
total_congregations VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Population, when % LDS is 0.54%, and when Total Congregations is greater than 2?
| SELECT MAX(population) FROM table_name_13 WHERE _percentage_lds = "0.54%" AND total_congregations > 2 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '22945235' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2001-12-09') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN... | css |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
... | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSMC = '手外科' AND mzjzjlb.JZKSRQ BETWEEN '2003-04-03' AND '2008-05-21' | css |
CREATE TABLE Employee (
EmployeeId integer,
LastName varchar(20),
FirstName varchar(20),
Title varchar(30),
ReportsTo integer,
BirthDate datetime,
HireDate datetime,
Address varchar(70),
City varchar(40),
State varchar(40),
Country varchar(40),
PostalCode varchar(10),
... | SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.AlbumId DESC | nvbench |
CREATE TABLE table_10389 (
"Round" text,
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the player from Round 2, Pick 19 from ... | SELECT "Nationality" FROM table_10389 WHERE "Round" = '2' AND "College" = 'kansas state' AND "Pick" = '19' | wikisql |
CREATE TABLE table_name_44 (
goals_against VARCHAR,
team VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals against did Clitheroe have when the loss was larger than 2?
| SELECT COUNT(goals_against) FROM table_name_44 WHERE team = "clitheroe" AND lost > 2 | sql_create_context |
CREATE TABLE table_10451 (
"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.
-- At which venue did an away team play with a scor... | SELECT "Venue" FROM table_10451 WHERE "Away team score" = '15.13 (103)' | wikisql |
CREATE TABLE table_44121 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rank of the movie from Paramount Studios that grossed $200,512,643?
| SELECT AVG("Rank") FROM table_44121 WHERE "Studio" = 'paramount' AND "Gross" = '$200,512,643' | wikisql |
CREATE TABLE table_name_5 (
surface VARCHAR,
outcome VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the surface played on when they were a runner-up in 2007?
| SELECT surface FROM table_name_5 WHERE outcome = "runner-up" AND year = 2007 | sql_create_context |
CREATE TABLE table_name_61 (
mintage INTEGER,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of all mintage created by Pierre Leduc?
| SELECT SUM(mintage) FROM table_name_61 WHERE artist = "pierre leduc" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '彭志勇' AND t_kc22.STA_DATE BETWEEN '2004-04-21' AND '2013-03-18' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_39093 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Tries against" FROM table_39093 WHERE "Try bonus" = '5' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1850" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_68118 (
"Margin" real,
"Score" text,
"Opponent" text,
"Venue" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average year for brookvale oval and margin more than 46
| SELECT AVG("Year") FROM table_68118 WHERE "Venue" = 'brookvale oval' AND "Margin" > '46' | wikisql |
CREATE TABLE table_63346 (
"House" text,
"Abbr." text,
"Type" text,
"Colour" text,
"Boarding/Day" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which house has an abbreviation of G?
| SELECT "House" FROM table_63346 WHERE "Abbr." = 'g' | wikisql |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZ... | css |
CREATE TABLE table_203_655 (
id number,
"goal" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the number of goals scored against san ... | SELECT "score" FROM table_203_655 WHERE "opponent" = 'san marino' | squall |
CREATE TABLE table_71920 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the Blue Jays lose to when their record was 36-20?
| SELECT "Loss" FROM table_71920 WHERE "Record" = '36-20' | wikisql |
CREATE TABLE table_name_77 (
years VARCHAR,
win_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the Win percentage 60%?
| SELECT years FROM table_name_77 WHERE win_percentage = "60%" | sql_create_context |
CREATE TABLE table_33974 (
"Date" text,
"Site" text,
"Sport" text,
"Winning team" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date had a site of N/A?
| SELECT "Date" FROM table_33974 WHERE "Site" = 'n/a' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC | nvbench |
CREATE TABLE table_2795 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name th... | SELECT MIN("Game") FROM table_2795 WHERE "Date" = 'March 20' | wikisql |
CREATE TABLE table_name_86 (
birthplace VARCHAR,
weight__kg_ VARCHAR,
birthdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the birthplace of the player who weighs 98 KG and was born on May 1, 1984?
| SELECT birthplace FROM table_name_86 WHERE weight__kg_ = 98 AND birthdate = "may 1, 1984" | sql_create_context |
CREATE TABLE table_13416 (
"Round" real,
"Date" text,
"Home" text,
"Result" text,
"Visitor" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has an Attendance larger than 5,804, and a Result of 6 3?
| SELECT "Date" FROM table_13416 WHERE "Attendance" > '5,804' AND "Result" = '6–3' | wikisql |
CREATE TABLE table_name_28 (
losses INTEGER,
team VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of losses for Nottingham City with fewer than 0 wins?
| SELECT MIN(losses) FROM table_name_28 WHERE team = "nottingham city" AND wins < 0 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGDH = '60691424102' | css |
CREATE TABLE table_203_603 (
id number,
"service" text,
"service id" text,
"bit rate" text,
"audio channels" text,
"description" text,
"analogue availability" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the first service after capital yor... | SELECT "service" FROM table_203_603 WHERE id = (SELECT id FROM table_203_603 WHERE "service" = 'capital yorkshire') + 1 | squall |
CREATE TABLE services (
service_name VARCHAR
)
CREATE TABLE party_services (
service_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find name of the services that has never been used.
| SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '79161122' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 2229.22) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '79161122' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CL... | css |
CREATE TABLE table_2196127_1 (
miles__km_ VARCHAR,
race_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many numbers were recorded under miles for the 3:00:46 race time?
| SELECT COUNT(miles__km_) FROM table_2196127_1 WHERE race_time = "3:00:46" | sql_create_context |
CREATE TABLE Staff_Department_Assignments (
staff_id VARCHAR,
date_assigned_to INTEGER,
job_title_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff?
| SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT MAX(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff') | sql_create_context |
CREATE TABLE table_14002 (
"City" text,
"System" text,
"Category" text,
"Daily ridership" real,
"As of" text,
"Opened" real,
"Stations" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opened has a Category of diesel light rail?
| SELECT MAX("Opened") FROM table_14002 WHERE "Category" = 'diesel light rail' | wikisql |
CREATE TABLE table_name_60 (
name VARCHAR,
rank VARCHAR,
placings VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a rank great than 3 and a placing of 64?
| SELECT name FROM table_name_60 WHERE rank > 3 AND placings = "64" | sql_create_context |
CREATE TABLE table_35764 (
"Date" text,
"Venue" text,
"Opponents" text,
"Score" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Competition of fa cup rd 1 had what venue?
| SELECT "Venue" FROM table_35764 WHERE "Competition" = 'fa cup rd 1' | wikisql |
CREATE TABLE table_61204 (
"Name" text,
"Years" text,
"Goals" real,
"Apps" real,
"Ratio" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Apps for the player with 150 Goals and a Ratio of 0.52?
| SELECT "Apps" FROM table_61204 WHERE "Ratio" = '0.52' AND "Goals" = '150' | wikisql |
CREATE TABLE table_17190 (
"Country" text,
"Population" real,
"Area (km\u00b2)" real,
"GDP (nominal)" text,
"GDP per capita (nominal)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the area (km ) for the country with a population of 1696700... | SELECT MIN("Area (km\u00b2)") FROM table_17190 WHERE "Population" = '16967000' | 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(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-168146')) AND treatment.treatmentname = 'antiviral therapy' AND STRFTIME('%y... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "34" | mimicsql_data |
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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Immunoglobulin M" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127')) AND medication.drugname = 'furosemide 10 mg/1 ml 2ml sdv inj'... | eicu |
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '白细胞异常' AND jyjgzbb.JCZBMC = '白蛋白' | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime ... | 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 |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE el... | SELECT governor FROM party GROUP BY governor ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '5705511' AND JZKSDM = '72478' AND RYDJSJ BETWEEN '2012-06-12' AND '2020-07-16' | css |
CREATE TABLE table_name_24 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the 1958 when 1957 is dnf-9
| SELECT 1958 FROM table_name_24 WHERE 1957 = "dnf-9" | sql_create_context |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC | nvbench |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Co... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC | nvbench |
CREATE TABLE table_name_23 (
election VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1st Member has an Election of 1895?
| SELECT 1 AS st_member FROM table_name_23 WHERE election = "1895" | sql_create_context |
CREATE TABLE table_45627 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Opponent in the game with a Score of 102-125?
| SELECT "Opponent" FROM table_45627 WHERE "Score" = '102-125' | wikisql |
CREATE TABLE table_26467 (
"Confederation" text,
"Teams started" text,
"Teams that have secured qualification" text,
"Teams that can still qualify" text,
"Teams that have been eliminated" text,
"Remaining places in finals" text,
"Total places in finals" text,
"Qualifying start date" text... | SELECT "Confederation" FROM table_26467 WHERE "Remaining places in finals" = '4' | wikisql |
CREATE TABLE table_name_69 (
circuit VARCHAR,
length VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what circuit is there a race that lasts 2 hours?
| SELECT circuit FROM table_name_69 WHERE length = "2 hours" | 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '20027341' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i... | css |
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.ethnicity = "WHITE - RUSSIAN" AND demographic.dob_year < "2103" | mimicsql_data |
CREATE TABLE table_43187 (
"Team" text,
"Match" text,
"Points" text,
"Draw" text,
"Lost" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the team that lost but had 10 points?
| SELECT "Lost" FROM table_43187 WHERE "Points" = '10' | wikisql |
CREATE TABLE table_name_50 (
venue VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue had the result 7-1?
| SELECT venue FROM table_name_50 WHERE result = "7-1" | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25312)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE table_70628 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Drawn" FROM table_70628 WHERE "Tries for" = '34' | wikisql |
CREATE TABLE table_name_15 (
player VARCHAR,
opponent VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What richmond player played against st kilda?
| SELECT player FROM table_name_15 WHERE opponent = "st kilda" AND team = "richmond" | sql_create_context |
CREATE TABLE table_203_252 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"place" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did paule desja... | SELECT "language" FROM table_203_252 WHERE "language" IN ('german', 'french') AND "artist" = 'paule desjardins' | squall |
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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefin... | SELECT u.Id AS "user_link", u.Reputation FROM Users AS u WHERE u.UpVotes < u.DownVotes ORDER BY u.Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_name_67 (
points INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the Points in the game with a Score of 2 7?
| SELECT SUM(points) FROM table_name_67 WHERE score = "2–7" | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ tim... | SELECT mzjzjlb.KH, mzjzjlb.KLX FROM mzjzjlb WHERE mzjzjlb.JZLSH = '58982567842' | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA" AND demographic.dod_year <= "2155.0" | mimicsql_data |
CREATE TABLE college (
college_id text,
name_full text,
city text,
state text,
country text
)
CREATE TABLE player_college (
player_id text,
college_id text,
year number
)
CREATE TABLE home_game (
year number,
league_id text,
team_id text,
park_id text,
span_first te... | SELECT birth_country FROM player GROUP BY birth_country ORDER BY COUNT(*) LIMIT 3 | spider |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'G21.554' AND jyjgzbb.JCZBDM = '602455' UNION SELECT jyjgzbb.CKZF... | css |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Users (
Id number,
Reputation number,... | SELECT COUNT(PostId) AS "count", UserId AS "user_link" FROM PostHistory WHERE UserId != -1 AND PostHistoryTypeId = 6 AND Text LIKE '%status-%' GROUP BY UserId ORDER BY COUNT(PostId) DESC | sede |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-57924')) AND treatment.treatmentname = 'antiarrhythmics - class iii anti... | eicu |
CREATE TABLE table_33632 (
"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 at the game at Punt Road O... | SELECT "Away team" FROM table_33632 WHERE "Crowd" > '13,000' AND "Venue" = 'punt road oval' | wikisql |
CREATE TABLE table_name_70 (
total VARCHAR,
silver VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Total when the Silver is less than 2, and a Bronze is less than 0?
| SELECT COUNT(total) FROM table_name_70 WHERE silver < 2 AND bronze < 0 | sql_create_context |
CREATE TABLE table_17403 (
"Vendor and type" text,
"Models" text,
"NetFlow Version" text,
"Implementation" text,
"Comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the comments when the vendor and type is alcatel-lucent routers?
| SELECT "Comments" FROM table_17403 WHERE "Vendor and type" = 'Alcatel-Lucent routers' | wikisql |
CREATE TABLE table_67807 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Score that has the Opponent of brewers, and the Attendance of 11,2... | SELECT "Score" FROM table_67807 WHERE "Opponent" = 'brewers' AND "Attendance" = '11,235' | wikisql |
CREATE TABLE table_62341 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Total, when Silver is less than 65, when Bronze is greater than 4, and when Rank is ... | SELECT "Total" FROM table_62341 WHERE "Silver" < '65' AND "Bronze" > '4' AND "Rank" = '4' | wikisql |
CREATE TABLE table_204_899 (
id number,
"event" text,
"date" text,
"area" text,
"tornadoes" number,
"casualties" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which tornado event occurred after the late may 1965 tornado outbre... | SELECT "event" FROM table_204_899 WHERE id = (SELECT id FROM table_204_899 WHERE "event" = 'late-may 1965 tornado outbreak') + 1 | squall |
CREATE TABLE table_31207 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How ma... | SELECT COUNT("High points") FROM table_31207 WHERE "Team" = 'UMass' | wikisql |
CREATE TABLE table_204_248 (
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.
-- which nation won the most gold medals ?
| SELECT "nation" FROM table_204_248 ORDER BY "gold" DESC LIMIT 1 | squall |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId n... | SELECT Id AS "post_link", Score, ViewCount FROM (SELECT ROW_NUMBER() OVER (ORDER BY a.CreationDate) AS "rownumber", * FROM Posts AS a, PostTags AS b WHERE a.Id = b.PostId AND b.TagId = 4452) AS abSorted WHERE rownumber > 100000 ORDER BY Score DESC LIMIT 100 | sede |
CREATE TABLE table_37569 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Wins have a Year of 1963, and a Class of 50cc?
| SELECT AVG("Wins") FROM table_37569 WHERE "Year" = '1963' AND "Class" = '50cc' | wikisql |
CREATE TABLE table_16125 (
"No." real,
"#" real,
"Title" text,
"Director" text,
"Writer" text,
"US air date" text,
"Storyteller" text,
"Villains" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many have the number 8
| SELECT COUNT("No.") FROM table_16125 WHERE "#" = '8' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,... | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department <> 'CMPLXSYS' AND program_course.course_id = course.course_id AND program.program_id = program_course.program_id | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.