instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_62 (
attendance INTEGER,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the sum of attendance of week 11
| SELECT SUM(attendance) FROM table_name_62 WHERE week = 11 | sql_create_context |
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE field (
fieldid int
)
CREATE TA... | SELECT DISTINCT COUNT(paper.paperid), paper.year FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'NIPS' GROUP BY paper.year ORDER BY COUNT(paper.paperid) DESC | scholar |
CREATE TABLE student (
major VARCHAR,
city_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the numbers of different majors and cities.
| SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student | sql_create_context |
CREATE TABLE table_name_18 (
bodyweight VARCHAR,
total__kg_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which bodyweight has a Total (kg) of 145.0?
| SELECT bodyweight FROM table_name_18 WHERE total__kg_ = "145.0" | sql_create_context |
CREATE TABLE table_name_7 (
director VARCHAR,
prod_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode with production code 40811-005?
| SELECT director FROM table_name_7 WHERE prod_code = "40811-005" | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy... | css |
CREATE TABLE table_name_66 (
state VARCHAR,
royal_house VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which state has a royal house of Ying?
| SELECT state FROM table_name_66 WHERE royal_house = "ying" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
chart... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert endotracheal tube') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26995) AND DATETIME(proced... | mimic_iii |
CREATE TABLE table_22627 (
"Year" real,
"Champion (average in final)" text,
"Legs" text,
"Runner-up (average in final)" text,
"Sponsor" text,
"Prize Fund" text,
"Champion" text,
"Runner-up" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables pr... | SELECT "Prize Fund" FROM table_22627 WHERE "Venue" = 'RWE-Sporthalle, Mülheim' | wikisql |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE table_name_42 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT SCORE HAD A RECORD OF 1-1?
| SELECT score FROM table_name_42 WHERE record = "1-1" | sql_create_context |
CREATE TABLE table_16388478_3 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the away team Fremantle play?
| SELECT date FROM table_16388478_3 WHERE away_team = "Fremantle" | 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_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '云雅容' AND gwyjzb.MED_SER_ORG_NO = '0201692' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%紧张%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '云雅容' AND fgwyjzb.MED_SER_ORG_NO = '0201692' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%紧张%' | css |
CREATE TABLE table_name_30 (
stadium VARCHAR,
final_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what stadium did a game result in a final scoreline reading 27-34?
| SELECT stadium FROM table_name_30 WHERE final_score = "27-34" | sql_create_context |
CREATE TABLE table_67801 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue had a draw?
| SELECT "Venue" FROM table_67801 WHERE "Result" = 'draw' | wikisql |
CREATE TABLE table_23057 (
"Series #" real,
"Episode #" real,
"Title" text,
"Written by" text,
"Directed by" text,
"Viewers" real,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the series number for the episode wr... | SELECT MAX("Series #") FROM table_23057 WHERE "Written by" = 'Kristen Dunphy and David Ogilvy' | wikisql |
CREATE TABLE table_8576 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the latest year when the venue is berlin, germany?
| SELECT MAX("Year") FROM table_8576 WHERE "Venue" = 'berlin, germany' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Hemodialysis" | mimicsql_data |
CREATE TABLE table_12557 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the latest year with a position of 1st at Maputo, Mozambique?
| SELECT MAX("Year") FROM table_12557 WHERE "Position" = '1st' AND "Venue" = 'maputo, mozambique' | wikisql |
CREATE TABLE table_200_41 (
id number,
"number" text,
"encoding" text,
"implied probability" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the implied probability of 8 = 23 + 0 ?
| SELECT "implied probability" FROM table_200_41 WHERE "number" = '8 = 23 + 0' | squall |
CREATE TABLE table_74569 (
"Area" text,
"Advertisement date" text,
"Block" text,
"Winning applicant" text,
"Ensemble name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Winning Applicant of Ensemble Name Muxco Lincolnshire in Block 10D?
| SELECT "Winning applicant" FROM table_74569 WHERE "Block" = '10d' AND "Ensemble name" = 'muxco lincolnshire' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "3613" | mimicsql_data |
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 advisory_requirement FROM course WHERE name LIKE '%Ibsen and Strindberg%' | advising |
CREATE TABLE table_name_59 (
finish VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the finish for Billy Casper?
| SELECT finish FROM table_name_59 WHERE player = "billy casper" | 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 SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_ID = '02992018' AND CLINIC_TYPE = '门诊' | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TAB... | SELECT LAST_DATE_OF_MONTH(p.CreationDate), ROUND((COUNT(p.ClosedDate)) * 100.0 / (COUNT(p.Id)), 2) AS percentage FROM Posts AS p WHERE (p.PostTypeId = 1) AND (p.CreationDate >= '##Date1?2010-01-01##') AND (p.CreationDate <= '##Date2?2021-01-01##') GROUP BY LAST_DATE_OF_MONTH(p.CreationDate) ORDER BY LAST_DATE_OF_MONTH(... | sede |
CREATE TABLE staff (
staff_id number,
staff_address_id number,
nickname text,
first_name text,
middle_name text,
last_name text,
date_of_birth time,
date_joined_staff time,
date_left_staff time
)
CREATE TABLE customers (
customer_id number,
customer_address_id number,
cu... | SELECT T1.city FROM addresses AS T1 JOIN staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" | spider |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '69886935' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2014-06-18') | css |
CREATE TABLE table_name_24 (
player VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has a nationality of spain?
| SELECT player FROM table_name_24 WHERE nationality = "spain" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43959) AND DATETIME(procedures_icd.charttime, 'start of year') = DAT... | mimic_iii |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
s... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99647 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'sodium polystyrene sulfonate' ORDER BY presc... | mimic_iii |
CREATE TABLE table_203_700 (
id number,
"year" number,
"species" text,
"height" text,
"location grown" text,
"state" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what species of tree was the tallest one used ?
| SELECT "species" FROM table_203_700 ORDER BY "height" DESC LIMIT 1 | squall |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type | nvbench |
CREATE TABLE table_name_42 (
podium VARCHAR,
race VARCHAR,
flap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On Race 14 when the FLap is larger than 1, what is the podium number?
| SELECT COUNT(podium) FROM table_name_42 WHERE race = 14 AND flap > 1 | sql_create_context |
CREATE TABLE table_35609 (
"Team" text,
"Copa Libertadores 1996" text,
"Supercopa Sudamericana 1996" text,
"Copa CONMEBOL 1996" text,
"Recopa Sudamericana 1996" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the recoupa sudamericana 1996 res... | SELECT "Recopa Sudamericana 1996" FROM table_35609 WHERE "Team" = 'corinthians' | wikisql |
CREATE TABLE table_36579 (
"Player" text,
"Touchdowns (5 points)" real,
"Extra points 1 point" real,
"Field goals (5 points)" real,
"Total Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Extra points 1 point is the highest one that has ... | SELECT MAX("Extra points 1 point") FROM table_36579 WHERE "Total Points" < '8' | wikisql |
CREATE TABLE table_54845 (
"Team" text,
"Nation" text,
"From" text,
"Matches" real,
"Drawn" real,
"Lost" real,
"Win %" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of drawn for 30 october 2006 and win % more than 43.2
| SELECT SUM("Drawn") FROM table_54845 WHERE "From" = '30 october 2006' AND "Win %" > '43.2' | wikisql |
CREATE TABLE table_name_49 (
date_s__administered VARCHAR,
joe_sestak__d_ VARCHAR,
margin_of_error VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT DATE DID JOE SESTAK HAVE 46% WITH 3.0% MARGIN OF ERROR?
| SELECT date_s__administered FROM table_name_49 WHERE joe_sestak__d_ = "46%" AND margin_of_error = "± 3.0%" | sql_create_context |
CREATE TABLE table_name_5 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2013 with virgin in 2009?
| SELECT 2013 FROM table_name_5 WHERE 2009 = "virgin" | sql_create_context |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '杨文彬' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.P... | css |
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 patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '027-41381' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'stress ulcer prophylaxis - esomeprazole' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(),... | eicu |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE STUDENT (
STU_NUM... | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE | nvbench |
CREATE TABLE table_name_84 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where did arron oberholser play?
| SELECT country FROM table_name_84 WHERE player = "arron oberholser" | sql_create_context |
CREATE TABLE table_name_40 (
number_of_electorates__2009_ INTEGER,
reserved_for___sc___st__none_ VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Number of electorates (2009 which has a Reserved for ( SC / ST /None) of none, and a Na... | SELECT MIN(number_of_electorates__2009_) FROM table_name_40 WHERE reserved_for___sc___st__none_ = "none" AND name = "jahanabad" | sql_create_context |
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizontal_bar_points number,
total_points number
)
CREATE TABLE people (
people_id number,
name text,
a... | SELECT DISTINCT hometown FROM people EXCEPT SELECT DISTINCT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Depress psychosis-unspec" | mimicsql_data |
CREATE TABLE table_name_35 (
losses INTEGER,
ballarat_fl VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Losses that Melton had when they had fewer Draws than 0?
| SELECT SUM(losses) FROM table_name_35 WHERE ballarat_fl = "melton" AND draws < 0 | sql_create_context |
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,
country text,
postal_code text,
phone t... | 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 | spider |
CREATE TABLE table_36317 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score in the game against the Buffalo Sabres?
| SELECT "Score" FROM table_36317 WHERE "Opponent" = 'buffalo sabres' | wikisql |
CREATE TABLE table_59606 (
"Pick" real,
"AFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is an offensive tackle for the New York Jets?
| SELECT "Player" FROM table_59606 WHERE "Position" = 'offensive tackle' AND "AFL Team" = 'new york jets' | wikisql |
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
type text,
built_year int,
notes text
)
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location t... | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id DESC | nvbench |
CREATE TABLE table_203_325 (
id number,
"year" number,
"title" text,
"(english)" text,
"ifpi israel certification" text,
"label" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which is david d'or 's oldest album ?
| SELECT "title" FROM table_203_325 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATL... | atis |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'oliguria - suspect atn' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) | eicu |
CREATE TABLE table_47068 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the highest Gold that has the Bronze larger than 3, and the Total smaller th... | SELECT MAX("Gold") FROM table_47068 WHERE "Bronze" > '3' AND "Total" < '24' | wikisql |
CREATE TABLE table_23465864_6 (
tues_25_aug VARCHAR,
mon_24_aug VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Tues 25 Aug time and speed when Mon 24 Aug was 22' 24.56 101.021mph?
| SELECT tues_25_aug FROM table_23465864_6 WHERE mon_24_aug = "22' 24.56 101.021mph" | sql_create_context |
CREATE TABLE table_19874169_3 (
branding VARCHAR,
callsign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the call sign is DXYR, what is the branding?
| SELECT branding FROM table_19874169_3 WHERE callsign = "DXYR" | sql_create_context |
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "61" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_203_800 (
id number,
"#" number,
"president" text,
"president's party" text,
"senate with" number,
"senate opposed" number,
"house with" number,
"house opposed" number,
"years served" number,
"elections won" number
)
-- Using valid SQLite, answer the followin... | SELECT "years served" FROM table_203_800 WHERE "president" = 'ulysses grant' | squall |
CREATE TABLE table_1239 (
"Maximum Ceiling Temperature" text,
"Temperature Rating" text,
"Temperature Classification" text,
"Color Code (with Fusible Link)" text,
"Glass Bulb Color" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most ceilin... | SELECT "Maximum Ceiling Temperature" FROM table_1239 WHERE "Temperature Classification" = 'Intermediate' | wikisql |
CREATE TABLE table_47719 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Crowd has a Home team of st kilda?
| SELECT "Crowd" FROM table_47719 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
C... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSB... | atis |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77586 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) GROUP BY prescriptions.dr... | mimic_iii |
CREATE TABLE table_name_79 (
transfer_fee VARCHAR,
ends VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the transfer fee for the player with an ends of 2007?
| SELECT transfer_fee FROM table_name_79 WHERE ends = 2007 | 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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '08788761413' | css |
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 * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6196587' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-08-31' AND '2016-04-05' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6196587' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2006-08-31' AND '2016-04-05' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '619658... | 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 demographic.age, demographic.insurance FROM demographic WHERE demographic.name = "Hector Blair" | mimicsql_data |
CREATE TABLE table_23117208_3 (
no_in_season INTEGER,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which is the biggest number of episode in the season, when the director of the episode was Constantine Makris?
| SELECT MAX(no_in_season) FROM table_23117208_3 WHERE directed_by = "Constantine Makris" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE chart... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'skelaxin' AND STRFTIME('%y', prescriptions.startdate) <= '2104') ... | mimic_iii |
CREATE TABLE table_1348 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Podiums" real,
"Poles" real,
"Wins" real,
"Points" real,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest valu... | SELECT MAX("Races") FROM table_1348 | wikisql |
CREATE TABLE table_name_46 (
party VARCHAR,
office VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Party has a Office of majority floor leader
| SELECT party FROM table_name_46 WHERE office = "majority floor leader" | sql_create_context |
CREATE TABLE table_80110 (
"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 hits for years before 1883
| SELECT "Hits" FROM table_80110 WHERE "Year" < '1883' | wikisql |
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
... | SELECT apt_number, room_count FROM Apartments ORDER BY apt_number | nvbench |
CREATE TABLE table_60858 (
"Rank" real,
"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 smallest number of gold medals a country with 7 medals has?
| SELECT MIN("Gold") FROM table_60858 WHERE "Total" = '7' | wikisql |
CREATE TABLE table_17387 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS 'DAVE MOVES OUT' PRODUCTION CODE?
| SELECT "Production code" FROM table_17387 WHERE "Title" = 'Dave Moves Out' | wikisql |
CREATE TABLE table_51104 (
"Owner" text,
"Class" text,
"Number in class" real,
"Road numbers" text,
"Built" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was built in a class with less than 10, and the Downer Rail owner?
| SELECT "Built" FROM table_51104 WHERE "Number in class" < '10' AND "Owner" = 'downer rail' | wikisql |
CREATE TABLE table_59824 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Catalog has a Label of geffen records / universal music special markets?
| SELECT "Catalog" FROM table_59824 WHERE "Label" = 'geffen records / universal music special markets' | wikisql |
CREATE TABLE table_66538 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name for the assembly segment with a... | SELECT "Name" FROM table_66538 WHERE "Constituency number" = '214' | wikisql |
CREATE TABLE table_43395 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score with a margin victory of 2 strokes?
| SELECT "Winning score" FROM table_43395 WHERE "Margin of victory" = '2 strokes' | wikisql |
CREATE TABLE table_47452 (
"Election" text,
"Candidate" text,
"Number of votes" text,
"Share of votes" text,
"Outcome of election" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the candidate in the 2008 (2) election?
| SELECT "Candidate" FROM table_47452 WHERE "Election" = '2008 (2)' | wikisql |
CREATE TABLE table_16659 (
"Round" real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winning driver when ... | SELECT "Winning Driver" FROM table_16659 WHERE "Fastest Lap" = 'Michael Schumacher' AND "Pole Position" = 'Michael Schumacher' | wikisql |
CREATE TABLE table_15491596_1 (
engine VARCHAR,
no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cars used number 48?
| SELECT COUNT(engine) FROM table_15491596_1 WHERE no = 48 | sql_create_context |
CREATE TABLE table_203_497 (
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 has earned the least amount of gold medals ?
| SELECT "nation" FROM table_203_497 ORDER BY "gold" LIMIT 1 | squall |
CREATE TABLE table_14447 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Having 429... | SELECT "Tries against" FROM table_14447 WHERE "Points against" = '429' | wikisql |
CREATE TABLE table_19532 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people directed the show written by Chris S... | SELECT COUNT("Directed by") FROM table_19532 WHERE "Written by" = 'Chris Sheridan' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | nvbench |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABL... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_name_86 (
name VARCHAR,
appearances VARCHAR,
goals VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had less than 7 goals, was ranked under 7, and had more than 8 appearances?
| SELECT name FROM table_name_86 WHERE goals < 7 AND rank < 7 AND appearances > 8 | sql_create_context |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.departure_time <= 1200 AND flight.departure_time >= 1800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND fligh... | atis |
CREATE TABLE campuses (
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many campuses are there in Los Angeles county?
| SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 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.MED_SER_ORG_NO = '7764485' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 27 | css |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Voting_record (
StuID INTEGER,
Registration_Date VARCHAR(12),
Election_Cycle VARCHAR(12),
Presiden... | SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor | nvbench |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_2858 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number in sea... | SELECT MAX("No. in season") FROM table_2858 WHERE "Production code" = '3ABC12' | 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 d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT a.Id AS "post_link", q.Title, a.Score FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId = '##id?210401##' AND a.PostTypeId = 2 ORDER BY a.Id | sede |
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "ROMANIAN EAST. ORTH" | mimicsql_data |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | SELECT DISTINCT name, number FROM course WHERE credits = 18 AND department = 'EECS' | advising |
CREATE TABLE table_53389 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the constellation when the Right ascension ( J20... | SELECT "Constellation" FROM table_53389 WHERE "Right ascension ( J2000 )" = '10h18m58.4s' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.