instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_reported DATETIME,
date_problem_closed DATETIME,
problem_description VARCHAR(255),
other_problem_details VARCHAR(255)
)
CREATE TABLE Problem... | SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date) | nvbench |
CREATE TABLE table_name_7 (
high_rebounds VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the high rebounds when the score was l 122 93?
| SELECT high_rebounds FROM table_name_7 WHERE score = "l 122–93" | 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_ty... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
)
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
)
-- Using valid SQLite, answer the... | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country | nvbench |
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 t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '59693307352' | css |
CREATE TABLE table_48131 (
"Event" text,
"Year" real,
"Category" text,
"Work" text,
"Outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What category was the nominated in after 2008?
| SELECT "Category" FROM table_48131 WHERE "Outcome" = 'nominated' AND "Year" > '2008' | wikisql |
CREATE TABLE table_26141 (
"Year" real,
"Driver" text,
"Constructor" text,
"Location" text,
"Formula" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did Randy Lewis drive?
| SELECT "Year" FROM table_26141 WHERE "Driver" = 'Randy Lewis' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count ... | SELECT LENGTH(Body) / @line_length, AVG(CAST(Score AS FLOAT)) FROM Posts WHERE Score > 1 AND ViewCount > 0 AND LENGTH(Body) BETWEEN 1 AND 1500 GROUP BY LENGTH(Body) / @line_length ORDER BY LENGTH(Body) / @line_length | sede |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 jobs (
JOB_ID varchar(10),
JOB_... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID 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 t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '11260648' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '氟哌啶醇片(糖衣)') | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | SELECT (SELECT COUNT(*) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '36091672' AND wdmzjzjlb.JZKSRQ BETWEEN '2002-02-09' AND '2005-03-12' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjl... | css |
CREATE TABLE table_name_86 (
date VARCHAR,
score VARCHAR,
result VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has lost as the result and a competition of friendly with 1-2 as the score?
| SELECT date FROM table_name_86 WHERE result = "lost" AND competition = "friendly" AND score = "1-2" | sql_create_context |
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 jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '83925055' AND jybgb.BGRQ BETWEEN '2007-12-02' AND '2008-06-25' UNI... | css |
CREATE TABLE WINE (
Grape VARCHAR
)
CREATE TABLE GRAPES (
Color VARCHAR,
Grape VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the color of the grape whose wine products has the highest average price?
| SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_94 (
attendance VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Attendance of the game with a Score of 0 0?
| SELECT attendance FROM table_name_94 WHERE score = "0 – 0" | sql_create_context |
CREATE TABLE table_name_54 (
location VARCHAR,
classification VARCHAR,
institution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is NCAA division ii Franklin Pierce University located at?
| SELECT location FROM table_name_54 WHERE classification = "ncaa division ii" AND institution = "franklin pierce university" | sql_create_context |
CREATE TABLE table_59469 (
"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 the date of 30/01/1991, when the away team was Liverpool, what was the score?
| SELECT "Score" FROM table_59469 WHERE "Date" = '30/01/1991' AND "Away team" = 'liverpool' | wikisql |
CREATE TABLE table_71753 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1st Member has an election in 1859 and a conservative 2nd Party?
| SELECT "1st Member" FROM table_71753 WHERE "2nd Party" = 'conservative' AND "Election" = '1859' | wikisql |
CREATE TABLE table_204_513 (
id number,
"date" text,
"time" text,
"opponent#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what time is the only game in august ?
| SELECT "time" FROM table_204_513 WHERE "date" = 8 | squall |
CREATE TABLE BLOCK (
blockcode VARCHAR,
blockfloor VARCHAR
)
CREATE TABLE room (
blockfloor VARCHAR,
blockcode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of rooms for different block code?
| SELECT COUNT(*), T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode | sql_create_context |
CREATE TABLE table_name_6 (
city VARCHAR,
date VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the city for guelferbytanus b and the 5th
| SELECT city FROM table_name_6 WHERE date = "5th" AND name = "guelferbytanus b" | sql_create_context |
CREATE TABLE table_21269441_4 (
tournament_venue__city_ VARCHAR,
regular_season_winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the tourney when Weber State won the regular season?
| SELECT tournament_venue__city_ FROM table_21269441_4 WHERE regular_season_winner = "Weber State" | sql_create_context |
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 lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_203_340 (
id number,
"rank" number,
"airport" text,
"passengers handled" number,
"% change 2011 / 12" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the only airport in portugal that is among the 10 busiest r... | SELECT "airport" FROM table_203_340 WHERE "airport" = 'portugal' | squall |
CREATE TABLE table_11677691_4 (
player VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players hometown was Cincinnati, Ohio?
| SELECT COUNT(player) FROM table_11677691_4 WHERE hometown = "Cincinnati, Ohio" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20066 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'prednisolone acetate 0.12% ophth. susp.' ORDER BY prescr... | mimic_iii |
CREATE TABLE table_8478 (
"Election" real,
"Candidate" text,
"Number of votes" text,
"Share of votes" text,
"Outcome of election" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the candidate with 73,494 votes?
| SELECT "Candidate" FROM table_8478 WHERE "Number of votes" = '73,494' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE lives... | SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student) | spider |
CREATE TABLE table_name_11 (
shirt_no INTEGER,
height VARCHAR,
position VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the shirt no with a position of setter, a nationality of Italy, and height larger than 172?
| SELECT SUM(shirt_no) FROM table_name_11 WHERE position = "setter" AND nationality = "italy" AND height > 172 | sql_create_context |
CREATE TABLE table_name_65 (
streak VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Streak on December 30?
| SELECT streak FROM table_name_65 WHERE date = "december 30" | sql_create_context |
CREATE TABLE table_4627 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue did the European Championships' 400 m Hurdles take place?
| SELECT "Venue" FROM table_4627 WHERE "Notes" = '400 m hurdles' AND "Competition" = 'european championships' | wikisql |
CREATE TABLE table_261954_1 (
type VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every type for the location of Roanoke, Virginia?
| SELECT type FROM table_261954_1 WHERE location = "Roanoke, Virginia" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATIO... | SELECT LAST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID | nvbench |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate tim... | SELECT t1.TagName, t2.TagName FROM Tags AS t1 INNER JOIN Tags AS t2 ON (t2.TagName = t1.TagName + 's') | sede |
CREATE TABLE table_204_340 (
id number,
"name" text,
"year inducted" number,
"position" text,
"apps" number,
"goals" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did the hall of fame player awarded the year after tony coton earn more goals t... | SELECT (SELECT "goals" FROM table_204_340 WHERE "year inducted" = (SELECT "year inducted" FROM table_204_340 WHERE "name" = 'tony coton') + 1) > (SELECT "goals" FROM table_204_340 WHERE "name" = 'tony coton') | squall |
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures INTEGER,
Stay INTEGER,
DateUndergoes DATETIME,
Physician INTEGER,
AssistingNurse INTEGER
)
CREATE TABLE Prescribes (
Physician INTEGER,
Patient INTEGER,
Medication INTEGER,
Date DATETIME,
Appointment INTEGER,
Dose VARC... | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_61 (
top_10 VARCHAR,
top_25 VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many top-10 numbers had a top 25 of more than 6 with less than 2 wins?
| SELECT COUNT(top_10) FROM table_name_61 WHERE top_25 > 6 AND wins < 2 | sql_create_context |
CREATE TABLE table_name_34 (
icao VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICAO when the IATA is ist?
| SELECT icao FROM table_name_34 WHERE iata = "ist" | sql_create_context |
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots text,
needed text,
votes text,
inducted text,
category text,
needed... | SELECT salary FROM salary WHERE league_id = "AL" | thehistoryofbaseball |
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE ... | SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | spider |
CREATE TABLE table_name_66 (
player VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what player scored 69-72-68=209?
| SELECT player FROM table_name_66 WHERE score = 69 - 72 - 68 = 209 | sql_create_context |
CREATE TABLE table_name_28 (
date VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the game played against the home team Rockets?
| SELECT date FROM table_name_28 WHERE home = "rockets" | 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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '孙雅洁' AND gwyjzb.MED_SER_ORG_NO = '5601930' AND gwyjzb.OUT_DIAG_DIS_NM LIKE '%肾结石%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '孙雅洁' AND fgwyjzb.MED_SER_ORG_NO = '5601930' AND fgwyjzb.OUT_DIAG_DIS_NM LIKE '%肾结石%' | css |
CREATE TABLE table_name_63 (
field VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What field had results of w 18-12?
| SELECT field FROM table_name_63 WHERE result = "w 18-12" | sql_create_context |
CREATE TABLE table_69509 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the loss with record of 38-53
| SELECT "Loss" FROM table_69509 WHERE "Record" = '38-53' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
... | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY Fname DESC | nvbench |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_83 (
date VARCHAR,
margin_of_victory VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date with margin of victory of 1 stroke and tournament of legend financial group classic
| SELECT date FROM table_name_83 WHERE margin_of_victory = "1 stroke" AND tournament = "legend financial group classic" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "BLACK/HAITIAN" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | 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 = '012-42521')) AND medication.drugname IN ('sodium chloride 0.9% 250 ml lvp'... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2114" AND lab.label = "Quantitative G6PD" | mimicsql_data |
CREATE TABLE table_name_39 (
date VARCHAR,
home VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the game played with the Cavaliers at home and the Warriors visiting?
| SELECT date FROM table_name_39 WHERE home = "cavaliers" AND visitor = "warriors" | sql_create_context |
CREATE TABLE table_39667 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest events with earning less than $384,489 ranked more than 4 with... | SELECT MAX("Events") FROM table_39667 WHERE "Earnings ( $ )" < '384,489' AND "Rank" > '4' AND "Wins" < '1' | wikisql |
CREATE TABLE table_name_49 (
number VARCHAR,
fleet VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what number is associated with the baltic fleet and leninets ( )?
| SELECT number FROM table_name_49 WHERE fleet = "baltic" AND name = "leninets (ленинец)" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'... | mimic_iii |
CREATE TABLE table_name_27 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team played in the matchup with an away team of Liverpool?
| SELECT home_team FROM table_name_27 WHERE away_team = "liverpool" | sql_create_context |
CREATE TABLE table_name_60 (
attendance VARCHAR,
result VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name for me the total number in attendance for week before 2 and result of t 24-24
| SELECT COUNT(attendance) FROM table_name_60 WHERE result = "t 24-24" AND week < 2 | sql_create_context |
CREATE TABLE table_12434380_1 (
founded VARCHAR,
institution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the institution of Kansas city Kansas community college founded?
| SELECT COUNT(founded) FROM table_12434380_1 WHERE institution = "Kansas City Kansas Community College" | sql_create_context |
CREATE TABLE table_18018214_2 (
goals_conceded INTEGER,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the number of goals scored to equal 58.
| SELECT MIN(goals_conceded) FROM table_18018214_2 WHERE points = 58 | sql_create_context |
CREATE TABLE table_name_16 (
name VARCHAR,
nationality VARCHAR,
heat VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the swimmer from Australia in lane 4 with a heat larger than 4?
| SELECT name FROM table_name_16 WHERE heat > 4 AND lane = 4 AND nationality = "australia" | sql_create_context |
CREATE TABLE table_204_365 (
id number,
"year" number,
"single" text,
"chart positions\nusa billboard hot dance club play" number,
"chart positions\npolish charts" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name o... | SELECT "album" FROM table_204_365 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_6847 (
"Rank" real,
"Country" text,
"Claimant" text,
"Highest point" text,
"Height" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which claimant's rank is 200?
| SELECT "Claimant" FROM table_6847 WHERE "Rank" = '200' | wikisql |
CREATE TABLE table_name_98 (
event VARCHAR,
days_held VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event has unknown as the days held.?
| SELECT event FROM table_name_98 WHERE days_held = "unknown" | sql_create_context |
CREATE TABLE table_1341897_6 (
first_elected INTEGER,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was James William Trimble first elected in the Arkansas 3 district?
| SELECT MIN(first_elected) FROM table_1341897_6 WHERE district = "Arkansas 3" | sql_create_context |
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | SELECT MAX(number_cities), MIN(number_cities) FROM market | spider |
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY Country_name DESC | nvbench |
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_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)... | SELECT AVG(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1862)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tf r... | mimic_iii |
CREATE TABLE table_name_46 (
drawn VARCHAR,
against VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Drawn has an Against smaller than 20 and Points of 15?
| SELECT drawn FROM table_name_46 WHERE against < 20 AND points = 15 | sql_create_context |
CREATE TABLE table_17342 (
"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.
-- How ma... | SELECT COUNT("Score") FROM table_17342 WHERE "High assists" = 'Earl Watson (5)' AND "Date" = 'December 2' | wikisql |
CREATE TABLE table_name_61 (
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tie number for the match that had away team of Scunthorpe & Lindsey United?
| SELECT tie_no FROM table_name_61 WHERE away_team = "scunthorpe & lindsey united" | sql_create_context |
CREATE TABLE table_35850 (
"Name" text,
"Hanzi" text,
"Hanyu Pinyin" text,
"Population (2010-11-01)" text,
"Area (km\u00b2)" text,
"Density (/km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Pinyin for the item that has a de... | SELECT "Hanyu Pinyin" FROM table_35850 WHERE "Density (/km\u00b2)" = '77' | wikisql |
CREATE TABLE table_24425976_2 (
series VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes in the series has a production code of 111?
| SELECT COUNT(series) FROM table_24425976_2 WHERE production_code = "111" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid ... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'o2 sat (%)')) AND STRFTIME('%y', cost.chargetime) >= '2103' GROUP BY... | eicu |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.MED_INV_ITEM_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '31300599205' AND t_kc22.SOC_SRT_DIRE_NM = '清脑复神液' | css |
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 zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '93164034335' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '93164034335' | css |
CREATE TABLE table_35412 (
"Constituency" text,
"Electorate" real,
"Turnout" text,
"Spoilt" text,
"Valid Poll" real,
"Quota" text,
"Seats" real,
"Candidates" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the turnout with 15 cand... | SELECT "Turnout" FROM table_35412 WHERE "Candidates" = '15' AND "Valid Poll" > '377,591' | wikisql |
CREATE TABLE table_78168 (
"Number" real,
"Name" text,
"Team" text,
"Position" text,
"Years with franchise" text,
"Year retired" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the player in Position G on the Petron Blaze Boosters and ret... | SELECT "Name" FROM table_78168 WHERE "Position" = 'g' AND "Team" = 'petron blaze boosters' AND "Year retired" = '2000' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Hypovolemia" | mimicsql_data |
CREATE TABLE playlist_tracks (
playlist_id INTEGER,
track_id INTEGER
)
CREATE TABLE invoice_lines (
id INTEGER,
invoice_id INTEGER,
track_id INTEGER,
unit_price NUMERIC(10,2),
quantity INTEGER
)
CREATE TABLE invoices (
id INTEGER,
customer_id INTEGER,
invoice_date TIMESTAMP,
... | SELECT first_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10 | nvbench |
CREATE TABLE table_19857 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT MIN("Stage") FROM table_19857 WHERE "Winner" = 'Sergei Smetanine' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE charte... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663) AND icustays.outtime IS NULL | mimic_iii |
CREATE TABLE table_29085880_1 (
no VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode number saw 1.312 million U.S. Wviewers?
| SELECT no FROM table_29085880_1 WHERE us_viewers__million_ = "1.312" | 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.ethnicity = "UNKNOWN/NOT SPECIFIED" AND demographic.diagnosis = "COMPLETE HEART BLOCK" | mimicsql_data |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_name_71 (
enrollment INTEGER,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the most enrollment in Hamilton?
| SELECT MAX(enrollment) FROM table_name_71 WHERE location = "hamilton" | sql_create_context |
CREATE TABLE table_74781 (
"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.
-- Who was the away team at the game at Victoria Pa... | SELECT "Away team" FROM table_74781 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_50347 (
"World Record" text,
"Press" text,
"103.5" text,
"Roger Fran\u00e7ois" text,
"Paris ( FRA )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the press like for the world olympic record holder Roger Francois and Jaa... | SELECT "Press" FROM table_50347 WHERE "World Record" = 'olympic record' AND "Roger Fran\u00e7ois" = 'jaan kikkas' | wikisql |
CREATE TABLE table_366 (
"Date of Issue" text,
"Theme" text,
"Denomination" text,
"Design" text,
"Illustration" text,
"Printing Process" text,
"Paper Type" text,
"First Day Cover Cancellation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Theme" FROM table_366 WHERE "Design" = 'Isabelle Toussaint' | wikisql |
CREATE TABLE table_12316 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Set 2 has a set one at 19:21?
| SELECT "Set 2" FROM table_12316 WHERE "Set 1" = '19:21' | wikisql |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE author (
authorid int,
authorname... | SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'NIPS' AND writes.paperid = paper.paperid | scholar |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code ... | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made) | nvbench |
CREATE TABLE table_37323 (
"District" real,
"Incumbent" text,
"2008 Status" text,
"Democratic" text,
"Republican" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Incumbent has a Republican of dan mansell?
| SELECT "Incumbent" FROM table_37323 WHERE "Republican" = 'dan mansell' | wikisql |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "30" | mimicsql_data |
CREATE TABLE table_name_3 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the Blue Jays lose to when their record was 36-20?
| SELECT loss FROM table_name_3 WHERE record = "36-20" | sql_create_context |
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 diagnoses (
... | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "QUET200" | mimicsql_data |
CREATE TABLE table_49073 (
"Year" text,
"2001" real,
"2002" real,
"2003" real,
"2004" real,
"2005" real,
"2006" real,
"2007" real,
"2008" real,
"2009" real,
"2010" real,
"2011" real,
"2012" real
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT MIN("2003") FROM table_49073 WHERE "2009" < '15,884' AND "2006" < '9,845' AND "2004" < '868' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int... | SELECT DISTINCT course.department, course.name, course.number 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 program_course.catego... | advising |
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
... | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY enr | nvbench |
CREATE TABLE table_name_47 (
year VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years have an Award of press award?
| SELECT COUNT(year) FROM table_name_47 WHERE award = "press award" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.