instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_48145 (
"Season" text,
"GP\u2013GS" text,
"Comp\u2013Att" text,
"Pct." text,
"Yards" text,
"Long" text,
"Avg/G" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the long value for the year with an average/game of 160... | SELECT "Long" FROM table_48145 WHERE "Avg/G" = '160.9' | wikisql |
CREATE TABLE table_10166 (
"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 fewest number of attendees at Kardin... | SELECT MIN("Crowd") FROM table_10166 WHERE "Venue" = 'kardinia park' | wikisql |
CREATE TABLE table_name_49 (
block_a VARCHAR,
prince_devitt VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Block A when Prince Devitt is Devitt (9:53)?
| SELECT block_a FROM table_name_49 WHERE prince_devitt = "devitt (9:53)" | sql_create_context |
CREATE TABLE table_12419515_4 (
directed_by VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the title that was written by Adam Milch?
| SELECT directed_by FROM table_12419515_4 WHERE written_by = "Adam Milch" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2200" AND prescriptions.route = "PR" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'glucagen') | eicu |
CREATE TABLE table_name_15 (
date VARCHAR,
winners VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Motherwell win?
| SELECT date FROM table_name_15 WHERE winners = "motherwell" | sql_create_context |
CREATE TABLE table_204_693 (
id number,
"place" text,
"total" number,
"men" number,
"women" number,
"children" number,
"elderly" number,
"serbs" number,
"jews" number,
"romani" number,
"rusyns" number,
"hungarians" number,
"russians" number
)
-- Using valid SQLite, ... | SELECT SUM("women") FROM table_204_693 | squall |
CREATE TABLE table_64135 (
"Rank" text,
"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 fewest number of golds for teams with a total of 3 and fewer than 2 silvers?
| SELECT MIN("Gold") FROM table_64135 WHERE "Total" = '3' AND "Silver" < '2' | wikisql |
CREATE TABLE table_204_110 (
id number,
"year" number,
"champion" text,
"city" text,
"llws" text,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year did the champions have a 3-0 record before 1983 ?
| SELECT "year" FROM table_204_110 WHERE "record" = '3-0' AND "year" < 1983 | squall |
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 demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "65652" | mimicsql_data |
CREATE TABLE table_64999 (
"Date" text,
"Venue" text,
"Score" text,
"Comp" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Report is on June 3, 2000?
| SELECT "Report" FROM table_64999 WHERE "Date" = 'june 3, 2000' | wikisql |
CREATE TABLE table_name_58 (
episode_no VARCHAR,
region_no VARCHAR,
no_of_dvds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT EPISODE HAS A REGION NUMBER BIGGER THAN 1, AND 32 DVDS?
| SELECT episode_no FROM table_name_58 WHERE region_no > 1 AND no_of_dvds = "32" | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT ROUND(CAST(Votes AS FLOAT) / Posts, 2) AS "votes", ROUND(CAST(Upvotes AS FLOAT) / Posts, 2) AS "upvotes", ROUND(CAST(Downvotes AS FLOAT) / Posts, 2) AS "downvotes", ROUND(CAST(Upvotes AS FLOAT) / Downvotes, 2) AS "up/down_ratio" FROM (SELECT COUNT(DISTINCT v.PostId) AS "posts", COUNT(*) AS "votes", COUNT(CASE v.... | sede |
CREATE TABLE table_name_66 (
final VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Final, when Team is United States (USA) USA I?
| SELECT final FROM table_name_66 WHERE team = "united states (usa) usa i" | sql_create_context |
CREATE TABLE table_18329 (
"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.
-- Who were the candidates when Shirley Chisholm was the incumbent?
| SELECT "Candidates" FROM table_18329 WHERE "Incumbent" = 'Shirley Chisholm' | 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(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1037880' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-02-22' AND '2009-05-23' | css |
CREATE TABLE table_18278508_2 (
position VARCHAR,
co_contestant__yaar_vs_pyaar_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did Pranita Sahu's team get?
| SELECT position FROM table_18278508_2 WHERE co_contestant__yaar_vs_pyaar_ = "Pranita Sahu" | sql_create_context |
CREATE TABLE table_31768 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the result for attendance of 54,462
| SELECT "Result" FROM table_31768 WHERE "Attendance" = '54,462' | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Intraoperative cardiac pacemaker" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.departure_time > 1700 AND flight.to_airport = AIRPORT_SERVICE_1.airpo... | atis |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
-- Using valid SQLite, answer... | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_train_84 (
"id" int,
"gender" string,
"mini_mental_state_examination_mmse" int,
"modified_hachinski_ischemia_scale" int,
"post_menopausal" bool,
"allergy_to_rifaximin" bool,
"surgically_sterilized" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)... | SELECT * FROM table_train_84 WHERE (gender = 'male' OR (gender = 'female' AND (post_menopausal >= 1 OR surgically_sterilized = 1))) AND (age >= 50 AND age <= 80) AND body_mass_index_bmi < 31 | criteria2sql |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9923455' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 12 | css |
CREATE TABLE table_name_59 (
year VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has 2 wins?
| SELECT year FROM table_name_59 WHERE wins = "2" | sql_create_context |
CREATE TABLE products (
product_id number,
product_name text,
product_details text
)
CREATE TABLE shipments (
shipment_id number,
order_id number,
invoice_number number,
shipment_tracking_number text,
shipment_date time,
other_shipment_details text
)
CREATE TABLE orders (
order... | SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments) | spider |
CREATE TABLE table_name_93 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is richmond's score as the home team?
| SELECT home_team AS score FROM table_name_93 WHERE home_team = "richmond" | sql_create_context |
CREATE TABLE table_14006 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points are in the scor... | SELECT SUM("Scored") FROM table_14006 WHERE "Played" < '18' | wikisql |
CREATE TABLE table_43426 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In Week 7, what is the highest attendance number?
| SELECT MAX("Attendance") FROM table_43426 WHERE "Week" = '7' | 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 mzjzjlb.JZLSH 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 = '尤安晏' AND hz_info.YLJGDM = '7400991' AND mzjzjlb.JZKSMC LIKE '%肝胆科%' | css |
CREATE TABLE table_name_49 (
attendance VARCHAR,
game VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Attendance has a Game smaller than 3, and a Date of october 31?
| SELECT COUNT(attendance) FROM table_name_49 WHERE game < 3 AND date = "october 31" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '鲁烨烨' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 809.11) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '鲁烨烨' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM... | css |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE L... | SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY AVG(share_count) DESC | nvbench |
CREATE TABLE table_name_71 (
place VARCHAR,
player VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place does Fred Funk, who has a score of 69-69=138, have?
| SELECT place FROM table_name_71 WHERE score = 69 - 69 = 138 AND player = "fred funk" | sql_create_context |
CREATE TABLE table_name_79 (
circuit VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What circuit had 16 rounds?
| SELECT circuit FROM table_name_79 WHERE round = 16 | sql_create_context |
CREATE TABLE table_56216 (
"Candidate" text,
"Money Raised, 3Q" text,
"Loans Received, 3Q" text,
"Money Spent, 3Q" text,
"Total Receipts" text,
"Cash On Hand" text,
"After Debt" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What After debt ... | SELECT "After Debt" FROM table_56216 WHERE "Money Raised, 3Q" = '$5,358,585' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_15306124_1 (
league_of_communists VARCHAR,
municipality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many league of communists have the municipality of bar?
| SELECT COUNT(league_of_communists) FROM table_15306124_1 WHERE municipality = "Bar" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '葛和悦' | css |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Aortic valve disorder" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_name_27 (
race VARCHAR,
winner_or_2nd VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the race when the winner of 2nd was Voleuse?
| SELECT race FROM table_name_27 WHERE winner_or_2nd = "voleuse" | sql_create_context |
CREATE TABLE table_name_54 (
intake INTEGER,
faith VARCHAR,
dcsf_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the sum of Intake that has the Faith of rc, and the DCSF number larger than 2428?
| SELECT SUM(intake) FROM table_name_54 WHERE faith = "rc" AND dcsf_number > 2428 | sql_create_context |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is minimum age for dif... | SELECT job, MIN(age) FROM Person GROUP BY job | nvbench |
CREATE TABLE table_name_40 (
win__percentage INTEGER,
manager VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highes win % that manager juan carlos ch vez's team had when they lost less than 4 times?
| SELECT MAX(win__percentage) FROM table_name_40 WHERE manager = "juan carlos chávez" AND lost < 4 | sql_create_context |
CREATE TABLE table_6266 (
"Episode" text,
"Title" text,
"Writer(s)" text,
"Preservation" text,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Has Episode 1b-16 (42) been preserved?
| SELECT "Preservation" FROM table_6266 WHERE "Episode" = '1b-16 (42)' | wikisql |
CREATE TABLE table_56531 (
"Year" text,
"Starts" real,
"Cuts made" real,
"Wins" real,
"Top 10" real,
"Top 25" real,
"Earnings ($)" real,
"Money list rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of Cuts ... | SELECT MAX("Cuts made") FROM table_56531 WHERE "Top 10" < '8' AND "Wins" > '0' | wikisql |
CREATE TABLE table_54942 (
"Year" real,
"Artist" text,
"Composition" text,
"Mintage" real,
"Issue Price" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Artist has an Issue Price of $8,159.95?
| SELECT "Artist" FROM table_54942 WHERE "Issue Price" = '$8,159.95' | wikisql |
CREATE TABLE instruments (
instrument VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most used instrument?
| SELECT instrument FROM instruments GROUP BY instrument ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_47597 (
"Rank" text,
"Team" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which final has a run of 1:19.49?
| SELECT "Final" FROM table_47597 WHERE "Run 3" = '1:19.49' | wikisql |
CREATE TABLE table_1272844_2 (
reward VARCHAR,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who received the reward on the episode where the finish was '3rd voted out day 8'?
| SELECT reward FROM table_1272844_2 WHERE finish = "3rd voted Out Day 8" | sql_create_context |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_38215 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which competition was on August 11, 1996?
| SELECT "Competition" FROM table_38215 WHERE "Date" = 'august 11, 1996' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.short_title = "Cardiogenic shock" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Comments (
Id number,
PostId number,
... | SELECT Posts.OwnerUserId AS "user_link", COUNT(*) AS "bounties_won", SUM(Votes.BountyAmount) AS "rep_gained" FROM Votes INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE VoteTypeId = 9 GROUP BY Posts.OwnerUserId ORDER BY 2 DESC LIMIT 20 | sede |
CREATE TABLE table_26914854_3 (
team VARCHAR,
date_of_appointment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date of appointment 11 june 2010?
| SELECT team FROM table_26914854_3 WHERE date_of_appointment = "11 June 2010" | sql_create_context |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_9 (
event VARCHAR,
round VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event had 1 round and a record of 6-2?
| SELECT event FROM table_name_9 WHERE round = 1 AND record = "6-2" | sql_create_context |
CREATE TABLE table_name_54 (
grid INTEGER,
laps VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the sum of Grid that has the Laps of 30, and the Rider of toni elias?
| SELECT SUM(grid) FROM table_name_54 WHERE laps = 30 AND rider = "toni elias" | 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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '75549243' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-06-05' AND '2019-12-01' | css |
CREATE TABLE table_22580855_1 (
written_by VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many writers write the episode whose director is Jonathan Herron?
| SELECT COUNT(written_by) FROM table_22580855_1 WHERE directed_by = "Jonathan Herron" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | SELECT jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '84803528320' | css |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY AVG(Capacity) | nvbench |
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
-- Using valid SQLite, answer the follo... | SELECT name FROM mountain ORDER BY name | spider |
CREATE TABLE table_34990 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the date of the game that has the Bulls as a visiting team?
| SELECT "Date" FROM table_34990 WHERE "Visitor" = 'bulls' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "58" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
)
CREATE TABLE claims (
claim_id number,
policy_id number,
date_claim_made time,
date_clai... | SELECT payment_method_code, date_payment_made, amount_payment FROM payments ORDER BY date_payment_made | spider |
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 time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '92252701748' | css |
CREATE TABLE table_70630 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Tries for" FROM table_70630 WHERE "Points against" = '479' | wikisql |
CREATE TABLE table_3714 (
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text,
"Ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least episode number for jonathan harvey
| SELECT MIN("Episode #") FROM table_3714 WHERE "Written by" = 'Jonathan Harvey' | wikisql |
CREATE TABLE table_name_37 (
shot_diameter__cm_ VARCHAR,
shot_volume__cm_3__ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is the shot volume (cm3) less than 172.76?
| SELECT COUNT(shot_diameter__cm_) FROM table_name_37 WHERE shot_volume__cm_3__ < 172.76 | sql_create_context |
CREATE TABLE table_66597 (
"Rank" real,
"City" text,
"Population" real,
"Year of Census or Estimate" real,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Year of Census or Estimate is the Toronto Population larger than 1,556,396?
| SELECT SUM("Year of Census or Estimate") FROM table_66597 WHERE "Population" > '1,556,396' AND "City" = 'toronto' | wikisql |
CREATE TABLE table_name_78 (
l2_cache VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's amount of L2 Cache on a device that has a Frequency of 1500mhz?
| SELECT l2_cache FROM table_name_78 WHERE frequency = "1500mhz" | sql_create_context |
CREATE TABLE table_name_22 (
political_party VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Political Party has a Name of rexhep bej mitrovica?
| SELECT political_party FROM table_name_22 WHERE name = "rexhep bej mitrovica" | sql_create_context |
CREATE TABLE organisations (
organisation_id number,
organisation_type text,
organisation_details text
)
CREATE TABLE tasks (
task_id number,
project_id number,
task_details text,
eg agree objectives text
)
CREATE TABLE project_staff (
staff_id number,
project_id number,
role_c... | SELECT T1.project_id, COUNT(*) FROM project_staff AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) | spider |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.short_title = "Crbl art ocl NOS w infrc" | mimicsql_data |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE table_21749 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the call sign of the station with the frequency of 90.3mhz
| SELECT "Callsign" FROM table_21749 WHERE "Frequency" = '90.3MHz' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97314) AND NOT transfers.careunit IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT BGRQ FROM jybgb WHERE BGDH = '51074072254' | css |
CREATE TABLE table_name_56 (
record VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record when St. Louis is the visitor?
| SELECT record FROM table_name_56 WHERE visitor = "st. louis" | 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 mzjzjlb.YLJGDM 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 = '69072554' UNION SELECT wdmzjzjlb.YLJGDM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmz... | css |
CREATE TABLE classification (
id int,
msid int,
gid int
)
CREATE TABLE genre (
gid int,
genre text
)
CREATE TABLE keyword (
id int,
keyword text
)
CREATE TABLE actor (
aid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABL... | SELECT movie.title FROM actor, cast, directed_by, director, movie WHERE actor.name = 'Taraneh Alidoosti' AND cast.aid = actor.aid AND director.did = directed_by.did AND director.name = 'Asghar Farhadi' AND movie.mid = cast.msid AND movie.mid = directed_by.msid | imdb |
CREATE TABLE table_27734286_6 (
record VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List records for game 29.
| SELECT record FROM table_27734286_6 WHERE game = 29 | sql_create_context |
CREATE TABLE table_55404 (
"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's the sum of gold where silver is more than 2 and the total is 12?
| SELECT SUM("Gold") FROM table_55404 WHERE "Silver" > '2' AND "Total" = '12' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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,
... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ARMENIAN' AND course.number = 171 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1 | advising |
CREATE TABLE document_sections_images (
section_id number,
image_id number
)
CREATE TABLE documents (
document_code text,
document_structure_code text,
document_type_code text,
access_count number,
document_name text
)
CREATE TABLE roles (
role_code text,
role_description text
)
C... | SELECT image_name, image_url FROM images ORDER BY image_name | spider |
CREATE TABLE table_79583 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of draws for losses over 8 and Against values under 1344?
| SELECT AVG("Draws") FROM table_79583 WHERE "Losses" > '8' AND "Against" < '1344' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72107) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'osmolality, urine') AND STRFTIME('%y-%m', labevents.charttime) <= '2103-02' ORDE... | mimic_iii |
CREATE TABLE table_3005450_1 (
station VARCHAR,
metlink_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the station where the metlink code is mata?
| SELECT station FROM table_3005450_1 WHERE metlink_code = "MATA" | sql_create_context |
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(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '任秀竹' AND t_kc22.STA_DATE BETWEEN '2000-08-26' AND '2011-03-02' AND gwyjzb.MED_SER_ORG_NO = '2367774' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_... | css |
CREATE TABLE table_name_78 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team at Kardinia Park?
| SELECT home_team FROM table_name_78 WHERE venue = "kardinia park" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home | 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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '袁修雅' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1137.71) | css |
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 t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'potassium chl 20 meq / 1000 ml d5 1/2 ns' AND admissions.subject_id = 20441 AND DATETIME(prescriptions.startdate, 'start of year') ... | mimic_iii |
CREATE TABLE table_1341973_3 (
incumbent VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the incumbent in the Alabama 6 voting district?
| SELECT incumbent FROM table_1341973_3 WHERE district = "Alabama 6" | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "31" AND diagnoses.short_title = "Crnry athrscl natve vssl" | mimicsql_data |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | SELECT (SELECT 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 = 12726 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM... | mimic_iii |
CREATE TABLE table_26168687_5 (
no_in_season VARCHAR,
vessel_operator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of season for beluga shipping
| SELECT COUNT(no_in_season) FROM table_26168687_5 WHERE vessel_operator = "Beluga Shipping" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate tim... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'methylprednisolone na succ' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_name_33 (
earnings___ VARCHAR,
player VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the earnings for jim colbert with under 4 wins?
| SELECT COUNT(earnings___) AS $__ FROM table_name_33 WHERE player = "jim colbert" AND wins < 4 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.