instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_70067 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which average bronze had a silver greater than 2 and a gold larger than 7?
| SELECT AVG("Bronze") FROM table_70067 WHERE "Silver" > '2' AND "Gold" > '7' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'reticulocyte count, manual')) | mimic_iii |
CREATE TABLE table_12153 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MAX("Losses") FROM table_12153 WHERE "Goals against" > '31' AND "Goals for" = '38' AND "Club" = 'cf calvo sotelo' AND "Played" < '30' | wikisql |
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
-- Using valid SQLite, answer the following questions ... | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country | nvbench |
CREATE TABLE table_47919 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "Date of appointment" FROM table_47919 WHERE "Replaced by" = 'markus babbel' | wikisql |
CREATE TABLE table_name_42 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Original title of Children of Sarajevo?
| SELECT original_title FROM table_name_42 WHERE film_title_used_in_nomination = "children of sarajevo" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT ILL_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '01468300137' | css |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0... | mimic_iii |
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 patient (
uniquepid text,
... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia - anemia of renal disease' AND STRFTIME('%y', diagnosis.diagnosistime) = '2101') AS t1 JOIN (SELECT p... | eicu |
CREATE TABLE table_name_72 (
total INTEGER,
date VARCHAR,
greater_doubles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Total has a Date of 1602, and Greater Doubles smaller than 16?
| SELECT MAX(total) FROM table_name_72 WHERE date = 1602 AND greater_doubles < 16 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '22035367321' | css |
CREATE TABLE table_54315 (
"PRR Class" text,
"Builder\u2019s Model" text,
"Build date" text,
"Total produced" real,
"Wheel arrangement" text,
"Service" text,
"Power output" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the build dat... | SELECT "Build date" FROM table_54315 WHERE "PRR Class" = 'brs24' | wikisql |
CREATE TABLE table_43162 (
"Year" text,
"Champion" text,
"Country" text,
"To par" text,
"Margin of victory" text,
"Winner's share ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is to par for the Winner's share 450,000
| SELECT "To par" FROM table_43162 WHERE "Winner's share ( $ )" = '450,000' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | SELECT COUNT(*) AS result FROM (SELECT COUNT(*) AS numPosts FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE Users.CreationDate < DATEADD(year, -10, GETDATE()) GROUP BY Users.Id) AS x WHERE x.numPosts >= 10 | sede |
CREATE TABLE game (
stadium_id number,
id number,
season number,
date text,
home_team text,
away_team text,
score text,
competition text
)
CREATE TABLE injury_accident (
game_id number,
id number,
player text,
injury text,
number_of_matches text,
source text
)
C... | SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_853 (
"Rnd" real,
"Circuit" text,
"GTP Winning Team" text,
"Lights Winning Team" text,
"GTO Winning Team" text,
"GTU Winning Team" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the results for steve m... | SELECT "Results" FROM table_853 WHERE "GTO Winning Team" = 'Steve Millen' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V4983" AND prescriptions.route = "IV DRIP" | mimicsql_data |
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 jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.BGDH = '49398353012' | css |
CREATE TABLE table_name_85 (
original_air_date VARCHAR,
series__number VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of a series number after 78, written by Jenee V. Giles?
| SELECT original_air_date FROM table_name_85 WHERE series__number > 78 AND written_by = "jenee v. giles" | sql_create_context |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | SELECT County, COUNT(County) FROM appellations GROUP BY County | nvbench |
CREATE TABLE table_27790 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Young Rider Classification" text,
"Team Classification" text,
"Aggressive Rider" text
)
-- Using valid SQLite, answer the following que... | SELECT "Stage" FROM table_27790 WHERE "Winner" = 'Luis León Sánchez' | wikisql |
CREATE TABLE table_22753245_1 (
constituency VARCHAR,
runner_up_a VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the constituency when the runner-up was d. Venugopal?
| SELECT constituency FROM table_22753245_1 WHERE runner_up_a = "D. Venugopal" | sql_create_context |
CREATE TABLE table_name_95 (
money___ INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Money ($) has a Score of 70-66-73-69=278?
| SELECT AVG(money___) AS $__ FROM table_name_95 WHERE score = 70 - 66 - 73 - 69 = 278 | 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8773 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'pantoprazole' ORDER BY prescriptions.startdate DESC LI... | mimic_iii |
CREATE TABLE table_48860 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Country is United States, and when Player is 'Arnold Palmer'?
| SELECT "Score" FROM table_48860 WHERE "Country" = 'united states' AND "Player" = 'arnold palmer' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vancomycin' AND admissions.subject_id = 3918 AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'sta... | mimic_iii |
CREATE TABLE table_22269839_1 (
written_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the title with production code 7acx14?
| SELECT written_by FROM table_22269839_1 WHERE production_code = "7ACX14" | sql_create_context |
CREATE TABLE table_17246160_1 (
season INTEGER,
points VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season did he have 0 points and 31st position?
| SELECT MAX(season) FROM table_17246160_1 WHERE points = 0 AND position = "31st" | sql_create_context |
CREATE TABLE table_name_61 (
attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total attendance for games when the record was 23-23?
| SELECT COUNT(attendance) FROM table_name_61 WHERE record = "23-23" | sql_create_context |
CREATE TABLE table_58082 (
"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.
-- If collingwood was the Home team, what Date did ... | SELECT "Date" FROM table_58082 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE table_204_891 (
id number,
"name" text,
"hanzi" text,
"population (2005)" number,
"area (km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total population in 2005 of qingxi , ruyi , and daping combined ?
| SELECT SUM("population (2005)") FROM table_204_891 WHERE "name" IN ('qingxi', 'ruyi', 'daping') | squall |
CREATE TABLE table_1277 (
"Mission name" text,
"Lunar lander" text,
"Lunar landing date" text,
"Lunar blastoff date" text,
"Lunar landing site" text,
"Duration on lunar surface" text,
"Crew" text,
"Number of s EVA" real,
"Total EVA Time (HH:MM)" text
)
-- Using valid SQLite, answer... | SELECT MAX("Number of s EVA") FROM table_1277 | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Road | nvbench |
CREATE TABLE table_name_66 (
runner_up VARCHAR,
champion VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the runner-up, when the champion was Bj rn Borg after 1978?
| SELECT runner_up FROM table_name_66 WHERE champion = "björn borg" AND year > 1978 | sql_create_context |
CREATE TABLE stores (
store_id text,
address_id number,
marketing_region_code text,
store_name text,
store_phone text,
store_email_address text,
other_details text
)
CREATE TABLE bookings (
booking_id number,
customer_id number,
workshop_group_id text,
status_code text,
... | SELECT DISTINCT payment_method_code FROM invoices | spider |
CREATE TABLE table_name_88 (
office VARCHAR,
democratic_ticket VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Office has a Democratic ticket of herbert h. lehman?
| SELECT office FROM table_name_88 WHERE democratic_ticket = "herbert h. lehman" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
had... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ... | mimic_iii |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
dep... | 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_name_52 (
fcc_info VARCHAR,
facility_id VARCHAR,
frequency_mhz VARCHAR,
erp_w VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the FCC info for the call sign with a frequency MHz of 101.3, a ERP W over 10, and a Facility ID s... | SELECT fcc_info FROM table_name_52 WHERE frequency_mhz = 101.3 AND erp_w > 10 AND facility_id < 87027 | sql_create_context |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2180" AND procedures.long_title = "Arteriography of femoral and other lower extremity arteries" | mimicsql_data |
CREATE TABLE table_66502 (
"Title" text,
"Series" text,
"Director" text,
"Production Num." real,
"Release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many production numbers have a Title of bosko in dutch?
| SELECT SUM("Production Num.") FROM table_66502 WHERE "Title" = 'bosko in dutch' | wikisql |
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 SOC_SRT_DIRE_CD FROM t_kc22 WHERE MED_CLINIC_ID = '86193769835' AND SOC_SRT_DIRE_NM = '丙戊酸钠片(糖衣)' | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.formulary_drug_cd = "NS100" | mimicsql_data |
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
-- Using valid SQLite, answer the follo... | SELECT name FROM climber ORDER BY points DESC | spider |
CREATE TABLE table_name_67 (
country VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Country, when Event is Rip Curl Women's Pro?
| SELECT country FROM table_name_67 WHERE event = "rip curl women's pro" | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2178" AND prescriptions.route = "NEB" | mimicsql_data |
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
-- Using valid SQLite, answer the follo... | SELECT COUNT(*) FROM climber | spider |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_name_87 (
season VARCHAR,
player_of_the_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For which season is Tim Mikkelson player of the year?
| SELECT season FROM table_name_87 WHERE player_of_the_year = "tim mikkelson" | sql_create_context |
CREATE TABLE table_61545 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Position, when Player is 'Magnus Nygren'?
| SELECT "Position" FROM table_61545 WHERE "Player" = 'magnus nygren' | wikisql |
CREATE TABLE table_203_387 (
id number,
"parish est" number,
"church" text,
"city" text,
"current bldg begun" number,
"weekly collections" text,
"notes" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many different cities are the liste... | SELECT COUNT(DISTINCT "city") FROM table_203_387 | squall |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "82" AND procedures.short_title = "Endosc destruc esoph les" | mimicsql_data |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ... | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY COUNT(title) | nvbench |
CREATE TABLE table_1134091_4 (
vacator VARCHAR,
date_successor_seated VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the vacator when the date successor seated was august 21, 1973?
| SELECT vacator FROM table_1134091_4 WHERE date_successor_seated = "August 21, 1973" | sql_create_context |
CREATE TABLE table_65272 (
"Position" text,
"Name" text,
"Year at CU" text,
"Experience" real,
"Alma Mater" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year at CU is the person in video services with an experience less than 1?
| SELECT "Year at CU" FROM table_65272 WHERE "Experience" < '1' AND "Position" = 'video services' | wikisql |
CREATE TABLE table_75363 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Points have a January of 18?
| SELECT COUNT("Points") FROM table_75363 WHERE "January" = '18' | wikisql |
CREATE TABLE table_42645 (
"Date" text,
"Location" text,
"Country" text,
"Event" text,
"Winner" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Winner of the French Polynesia Billabong Pro Event?
| SELECT "Winner" FROM table_42645 WHERE "Event" = 'billabong pro' AND "Country" = 'french polynesia' | wikisql |
CREATE TABLE table_27616 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what game sites are there wher... | SELECT "Game site" FROM table_27616 WHERE "Team record" = '0–5' | wikisql |
CREATE TABLE table_44926 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score for T9 United States Player Kirk Triplett?
| SELECT "Score" FROM table_44926 WHERE "Place" = 't9' AND "Country" = 'united states' AND "Player" = 'kirk triplett' | wikisql |
CREATE TABLE detention (
detention_id number,
detention_type_code text,
teacher_id number,
datetime_detention_start time,
datetime_detention_end time,
detention_summary text,
other_details text
)
CREATE TABLE ref_detention_type (
detention_type_code text,
detention_type_description ... | SELECT incident_type_description FROM ref_incident_type WHERE incident_type_code = "VIOLENCE" | spider |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | 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-6009')) AND DATETIME(medication.drugstarttime, 'start of month') = DAT... | eicu |
CREATE TABLE table_name_4 (
rebounds INTEGER,
minutes_played VARCHAR,
games_played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Rebounds, when Minutes Played is '113', and when Games Played is greater than '18'?
| SELECT AVG(rebounds) FROM table_name_4 WHERE minutes_played = 113 AND games_played > 18 | sql_create_context |
CREATE TABLE table_name_19 (
school_year VARCHAR,
cross_country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is School Year, when Cross Country is Wooster?
| SELECT school_year FROM table_name_19 WHERE cross_country = "wooster" | sql_create_context |
CREATE TABLE table_name_23 (
losses INTEGER,
goals_for INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average losses for 22 goals?
| SELECT AVG(losses) FROM table_name_23 WHERE goals_for > 22 | sql_create_context |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment tex... | SELECT a.Id AS "post_link", a.Score, COUNT(c.Id) AS "comment_count" FROM Posts AS q INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags ON Tags.Id = pt.TagId INNER JOIN Posts AS a ON q.Id = a.ParentId INNER JOIN Comments AS c ON c.PostId = a.Id WHERE Tags.TagName LIKE '##tag:string##' AND a.Score > 1 AND c.Sc... | sede |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY < (SELECT MIN(SALARY) FROM employees WHERE JOB_ID = 'MK_MAN') GROUP BY JOB_ID | nvbench |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy... | css |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLA... | atis |
CREATE TABLE table_name_19 (
gold INTEGER,
bronze VARCHAR,
total VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of gold medals won by Brazil for entries with more than 1 bronze medal but a total smaller than... | SELECT AVG(gold) FROM table_name_19 WHERE total < 4 AND nation = "brazil" AND bronze > 1 | sql_create_context |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '2型糖尿病' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇' UNION SELECT jyjgzbb.CKZ... | css |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_... | SELECT installation_date, COUNT(installation_date) FROM station | nvbench |
CREATE TABLE table_12709 (
"Year" real,
"Championship" text,
"Partnering" text,
"Opponents in Final" text,
"Score in Final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the Shingo Kunieda Satoshi Saida were the opponents?
| SELECT "Score in Final" FROM table_12709 WHERE "Opponents in Final" = 'shingo kunieda satoshi saida' | wikisql |
CREATE TABLE table_31380 (
"Value" text,
"Dimensions" text,
"Main Color" text,
"Obverse" text,
"Reverse" text,
"Watermark" text,
"Date of issue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the dimensions of the coin worth 200?
| SELECT "Dimensions" FROM table_31380 WHERE "Value" = '₩200' | wikisql |
CREATE TABLE table_2553 (
"Team" text,
"Outgoing manager(s)" text,
"Manner of departure" text,
"Date of vacancy" text,
"Position in table" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What wa... | SELECT "Date of appointment" FROM table_2553 WHERE "Position in table" = '10th' | wikisql |
CREATE TABLE table_200_0 (
id number,
"year" number,
"title" text,
"chart-positions\nuk" number,
"chart-positions\nus" number,
"chart-positions\nnl" number,
"comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the earliest albu... | SELECT "title" FROM table_200_0 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape | nvbench |
CREATE TABLE table_name_34 (
total INTEGER,
rank VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total when the rank is 14 and the gold medals is larger than 0?
| SELECT MIN(total) FROM table_name_34 WHERE rank = "14" AND gold > 0 | 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 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 '2007-01-10' AND '2011-12-26' 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_29162856_1 (
fastest_lap VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the fastest lap in round 1?
| SELECT fastest_lap FROM table_29162856_1 WHERE round = 1 | sql_create_context |
CREATE TABLE table_name_8 (
bronze VARCHAR,
gold INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many bronze medals for the nation with over 9 golds?
| SELECT COUNT(bronze) FROM table_name_8 WHERE gold > 9 | sql_create_context |
CREATE TABLE table_30020 (
"Series #" real,
"Episode #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of episod... | SELECT "Title" FROM table_30020 WHERE "Episode #" = '9-10' | wikisql |
CREATE TABLE table_34492 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round of Tommy Allman, who had a pick less than 40?
| SELECT MAX("Round") FROM table_34492 WHERE "Player" = 'tommy allman' AND "Pick" < '40' | wikisql |
CREATE TABLE table_54017 (
"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.
-- Where does Carlton play?
| SELECT "Venue" FROM table_54017 WHERE "Home team" = 'carlton' | wikisql |
CREATE TABLE table_18207285_2 (
opponents INTEGER,
result VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many opponents played 1 game with a result win?
| SELECT MAX(opponents) FROM table_18207285_2 WHERE result = "Win" AND game = 1 | sql_create_context |
CREATE TABLE table_64651 (
"Rank" real,
"Name" text,
"Status" text,
"City" text,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of floors for the number 2 ranked Joyus Housing?
| SELECT MIN("Floors") FROM table_64651 WHERE "Name" = 'joyus housing' AND "Rank" < '2' | wikisql |
CREATE TABLE table_63835 (
"Model" text,
"Engine" text,
"Displacement" text,
"Valvetrain" text,
"Fuel system" text,
"Max. power at rpm" text,
"Max. torque at rpm" text,
"Years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What fuel sys... | SELECT "Fuel system" FROM table_63835 WHERE "Model" = 'diesel engines' | wikisql |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | SELECT Party, COUNT(*) FROM driver GROUP BY Party ORDER BY Party DESC | nvbench |
CREATE TABLE table_43925 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest bronze value with silvers over 2, golds under 16, and in Cycling?
| SELECT MAX("Bronze") FROM table_43925 WHERE "Silver" > '2' AND "Sport" = 'cycling' AND "Gold" < '16' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLO... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_1342379_41 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district does edward everett eslick represent?
| SELECT district FROM table_1342379_41 WHERE incumbent = "Edward Everett Eslick" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "5" | mimicsql_data |
CREATE TABLE table_name_31 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country that has a Player of Scott Hoch?
| SELECT country FROM table_name_31 WHERE player = "scott hoch" | sql_create_context |
CREATE TABLE table_77050 (
"Team" text,
"Manager" text,
"Home city" text,
"Stadium" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the stadium of the NK Zagreb?
| SELECT "Stadium" FROM table_77050 WHERE "Team" = 'nk zagreb' | wikisql |
CREATE TABLE table_name_89 (
segment_a VARCHAR,
netflix VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the segment A for netflix of s05e01
| SELECT segment_a FROM table_name_89 WHERE netflix = "s05e01" | sql_create_context |
CREATE TABLE table_203_222 (
id number,
"category" text,
"#" number,
"name" text,
"hanzi" text,
"hanyu pinyin" text,
"population (2010 census)" number,
"area (km2)" number,
"density (/km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "name" FROM table_203_222 ORDER BY "density (/km2)" LIMIT 1 | squall |
CREATE TABLE table_73283 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes have Valerie?
| SELECT COUNT("Episode Summary") FROM table_73283 WHERE "Coach" = 'Valerie' | wikisql |
CREATE TABLE table_55892 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game played at rich stadium?
| SELECT "Date" FROM table_55892 WHERE "Game site" = 'rich stadium' | wikisql |
CREATE TABLE table_51060 (
"Year" real,
"Beer Name" text,
"Prize" text,
"Category" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What beer won a silver medal at the camra reading branch beer festival in 2008?
| SELECT "Beer Name" FROM table_51060 WHERE "Prize" = 'silver medal' AND "Competition" = 'camra reading branch beer festival' AND "Year" = '2008' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26793) AND prescriptions.drug = '0.9% sodium chloride' AND STRFTIME('%y', prescriptions.startdate) = '2105' | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.