instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_34965 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Year larger than 2001 has what average points?
| SELECT AVG("Points") FROM table_34965 WHERE "Year" > '2001' | wikisql |
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
product_size VARCHAR(20)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY date_account_opened DESC | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | 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 BETWEEN... | mimic_iii |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-32465')) AND treatment.treatmentname = 'nicotine patch' AND S... | eicu |
CREATE TABLE table_58297 (
"Team" text,
"Make" text,
"Driver" text,
"Sponsor" text,
"Car Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team is sponsored by w.h. bolin?
| SELECT "Team" FROM table_58297 WHERE "Sponsor" = 'w.h. bolin' | wikisql |
CREATE TABLE table_23733 (
"Date" text,
"Presenter" text,
"Guest 1" text,
"Guest 2" text,
"Guest 3" text,
"Guest 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the guest 3 for iyare igiehon
| SELECT "Guest 3" FROM table_23733 WHERE "Guest 2" = 'Iyare Igiehon' | wikisql |
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 cost (
costid num... | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-129568')) AND STRFTIME('%y-%m', lab.labresulttime) = '2101-07' ORDER BY lab.labresult... | eicu |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
item... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40707 AND admissions.dischtime IS NULL)) AND transfers... | mimic_iii |
CREATE TABLE table_10634 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT MIN("Game") FROM table_10634 WHERE "Date" = 'february 20' | wikisql |
CREATE TABLE table_203_781 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which year had the most competitions ?
| SELECT "year" FROM table_203_781 GROUP BY "year" ORDER BY COUNT("competition") DESC LIMIT 1 | squall |
CREATE TABLE table_name_66 (
erp_w VARCHAR,
frequency_mhz VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ERP W for frequency of 92.7
| SELECT erp_w FROM table_name_66 WHERE frequency_mhz = 92.7 | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE table_name_6 (
constructor VARCHAR,
winning_driver VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Constructor has the Winning Driver, Jim Clark and the Circuit, Syracuse?
| SELECT constructor FROM table_name_6 WHERE winning_driver = "jim clark" AND circuit = "syracuse" | sql_create_context |
CREATE TABLE table_name_38 (
year VARCHAR,
league VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the League of malaysian super league, and the Position was 10/14?
| SELECT year FROM table_name_38 WHERE league = "malaysian super league" AND position = "10/14" | sql_create_context |
CREATE TABLE table_13587 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which event did Moradi compete and finish in 2nd at the Asian Championships in Kob... | SELECT "Event" FROM table_13587 WHERE "Year" > '2005' AND "Competition" = 'asian championships' AND "Position" = '2nd' AND "Venue" = 'kobe, japan' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
... | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6170)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'st... | mimic_iii |
CREATE TABLE table_20197 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player for seattle
| SELECT "Player" FROM table_20197 WHERE "School/Club Team" = 'Seattle' | wikisql |
CREATE TABLE table_name_52 (
event VARCHAR,
res VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event was a loss in 5:00?
| SELECT event FROM table_name_52 WHERE res = "loss" AND time = "5:00" | sql_create_context |
CREATE TABLE table_4487 (
"Region" text,
"Operator" text,
"Licence award date" text,
"On air date" text,
"Closure date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the operator of the ensemble from Yorkshire?
| SELECT "Operator" FROM table_4487 WHERE "Region" = 'yorkshire' | wikisql |
CREATE TABLE table_50107 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Record is 12-57?
| SELECT "Score" FROM table_50107 WHERE "Record" = '12-57' | wikisql |
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 cost (
costid num... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3507')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2103-1... | eicu |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ tim... | SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '92492816' AND hz_info.YLJGDM = '2726098' AND mzjzjlb.JZZDSM LIKE '%扁桃体炎%' | css |
CREATE TABLE table_name_35 (
nation VARCHAR,
world_rank VARCHAR,
birth_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the nation when the world rank is 2 and the birth date is 1976-12-20?
| SELECT nation FROM table_name_35 WHERE world_rank = "2" AND birth_date = "1976-12-20" | sql_create_context |
CREATE TABLE table_2781227_7 (
nationality VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different nationalities is pick number 179?
| SELECT COUNT(nationality) FROM table_2781227_7 WHERE pick = 179 | sql_create_context |
CREATE TABLE table_69696 (
"Year" real,
"Winners" text,
"2nd place" text,
"3rd place" text,
"4th place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winners when 3rd place is weymouth wildcats
| SELECT "Winners" FROM table_69696 WHERE "3rd place" = 'weymouth wildcats' | wikisql |
CREATE TABLE party (
party_id number,
party_theme text,
location text,
first_year text,
last_year text,
number_of_hosts number
)
CREATE TABLE party_host (
party_id number,
host_id number,
is_main_in_charge others
)
CREATE TABLE host (
host_id number,
name text,
national... | SELECT AVG(number_of_hosts) FROM party | spider |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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... | SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_name_9 (
rank VARCHAR,
bronze VARCHAR,
silver VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of ladies ranked who had less than 3 silvers, less than 2 total medals, and more than 0 bronze med... | SELECT COUNT(rank) FROM table_name_9 WHERE silver < 3 AND total < 2 AND bronze > 0 | sql_create_context |
CREATE TABLE table_13353 (
"Parameter" text,
"Symbol" text,
"Best fit (WMAP only)" text,
"Best fit (WMAP, extra parameter)" text,
"Best fit (all data)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the parameter when the best fit (WMAP only... | SELECT "Parameter" FROM table_13353 WHERE "Best fit (WMAP only)" = '.9 ± .1' AND "Best fit (WMAP, extra parameter)" = '.92 ± .12' | wikisql |
CREATE TABLE table_52301 (
"D 49 \u221a" text,
"D 48 \u221a" text,
"D 47 \u221a" text,
"D 46 \u221a" text,
"D 45 \u221a" text,
"D 44 \u221a" text,
"D 43 \u221a" text,
"D 42 \u221a" text,
"D 41 \u221a" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "D 43 \u221a" FROM table_52301 WHERE "D 49 \u221a" = 'd 49 √' | wikisql |
CREATE TABLE table_name_54 (
week INTEGER,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week had attendance of 52,714?
| SELECT MAX(week) FROM table_name_54 WHERE attendance = 52 OFFSET 714 | sql_create_context |
CREATE TABLE table_28001186_8 (
site_stadium VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the site of the game that had an 11-4 score?
| SELECT site_stadium FROM table_28001186_8 WHERE score = "11-4" | sql_create_context |
CREATE TABLE table_2818164_4 (
no_in_series INTEGER,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the series number for the episode written by janet leahy?
| SELECT MIN(no_in_series) FROM table_2818164_4 WHERE written_by = "Janet Leahy" | sql_create_context |
CREATE TABLE table_62842 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the 2012 during Wimbledon and had a Q3 in 2008?
| SELECT "2012" FROM table_62842 WHERE "2008" = 'q3' AND "Tournament" = 'wimbledon' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47961')) AND STRFTIME('%y', allergy.allergytime) >= '2103' | eicu |
CREATE TABLE table_22061 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many were in attendance when the game was held in Arrowhead... | SELECT MIN("Attendance") FROM table_22061 WHERE "Game site" = 'Arrowhead Stadium' | wikisql |
CREATE TABLE table_64636 (
"Name" text,
"LWAT" real,
"100+" real,
"140+" real,
"180s" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the least 180's of John Part having a LWAT less than 28 with 100+ less than 180?
| SELECT MIN("180s") FROM table_64636 WHERE "LWAT" < '28' AND "Name" = 'john part' AND "100+" < '180' | wikisql |
CREATE TABLE table_44982 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" real,
"Avg. Finish" real,
"Winnings" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whic... | SELECT "Winnings" FROM table_44982 WHERE "Starts" > '34' AND "Poles" < '1' AND "Top 10" = '5' | wikisql |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varcha... | SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_15020 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original name" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which movie originated in Bulgaria?
| SELECT "Film title used in nomination" FROM table_15020 WHERE "Country" = 'bulgaria' | wikisql |
CREATE TABLE Customer_Event_Notes (
Customer_Event_ID VARCHAR
)
CREATE TABLE Customer_Events (
Customer_Event_ID VARCHAR,
property_id VARCHAR,
customer_event_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which events have the number of notes bet... | SELECT T1.Customer_Event_ID, T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.Customer_Event_ID HAVING COUNT(*) BETWEEN 1 AND 3 | sql_create_context |
CREATE TABLE table_25691838_12 (
episode__number INTEGER,
guest VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the episode # when the guests were julie nixon eisenhower and david eisenhower?
| SELECT MIN(episode__number) FROM table_25691838_12 WHERE guest = "Julie Nixon Eisenhower and David Eisenhower" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_8903 (
"Consonant final stem" text,
"Example: did-" text,
"Vowel final stem" text,
"Example: ch'aghara-" text,
"Noun example: datv-" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What example for did- is shown for a Noun example:... | SELECT "Example: did-" FROM table_8903 WHERE "Noun example: datv-" = 'datv-is' | wikisql |
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 COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_CD = 'S71.176' | css |
CREATE TABLE table_204_756 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | SELECT SUM("sacks") FROM table_204_756 WHERE id <= 5 | squall |
CREATE TABLE table_75066 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number for rank when gold is less than 0?
| SELECT SUM("Rank") FROM table_75066 WHERE "Gold" < '0' | wikisql |
CREATE TABLE APPELLATIONS (
Area VARCHAR,
County VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the area and county of all appelations.
| SELECT Area, County FROM APPELLATIONS | sql_create_context |
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)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
... | SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_20760 (
"Country" text,
"Preliminary" text,
"Interview" text,
"Swimsuit" text,
"Evening gown" text,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the interview scores for contestants whose average is 9.090?... | SELECT "Interview" FROM table_20760 WHERE "Average" = '9.090' | wikisql |
CREATE TABLE table_633 (
"Season" real,
"Champion" text,
"Motorcycle" text,
"Wins" real,
"2nd pl." real,
"3rd pl." real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the champion for 3rd place being 4 and 2nd place being larger... | SELECT "Champion" FROM table_633 WHERE "3rd pl." = '4' AND "2nd pl." > '4.0' | wikisql |
CREATE TABLE country (
id number,
name text
)
CREATE TABLE player_attributes (
id number,
player_fifa_api_id number,
player_api_id number,
date text,
overall_rating number,
potential number,
preferred_foot text,
attacking_work_rate text,
defensive_work_rate text,
crossin... | SELECT preferred_foot, AVG(overall_rating) FROM player_attributes GROUP BY preferred_foot | spider |
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(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | nvbench |
CREATE TABLE table_47726 (
"Dates" text,
"Tournament" text,
"Prize fund ( \uffe5 )" real,
"Winner" text,
"OWGR pts" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many OWGR pts have a Prize fund ( ) of 100,000,000, and a Tournament of tsuruya op... | SELECT COUNT("OWGR pts") FROM table_47726 WHERE "Prize fund ( \uffe5 )" = '100,000,000' AND "Tournament" = 'tsuruya open' | wikisql |
CREATE TABLE table_48649 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of money that Craig Stadler won?
| SELECT MIN("Money ( $ )") FROM table_48649 WHERE "Player" = 'craig stadler' | wikisql |
CREATE TABLE table_1255110_7 (
goals_against INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest value under the column goals against?
| SELECT MAX(goals_against) FROM table_1255110_7 | sql_create_context |
CREATE TABLE table_22319599_1 (
colors VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the school is John A. Logan College, what are the colors?
| SELECT colors FROM table_22319599_1 WHERE school = "John A. Logan College" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND procedures.short_title = "Aortocor bypas-2 cor art" | mimicsql_data |
CREATE TABLE table_18437 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was Dale Alford first elected in the Arkansas 5 district?
| SELECT "First elected" FROM table_18437 WHERE "District" = 'Arkansas 5' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "3891" | mimicsql_data |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '钱天逸' | css |
CREATE TABLE table_name_33 (
total_matches INTEGER,
total_w_l_h VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Total matches is the lowest one that has a Total W-L-H of 1-2-0?
| SELECT MIN(total_matches) FROM table_name_33 WHERE total_w_l_h = "1-2-0" | sql_create_context |
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE sta... | SELECT Season, COUNT(Season) FROM game GROUP BY Away_team ORDER BY Season DESC | nvbench |
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 demographic (... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "RUQ PAIN" | mimicsql_data |
CREATE TABLE table_name_79 (
opponent VARCHAR,
outcome VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent with an outcome runner-up on November 15, 2010?
| SELECT opponent FROM table_name_79 WHERE outcome = "runner-up" AND date = "november 15, 2010" | sql_create_context |
CREATE TABLE table_name_18 (
gpu_frequency VARCHAR,
model_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is GPU Frequency, when Model Number is Atom N435?
| SELECT gpu_frequency FROM table_name_18 WHERE model_number = "atom n435" | sql_create_context |
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 AVG(CAST((JULIANDAY(ApprovalDate) - JULIANDAY(p.CreationDate)) * 86400.0 AS INT) * 1.0) AS seconds_to_approved_answer FROM SuggestedEdits AS sed LEFT JOIN Posts AS p ON p.Id = sed.PostId WHERE YEAR(p.CreationDate) = '2017' | sede |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '朱涵蓄' AND t_kc22.STA_DATE BETWEEN '2008-12-31' AND '2013-11-25' AND t_kc22.SOC_SRT_DIRE_CD = '908952' | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE... | SELECT TOP(200) AS Title, ViewCount, Tags FROM Posts AS p JOIN PostTags AS t ON p.Id = t.PostId WHERE t.TagId IN (95204, 92613, 94462, 116647, 100530, 87010, 130950, 75599) AND p.PostTypeId = 1 ORDER BY ViewCount DESC | sede |
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.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 ... | css |
CREATE TABLE table_name_10 (
pop_¹ VARCHAR,
prefecture VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of pop for ibaraki
| SELECT COUNT(pop_¹) FROM table_name_10 WHERE prefecture = "ibaraki" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_r... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47295) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'beta-2 microglobulin') AND STRFTIME('%y-%m', labevents.charttime) <= '2102-... | mimic_iii |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Na... | SELECT ph.Name, COUNT(*) FROM ReviewTaskResults AS r LEFT JOIN ReviewTaskResultTypes AS ph ON ph.Id = r.ReviewTaskResultTypeId GROUP BY ph.Name | sede |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_... | SELECT T1.customer_id, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id | nvbench |
CREATE TABLE table_41934 (
"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 goal Difference at Position 5?
| SELECT "Difference" FROM table_41934 WHERE "Position" = '5' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNot... | SELECT Users.Id AS "user_link", Reputation FROM Users INNER JOIN Tags ON Tags.TagName IN ('##tagX##', '##tagY##', '###tagZ#') INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.OwnerUserId = Users.Id AND Posts.ParentId = PostTags.PostId WHERE Location = '##Location##' GROUP BY Users.Id, Reputatio... | sede |
CREATE TABLE table_76270 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "Location Attendance" FROM table_76270 WHERE "High points" = 'allen iverson (23)' | wikisql |
CREATE TABLE table_name_47 (
water__sqmi_ INTEGER,
county VARCHAR,
longitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest water(sqmi) in the county of dickey where the longitude was smaller than -98.444062?
| SELECT MIN(water__sqmi_) FROM table_name_47 WHERE county = "dickey" AND longitude < -98.444062 | sql_create_context |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | SELECT roomname, baseprice FROM rooms ORDER BY baseprice LIMIT 1 | spider |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE semester (
semester_id int,
... | SELECT DISTINCT course_offering.has_final_exam FROM course_offering INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHER... | advising |
CREATE TABLE table_225098_4 (
date_successor_seated VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The successor for the Massachusetts 20th district was seated on what date?
| SELECT date_successor_seated FROM table_225098_4 WHERE district = "Massachusetts 20th" | sql_create_context |
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE statements (
statement... | SELECT T1.statement_details, T2.document_name FROM statements AS T1 JOIN documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project' | spider |
CREATE TABLE table_name_68 (
quantity VARCHAR,
manufacturer VARCHAR,
retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many in the quantity section had Fokker as a manufacturer and retired later than 1999?
| SELECT COUNT(quantity) FROM table_name_68 WHERE manufacturer = "fokker" AND retired > 1999 | 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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '95082544208' | css |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c... | advising |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTasks (
Id num... | SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) > 10... | sede |
CREATE TABLE table_76343 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Round is '2', and when School/Club Team is 'Xavier'?... | SELECT "Player" FROM table_76343 WHERE "Round" = '2' AND "School/Club Team" = 'xavier' | wikisql |
CREATE TABLE table_name_81 (
votes VARCHAR,
residence VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Votes, when the Residence is Halifax?
| SELECT votes FROM table_name_81 WHERE residence = "halifax" | sql_create_context |
CREATE TABLE table_name_75 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record after the April 15 game?
| SELECT record FROM table_name_75 WHERE date = "april 15" | 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'traumatic subdural hem') AND DATETIME(diagnoses_icd.charttime, 'start of y... | mimic_iii |
CREATE TABLE table_204_255 (
id number,
"constituency number" number,
"name" text,
"reserved for (sc/st/none)" text,
"district" text,
"number of electorates (2009)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many electorates does jatar... | SELECT "number of electorates (2009)" FROM table_204_255 WHERE "name" = 'jatara' | squall |
CREATE TABLE table_42985 (
"Year" text,
"GP/GS" text,
"Goals" text,
"Assists" text,
"Total Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the gp/gs when the assists was 1?
| SELECT "GP/GS" FROM table_42985 WHERE "Assists" = '1' | wikisql |
CREATE TABLE table_67660 (
"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.
-- Which Opponent has a Round of qf replay?
| SELECT "Opponent" FROM table_67660 WHERE "Round" = 'qf replay' | wikisql |
CREATE TABLE table_25360865_1 (
home_town VARCHAR,
_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of home town for number being 32
| SELECT COUNT(home_town) FROM table_25360865_1 WHERE _number = 32 | sql_create_context |
CREATE TABLE table_204_713 (
id number,
"rank" number,
"bib" number,
"athlete" text,
"country" text,
"time" text,
"deficit" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of athletes that competed ?
| SELECT COUNT("athlete") FROM table_204_713 | squall |
CREATE TABLE table_16028459_2 (
bills_first_downs INTEGER,
opponents VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many first downs did the bills have when their opponent had 6
| SELECT MIN(bills_first_downs) FROM table_16028459_2 WHERE opponents = 6 | sql_create_context |
CREATE TABLE table_22705586_1 (
name VARCHAR,
date_of_birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date of birth for 27/07/86
| SELECT name FROM table_22705586_1 WHERE date_of_birth = "27/07/86" | sql_create_context |
CREATE TABLE table_25235489_2 (
march_27_29 VARCHAR,
november_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When November is 153 what is the March number?
| SELECT march_27_29 FROM table_25235489_2 WHERE november_3 = "153" | sql_create_context |
CREATE TABLE table_1555308_1 (
bleeding_time VARCHAR,
platelet_count VARCHAR,
prothrombin_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How is the bleeding time wherein platelet count is decreased and prothrombin time is unaffected?
| SELECT bleeding_time FROM table_1555308_1 WHERE platelet_count = "Decreased" AND prothrombin_time = "Unaffected" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.