instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please give me a bar chart ... | SELECT job, COUNT(job) FROM Person GROUP BY job ORDER BY name | nvbench |
CREATE TABLE table_name_31 (
top_scorer VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the top scorer in the 1890-91 season?
| SELECT top_scorer FROM table_name_31 WHERE season = "1890-91" | sql_create_context |
CREATE TABLE table_train_56 (
"id" int,
"organ_transplantation" bool,
"severe_sepsis" bool,
"immune_suppression" bool,
"autoimmune_disease" bool,
"hematopoietic" bool,
"chronic_infectious" bool,
"steroid_therapy" bool,
"sepsis" bool,
"systemic_inflammatory_response" bool,
"or... | SELECT * FROM table_train_56 WHERE (sepsis = 1 AND organ_failure = 1) OR severe_sepsis = 1 OR septic_shock = 1 | criteria2sql |
CREATE TABLE table_19722233_5 (
blocks INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest number of blocks
| SELECT MIN(blocks) FROM table_19722233_5 | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTME... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_77039 (
"Year" text,
"Total matches" real,
"Total W-L-H" text,
"Points won" real,
"Points %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the lowest Points won that has the Total matches of 4, and the Total W-L-H... | SELECT MIN("Points won") FROM table_77039 WHERE "Total matches" = '4' AND "Total W-L-H" = '4-0-0' | wikisql |
CREATE TABLE table_27940569_1 (
make VARCHAR,
sponsor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What car make was sponsored by Aflac?
| SELECT make FROM table_27940569_1 WHERE sponsor = "Aflac" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '38500405339' AND SOC_SRT_DIRE_CD = '234944950-z' | css |
CREATE TABLE Invoices (
Invoice_ID INTEGER,
Order_ID INTEGER,
payment_method_code CHAR(15),
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255),
Order_Item_ID INTEGER
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_I... | SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY City_Town DESC | nvbench |
CREATE TABLE table_34167 (
"Team" text,
"City, Region" text,
"Arena" text,
"Colours" text,
"Head coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the colours of the team with benedikt gu mundsson as head coach?
| SELECT "Colours" FROM table_34167 WHERE "Head coach" = 'benedikt guðmundsson' | wikisql |
CREATE TABLE table_15001957_1 (
mixed_doubles VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many mixed doubles were won in 1996?
| SELECT COUNT(mixed_doubles) FROM table_15001957_1 WHERE year = 1996 | sql_create_context |
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata t... | SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2 | spider |
CREATE TABLE table_69689 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Pick # smaller than 46, and a Round of 5, and a Position of defensive tackle involves ... | SELECT "College" FROM table_69689 WHERE "Pick #" < '46' AND "Round" = '5' AND "Position" = 'defensive tackle' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Contusion of face, scalp, and neck except eye(s)" | mimicsql_data |
CREATE TABLE table_1527 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the poin... | SELECT "Points for" FROM table_1527 WHERE "Points" = '6' | wikisql |
CREATE TABLE table_39177 (
"Team" text,
"Copa Libertadores 1999" text,
"Copa Mercosur 1999" text,
"Copa CONMEBOL 1999" text,
"Intercontinental Cup 1999" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Copa Conmebol 1999 result of team cru... | SELECT "Copa CONMEBOL 1999" FROM table_39177 WHERE "Copa Libertadores 1999" = 'did not qualify' AND "Team" = 'cruzeiro' | wikisql |
CREATE TABLE table_46539 (
"Name" text,
"Country" text,
"Loan Club" text,
"Started" text,
"Ended" text,
"Start Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the loan club named dennehy?
| SELECT "Loan Club" FROM table_46539 WHERE "Name" = 'dennehy' | wikisql |
CREATE TABLE table_7213 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which amount of lost had an against of more than... | SELECT "Lost" FROM table_7213 WHERE "Against" > '22' AND "Points" = '9' | wikisql |
CREATE TABLE table_25505246_7 (
result VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the results when Hanne Skak Jensen faced Andreja Klepa as opponent?
| SELECT result FROM table_25505246_7 WHERE opponent = "Andreja Klepač" | 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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "30" AND prescriptions.drug = "HYDROmorphone (Dilaudid)" | mimicsql_data |
CREATE TABLE table_32411 (
"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 team was the away ream when they scored 13.... | SELECT "Away team" FROM table_32411 WHERE "Away team score" = '13.12 (90)' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '褚雨伯' AND t_kc22.STA_DATE BETWEEN '2010-11-02' AND '2016-08-24' AND t_kc22.SOC_SRT_DIRE_CD = '477789-7' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgw... | css |
CREATE TABLE table_name_51 (
chassis VARCHAR,
points VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 1961, what was the Chassis when the points were lower than 6?
| SELECT chassis FROM table_name_51 WHERE points < 6 AND year = 1961 | sql_create_context |
CREATE TABLE table_name_88 (
home_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has home game with tie of 4?
| SELECT home_team FROM table_name_88 WHERE tie_no = "4" | sql_create_context |
CREATE TABLE table_15254 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year team tyrrell earned more than 14 points?
| SELECT MAX("Year") FROM table_15254 WHERE "Entrant" = 'team tyrrell' AND "Points" > '14' | wikisql |
CREATE TABLE table_49180 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of points for a position over 5 with more than 2 draws?
| SELECT SUM("Points") FROM table_49180 WHERE "Drawn" > '2' AND "Position" > '5' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Height, Weight FROM people | nvbench |
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 * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '杨凌霜' AND hz_info.YLJGDM = '7646173' AND wdmzjzjlb.JZKSMC LIKE '%骨肿瘤%' UNION SELECT * FROM person_info JOIN ... | css |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
... | SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY name DESC | nvbench |
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.discharge_location = "HOME" AND demographic.admityear < "2127" | mimicsql_data |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_69788 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the roll with an area of Waikaka?
| SELECT SUM("Roll") FROM table_69788 WHERE "Area" = 'waikaka' | wikisql |
CREATE TABLE table_name_66 (
draws INTEGER,
byes VARCHAR,
ballarat_fl VARCHAR,
losses VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest draws that have losses greater than 0, an against less than 1728, melton as t... | SELECT MIN(draws) FROM table_name_66 WHERE losses > 0 AND against < 1728 AND ballarat_fl = "melton" AND byes < 2 | sql_create_context |
CREATE TABLE table_name_97 (
silver INTEGER,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Silver with a Total that is smaller than 1?
| SELECT AVG(silver) FROM table_name_97 WHERE total < 1 | sql_create_context |
CREATE TABLE table_name_56 (
home VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played the home team during the game on January 6?
| SELECT home FROM table_name_56 WHERE date = "january 6" | sql_create_context |
CREATE TABLE table_29764 (
"Stadium" text,
"City" text,
"Capacity" real,
"Matches played" real,
"Overall attendance" real,
"Average attendance per match" real,
"Average attendance as % of Capacity" text,
"Overall goals scored" real,
"Average goals scored per match" text,
"Elevati... | SELECT "Elevation" FROM table_29764 WHERE "City" = 'Port Elizabeth' | wikisql |
CREATE TABLE table_56223 (
"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 was the away score for Carlton?
| SELECT "Away team score" FROM table_56223 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE table_name_41 (
apps VARCHAR,
country VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many apps does Uzbekistan have in 2003?
| SELECT apps FROM table_name_41 WHERE country = "uzbekistan" AND season = "2003" | sql_create_context |
CREATE TABLE table_79194 (
"Rank" text,
"Capacity" real,
"City" text,
"State" text,
"Year opened" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest capacity for 1903?
| SELECT MIN("Capacity") FROM table_79194 WHERE "Year opened" = '1903' | 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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" | mimicsql_data |
CREATE TABLE table_name_2 (
gold VARCHAR,
bronze VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of gold for bronze more than 0 and total more than 100
| SELECT COUNT(gold) FROM table_name_2 WHERE bronze > 0 AND rank = "total" AND "total" > 100 | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29741) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-22 month') ORDER BY labevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_39 (
gauge VARCHAR,
locomotive VARCHAR,
status VARCHAR,
owner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Gauge of Locomotive G534 Owned by Aurizon which has a Status of Operational?
| SELECT gauge FROM table_name_39 WHERE status = "operational" AND owner = "aurizon" AND locomotive = "g534" | sql_create_context |
CREATE TABLE table_204_338 (
id number,
"location" text,
"coordinates" text,
"type" text,
"built" text,
"details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year built is at the top ?
| SELECT "built" FROM table_204_338 WHERE id = 1 | squall |
CREATE TABLE table_name_37 (
number VARCHAR,
year VARCHAR,
bb_ VARCHAR,
hbp VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The year of 1985 which has a BB +HBP of 39 has what Number listed?
| SELECT number FROM table_name_37 WHERE bb_ + hbp = 39 AND year = "1985" | sql_create_context |
CREATE TABLE table_name_67 (
lane VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which lane did the swimmer with a time of 1:58.44 swim?
| SELECT COUNT(lane) FROM table_name_67 WHERE time = "1:58.44" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'parenteral feeds - tpn' AND STRFTIME('%y', treatment.treatmenttime) <= '2104' | eicu |
CREATE TABLE table_29583818_3 (
couple VARCHAR,
total_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the total points 128.0?
| SELECT COUNT(couple) FROM table_29583818_3 WHERE total_points = "128.0" | sql_create_context |
CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
)
CREATE TABLE roller_coaster (
Roller_Coaster_ID int,
Name text,
Park text,
Country_ID int,
Length real,
Height real,
Speed text,
Opened text,
Status text
)
-- Using val... | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name ORDER BY AVG(T2.Speed) | nvbench |
CREATE TABLE table_name_15 (
military_deaths VARCHAR,
military_and_or_civilian_wounded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many military deaths were there when there were 1,200+ military and/or civilian wounded?
| SELECT military_deaths FROM table_name_15 WHERE military_and_or_civilian_wounded = "1,200+" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiology... | mimic_iii |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Acquired coagulation factor deficiency" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57169 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.labe... | mimic_iii |
CREATE TABLE table_name_34 (
avg VARCHAR,
yards VARCHAR,
car VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the amount of Avg that has Yards more 265 and a Car more 105?
| SELECT COUNT(avg) FROM table_name_34 WHERE yards > 265 AND car > 105 | sql_create_context |
CREATE TABLE table_69727 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the loss for the angels opponent
| SELECT "Loss" FROM table_69727 WHERE "Opponent" = 'angels' | wikisql |
CREATE TABLE table_12948 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in the mallorca 2, spain tournament?
| SELECT "Opponent" FROM table_12948 WHERE "Tournament" = 'mallorca 2, spain' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_204_876 (
id number,
"ecclesiastical jurisdictions" text,
"latin name" text,
"type" text,
"rite" text,
"ecclesiastical province" text,
"established" text,
"area (km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- h... | SELECT COUNT("ecclesiastical jurisdictions") FROM table_204_876 WHERE "type" = 'metropolitan archdiocese' | squall |
CREATE TABLE table_19250 (
"Year" real,
"Boys singles" text,
"Girls singles" text,
"Boys doubles" text,
"Girls doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When mixed doubles is danny bawa chrisnanta debby susant... | SELECT "Boys singles" FROM table_19250 WHERE "Mixed doubles" = 'Danny Bawa Chrisnanta Debby Susanto' | wikisql |
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 * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '33309508' AND jyjgzbb.jybgb_BBCJBW = '颅部' UNION SELECT * FR... | css |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Total Protein, CSF" | mimicsql_data |
CREATE TABLE table_9767 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game played after week 15?
| SELECT "Date" FROM table_9767 WHERE "Week" > '15' | wikisql |
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 PostFeedback (
Id number,
PostId numb... | WITH lastrev_cte AS (SELECT MAX(Id) AS last FROM PostHistory GROUP BY PostId), lastcw_cte AS (SELECT ph.PostId AS pid FROM PostHistory AS ph INNER JOIN lastrev_cte AS l ON ph.Id = l.last WHERE (ph.PostHistoryTypeId = 16)) SELECT l.pid AS "post_link", revisions = 'site://posts/' + CAST(l.pid AS TEXT) + '/revisions', COU... | sede |
CREATE TABLE table_34687 (
"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 nationality has a higher round than 8?
| SELECT "Nationality" FROM table_34687 WHERE "Round" > '8' | wikisql |
CREATE TABLE table_name_68 (
goal_ratio INTEGER,
league VARCHAR,
fa_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Highest Goal Ratio with a League of 88 and an FA Cup less than 7?
| SELECT MAX(goal_ratio) FROM table_name_68 WHERE league = 88 AND fa_cup < 7 | sql_create_context |
CREATE TABLE table_name_4 (
series VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which series was on May 16?
| SELECT series FROM table_name_4 WHERE date = "may 16" | sql_create_context |
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 CYZTDM FROM zyjzjlb WHERE JZLSH = '52037061275' | css |
CREATE TABLE table_name_17 (
premiers VARCHAR,
details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which premier team played the 1951 NSWRFL Grand Final?
| SELECT premiers FROM table_name_17 WHERE details = "1951 nswrfl grand final" | sql_create_context |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_65 (
location VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest 1st prize for florida tournaments and a Score of 200 (-16)?
| SELECT MIN(1 AS st_prize__) AS $__ FROM table_name_65 WHERE location = "florida" AND score = "200 (-16)" | sql_create_context |
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 varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_46311 (
"from" text,
"aircraft" text,
"carrier" text,
"air wing" text,
"tail code" text,
"area" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which carrier was deployed on 18 July 1968?
| SELECT "carrier" FROM table_46311 WHERE "from" = '18 july 1968' | wikisql |
CREATE TABLE table_name_53 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Date of september 28, 1951?
| SELECT opponent FROM table_name_53 WHERE date = "september 28, 1951" | sql_create_context |
CREATE TABLE table_name_32 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2009 value with A in 2012 and q2 in 2011?
| SELECT 2009 FROM table_name_32 WHERE 2012 = "a" AND 2011 = "q2" | sql_create_context |
CREATE TABLE table_23801721_1 (
market_share VARCHAR,
technology VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the market share of the operator whose technology is CDMA EVDO GSM EDGE HSPA+?
| SELECT market_share FROM table_23801721_1 WHERE technology = "CDMA EVDO GSM EDGE HSPA+" | sql_create_context |
CREATE TABLE table_name_74 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date, when the Opponent is Gisela Dulko?
| SELECT date FROM table_name_74 WHERE opponent = "gisela dulko" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '姜璇子' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '阿立哌唑口腔崩解片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '姜璇子' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC... | css |
CREATE TABLE table_name_39 (
rank INTEGER,
gold VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank for a nation with 26 golds and over 17 silvers?
| SELECT MAX(rank) FROM table_name_39 WHERE gold = 26 AND silver > 17 | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABL... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AND d... | atis |
CREATE TABLE invoice_lines (
id INTEGER,
invoice_id INTEGER,
track_id INTEGER,
unit_price NUMERIC(10,2),
quantity INTEGER
)
CREATE TABLE playlist_tracks (
playlist_id INTEGER,
track_id INTEGER
)
CREATE TABLE media_types (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE employees (
... | SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5 | nvbench |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Injury to femoral nerve" AND lab.flag = "delta" | mimicsql_data |
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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.admityear < "2144" | mimicsql_data |
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 jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 person_info_hz_info.KH = hz_info.KH AND pe... | css |
CREATE TABLE table_14257 (
"Model number" text,
"sSpec number" text,
"Cores" real,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | SELECT "Release date" FROM table_14257 WHERE "sSpec number" = 'sr15h(c0)' | wikisql |
CREATE TABLE table_42359 (
"Year" real,
"Category" text,
"Champions" text,
"Runners-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Category after 1991 with a Score of 7-5, 6-7, 6-2?
| SELECT "Category" FROM table_42359 WHERE "Year" > '1991' AND "Score" = '7-5, 6-7, 6-2' | wikisql |
CREATE TABLE table_2201724_1 (
year VARCHAR,
score_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the total number of years that have a score of 3 6, 4 6, 2 6.
| SELECT COUNT(year) FROM table_2201724_1 WHERE score_in_the_final = "3–6, 4–6, 2–6" | sql_create_context |
CREATE TABLE table_14916 (
"Season" text,
"Series" text,
"Races" text,
"Wins" text,
"Podiums" text,
"Points" text,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has 0 Podiums, 1 Race, and 0 Points?
| SELECT "Season" FROM table_14916 WHERE "Podiums" = '0' AND "Races" = '1' AND "Points" = '0' | wikisql |
CREATE TABLE table_16075179_6 (
date_of_appointment VARCHAR,
outgoing_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the date of appointment for the manager replacing Wim Jansen?
| SELECT date_of_appointment FROM table_16075179_6 WHERE outgoing_manager = "Wim Jansen" | sql_create_context |
CREATE TABLE table_1134091_4 (
date_successor_seated VARCHAR,
vacator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the date successor seated when the vacator was charles e. chamberlain (r)?
| SELECT date_successor_seated FROM table_1134091_4 WHERE vacator = "Charles E. Chamberlain (R)" | sql_create_context |
CREATE TABLE table_74840 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Format has a Date of may 24, 2008?
| SELECT "Format" FROM table_74840 WHERE "Date" = 'may 24, 2008' | wikisql |
CREATE TABLE table_78061 (
"Track" real,
"Recorded" text,
"Catalogue" text,
"Release Date" text,
"Song Title" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the time for 6/6/77 release date and song title of way down
| SELECT "Time" FROM table_78061 WHERE "Release Date" = '6/6/77' AND "Song Title" = 'way down' | wikisql |
CREATE TABLE table_name_53 (
silver VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won Silver in 2000?
| SELECT silver FROM table_name_53 WHERE year = 2000 | sql_create_context |
CREATE TABLE table_203_214 (
id number,
"member" text,
"party" text,
"electorate" text,
"state" text,
"first elected" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did tom burke run as country or alp party ?
| SELECT "party" FROM table_203_214 WHERE "member" = 'tom burke' | squall |
CREATE TABLE table_name_65 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Scott Verplank's score?
| SELECT score FROM table_name_65 WHERE player = "scott verplank" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT demographic.admission_location FROM demographic WHERE demographic.name = "Edward Schafer" | mimicsql_data |
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ... | css |
CREATE TABLE procedures (
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 prescriptions.route FROM prescriptions WHERE prescriptions.drug = "D5LR" | mimicsql_data |
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,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZX... | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '水锐逸' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-09-03' AND '2020-09-18' AND wdmzjzjlb.YLJGDM = '2777621' UNI... | css |
CREATE TABLE table_name_76 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue has a Away team of hawthorn?
| SELECT venue FROM table_name_76 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.