instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_train_176 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"blood_glucose" int,
"hypoglycemia" bool,
"total_cholesterol" int,
"low_density_lipoprotein_ldl_cholesterol" int,
"triglyceride_t... | SELECT * FROM table_train_176 WHERE total_cholesterol < 205 OR triglyceride_tg < 250 OR low_density_lipoprotein_ldl_cholesterol < 130 | criteria2sql |
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 lab (
labid number,
pa... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-595... | eicu |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20589) | mimic_iii |
CREATE TABLE table_57038 (
"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 home team plays at princes park?
| SELECT "Home team" FROM table_57038 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE table_name_44 (
player VARCHAR,
date VARCHAR,
transfer_fee VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player had a Date of 31 jan. 2008, and a Transfer fee of 3.87m?
| SELECT player FROM table_name_44 WHERE date = "31 jan. 2008" AND transfer_fee = "£3.87m" | sql_create_context |
CREATE TABLE table_train_7 (
"id" int,
"bleeding" int,
"hypotension" bool,
"burn_injury" int,
"hypoperfusion" bool,
"hypertension" bool,
"age" float,
"lactate" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- bleeding / h... | SELECT * FROM table_train_7 WHERE bleeding = 1 OR hypotension = 1 | criteria2sql |
CREATE TABLE table_name_59 (
draw INTEGER,
lost VARCHAR,
goals_scored VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Count the Draw which has Lost of 0, and a Goals Scored larger than 0?
| SELECT SUM(draw) FROM table_name_59 WHERE lost = 0 AND goals_scored > 0 | sql_create_context |
CREATE TABLE table_29726 (
"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("High points") FROM table_29726 WHERE "Date" = 'October 5' | wikisql |
CREATE TABLE table_18894744_5 (
game VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the game for june 16
| SELECT game FROM table_18894744_5 WHERE date = "June 16" | sql_create_context |
CREATE TABLE table_191105_2 (
first_aired VARCHAR,
performed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When zachary sanders is the performer how many first aired are there?
| SELECT COUNT(first_aired) FROM table_191105_2 WHERE performed_by = "Zachary Sanders" | sql_create_context |
CREATE TABLE table_28606933_7 (
teams VARCHAR,
consecutive_starts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team(s) had 120 consecutive starts?
| SELECT teams FROM table_28606933_7 WHERE consecutive_starts = 120 | sql_create_context |
CREATE TABLE table_27618 (
"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.
-- In game site AOL Arena, who are a... | SELECT "Opponent" FROM table_27618 WHERE "Game site" = 'AOL Arena' | wikisql |
CREATE TABLE table_name_76 (
city_of_license VARCHAR,
frequency_mhz VARCHAR,
erp_w VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city of license has an ERP W smaller than 500, Class A, and Frequency MHz larger than 89.7?
| SELECT city_of_license FROM table_name_76 WHERE erp_w < 500 AND class = "a" AND frequency_mhz > 89.7 | sql_create_context |
CREATE TABLE table_69393 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of gold medals with a total of 12 medals and less than 4 bronze medals?
| SELECT SUM("Gold") FROM table_69393 WHERE "Total" = '12' AND "Bronze" < '4' | wikisql |
CREATE TABLE table_76632 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/g" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Loss, when Avg/g is 0, and when Long is less than 0?
| SELECT AVG("Loss") FROM table_76632 WHERE "Avg/g" = '0' AND "Long" < '0' | wikisql |
CREATE TABLE table_22496374_1 (
_number INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was rickie winslow's number?
| SELECT MAX(_number) FROM table_22496374_1 WHERE name = "Rickie Winslow" | sql_create_context |
CREATE TABLE table_19415 (
"Name (Alma Mater)" text,
"Seasons" text,
"Games" real,
"Wins" real,
"Losses" real,
"Win %" text,
"NCAA Tour" text,
"NIT Tour" text,
"MCC Tour" text,
"A-10 Tour" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Name (Alma Mater)" FROM table_19415 WHERE "Wins" = '15' | wikisql |
CREATE TABLE table_name_86 (
russian_name VARCHAR,
latin_3_letter_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Russian name with lbr as the Latin 3-letter code?
| SELECT russian_name FROM table_name_86 WHERE latin_3_letter_code = "lbr" | sql_create_context |
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 t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1456542' GROUP BY t_kc21.MED_ORG_DEPT_CD | css |
CREATE TABLE table_69802 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the game that the Indianapolis Colts lost in 2004?
| SELECT "Date" FROM table_69802 WHERE "Loser" = 'indianapolis colts' AND "Year" = '2004' | wikisql |
CREATE TABLE table_name_4 (
tickets_sold___available VARCHAR,
gross_revenue__2011_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tickets were sold/available when the gross revenue (2011) was $5,948,390?
| SELECT tickets_sold___available FROM table_name_4 WHERE gross_revenue__2011_ = "$5,948,390" | sql_create_context |
CREATE TABLE table_10928 (
"Model" text,
"FSB (MHz)" text,
"Chipset" text,
"Memory" text,
"Graphics" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of chipset is in the Precision t3400 model with the PCI Express graphics?
| SELECT "Chipset" FROM table_10928 WHERE "Graphics" = 'pci express' AND "Model" = 'precision t3400' | wikisql |
CREATE TABLE table_name_43 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the match against duk-hee lee?
| SELECT score FROM table_name_43 WHERE opponent = "duk-hee lee" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-7646')) AND intakeoutput.celllabel = 'per iv... | eicu |
CREATE TABLE table_name_9 (
li_fes_2 VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Li-FeS 2, when Type is Nominal Voltage?
| SELECT li_fes_2 FROM table_name_9 WHERE type = "nominal voltage" | sql_create_context |
CREATE TABLE table_19753079_4 (
result VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result for first elected being 1992
| SELECT result FROM table_19753079_4 WHERE first_elected = 1992 | sql_create_context |
CREATE TABLE table_15624586_2 (
deficit___surplus_ VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the deficit (-surplus) of France?
| SELECT deficit___surplus_ FROM table_15624586_2 WHERE country = "France" | sql_create_context |
CREATE TABLE Rooms (
roomName VARCHAR,
bedType VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the name of rooms with king or queen bed.
| SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen" | sql_create_context |
CREATE TABLE table_72819 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the latitude of the feature of longitude 80.0e
| SELECT "Latitude" FROM table_72819 WHERE "Longitude" = '80.0E' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC | nvbench |
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 pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos ORDER BY pPos | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884') AND NOT patient.unitdischargetime IS NULL ORDER BY patient... | eicu |
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,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZX... | SELECT jybgb.BBCJBW FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '60960957' AND jybgb.BGRQ BETWEEN '2014-02-27' AND '201... | css |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Dr... | SELECT Position, COUNT(*) FROM match_season GROUP BY Position | nvbench |
CREATE TABLE table_name_52 (
floors INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Floors at st. joseph church?
| SELECT SUM(floors) FROM table_name_52 WHERE name = "st. joseph church" | sql_create_context |
CREATE TABLE table_name_48 (
nation VARCHAR,
result VARCHAR,
year VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Nation with 2012 as the year, and a Competition of preseason, and a Result of w 0 3?
| SELECT nation FROM table_name_48 WHERE year = 2012 AND competition = "preseason" AND result = "w 0–3" | 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 prescriptions.formulary_drug_cd = "ZOSY4FPB" | mimicsql_data |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '7475007' AND RYDJSJ BETWEEN '2009-03-06' AND '2018-12-10' AND DATEDIFF(CYSJ, RYSJ) > 9 | css |
CREATE TABLE table_10992_3 (
city_district__stadtteil_ VARCHAR,
no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the city where the number is 47?
| SELECT city_district__stadtteil_ FROM table_10992_3 WHERE no = "47" | sql_create_context |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE venue (
venueid int,
venue... | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'Neutralizing Antibody' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2012 AND writes.paperid = paper.paperid GROUP BY ... | scholar |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGD... | css |
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 diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18351" | mimicsql_data |
CREATE TABLE table_52697 (
"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 team was the away team when the home team s... | SELECT "Away team" FROM table_52697 WHERE "Home team score" = '12.8 (80)' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
U... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%gurgaon%' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE table_name_72 (
year INTEGER,
round_1 VARCHAR,
money__$_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Round 1 of 70, and a Money ($) larger than 500,000 has the highest year?
| SELECT MAX(year) FROM table_name_72 WHERE round_1 = "70" AND money__$_ > 500 OFFSET 000 | sql_create_context |
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 wdmzjzjlb.MZZYZDZZBM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '83368624588' UNION SELECT bdmzjzjlb.MZZYZDZZBM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '83368624588' | css |
CREATE TABLE table_38832 (
"States" text,
"Fall 05" real,
"Fall 06" real,
"Fall 07" real,
"Fall 08" real,
"Fall 09" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the smallest fall 05 number when fall 09 is less than 14 and fall 08 is mor... | SELECT MIN("Fall 05") FROM table_38832 WHERE "Fall 09" < '14' AND "Fall 08" > '5' | wikisql |
CREATE TABLE table_26466528_1 (
colors VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the colors for north canton
| SELECT colors FROM table_26466528_1 WHERE location = "North Canton" | sql_create_context |
CREATE TABLE table_name_61 (
bronze INTEGER,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest number for bronze with a rank of 19?
| SELECT MAX(bronze) FROM table_name_61 WHERE rank = "19" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26817 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDa... | SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE ('tags' LIKE '%<iphone%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME... | sede |
CREATE TABLE table_name_75 (
report VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the report in the tournament that started at 12:30?
| SELECT report FROM table_name_75 WHERE time = "12:30" | sql_create_context |
CREATE TABLE table_name_9 (
draw VARCHAR,
artist VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the draw with less than 107 points by the artist Jan Johansen?
| SELECT COUNT(draw) FROM table_name_9 WHERE artist = "jan johansen" AND points < 107 | sql_create_context |
CREATE TABLE table_9019 (
"Verb" text,
"2 (VF)" text,
"2 (F)" text,
"3 (F)" text,
"2/3 (P)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2 (F) has a 3 (F) of khelto?
| SELECT "2 (F)" FROM table_9019 WHERE "3 (F)" = 'সে khelto' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-69... | eicu |
CREATE TABLE table_2554 (
"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 is... | SELECT "Date of vacancy" FROM table_2554 WHERE "Manner of departure" = 'End of caretaker contract' | wikisql |
CREATE TABLE table_name_59 (
record VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record at the home of the Montreal Maroons
| SELECT record FROM table_name_59 WHERE home = "montreal maroons" | sql_create_context |
CREATE TABLE table_55704 (
"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 was the score for the home team that played... | SELECT "Home team score" FROM table_55704 WHERE "Venue" = 'moorabbin oval' | wikisql |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | 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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBase... | SELECT Posts.Id, Title, Tags, Posts.CreationDate, PostLinks.RelatedPostId AS ClosedAsDuplicateOf, 'originals(s)' = SUBSTRING(PostHistory.Text, STR_POSITION(PostHistory.Text, '') + 1, STR_POSITION(PostHistory.Text, '') - (STR_POSITION(PostHistory.Text, '[') + 1)) FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.Pos... | sede |
CREATE TABLE table_name_52 (
grid INTEGER,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the smallest grid for Time/Retired of +22.687?
| SELECT MIN(grid) FROM table_name_52 WHERE time_retired = "+22.687" | sql_create_context |
CREATE TABLE table_34250 (
"interval name" text,
"size (steps)" real,
"size (cents)" real,
"just ratio" text,
"just (cents)" real,
"error" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- size (steps) that has a size (cents) of 58.54, and a just r... | SELECT COUNT("size (steps)") FROM table_34250 WHERE "size (cents)" = '58.54' AND "just ratio" = '28:27' AND "just (cents)" > '62.96' | wikisql |
CREATE TABLE table_29312 (
"Stage" real,
"Stage winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Asian rider classification" text,
"Team classification" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "Stage winner" FROM table_29312 WHERE "Team classification" = 'LeTua Cycling Team' AND "Stage" = '2' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score num... | SELECT DISTINCT q.Id AS "post_link", q.Title, q.Id, q.CreationDate FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Votes AS v ON q.Id = v.PostId WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL AND pt.TagId IN (930, 74749, 90868, 39956, 7751, 35275, 90210, 83935) AND v.VoteTypeId = 6 AND q.Id NO... | sede |
CREATE TABLE table_7224 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Drawn has an Against smaller than 20... | SELECT "Drawn" FROM table_7224 WHERE "Against" < '20' AND "Points" = '15' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE table_name_66 (
team VARCHAR,
rank VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team is ranked 3rd in 2008?
| SELECT team FROM table_name_66 WHERE rank = "3rd" AND year = 2008 | sql_create_context |
CREATE TABLE table_27653752_1 (
resolution VARCHAR,
pixels_per_degree__ppd_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the resolution of the model with a PPD of 69?
| SELECT resolution FROM table_27653752_1 WHERE pixels_per_degree__ppd_ = 69 | sql_create_context |
CREATE TABLE table_name_21 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team 1 played against team 2 of Tours FC (D2)?
| SELECT team_1 FROM table_name_21 WHERE team_2 = "tours fc (d2)" | sql_create_context |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
... | SELECT Committee, COUNT(Committee) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" GROUP BY Committee ORDER BY Committee | nvbench |
CREATE TABLE diagnoses (
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
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT People_ID, Weight FROM people | nvbench |
CREATE TABLE table_15991 (
"Case/Suffix" text,
"we two" text,
"you and I" text,
"you two" text,
"them two (the two)" text,
"who-two" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is them two (the two) when you and i is ng balngu?
| SELECT "them two (the two)" FROM table_15991 WHERE "you and I" = 'ngœbalngu' | wikisql |
CREATE TABLE table_5507 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what team was the visitor in the chicago game
| SELECT "Visitor" FROM table_5507 WHERE "Home" = 'chicago' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_name_79 (
player VARCHAR,
pick INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a Pick larger than 20?
| SELECT player FROM table_name_79 WHERE pick > 20 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'leukocytosis') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosist... | eicu |
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 person_info.XM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '5... | css |
CREATE TABLE table_19616 (
"DVD name" text,
"Episodes" real,
"Region 1 (CAN)" text,
"Region 1 (US)" text,
"Region 2 (FR)" text,
"Region 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes were released on DVD in the US on October... | SELECT "Episodes" FROM table_19616 WHERE "Region 1 (US)" = 'October 13, 2009' | wikisql |
CREATE TABLE table_name_10 (
week VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which week was attendance at 50,814?
| SELECT COUNT(week) FROM table_name_10 WHERE attendance = "50,814" | sql_create_context |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
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.marital_status = "DIVORCED" AND prescriptions.route = "DIALYS" | mimicsql_data |
CREATE TABLE table_58871 (
"DSL Type" text,
"Provider" text,
"Resale" text,
"Down (up to kbit/s)" real,
"Up (up to kbit/s)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the resale when the down (up to kbit/s) is 24000?
| SELECT "Resale" FROM table_58871 WHERE "Down (up to kbit/s)" = '24000' | wikisql |
CREATE TABLE table_45601 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Result, when Date is 11 August 1992?
| SELECT "Result" FROM table_45601 WHERE "Date" = '11 august 1992' | wikisql |
CREATE TABLE table_name_62 (
date VARCHAR,
week VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game later than week 13 and 41,862 people attended?
| SELECT date FROM table_name_62 WHERE week > 13 AND attendance = "41,862" | sql_create_context |
CREATE TABLE table_59557 (
"Season" real,
"Year" real,
"Mole" text,
"Winner" text,
"Runner-up" text,
"Total prize money" text,
"Potential prize money" text,
"Destination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earlies... | SELECT MIN("Season") FROM table_59557 WHERE "Runner-up" = 'aisha jefcoate' | wikisql |
CREATE TABLE table_29756040_1 (
song_choice VARCHAR,
week__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which song was chosen during the audition week?
| SELECT song_choice FROM table_29756040_1 WHERE week__number = "Audition" | sql_create_context |
CREATE TABLE table_33759 (
"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 average crowd size when the home tea... | SELECT AVG("Crowd") FROM table_33759 WHERE "Home team score" = '16.9 (105)' | wikisql |
CREATE TABLE table_41944 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Sum of Score, when Place is T2, and when Player is Justin Leonard?
| SELECT SUM("Score") FROM table_41944 WHERE "Place" = 't2' AND "Player" = 'justin leonard' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite = '... | eicu |
CREATE TABLE table_1458412_1 (
year VARCHAR,
avg_start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the totl amount of years where avg start is 27.3?
| SELECT COUNT(year) FROM table_1458412_1 WHERE avg_start = "27.3" | sql_create_context |
CREATE TABLE table_66467 (
"Sport" text,
"Body" text,
"Year" text,
"Event type" text,
"Location" text,
"Nations" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event type had BODY CMAS in 1980 and underwater hockey?
| SELECT "Event type" FROM table_66467 WHERE "Body" = 'cmas' AND "Year" = '1980' AND "Sport" = 'underwater hockey' | wikisql |
CREATE TABLE table_204_438 (
id number,
"year" number,
"title" text,
"album" text,
"us r&b" number,
"us pop" number,
"us dance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the last year listed ?
| SELECT "year" FROM table_204_438 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
... | SELECT Id AS "post_link", FavoriteCount, Score, CreationDate FROM Posts WHERE (PostTypeId = 1) AND (NOT ClosedDate IS NULL) AND (FavoriteCount > 0) AND (Score < 0) ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_26 (
draws VARCHAR,
goals_against VARCHAR,
goals_for VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many draws have goals for less than 56, 10 as the postion, with goals against less than 45?
| SELECT COUNT(draws) FROM table_name_26 WHERE goals_for < 56 AND position = 10 AND goals_against < 45 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | SELECT COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, CAST(SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 1.0 / COUNT(*) AS FLOAT(3, 2)) AS fraction, u.Id AS UserId, u.DisplayName AS Name FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId INNE... | sede |
CREATE TABLE table_name_24 (
since VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of since for belletti
| SELECT COUNT(since) FROM table_name_24 WHERE name = "belletti" | sql_create_context |
CREATE TABLE table_name_74 (
director VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director of Chaser on the Rocks?
| SELECT director FROM table_name_74 WHERE title = "chaser on the rocks" | sql_create_context |
CREATE TABLE table_name_64 (
authority VARCHAR,
area VARCHAR,
roll VARCHAR,
decile VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the authority for te akau with roll less than 254 and decile of 8
| SELECT authority FROM table_name_64 WHERE roll < 254 AND decile = "8" AND area = "te akau" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.