instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '03015928' AND t_kc22.STA_DATE BETWEEN '2011-04-01' AND '2012-04-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_name_52 (
november VARCHAR,
year VARCHAR,
october VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is in November after 1988 when Prinzzess is in October?
| SELECT november FROM table_name_52 WHERE year > 1988 AND october = "prinzzess" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
c... | SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'NATIVEAM' AND cours... | advising |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_204_48 (
id number,
"date" text,
"race name" text,
"location" text,
"uci rating" text,
"winner" text,
"team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the first race in the year ?
| SELECT "race name" FROM table_204_48 ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE player_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes TEXT
)
CREATE TABLE team_half (
year INTEGER,
league_id TEXT,
team_id TEXT,
half INTEGER,
div_id TEXT,
div_win TEXT,
rank INTEGER,
g INTEGER,
w INTEGER,
... | SELECT year, AVG(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC | nvbench |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
... | SELECT P.Id AS "post_link", P.CreationDate, P.Score, P.PostTypeId, p.LastEditDate, p.LastActivityDate FROM Posts AS P WHERE p.LastEditDate < DATEADD(month, -6, p.LastActivityDate) AND Score >= 5 AND (Title LIKE '%dinamic%' OR Title LIKE '%sintax%' OR Title LIKE '%programatically%') ORDER BY P.Score, P.CreationDate | sede |
CREATE TABLE table_30241 (
"Entrant" text,
"Constructor" text,
"Car" text,
"Driver" text,
"Co-driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the person that is part of the belgian vw club that works with fr d ric mi... | SELECT "Driver" FROM table_30241 WHERE "Entrant" = 'Belgian VW Club' AND "Co-driver" = 'Frédéric Miclotte' | wikisql |
CREATE TABLE table_15187735_19 (
segment_a VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the segment A on episode 237?
| SELECT segment_a FROM table_15187735_19 WHERE episode = 237 | sql_create_context |
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,
Join_Year int,
Team text
)
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE aircraft (
Aircraft_ID int,
Orde... | SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality | nvbench |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUser... | SELECT MAX(h.t), h.pc AS "Percent of closed answered negative-scored questions over time" FROM (SELECT q.t AS t, NTILE(100) OVER (ORDER BY q.t) AS pc FROM (SELECT ClosedDate - CreationDate AS t FROM Posts WHERE PostTypeId = 1 AND AnswerCount > 0 AND Score < 0 AND NOT ClosedDate IS NULL) AS q) AS h WHERE h.t <= '23:59:5... | sede |
CREATE TABLE table_name_68 (
first_airdate VARCHAR,
episodes VARCHAR,
nielsen_ranking VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the first airdate or the season that had less than 24 episodes and a Nielsen ranking of #38?
| SELECT first_airdate FROM table_name_68 WHERE episodes < 24 AND nielsen_ranking = "#38" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132')) AND intakeoutput.cellpath LIKE '%output... | eicu |
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,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 71689 AND STRFTIME('%y', admissions.admittime) = '2105' | mimic_iii |
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(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) | mimic_iii |
CREATE TABLE table_66089 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location for the game with a score of w 106-81?
| SELECT "Location/Attendance" FROM table_66089 WHERE "Score" = 'w 106-81' | wikisql |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT JZLSH FROM jybgb WHERE BGDH = '20790393793' | css |
CREATE TABLE table_name_55 (
area__km²_ INTEGER,
population__2010_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the lowest area with a population of 7,616?
| SELECT MIN(area__km²_) FROM table_name_55 WHERE population__2010_ = 7 OFFSET 616 | sql_create_context |
CREATE TABLE table_16588 (
"#" real,
"Episode" text,
"Air Date" text,
"Timeslot (EST)" text,
"Season" text,
"Rating" text,
"Share" real,
"18\u201349" text,
"Viewers (m)" text,
"Rank (#)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT COUNT("Rank (#)") FROM table_16588 WHERE "Viewers (m)" = '5.96' | wikisql |
CREATE TABLE table_6104 (
"Celebrity" text,
"Known for" text,
"Entered" text,
"Exited" text,
"Finished" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did the person who finished in 12th place leave on?
| SELECT "Exited" FROM table_6104 WHERE "Finished" = '12th' | wikisql |
CREATE TABLE book_club (
publisher VARCHAR,
YEAR VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all publishers which do not have a book in 1989.
| SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989 | sql_create_context |
CREATE TABLE table_name_47 (
overall INTEGER,
pick__number VARCHAR,
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Position of defensive tackle, and a Round of 4, and a Pick # smaller than 36 has what overall average?
| SELECT AVG(overall) FROM table_name_47 WHERE position = "defensive tackle" AND round = 4 AND pick__number < 36 | sql_create_context |
CREATE TABLE table_name_24 (
record VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Record of the game in which the Trail Blazers was the visiting team?
| SELECT record FROM table_name_24 WHERE visitor = "trail blazers" | sql_create_context |
CREATE TABLE table_name_99 (
date VARCHAR,
decision VARCHAR,
home VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Home of montreal canadiens, and Points larger than 9, and a Decision of price?
| SELECT date FROM table_name_99 WHERE home = "montreal canadiens" AND points > 9 AND decision = "price" | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Scott Baron%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer... | advising |
CREATE TABLE Albums (
label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the labels?
| SELECT DISTINCT label FROM Albums | sql_create_context |
CREATE TABLE table_name_72 (
driver VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which river had 26 points?
| SELECT driver FROM table_name_72 WHERE points = 26 | sql_create_context |
CREATE TABLE table_70184 (
"Week" real,
"Issue Date" text,
"Artist" text,
"Single" text,
"Download" text,
"Title" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Issue Date for an Eric Prydz song with a no available Download informatio... | SELECT "Issue Date" FROM table_70184 WHERE "Download" = 'no available' AND "Artist" = 'eric prydz' | wikisql |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_date time,
order_status_code text
)
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE customers... | SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county | spider |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-153198')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE table_name_59 (
december INTEGER,
opponent VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum for December against the vancouver canucks earlier than game 33?
| SELECT SUM(december) FROM table_name_59 WHERE opponent = "vancouver canucks" AND game < 33 | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airli... | 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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 2 AND date_day.month_number =... | atis |
CREATE TABLE table_name_96 (
cuts_made INTEGER,
wins VARCHAR,
top_5 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many vuts made for a player with 2 wins and under 7 top 5s?
| SELECT AVG(cuts_made) FROM table_name_96 WHERE wins = 2 AND top_5 < 7 | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '11260648' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '氟哌啶醇片(糖衣)') | css |
CREATE TABLE table_name_47 (
result VARCHAR,
opponent VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the opponent was Brechin City and the attendance was 656, what was the Result?
| SELECT result FROM table_name_47 WHERE opponent = "brechin city" AND attendance = 656 | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | SELECT COUNT(*) AS ActivePosters5 FROM Posts AS p WHERE p.Score >= 0 AND DATEDIFF(day, p.CreationDate, GETDATE()) <= 30 GROUP BY p.OwnerUserId HAVING COUNT(p.Id) >= 5 | sede |
CREATE TABLE table_11224 (
"Name" text,
"Area (km 2 )" real,
"Population Estimate 2005" real,
"Population Census 2010" real,
"Capital" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the population estimate 2005 for the with the area (km2) 3,... | SELECT AVG("Population Estimate 2005") FROM table_11224 WHERE "Area (km 2 )" = '3,034.08' | wikisql |
CREATE TABLE table_name_75 (
name VARCHAR,
rank VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the name for rank less than 6 and year more than 1974
| SELECT name FROM table_name_75 WHERE rank < 6 AND year > 1974 | sql_create_context |
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.JCRGH, jyjgzbb.JCRXM 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 = jyjgzbb.... | css |
CREATE TABLE table_26156 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest numbered division Cleveland played in?
| SELECT MIN("Division") FROM table_26156 | wikisql |
CREATE TABLE table_name_50 (
attendance INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Attendance with a Result that is w 24-21?
| SELECT MAX(attendance) FROM table_name_50 WHERE result = "w 24-21" | 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE proce... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_10885 (
"Model number" text,
"Frequency" text,
"L2 cache" text,
"FPU width" text,
"Multiplier 1" text,
"Socket" text,
"Release date" text,
"Order part number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the ... | SELECT "Frequency" FROM table_10885 WHERE "Order part number" = 'tmn550dcr23gm' | wikisql |
CREATE TABLE table_57294 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the speed for andy reynolds
| SELECT "Speed" FROM table_57294 WHERE "Rider" = 'andy reynolds' | wikisql |
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 SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '褚泰鸿' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-01-20' AND '2021-04-06' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PE... | css |
CREATE TABLE table_2402209_1 (
no_of_barangays VARCHAR,
area_coordinator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Barangays lived in the municipality with area coordinator of 110.95?
| SELECT no_of_barangays FROM table_2402209_1 WHERE area_coordinator = "110.95" | sql_create_context |
CREATE TABLE table_41530 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" text,
"Province / Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Caps, when Province / Club is DRFC, and when Position is Center?
| SELECT "Caps" FROM table_41530 WHERE "Province / Club" = 'drfc' AND "Position" = 'center' | wikisql |
CREATE TABLE table_train_107 (
"id" int,
"systolic_blood_pressure_sbp" int,
"body_weight" float,
"modified_hachinski_ischemia_scale" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"clinical_dementia_rating_cdr" float,
"NOUSE" float
)
-- Using valid SQLite, answer... | SELECT * FROM table_train_107 WHERE modified_hachinski_ischemia_scale <= 4 | criteria2sql |
CREATE TABLE table_train_277 (
"id" int,
"gender" string,
"cholesterol" float,
"blood_platelet_counts" int,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"severe_dyslipidemia" bool,
"fasting_triglyceride" int,
"body_mass_index_bmi" float,
"trig... | SELECT * FROM table_train_277 WHERE (creatinine_clearance_cl > 1.4 AND gender = 'female') OR (creatinine_clearance_cl > 1.5 AND gender = 'male') OR estimated_glomerular_filtration_rate_egfr < 60 | criteria2sql |
CREATE TABLE table_20963074_1 (
result VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of results for octubre
| SELECT COUNT(result) FROM table_20963074_1 WHERE original_title = "Octubre" | 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 * FROM qtb WHERE qtb.MED_SER_ORG_NO = '3713663' AND qtb.IN_HOSP_DATE BETWEEN '2008-07-24' AND '2015-01-04' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '3713663' AND gyb.IN_HOSP_DATE BETWEEN '2008-07-24' AND '2015-01-04' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '3713663' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE table_name_22 (
launched VARCHAR,
commissioned VARCHAR,
bow_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the ship that was commissioned July 1948 with a bow number of ps-31 launch?
| SELECT launched FROM table_name_22 WHERE commissioned = "july 1948" AND bow_number = "ps-31" | sql_create_context |
CREATE TABLE table_44259 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Team points" real,
"Opponent score" real,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which streak before game 12 had a team... | SELECT "Streak" FROM table_44259 WHERE "Team points" > '113' AND "Game" < '12' AND "Date" = 'november 16' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-111547') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medic... | eicu |
CREATE TABLE table_18600760_13 (
ansi_code INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest ansi code?
| SELECT MIN(ansi_code) FROM table_18600760_13 | sql_create_context |
CREATE TABLE table_27359 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the NFL Teams in College North Texas State?
| SELECT "NFL Team" FROM table_27359 WHERE "College" = 'North Texas State' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-50177' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '003-50177' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_51165 (
"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 D... | SELECT "Date" FROM table_51165 WHERE "Game" < '58' AND "Team" = 'boston' | wikisql |
CREATE TABLE table_40927 (
"From" real,
"Goal" text,
"Round 1" text,
"Round 2" text,
"Round 3" text,
"Round 4" text,
"Round 5" text,
"Round 6+" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Round 4 when Round 6+ is triple, Round... | SELECT "Round 4" FROM table_40927 WHERE "Round 6+" = 'triple' AND "Round 5" = 'triple' AND "Round 3" = 'single' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Iran%' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT wdmzjzjlb.ZZYSGH, wdmzjzjlb.QTJZYSGH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '16949706262' UNION SELECT bdmzjzjlb.ZZYSGH, bdmzjzjlb.QTJZYSGH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '16949706262' | css |
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id number,
bike_id number,
subscription_type text,
zip_code number
)
CREATE TABLE station (
id number,
... | SELECT DISTINCT start_station_name FROM trip WHERE duration < 100 | spider |
CREATE TABLE table_10432 (
"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 date when Richmond was the home team... | SELECT "Date" FROM table_10432 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE table_279 (
"car plates (since 1937)" text,
"Voivodeship Separate city" text,
"Capital" text,
"Area in 1000km\u00b2 (1930)" text,
"Population in 1000 (1931)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all areas within 1000 km i... | SELECT "Area in 1000km\u00b2 (1930)" FROM table_279 WHERE "Voivodeship Separate city" = 'lubelskie' | wikisql |
CREATE TABLE table_name_60 (
events INTEGER,
player VARCHAR,
earnings___$__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Events have a Player of tom kite, and Earnings ($) smaller than 760,405?
| SELECT AVG(events) FROM table_name_60 WHERE player = "tom kite" AND earnings___$__ < 760 OFFSET 405 | sql_create_context |
CREATE TABLE table_1637981_7 (
detroit__dtw_ VARCHAR,
grand_rapids__grr_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Grand Rapids's fare was $377.29, what is the fare to Detroit?
| SELECT detroit__dtw_ FROM table_1637981_7 WHERE grand_rapids__grr_ = "$377.29" | sql_create_context |
CREATE TABLE table_name_3 (
surface VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the surface for the opponent Marcos Baghdatis?
| SELECT surface FROM table_name_3 WHERE opponent = "marcos baghdatis" | sql_create_context |
CREATE TABLE table_name_59 (
rank INTEGER,
result VARCHAR,
group VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rank for Group A athlete Yanina Karolchyk, and a result higher than 18?
| SELECT AVG(rank) FROM table_name_59 WHERE group = "a" AND athlete = "yanina karolchyk" AND result > 18 | sql_create_context |
CREATE TABLE table_name_45 (
finish INTEGER,
start VARCHAR,
year VARCHAR,
manufacturer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest finish time for a race where start was less than 3, buick was the manufacturer, and the race wa... | SELECT MIN(finish) FROM table_name_45 WHERE year > 1978 AND manufacturer = "buick" AND start < 3 | sql_create_context |
CREATE TABLE table_66952 (
"Year" real,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What division did the Nashville Metros play in during the year that they di... | SELECT "Division" FROM table_66952 WHERE "Playoffs" = 'did not qualify' AND "League" = 'usl pdl' AND "Regular Season" = '7th, southeast' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "20" AND prescriptions.drug = "NEO*IV*Fat Emulsion" | mimicsql_data |
CREATE TABLE table_238124_1 (
bleeding_time VARCHAR,
condition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the bleeding time for glanzmann's thrombasthenia?
| SELECT bleeding_time FROM table_238124_1 WHERE condition = "Glanzmann's thrombasthenia" | sql_create_context |
CREATE TABLE table_26464 (
"Confederation" text,
"Teams started" text,
"Teams that have secured qualification" text,
"Teams that can still qualify" text,
"Teams that have been eliminated" text,
"Remaining places in finals" text,
"Total places in finals" text,
"Qualifying start date" text... | SELECT "Qualifying end date" FROM table_26464 WHERE "Qualifying start date" = 'Qualifying start date' | wikisql |
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 (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ... | eicu |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varc... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.sem... | advising |
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 zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '王飞燕' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2020-10-1... | css |
CREATE TABLE table_name_34 (
score VARCHAR,
total_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score where the total points was 50?
| SELECT score FROM table_name_34 WHERE total_points = 50 | sql_create_context |
CREATE TABLE table_name_50 (
elevator VARCHAR,
elevated VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Elevator of the Elected Elevated on September 21, 1179?
| SELECT elevator FROM table_name_50 WHERE elevated = "september 21, 1179" | sql_create_context |
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 TOP(15) AS Id, FavoriteCount AS Votes, CommentCount AS Answers, ViewCount AS Views, Title FROM Posts WHERE NOT Title IS NULL ORDER BY Score DESC | sede |
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '32467373' | css |
CREATE TABLE table_69496 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Attendance larger than 55,189 is which average game?
| SELECT AVG("Game") FROM table_69496 WHERE "Attendance" > '55,189' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'ptt' | eicu |
CREATE TABLE table_32200 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total overall in round 1, in which Charles White was a player?
| SELECT SUM("Overall") FROM table_32200 WHERE "Player" = 'charles white' AND "Round" < '1' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT mzjzjlb.SG, mzjzjlb.TZ, mzjzjlb.TW, mzjzjlb.SSY, mzjzjlb.SZY, mzjzjlb.XL, mzjzjlb.HXPLC, mzjzjlb.ML FROM mzjzjlb WHERE mzjzjlb.JZLSH = '08031682316' | css |
CREATE TABLE table_62659 (
"Rank" real,
"Railway Station" text,
"Annual entry/exit (millions) 2011\u201312" real,
"Annual interchanges (millions) 2011\u201312" real,
"Total Passengers (millions) 2011\u201312" real,
"Location" text,
"Number of Platforms" real
)
-- Using valid SQLite, answer... | SELECT MIN("Total Passengers (millions) 2011\u201312") FROM table_62659 WHERE "Annual entry/exit (millions) 2011\u201312" = '36.609' | wikisql |
CREATE TABLE table_204_416 (
id number,
"chip" text,
"flash size" text,
"eeprom" number,
"sram" number,
"frequency\n[mhz]" number,
"package" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the flash size difference in the at90s8515 ch... | SELECT ABS((SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s8515') - (SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s4414')) | squall |
CREATE TABLE table_57402 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score for december 5
| SELECT "Score" FROM table_57402 WHERE "Date" = 'december 5' | wikisql |
CREATE TABLE table_name_29 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average crowd to watch Hawthorn as the away team?
| SELECT AVG(crowd) FROM table_name_29 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE table_name_69 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 2007 of 8 4 is involved in what 2002?
| SELECT 2002 FROM table_name_69 WHERE 2007 = "8–4" | sql_create_context |
CREATE TABLE table_17360840_9 (
attendance INTEGER,
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance when the opposing team was the Ottawa Senators and the record was 24-35-17?
| SELECT MAX(attendance) FROM table_17360840_9 WHERE opponent = "Ottawa Senators" AND record = "24-35-17" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992') AND patient.unitdischargetime IS NULL) ... | eicu |
CREATE TABLE table_42341 (
"Year" text,
"Matches" text,
"Wins" text,
"Losses" text,
"No Result" text,
"Success Rate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the win for the 6 matches?
| SELECT "Wins" FROM table_42341 WHERE "Matches" = '6' | wikisql |
CREATE TABLE table_169766_13 (
show VARCHAR,
new_returning_same_network VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which show was sent to syndication for its new/returning/same network.
| SELECT show FROM table_169766_13 WHERE new_returning_same_network = "Syndication" | sql_create_context |
CREATE TABLE table_203_277 (
id number,
"entered" number,
"wrestler" text,
"place" text,
"eliminated by" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many wrestlers had a time of 6:47 ?
| SELECT COUNT("wrestler") FROM table_203_277 WHERE "time" = '06:47' | squall |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country DESC | nvbench |
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 SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '6493695' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-05-01' AND '2010-01-25' | css |
CREATE TABLE table_40292 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" real,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which week was the beatles the original artist and the order # smaller... | SELECT "Week #" FROM table_40292 WHERE "Original artist" = 'the beatles' AND "Order #" < '10' | wikisql |
CREATE TABLE table_52202 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game did was Bud Eley a player in?
| SELECT "Games" FROM table_52202 WHERE "Name" = 'bud eley' | wikisql |
CREATE TABLE table_54432 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament has a 2011 of 1r?
| SELECT "Tournament" FROM table_54432 WHERE "2011" = '1r' | wikisql |
CREATE TABLE table_23409 (
"No. overall" text,
"No. in series" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of families for uk30
| SELECT COUNT("Family/families") FROM table_23409 WHERE "No. overall" = 'UK30' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.