instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_13550 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is th... | SELECT "Outgoing manager" FROM table_13550 WHERE "Manner of departure" = 'contract terminated' AND "Date of vacancy" = '1 september 2008' | wikisql |
CREATE TABLE table_28155 (
"Graphics" text,
"Launch" real,
"Market" text,
"CPU" text,
"Code name" text,
"Device ID" real,
"Core clock ( MHz )" text,
"Execution units" real,
"Shader model" text,
"DirectX" text,
"OpenGL" text,
"OpenCL" text,
"Memory bandwidth ( GB/s )" ... | SELECT "CVT HD" FROM table_28155 WHERE "Market" = 'Mobile' | wikisql |
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.admission_type = "ELECTIVE" AND demographic.admityear < "2197" | mimicsql_data |
CREATE TABLE table_73053 (
"Name" text,
"Nickname" text,
"First season" text,
"Location" text,
"Home ground(s)" text,
"Coach" text,
"Captain" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the dates where Hillcrest Reserve is the hom... | SELECT "First season" FROM table_73053 WHERE "Home ground(s)" = 'Hillcrest Reserve' | wikisql |
CREATE TABLE table_45717 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Attendance has a Result of w 23-21, and a Week smaller than 5?
| SELECT AVG("Attendance") FROM table_45717 WHERE "Result" = 'w 23-21' AND "Week" < '5' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "T5 FRACTURE" AND procedures.icd9_code = "3612" | mimicsql_data |
CREATE TABLE table_39768 (
"Time" text,
"12:00 PM" text,
"01:00 PM" text,
"02:00 PM" text,
"03:00 PM" text,
"04:00 PM" text,
"05:00 PM" text,
"05:55 PM" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who preforms at 2:00PM on Monday?
| SELECT "02:00 PM" FROM table_39768 WHERE "Time" = 'monday' | wikisql |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Co... | SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code | nvbench |
CREATE TABLE table_75780 (
"Capital/Region" text,
"1997" real,
"1998" real,
"1999" real,
"2000" real,
"2001" real,
"2002" real,
"2003" real,
"2004" real,
"2005" real,
"2006" real,
"2007" real
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT SUM("2007") FROM table_75780 WHERE "2000" > '56,6' AND "2006" = '23,2' AND "1998" > '61,1' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer | nvbench |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TA... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1... | atis |
CREATE TABLE table_72915 (
"State" text,
"Preliminary" text,
"Interview" text,
"Swimsuit" text,
"Evening Gown" text,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the swuinsuit for oregon
| SELECT "Swimsuit" FROM table_72915 WHERE "State" = 'Oregon' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime t... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND icustays.outtime IS NULL) ... | mimic_iii |
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'clindamycin') AS t1 JOIN (SELECT patient.uniquepid,... | eicu |
CREATE TABLE table_68334 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date which has type of plain stage
| SELECT "Date" FROM table_68334 WHERE "Type" = 'plain stage' | wikisql |
CREATE TABLE table_dev_58 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"intra_aortic_balloon_pump_iabp" bool,
"systemic_arterial_po2" int,
"creatinine_clearance_cl" float,
"supplemental_oxygen" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the foll... | SELECT * FROM table_dev_58 WHERE creatinine_clearance_cl < 60 | criteria2sql |
CREATE TABLE table_80109 (
"Hits" real,
"Player" text,
"Team" text,
"Year" real,
"Years Record Stood" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player with 238 hits and years after 1885
| SELECT "Player" FROM table_80109 WHERE "Year" > '1885' AND "Hits" = '238' | wikisql |
CREATE TABLE table_18026 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance at the game that resulted in w 24-20?
| SELECT "Attendance" FROM table_18026 WHERE "Result" = 'W 24-20' | wikisql |
CREATE TABLE table_name_4 (
draw INTEGER,
points VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number for draw when the points are less than 17, and the lost is 13?
| SELECT MIN(draw) FROM table_name_4 WHERE points < 17 AND lost = 13 | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'sputum, expectorated' ORDER BY microla... | eicu |
CREATE TABLE table_name_46 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Loss when the Record was 50-54?
| SELECT loss FROM table_name_46 WHERE record = "50-54" | sql_create_context |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id | advising |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | 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 = '022-44805')) AND medication.drugname IN ('1000 ml flex cont: sodium chlori... | eicu |
CREATE TABLE table_204_320 (
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 country has the most gold medals ?
| SELECT "nation" FROM table_204_320 ORDER BY "gold" DESC LIMIT 1 | squall |
CREATE TABLE table_6318 (
"Competition" text,
"Played" real,
"Blackpool" real,
"Draw" real,
"Preston North End" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Played is the lowest one that has a Blackpool smaller than 0?
| SELECT MIN("Played") FROM table_6318 WHERE "Blackpool" < '0' | wikisql |
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst text,
packst t... | SELECT distst FROM sampledata15 WHERE commod = "AP" GROUP BY distst ORDER BY COUNT(*) DESC LIMIT 1 | pesticide |
CREATE TABLE table_name_68 (
nationality VARCHAR,
nhl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the Washington Capitals?
| SELECT nationality FROM table_name_68 WHERE nhl_team = "washington capitals" | sql_create_context |
CREATE TABLE table_name_45 (
assists INTEGER,
games INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Assists for the Player with more than 25 Games?
| SELECT SUM(assists) FROM table_name_45 WHERE games > 25 | sql_create_context |
CREATE TABLE table_204_913 (
id number,
"#" 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 is the top listed venue in the table ?
| SELECT "venue" FROM table_204_913 WHERE id = 1 | squall |
CREATE TABLE table_3524 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What song was used resulting in the bottom 3?
| SELECT "Song choice" FROM table_3524 WHERE "Result" = 'Bottom 3' | wikisql |
CREATE TABLE table_name_51 (
votes VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many votes were cast when the notes reported lost to incumbent vic gilliam?
| SELECT votes FROM table_name_51 WHERE notes = "lost to incumbent vic gilliam" | 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue | nvbench |
CREATE TABLE table_14650162_1 (
college VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did the defensive back attend?
| SELECT college FROM table_14650162_1 WHERE position = "Defensive Back" | sql_create_context |
CREATE TABLE table_name_92 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did woking compete?
| SELECT date FROM table_name_92 WHERE opponent = "woking" | sql_create_context |
CREATE TABLE table_12500 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country of the Player with a To par of +1 and a Score of 74-70-70=214?
| SELECT "Country" FROM table_12500 WHERE "To par" = '+1' AND "Score" = '74-70-70=214' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苗星河' AND t_kc22.STA_DATE BETWEEN '2000-07-11' AND '2017-06-02' AND t_kc21.MED_SER_ORG_NO = '0680435' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
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 Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_65325 (
"Year" real,
"Artist" text,
"Song" text,
"UK Chart" text,
"At Eurovision" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did Scott Fitzgerald rank on the UK charts?
| SELECT "UK Chart" FROM table_65325 WHERE "Artist" = 'scott fitzgerald' | wikisql |
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 (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND procedures.long_title = "Radical cystectomy" | mimicsql_data |
CREATE TABLE table_name_38 (
draws VARCHAR,
losses VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many draws occured with a record of 10 losses, and 6 wins?
| SELECT COUNT(draws) FROM table_name_38 WHERE losses = 10 AND wins > 6 | sql_create_context |
CREATE TABLE table_60275 (
"Model" text,
"Year" text,
"Type" text,
"Engine" text,
"Displacement cc" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of car has the model 6cm?
| SELECT "Type" FROM table_60275 WHERE "Model" = '6cm' | wikisql |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE playe... | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class | nvbench |
CREATE TABLE table_10798928_1 (
director VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed Dulcinea?
| SELECT director FROM table_10798928_1 WHERE original_title = "Dulcinea" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'non-invasive mech vent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85131 AND NO... | mimic_iii |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY Class DESC | nvbench |
CREATE TABLE table_name_90 (
rank__number VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank were the Buckeyes when there were 68,586 in attendance?
| SELECT rank__number FROM table_name_90 WHERE attendance = "68,586" | sql_create_context |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEX... | SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) | nvbench |
CREATE TABLE table_38365 (
"State" text,
"Revenue (millions)" text,
"Population" real,
"Revenue per capita" text,
"Spending (millions)" text,
"Spending per capita" text,
"Net contribution per capita" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Revenue (millions)" FROM table_38365 WHERE "Population" > '1,499,402' AND "Spending (millions)" = '$13,986' | 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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE < 10) | 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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "2078" | mimicsql_data |
CREATE TABLE table_name_74 (
year VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years have a Record of 73-65?
| SELECT COUNT(year) FROM table_name_74 WHERE record = "73-65" | sql_create_context |
CREATE TABLE table_name_14 (
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which visitor visited on February 21?
| SELECT visitor FROM table_name_14 WHERE date = "february 21" | sql_create_context |
CREATE TABLE table_55036 (
"Outcome" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which surface has an Opponent of fernando verdasco?
| SELECT "Surface" FROM table_55036 WHERE "Opponent" = 'fernando verdasco' | wikisql |
CREATE TABLE table_30303 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the mens doubles when wang hao won the mens singles?
| SELECT "Mens Doubles" FROM table_30303 WHERE "Mens Singles" = 'Wang Hao' | wikisql |
CREATE TABLE table_41692 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2nd leg has pamesa valencia for team #2?
| SELECT "2nd leg" FROM table_41692 WHERE "Team #2" = 'pamesa valencia' | wikisql |
CREATE TABLE table_13501 (
"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 the average gold when rank is total and silver is more than 20?
| SELECT AVG("Gold") FROM table_13501 WHERE "Rank" = 'total' AND "Silver" > '20' | wikisql |
CREATE TABLE table_56113 (
"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.
-- Which home team scored 12.11 (83)?
| SELECT "Home team" FROM table_56113 WHERE "Home team score" = '12.11 (83)' | wikisql |
CREATE TABLE table_204_214 (
id number,
"pos" text,
"no." number,
"rider" text,
"manufacturer" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which rider came in fir... | SELECT "rider" FROM table_204_214 WHERE "points" = 25 | squall |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT JLSJ FROM mzjzjlb WHERE JZLSH = '32713764439' | css |
CREATE TABLE table_name_32 (
attendance INTEGER,
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance for the game against the Kansas City Chiefs earlier than week 13?
| SELECT AVG(attendance) FROM table_name_32 WHERE opponent = "kansas city chiefs" AND week < 13 | sql_create_context |
CREATE TABLE table_name_95 (
place VARCHAR,
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a To par of 5, what is Nick Faldo's Place?
| SELECT place FROM table_name_95 WHERE to_par = "–5" AND player = "nick faldo" | sql_create_context |
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built tex... | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE table_43140 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game with the Broadview Hawks as the home team?
| SELECT "Score" FROM table_43140 WHERE "Home" = 'broadview hawks' | wikisql |
CREATE TABLE table_204_928 (
id number,
"year" number,
"album" text,
"territory" text,
"label" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total albums did this group have under capitol records ?
| SELECT COUNT("album") FROM table_204_928 WHERE "label" = 'capitol records' | squall |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.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 = admissi... | mimic_iii |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "RASH" AND prescriptions.route = "IV" | mimicsql_data |
CREATE TABLE table_71400 (
"Date" text,
"Tournament" text,
"Surface" text,
"Tier" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has opponents, Akgul Amanmuradova Nina B... | SELECT "Date" FROM table_71400 WHERE "Opponents in the final" = 'akgul amanmuradova nina bratchikova' | wikisql |
CREATE TABLE table_34593 (
"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.
-- What is the largest played number when the diff... | SELECT MAX("Played") FROM table_34593 WHERE "Difference" = '- 8' AND "Position" > '8' | wikisql |
CREATE TABLE table_203_163 (
id number,
"year" number,
"total" number,
"serbs" text,
"hungarians" text,
"germans" text,
"romanians" text,
"slovaks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the first year that the romanian ... | SELECT MIN("year") FROM table_203_163 WHERE "romanians" < 51000 | squall |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT SUM(t_kc24.MED_AMOUT) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7756841' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-06-17' AND '2018-12-02' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO... | css |
CREATE TABLE table_name_72 (
power__kw_ VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Power (kW) for the station with a frequency of 95.1mhz?
| SELECT power__kw_ FROM table_name_72 WHERE frequency = "95.1mhz" | sql_create_context |
CREATE TABLE table_69060 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" text,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of Frequency MHz with a Class of b1?
| SELECT SUM("Frequency MHz") FROM table_69060 WHERE "Class" = 'b1' | wikisql |
CREATE TABLE table_50221 (
"Date" text,
"Opponent#" text,
"Rank #" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when the result was w24-7?
| SELECT "Opponent#" FROM table_50221 WHERE "Result" = 'w24-7' | wikisql |
CREATE TABLE table_64829 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many bronzes have west germany as the nation?
| SELECT SUM("Bronze") FROM table_64829 WHERE "Nation" = 'west germany' | wikisql |
CREATE TABLE table_20374 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the cont... | SELECT "Content" FROM table_20374 WHERE "Package/Option" = 'Sky Famiglia' AND "Language" = 'Italian' AND "DAR" = '16:9' AND "Television service" = 'MTV Hits' | wikisql |
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE authors (
authid number,
lname text,
fname text
)
-... | SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume" | spider |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEX... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) | nvbench |
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 procedures_icd (
r... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582 AND admissions.dischtime IS NULL)) AND transfers... | mimic_iii |
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
opening_year number
)
CREATE TABLE swimmer (
id number,
name text,
nationality text,
meter_100 number,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter... | SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006 | spider |
CREATE TABLE table_name_83 (
scored VARCHAR,
points VARCHAR,
draws VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points are in the scored category for the team that has less than 5 draws, 8 total wins, and total overall points... | SELECT COUNT(scored) FROM table_name_83 WHERE draws < 5 AND wins = 8 AND points < 27 | sql_create_context |
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 Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Games | nvbench |
CREATE TABLE table_41533 (
"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.
-- What is the average number played of the team w... | SELECT AVG("Played") FROM table_41533 WHERE "Drawn" = '1' AND "Against" = '24' | wikisql |
CREATE TABLE table_64076 (
"School" text,
"Location" text,
"Mascot" text,
"County" text,
"Year Joined" text,
"Previous Conference" text,
"Year Left" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the mascot when the school is warsaw?... | SELECT "Mascot" FROM table_64076 WHERE "School" = 'warsaw' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12885)) AND DATETIME(outputevents.charttim... | mimic_iii |
CREATE TABLE table_26580 (
"Processor" text,
"Brand name" text,
"Model (list)" text,
"Cores" real,
"L2 Cache" text,
"Socket" text,
"TDP" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the model of the processor with a 5.5 w TDP?
| SELECT "Model (list)" FROM table_26580 WHERE "TDP" = '5.5 W' | wikisql |
CREATE TABLE table_19818 (
"Ido" text,
"English" text,
"Italian" text,
"French" text,
"German" text,
"Russian" text,
"Spanish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the french word for the Russian word filtrovat ( )?
| SELECT "French" FROM table_19818 WHERE "Russian" = 'filtrovat (фильтровать)' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | SELECT TagName, COUNT(TagName) AS TagsPerAge, Age FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE TagName = 'php' AND age > 0 GROUP BY Age, TagName ORDER BY TagsPerAge DESC | sede |
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 (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.dod_year <= "2183.0" | mimicsql_data |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
... | SELECT OwnerUserId AS "user_link", Id AS "post_link" FROM Posts WHERE ParentId IN (SELECT Id FROM Posts WHERE Tags LIKE '%data.table%' AND Body COLLATE Latin1_General_CS_AS LIKE '%column%') AND Body COLLATE Latin1_General_CS_AS LIKE '%.BY%' | sede |
CREATE TABLE table_11214772_1 (
score VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the score where year is 2007
| SELECT score FROM table_11214772_1 WHERE year = "2007" | sql_create_context |
CREATE TABLE table_33623 (
"Year" text,
"1st Position" text,
"2nd Position" text,
"9th Position" text,
"10th Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is in the ninth position where the tenth position is rabat ajax?
| SELECT "9th Position" FROM table_33623 WHERE "10th Position" = 'rabat ajax' | wikisql |
CREATE TABLE table_69835 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest round for Southern College?
| SELECT MIN("Round") FROM table_69835 WHERE "College" = 'southern' | wikisql |
CREATE TABLE table_54881 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team score of a Melbourne team that has a home te... | SELECT "Away team score" FROM table_54881 WHERE "Home team score" = '12.7 (79)' AND "Away team" = 'melbourne' | wikisql |
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 transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733 AND admissions.dischtime IS NULL) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime LIMIT 1 | mimic_iii |
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 demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "17787" | mimicsql_data |
CREATE TABLE table_18772 (
"Serial & Branch" real,
"Seaman" text,
"Mechanical" text,
"Secretariat" text,
"Supply" text,
"Electrical" text,
"Radio Electrical" text,
"Regulating" text,
"Medical" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Radio Electrical" FROM table_18772 WHERE "Secretariat" = 'WTR I' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-4 year') | mimic_iii |
CREATE TABLE table_name_56 (
date VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game that tied at 3?
| SELECT date FROM table_name_56 WHERE tie_no = "3" | 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 * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.