instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_91 (
round VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the fight against Brandon Bledsoe, how many rounds did the fight last?
| SELECT round FROM table_name_91 WHERE opponent = "brandon bledsoe" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '1195150' AND t_kc22.STA_DATE BETWEEN '2003-02-04' AND '2004-12-30' | css |
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_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9767993' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) D... | css |
CREATE TABLE Ref_Product_Categories (
product_category_code VARCHAR(15),
product_category_description VARCHAR(80),
unit_of_measure VARCHAR(20)
)
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
product_characteristic_value VARCHAR(50)
)
CREATE TABLE Ref_Cha... | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY COUNT(product_category_description) | nvbench |
CREATE TABLE table_name_11 (
notes VARCHAR,
authors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the notes where the authors are Zhou & Zhang?
| SELECT notes FROM table_name_11 WHERE authors = "zhou & zhang" | sql_create_context |
CREATE TABLE table_name_79 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record after the bout with Alexis Vila?
| SELECT record FROM table_name_79 WHERE opponent = "alexis vila" | sql_create_context |
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT COUNT(*) 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 = 92788)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cardiac output' AN... | mimic_iii |
CREATE TABLE table_name_7 (
iata VARCHAR,
airport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IATA code for SHahjalal International Airport?
| SELECT iata FROM table_name_7 WHERE airport = "shahjalal international airport" | sql_create_context |
CREATE TABLE mzb (
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 qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7148894' GROUP BY qtb.IN_DIAG_DIS_NM UNION SELECT gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7148894' GROUP BY gyb.IN_DIAG_DIS_NM UNION SELECT zyb.IN_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb.... | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDa... | SELECT ViewCount FROM Posts | sede |
CREATE TABLE table_name_2 (
week INTEGER,
date VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest week when the date is september 16, 1979 and the attendance less than 54,212?
| SELECT MIN(week) FROM table_name_2 WHERE date = "september 16, 1979" AND attendance < 54 OFFSET 212 | sql_create_context |
CREATE TABLE table_70080 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What result had a score of 2-1?
| SELECT "Result" FROM table_70080 WHERE "Score" = '2-1' | wikisql |
CREATE TABLE table_name_82 (
outcome VARCHAR,
surface VARCHAR,
score_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Outcome has a Surface of hard, and a Score in the final of 6 2, 6 4?
| SELECT outcome FROM table_name_82 WHERE surface = "hard" AND score_in_the_final = "6–2, 6–4" | sql_create_context |
CREATE TABLE table_204_636 (
id number,
"season" text,
"tier" number,
"division" text,
"pos." text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many seasons did someone get 3rd place ?
| SELECT COUNT("season") FROM table_204_636 WHERE "pos." = 3 | squall |
CREATE TABLE table_221398_1 (
prefecture VARCHAR,
area__km²_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many prefectures have an area of 361.719 kilometers squared?
| SELECT COUNT(prefecture) FROM table_221398_1 WHERE area__km²_ = "361.719" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate tim... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'left heart ... | 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 prescriptions (
subject_id text,
hadm_id... | SELECT prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Phenylephrine 0.5% Nasal Spray" | mimicsql_data |
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.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '56236131' AND t_kc21.MED_SER_ORG_NO = '6811873' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%孤独症%' | css |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '30139154' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 4566.82) | css |
CREATE TABLE table_name_22 (
partner VARCHAR,
surface VARCHAR,
opponents_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the partner for surface of grass and opponents of j rgen melzer philipp petzschner
| SELECT partner FROM table_name_22 WHERE surface = "grass" AND opponents_in_the_final = "jürgen melzer philipp petzschner" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_CD = 'K03.248' | css |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_cod... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2098" AND lab.itemid = "51032" | mimicsql_data |
CREATE TABLE table_203_499 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the first golfer not from the united states to finish in ... | SELECT "player" FROM table_203_499 WHERE "country" <> 'united states' ORDER BY "place" LIMIT 1 | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicatio... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'cl flush: non-tunneled dialysis ij r' AND intakeoutput.cellpath LIKE '%input%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2103') | eicu |
CREATE TABLE table_202_224 (
id number,
"party" text,
"candidate" text,
"votes" number,
"%" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did the snp or the conservative party get a greater percentage of the vote in the 2001 general election in o... | SELECT "party" FROM table_202_224 WHERE "party" IN ('snp', 'conservative') ORDER BY "%" DESC LIMIT 1 | squall |
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE purchase (
member_id number,
branch_id text,
year text,
total_pounds number
)
CREATE TABLE membership_register_branch (
member_id number,
... | SELECT level FROM member GROUP BY level ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE member (
Member_ID int,
Member_Name tex... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_25456 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Arena Attendance" text,
"High Points" text,
"High Rebounds" text,
"High Assists" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ... | SELECT COUNT("High Points") FROM table_25456 WHERE "Record" = '21-45' | wikisql |
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 Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 | nvbench |
CREATE TABLE table_25383 (
"No." real,
"Player" text,
"Position" text,
"Height" text,
"Weight" real,
"Class" text,
"Hometown" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is jim dutcher's hometown?
| SELECT "Hometown" FROM table_25383 WHERE "Player" = 'Jim Dutcher' | wikisql |
CREATE TABLE table_name_3 (
package_option VARCHAR,
content VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Package/Option, when Content is Poker?
| SELECT package_option FROM table_name_3 WHERE content = "poker" | sql_create_context |
CREATE TABLE table_18460 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the candidates for l. mendel rivers
| SELECT COUNT("Candidates") FROM table_18460 WHERE "Incumbent" = 'L. Mendel Rivers' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_fli... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... | atis |
CREATE TABLE table_1876825_2 (
no_in_series VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of series for march 19, 2000
| SELECT COUNT(no_in_series) FROM table_1876825_2 WHERE original_air_date = "March 19, 2000" | sql_create_context |
CREATE TABLE table_name_38 (
constellation VARCHAR,
designation_hd VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which constellation has hd 75732 as a destignation HD?
| SELECT constellation FROM table_name_38 WHERE designation_hd = "hd 75732" | sql_create_context |
CREATE TABLE roles (
role_code text,
role_description text
)
CREATE TABLE users (
user_id number,
role_code text,
user_name text,
user_login text,
password text
)
CREATE TABLE documents (
document_code text,
document_structure_code text,
document_type_code text,
access_coun... | SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = "David CV" | spider |
CREATE TABLE table_name_90 (
venue VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue is in the state of Connecticut?
| SELECT venue FROM table_name_90 WHERE state = "connecticut" | sql_create_context |
CREATE TABLE table_1298 (
"Country" text,
"Uranium required 2006-08" text,
"% of world demand" text,
"Indigenous mining production 2006" text,
"Deficit (-surplus)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the indigenous mining producti... | SELECT "Indigenous mining production 2006" FROM table_1298 WHERE "% of world demand" = '3.4%' | wikisql |
CREATE TABLE table_203_644 (
id number,
"pos." number,
"driver" text,
"co-driver" text,
"car" text,
"time" text,
"difference" text,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times was the fiat abarth 124 rallye c... | SELECT COUNT(*) FROM table_203_644 WHERE "car" = 'fiat abarth 124 rallye' | squall |
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 COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'UP' AND COURSE_0.... | advising |
CREATE TABLE table_name_23 (
snow__days_year_ INTEGER,
sunshine__hrs_year_ VARCHAR,
storms__days_year_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the amount of snow where the sunshine is 1 633, and storms are lower than 29?
| SELECT AVG(snow__days_year_) FROM table_name_23 WHERE sunshine__hrs_year_ = "1 633" AND storms__days_year_ < 29 | sql_create_context |
CREATE TABLE table_9579 (
"Name" text,
"Rank" text,
"Tenure" text,
"Date of death" text,
"Cause of death" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Gary David Saunders' Tenure?
| SELECT "Tenure" FROM table_9579 WHERE "Name" = 'gary david saunders' | wikisql |
CREATE TABLE table_52171 (
"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.
-- At what venue did the Essendon team play as an away team?
| SELECT "Venue" FROM table_52171 WHERE "Away team" = 'essendon' | wikisql |
CREATE TABLE table_57289 (
"Player" text,
"Pos." text,
"From" real,
"School/Country" text,
"Rebs" real,
"Asts" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year is the player who attended la salle with under 6 assists from?
| SELECT SUM("From") FROM table_57289 WHERE "School/Country" = 'la salle' AND "Asts" < '6' | wikisql |
CREATE TABLE table_name_28 (
drivers VARCHAR,
engine VARCHAR,
races VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drove a race car with a Mercedes IC 108e engine and has an 8-10 record?
| SELECT drivers FROM table_name_28 WHERE engine = "mercedes ic 108e" AND races = "8-10" | 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" AND lab.label = "Cyclosporin" | mimicsql_data |
CREATE TABLE table_38705 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest game with a record of 16 4 3?
| SELECT MIN("Game") FROM table_38705 WHERE "Record" = '16–4–3' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid n... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'morphine 10 mg/ml injection : 1 ml injection' AND STRFTIME('%y', medication.drugstarttime) >= '2101') | eicu |
CREATE TABLE table_22613 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "High assists" FROM table_22613 WHERE "Record" = '13-11' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varch... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_14501 (
"Status" text,
"Name" text,
"First Performance" text,
"Last Performance" text,
"Style" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the actor who played Billy Elliot in the Final Cast with a Last Perf... | SELECT "Name" FROM table_14501 WHERE "Status" = 'final cast' AND "Last Performance" = '13 june 2009' | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
pat... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'cerebral subdural hematoma') | eicu |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 prescriptions (
row_id numbe... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9294)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperature c (cal... | mimic_iii |
CREATE TABLE table_name_28 (
position VARCHAR,
weight VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Postion, when Weight is greater than 220, and when Player is 'Travis Knight'?
| SELECT position FROM table_name_28 WHERE weight > 220 AND player = "travis knight" | sql_create_context |
CREATE TABLE table_name_53 (
average INTEGER,
total VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player was from Fermanagh and had an average score of 22?
| SELECT AVG(average) FROM table_name_53 WHERE total = 22 AND county = "fermanagh" | sql_create_context |
CREATE TABLE table_32138 (
"Player" text,
"Career" text,
"Goals" real,
"Caps" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years did Tymerlan Huseynov, whose average is larger than 0.361, play?
| SELECT "Career" FROM table_32138 WHERE "Average" > '0.361' AND "Player" = 'tymerlan huseynov' | wikisql |
CREATE TABLE table_21151 (
"Season" real,
"Class" text,
"Motorcycle" text,
"Team" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"FLaps" real,
"Points" text,
"Placement" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT MIN("Races") FROM table_21151 WHERE "Poles" = '2' | wikisql |
CREATE TABLE table_29017 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player was drafted by the Minnesota North Stars?
| SELECT "Player" FROM table_29017 WHERE "NHL team" = 'Minnesota North Stars' | wikisql |
CREATE TABLE table_234886_3 (
no_in_season VARCHAR,
prod_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number in the season of the episode with a production code of 2-05?
| SELECT COUNT(no_in_season) FROM table_234886_3 WHERE prod_code = "2-05" | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
-- Using valid SQLite... | SELECT T2.allergytype, COUNT(*) FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype | spider |
CREATE TABLE table_203_860 (
id number,
"rank" number,
"city" text,
"population (2011)" number,
"population (2001)" number,
"state/territory" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what city is listed at the top of the table as having th... | SELECT "city" FROM table_203_860 ORDER BY "population (2011)" DESC LIMIT 1 | squall |
CREATE TABLE table_31217 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of ends wo... | SELECT COUNT("Ends Won") FROM table_31217 WHERE "Skip (Club)" = 'Chantelle Eberle (Tartan)' | wikisql |
CREATE TABLE diagnoses_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 microbiologyevents (
row_id number,
subject_id number... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29161) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid... | mimic_iii |
CREATE TABLE table_name_84 (
against VARCHAR,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Againsts have more than 15 wins?
| SELECT COUNT(against) FROM table_name_84 WHERE wins > 15 | sql_create_context |
CREATE TABLE table_204_785 (
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.
-- name the countries that had at least 5 gold medals
| SELECT "nation" FROM table_204_785 WHERE "gold" >= 5 | squall |
CREATE TABLE table_5747 (
"Name" text,
"Street Address" text,
"Height feet / meters" text,
"Floors" real,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Street Address of 401 n. wabash avenue involves what name?
| SELECT "Name" FROM table_5747 WHERE "Street Address" = '401 n. wabash avenue' | wikisql |
CREATE TABLE table_24318 (
"Draw" real,
"Song" text,
"Artist" text,
"Panel Points" real,
"Televotes" real,
"Televote Points" real,
"Score" real,
"Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the artist for 7 points
| SELECT COUNT("Artist") FROM table_24318 WHERE "Televote Points" = '7' | wikisql |
CREATE TABLE table_39144 (
"FOURCC" text,
"DX 10 Name" text,
"Description" text,
"Alpha premultiplied?" text,
"Compression ratio" text,
"Texture Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Compression ratio has a (none) DX 10 Name... | SELECT "Compression ratio" FROM table_39144 WHERE "DX 10 Name" = '(none)' AND "FOURCC" = 'dxt4' | wikisql |
CREATE TABLE table_17765264_1 (
date VARCHAR,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did they play at the Cotton Bowl?
| SELECT date FROM table_17765264_1 WHERE game_site = "Cotton Bowl" | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "5180" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY COUNT(*) | nvbench |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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 t... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj... | css |
CREATE TABLE table_4365 (
"Year" real,
"Wins" real,
"Losses" real,
"Percentage" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most losses that the Royals had when they had a percentage over 0.461, won over 86 games, and f... | SELECT MAX("Losses") FROM table_4365 WHERE "Percentage" > '0.461' AND "Wins" > '86' AND "Finish" = '2nd' AND "Year" = '1953' | wikisql |
CREATE TABLE table_name_26 (
location VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the location of the game with a Result of 21 16?
| SELECT location FROM table_name_26 WHERE result = "21–16" | sql_create_context |
CREATE TABLE table_54523 (
"Grade" text,
"Points" real,
"Sit-up (reps)" text,
"Standing Broad Jump (cm)" text,
"Chin-up (reps)" text,
"Shuttle Run (sec)" text,
"2.4km Run (min:sec)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many poi... | SELECT COUNT("Points") FROM table_54523 WHERE "Standing Broad Jump (cm)" = '207-215' | wikisql |
CREATE TABLE table_11609814_1 (
permanence_of_the_body VARCHAR,
purity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the permanence of the body where purity is rudra
| SELECT permanence_of_the_body FROM table_11609814_1 WHERE purity = "Rudra" | sql_create_context |
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 JZKSRQ FROM mzjzjlb WHERE JZLSH = '54076263049' | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | advising |
CREATE TABLE table_11953 (
"Date" text,
"Opponent" text,
"Winner" text,
"Score" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the result for winner of bc 3
| SELECT "Result" FROM table_11953 WHERE "Winner" = 'bc 3' | wikisql |
CREATE TABLE table_24433 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Driver" FROM table_24433 WHERE "Laps" = '200' AND "Year" = '1997' | wikisql |
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 t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '95258264828' | css |
CREATE TABLE table_65565 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week has December 19, 2004 as the date?
| SELECT "Week" FROM table_65565 WHERE "Date" = 'december 19, 2004' | wikisql |
CREATE TABLE table_203_365 (
id number,
"released" text,
"video title" text,
"company" text,
"director" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many films did shoko goto appear in 2004 ?
| SELECT COUNT(DISTINCT "video title") FROM table_203_365 WHERE "released" = 2004 | squall |
CREATE TABLE table_5764 (
"Opposition" text,
"Score" text,
"Venue" text,
"City" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opposition has a Year smaller than 1911, and a Venue of old trafford?
| SELECT "Opposition" FROM table_5764 WHERE "Year" < '1911' AND "Venue" = 'old trafford' | wikisql |
CREATE TABLE table_41521 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"Previous Club/Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the avera... | SELECT AVG("Jersey #") FROM table_41521 WHERE "Name" = 'steve griffith' AND "Weight (kg)" < '84' | wikisql |
CREATE TABLE table_35536 (
"Date" text,
"ID code of his Zero Fighter" text,
"Flight hours" text,
"Count" text,
"Sub-total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the count for the Zero Fighter with hours of 2:00?
| SELECT "Count" FROM table_35536 WHERE "Flight hours" = '2:00' | wikisql |
CREATE TABLE table_2527617_1 (
champion VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the champion of the 1994 season?
| SELECT champion FROM table_2527617_1 WHERE season = 1994 | sql_create_context |
CREATE TABLE table_51023 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" real,
"Song" text,
"Artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long was Volume:Issue 12:4-6 at the top?
| SELECT COUNT("Weeks on Top") FROM table_51023 WHERE "Volume:Issue" = '12:4-6' | wikisql |
CREATE TABLE table_26200 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different players got drafted for the Ottawa Renegades?
| SELECT COUNT("Player") FROM table_26200 WHERE "CFL Team" = 'Ottawa Renegades' | wikisql |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varch... | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY SUM(STU_HRS) 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2112" AND procedures.long_title = "Suture of laceration of bladder" | mimicsql_data |
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
CREATE TABLE tags (
index number,
id number,
tag text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT SUM(totalsnatched), releasetype FROM torrents GROUP BY releasetype | whatcdhiphop |
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 CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'MySQL' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'mysql%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY YE... | sede |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Sodium" | mimicsql_data |
CREATE TABLE table_name_81 (
time VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time of the Essendon home team game?
| SELECT time FROM table_name_81 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE table_27773 (
"City/ municipality" text,
"Type" text,
"No. of Barangays" real,
"Population (2010)" real,
"Area (km\u00b2)" text,
"Pop. density (per km\u00b2)" real,
"Income Class" text,
"Zip Code" real
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT COUNT("Pop. density (per km\u00b2)") FROM table_27773 WHERE "Area (km\u00b2)" = '48.67' | wikisql |
CREATE TABLE table_name_54 (
name VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Name had the Rank, 15?
| SELECT name FROM table_name_54 WHERE rank = 15 | sql_create_context |
CREATE TABLE table_9484 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place was the player from Italy in ?
| SELECT "Place" FROM table_9484 WHERE "Country" = 'italy' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.