instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_stop (
flight_id int,
stop... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 AN... | atis |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "ROMANIAN EAST. ORTH" AND lab.itemid = "50878" | mimicsql_data |
CREATE TABLE table_36523 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Score of 3 4, and a Attendance larger than 34,609 happened on what date?
| SELECT "Date" FROM table_36523 WHERE "Score" = '3–4' AND "Attendance" > '34,609' | wikisql |
CREATE TABLE table_63956 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of draws with more than 2 byes?
| SELECT MIN("Draws") FROM table_63956 WHERE "Byes" > '2' | wikisql |
CREATE TABLE table_name_46 (
lost INTEGER,
team VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Lost for s o paulo railway, Points more than 21?
| SELECT MIN(lost) FROM table_name_46 WHERE team = "são paulo railway" AND points > 21 | sql_create_context |
CREATE TABLE table_name_77 (
score INTEGER,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Score when the Country is canada?
| SELECT MIN(score) FROM table_name_77 WHERE country = "canada" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResults (
Id number,
Review... | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Kerala%' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_60419 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the away team Sheffield Wednesday?
| SELECT "Date" FROM table_60419 WHERE "Away team" = 'sheffield wednesday' | wikisql |
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 AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '过敏反应科' AND IN_HOSP_DATE BETWEEN '2003-04-29' AND '2008-01-03' AND IN_DIAG_DIS_CD = 'Q89.696' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_204_608 (
id number,
"name" text,
"elected party" text,
"constituency" text,
"elected date" text,
"military service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which party had the most elected from it , liberal or unionist... | SELECT "elected party" FROM table_204_608 WHERE "elected party" IN ('liberal', 'unionist') GROUP BY "elected party" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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,
round_trip_re... | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... | atis |
CREATE TABLE table_70480 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the years for porangahau school
| SELECT "Years" FROM table_70480 WHERE "Area" = 'porangahau' AND "Name" = 'porangahau school' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_48082 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a Record of 10-6?
| SELECT MIN("Round") FROM table_48082 WHERE "Record" = '10-6' | wikisql |
CREATE TABLE table_1341690_9 (
candidates VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What candidates ran in the election with don fuqua?
| SELECT candidates FROM table_1341690_9 WHERE incumbent = "Don Fuqua" | sql_create_context |
CREATE TABLE table_20383 (
"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.
-- How many time... | SELECT COUNT("Content") FROM table_20383 WHERE "Television service" = 'R-LIGHT' | wikisql |
CREATE TABLE table_204_487 (
id number,
"home team" text,
"score" text,
"visiting team" text,
"location" text,
"venue" text,
"door" text,
"surface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many teams won by at least three point... | SELECT COUNT(*) FROM table_204_487 WHERE ABS("score" - "score") >= 3 | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM... | css |
CREATE TABLE table_204_32 (
id number,
"season" number,
"division" text,
"w-l" text,
"finish" text,
"home" text,
"road" text,
"gf" number,
"ga" number,
"coach" text,
"playoffs" text,
"avg attendance" number
)
-- Using valid SQLite, answer the following questions for the... | SELECT "season" FROM table_204_32 ORDER BY "w-l" DESC LIMIT 1 | squall |
CREATE TABLE table_name_96 (
player VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player is from the Southern Illinois team?
| SELECT player FROM table_name_96 WHERE school_club_team = "southern illinois" | sql_create_context |
CREATE TABLE table_6611 (
"Title" text,
"Year" real,
"Platform(s)" text,
"Director" text,
"Producer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Metroid Prime Hunters 5 released?
| SELECT SUM("Year") FROM table_6611 WHERE "Title" = 'metroid prime hunters 5' | wikisql |
CREATE TABLE table_204_34 (
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 three countries have at least nine metals ?
| SELECT "nation" FROM table_204_34 WHERE "total" >= 9 | squall |
CREATE TABLE table_6372 (
"Year" text,
"Team" text,
"Attempts" text,
"Completions" text,
"Completion %" text,
"Yards" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Yards has a Attempts of 247
| SELECT "Yards" FROM table_6372 WHERE "Attempts" = '247' | wikisql |
CREATE TABLE table_name_84 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Country is David Toms from?
| SELECT country FROM table_name_84 WHERE player = "david toms" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'TCHNCLCM' AND number = 610 | advising |
CREATE TABLE table_80302 (
"Year" text,
"Winner" text,
"Country" text,
"Score" text,
"Margin" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the year 2004?
| SELECT "Score" FROM table_80302 WHERE "Year" = '2004' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-51980')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... | eicu |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "8" AND prescriptions.drug = "Magnesium Oxide" | mimicsql_data |
CREATE TABLE table_203802_2 (
county_councils___2011__ INTEGER,
english_party_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many county councils for the communist party of norway
| SELECT MAX(county_councils___2011__) FROM table_203802_2 WHERE english_party_name = "Communist Party of Norway" | sql_create_context |
CREATE TABLE table_name_42 (
record VARCHAR,
decision VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record in the game where the decision was Backstrom and there were more than 18,568 in attendance?
| SELECT record FROM table_name_42 WHERE decision = "backstrom" AND attendance > 18 OFFSET 568 | sql_create_context |
CREATE TABLE table_36937 (
"Channel" real,
"Station" text,
"Video" text,
"Aspect" text,
"PSIP Short Name" text,
"Programming" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the short name of channel 5.5, KSTC-TV?
| SELECT "PSIP Short Name" FROM table_36937 WHERE "Station" = 'kstc-tv' AND "Channel" = '5.5' | wikisql |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
... | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC | scholar |
CREATE TABLE table_2516282_3 (
championship VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which championship was the partner Jie Zheng?
| SELECT championship FROM table_2516282_3 WHERE partner = "Jie Zheng" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-136480' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-136480' AND patient.hospitaldischargetime IS NULL)) AND ... | eicu |
CREATE TABLE table_name_9 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for the opponent Atlanta Hawks?
| SELECT record FROM table_name_9 WHERE opponent = "atlanta hawks" | sql_create_context |
CREATE TABLE table_20722805_1 (
parish VARCHAR,
mccain_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What parish did McCain have 45.37% of the votes?
| SELECT parish FROM table_20722805_1 WHERE mccain_percentage = "45.37%" | sql_create_context |
CREATE TABLE table_72785 (
"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.
-- Where the home team scored 13.10 (88), what was... | SELECT MAX("Crowd") FROM table_72785 WHERE "Home team score" = '13.10 (88)' | wikisql |
CREATE TABLE table_name_80 (
opponents VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the Opponents in the Match with Partner Rushmi Chakravarthi?
| SELECT opponents FROM table_name_80 WHERE partner = "rushmi chakravarthi" | sql_create_context |
CREATE TABLE table_203_244 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"time/retired" text,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which rider scored the least amount of points ?
| SELECT "rider" FROM table_203_244 ORDER BY "points" LIMIT 1 | squall |
CREATE TABLE table_2417330_4 (
successor VARCHAR,
reason_for_change VARCHAR,
date_successor_seated VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the successor for vacant and december 3, 1862
| SELECT successor FROM table_2417330_4 WHERE reason_for_change = "Vacant" AND date_successor_seated = "December 3, 1862" | sql_create_context |
CREATE TABLE table_name_50 (
nat VARCHAR,
moving_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what nation is Bordeaux?
| SELECT nat FROM table_name_50 WHERE moving_from = "bordeaux" | sql_create_context |
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT wdmzjzjlb.RYTJDM, wdmzjzjlb.RYTJMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '13547641005' UNION SELECT bdmzjzjlb.RYTJDM, bdmzjzjlb.RYTJMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '13547641005' | css |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | 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 = 17667 AND admissions.dischtime IS NULL)) AND transfers... | mimic_iii |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_54 (
pi_code VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the PI code in the hindhead area?
| SELECT pi_code FROM table_name_54 WHERE area = "hindhead" | sql_create_context |
CREATE TABLE table_59834 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player placed t10?
| SELECT "Player" FROM table_59834 WHERE "Place" = 't10' | wikisql |
CREATE TABLE table_203_104 (
id number,
"athlete" text,
"nation" text,
"olympics" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many medals have sweden and norway won ... | SELECT SUM("total") FROM table_203_104 WHERE "nation" IN ('sweden', 'norway') | squall |
CREATE TABLE table_48040 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week had an attendance of 55,158?
| SELECT SUM("Week") FROM table_48040 WHERE "Attendance" = '55,158' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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,
... | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tachypnea' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tachypnea' | mimic_iii |
CREATE TABLE table_19001 (
"Position" real,
"Artist" text,
"Song title" text,
"Highest position" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many song title with artbeingt being chubby checker
| SELECT COUNT("Song title") FROM table_19001 WHERE "Artist" = 'Chubby Checker' | wikisql |
CREATE TABLE station (
id number,
name text,
lat number,
long number,
dock_count number,
city text,
installation_date text
)
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_stat... | SELECT name, lat, city FROM station ORDER BY lat LIMIT 1 | spider |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.itemid = "51275" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | 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 = '016-24379')) AND DATETIME(medication.drugstarttime, 'start of year') = DAT... | eicu |
CREATE TABLE table_28884858_2 (
team VARCHAR,
capacity_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team had a capacity of 102.3%?
| SELECT team FROM table_28884858_2 WHERE capacity_percentage = "102.3%" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
s... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec... | advising |
CREATE TABLE table_name_38 (
career VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the career of player andriy husyn?
| SELECT career FROM table_name_38 WHERE player = "andriy husyn" | sql_create_context |
CREATE TABLE table_10663 (
"Year" real,
"Main colour(s)" text,
"Additional colour(s)" text,
"Livery" text,
"Additional major sponsor(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the additional major sponsors which correspond to the ad... | SELECT "Additional major sponsor(s)" FROM table_10663 WHERE "Additional colour(s)" = 'black' AND "Year" = '1984' | wikisql |
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME
)
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME,
... | SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details, Type_of_Thing_Code ORDER BY Type_of_Thing_Code DESC | nvbench |
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR
)
CREATE TABLE customer_orders (
customer_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of customers who never placed an order.
| SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id | sql_create_context |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1833407' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-07-26' AND '2011-07-21' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1833407' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-07-26' AND '2011-07-21' | css |
CREATE TABLE table_72010 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the decision in Minnesota?
| SELECT "Decision" FROM table_72010 WHERE "Home" = 'minnesota' | wikisql |
CREATE TABLE table_56582 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Away Team score of North Melbourne?
| SELECT "Away team score" FROM table_56582 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE table_name_86 (
opponent VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when the attendance was 31,002?
| SELECT opponent FROM table_name_86 WHERE attendance = "31,002" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN" | mimicsql_data |
CREATE TABLE table_name_43 (
worst_dancer_s_ VARCHAR,
lowest_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which of the Worst dancer(s) has the Lowest score of 14?
| SELECT worst_dancer_s_ FROM table_name_43 WHERE lowest_score = 14 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4044')) AND intakeoutput.cellpath LIKE '%output%' AND ST... | eicu |
CREATE TABLE table_27701 (
"Date of Issue" text,
"Theme" text,
"Denomination" text,
"Design" text,
"Illustration" text,
"Quantity" text,
"Printing Process" text,
"Paper Type" text,
"First Day Cover Cancellation" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "Design" FROM table_27701 WHERE "Quantity" = '5,000,000' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
s... | SELECT COUNT(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night' | spider |
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_26307 (
"No." real,
"Episode" text,
"Rating" text,
"Share" real,
"Rating/share (18-49)" text,
"Viewers (millions)" text,
"Rank (timeslot)" real,
"Rank (night)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number... | SELECT MIN("No.") FROM table_26307 WHERE "Rating" = '4.7' | wikisql |
CREATE TABLE table_name_97 (
lane INTEGER,
heat VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest numbered Lane with a Time of 1:10.57 and Heat larger than 2?
| SELECT MIN(lane) FROM table_name_97 WHERE heat > 2 AND time = "1:10.57" | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY Name | nvbench |
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 COUNT(*) FROM t_kc24 WHERE PERSON_ID = '87682313' AND CLINIC_SLT_DATE BETWEEN '2005-12-13' AND '2021-10-01' AND MED_AMOUT <= 10 | css |
CREATE TABLE table_name_75 (
film VARCHAR,
recipient VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What film had Bub Ltd as the recipient?
| SELECT film FROM table_name_75 WHERE recipient = "bub ltd" | sql_create_context |
CREATE TABLE county_public_safety (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many counties are there?
| SELECT COUNT(*) FROM county_public_safety | sql_create_context |
CREATE TABLE table_58941 (
"Player" text,
"Height" real,
"Position" text,
"Year born (Age)" text,
"Current Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the tallest height for c position in current club unicaja malaga?
| SELECT MAX("Height") FROM table_58941 WHERE "Position" = 'c' AND "Current Club" = 'unicaja malaga' | wikisql |
CREATE TABLE table_name_61 (
wins__outdoor_ INTEGER,
wins__indoor_ VARCHAR,
rank VARCHAR,
wins__total_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average wins outdoor with rank more than 4 and wins less than 3 with outdoor wins more than... | SELECT AVG(wins__outdoor_) FROM table_name_61 WHERE rank > 4 AND wins__total_ < 3 AND wins__indoor_ > 0 | 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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '64711366' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-08-23' AND '2013-08-10' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID... | css |
CREATE TABLE table_64764 (
"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 most gold when the total is 7?
| SELECT MAX("Gold") FROM table_64764 WHERE "Total" = '7' | wikisql |
CREATE TABLE table_name_55 (
points INTEGER,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average points when played is less than 16?
| SELECT AVG(points) FROM table_name_55 WHERE played < 16 | sql_create_context |
CREATE TABLE table_16331144_1 (
winning_mentor VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winning mentor in season two?
| SELECT winning_mentor FROM table_16331144_1 WHERE season = "Two" | sql_create_context |
CREATE TABLE table_44973 (
"Player" text,
"League" real,
"Title Playoff" real,
"Super Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Title Playoff, when League is greater than 3, and when Super Cup is less than ... | SELECT MIN("Title Playoff") FROM table_44973 WHERE "League" > '3' AND "Super Cup" < '0' | wikisql |
CREATE TABLE table_80203 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home Captain has Venue of Bourda?
| SELECT "Home captain" FROM table_80203 WHERE "Venue" = 'bourda' | wikisql |
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_salary number
)
CREATE TABLE job_history (
employee_id number,
start_date time,
end_date time,
job_id text,
department_id number
)
CREATE TABLE locations (
location_id number,
street_address text,
p... | SELECT * FROM employees WHERE hire_date < '2002-06-21' | spider |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(SALARY) FROM employees | nvbench |
CREATE TABLE table_10601843_2 (
city VARCHAR,
capacity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has a capacity of 41903?
| SELECT city FROM table_10601843_2 WHERE capacity = 41903 | sql_create_context |
CREATE TABLE table_29917 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT MIN("Game") FROM table_29917 WHERE "Location Attendance" = 'The Palace of Auburn Hills 15,166' | wikisql |
CREATE TABLE table_77113 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Finish, when Country is 'United States', and when To Par is '+21'?
| SELECT "Finish" FROM table_77113 WHERE "Country" = 'united states' AND "To par" = '+21' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_... | css |
CREATE TABLE table_16799784_11 (
latitude VARCHAR,
diameter__km_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At what latitude can you find the diameter (km) of 500.0?
| SELECT latitude FROM table_16799784_11 WHERE diameter__km_ = "500.0" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | WITH Raw AS (SELECT Posts.OwnerUserId AS UserId, MIN(Users.Reputation) AS Reputation, COUNT(CASE WHEN Votes.VoteTypeId = 2 THEN 1 ELSE NULL END) AS UpVotes, COUNT(*) AS AllVotes FROM Users, Posts, Votes WHERE Users.Reputation >= '##MinRep:int?3000##' AND Votes.PostId = Posts.Id AND Posts.PostTypeId = 2 AND Posts.OwnerU... | sede |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | SELECT MIN(Tags.TagName) AS TagName, COUNT(*) AS TagCount, SUM(CAST(Posts.ViewCount AS INT)) AS TotalViewCount FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND PostTags.PostId = Posts.Id GROUP BY Tags.Id ORDER BY TotalViewCount DESC, Tags.Id LIMIT 1000 | sede |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
... | SELECT DISTINCT paper.paperid FROM paper, venue WHERE paper.year = 2014 AND paper.venueid = venue.venueid AND venue.venuename = 'ACL' | scholar |
CREATE TABLE table_name_30 (
word_form VARCHAR,
other VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What can you say is the word from of sam sep?
| SELECT word_form FROM table_name_30 WHERE other = "sam sep" | sql_create_context |
CREATE TABLE table_65344 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What home team has a tie no of 20?
| SELECT "Home team" FROM table_65344 WHERE "Tie no" = '20' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CI... | atis |
CREATE TABLE table_49086 (
"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 average Bronze, when Rank is greater than 6, when Nation is Italy (ITA), and whe... | SELECT AVG("Bronze") FROM table_49086 WHERE "Rank" > '6' AND "Nation" = 'italy (ita)' AND "Total" < '1' | wikisql |
CREATE TABLE table_name_37 (
points INTEGER,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest points of using mclaren m14a as chassis?
| SELECT MIN(points) FROM table_name_37 WHERE chassis = "mclaren m14a" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.