instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 COUNT(DISTINCT mzjzjlb.ZZYSGH) 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 mzjzjlb.JZKSRQ BETWEEN '2004-08-14' AND '2017-05-20' | css |
CREATE TABLE table_203_498 (
id number,
"first issued" text,
"design" text,
"slogan" text,
"serial format" text,
"serials issued" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in what year was the last design of passenger base... | SELECT MAX("first issued") FROM table_203_498 | squall |
CREATE TABLE table_19500 (
"Week" real,
"Date" 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.
-- What day was the oppenent the detroit lions?
| SELECT "Date" FROM table_19500 WHERE "Opponent" = 'Detroit Lions' | wikisql |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Pr... | SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2102-12' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
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 intakeoutput (
in... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... | eicu |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC | nvbench |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price | nvbench |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '蒋飞白' AND t_kc22.STA_DATE BETWEEN '2000-04-18' AND '2006-08-04' AND qtb.MED_SER_ORG_NO = '4684405' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLIN... | css |
CREATE TABLE table_name_38 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the game that ended with a score of 6-4?
| SELECT date FROM table_name_38 WHERE score = "6-4" | sql_create_context |
CREATE TABLE table_name_54 (
goals VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals were scored by Eugene Galekovi ?
| SELECT goals FROM table_name_54 WHERE player = "eugene galeković" | sql_create_context |
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G) | nvbench |
CREATE TABLE table_75308 (
"Source" text,
"Date" text,
"Blagojevich (D)" text,
"Topinka (R)" text,
"Remainder" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Source has a Remainder of 15%, and a Topinka of 26%?
| SELECT "Source" FROM table_75308 WHERE "Remainder" = '15%' AND "Topinka (R)" = '26%' | wikisql |
CREATE TABLE table_name_2 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the Cubs game when the Cubs had a record of 1-0?
| SELECT date FROM table_name_2 WHERE record = "1-0" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "PHEN10I" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2187" AND diagnoses.long_title = "Pure hyperglyceridemia" | mimicsql_data |
CREATE TABLE table_9850 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" text,
"Song" text,
"Artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the artist that issued the single on 23 February?
| SELECT "Artist" FROM table_9850 WHERE "Issue Date(s)" = '23 february' | wikisql |
CREATE TABLE table_8232 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the game on April 17 against Los Angeles?
| SELECT "Result" FROM table_8232 WHERE "Road Team" = 'los angeles' AND "Date" = 'april 17' | wikisql |
CREATE TABLE table_24561550_1 (
record VARCHAR,
wildcats_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the record from the game where Wildcats had 48 points.
| SELECT record FROM table_24561550_1 WHERE wildcats_points = 48 | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE month (
month_number int,
... | 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 = 'DALLAS' AND flight.stops = 1 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND ... | atis |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
other_customer_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,... | SELECT card_type_code, COUNT(*) FROM customers_cards GROUP BY card_type_code | spider |
CREATE TABLE table_23048 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the song choice for michael jackson
| SELECT "Song choice" FROM table_23048 WHERE "Original artist" = 'Michael Jackson' | wikisql |
CREATE TABLE table_name_17 (
points INTEGER,
lost VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did the ESC Riverrats Geretsried, who lost more than 3 games, score?
| SELECT SUM(points) FROM table_name_17 WHERE lost > 3 AND name = "esc riverrats geretsried" | sql_create_context |
CREATE TABLE table_name_4 (
crowd VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How big was the crowd when the away team was Richmond?
| SELECT crowd FROM table_name_4 WHERE away_team = "richmond" | sql_create_context |
CREATE TABLE table_3334 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the cyrillic... | SELECT "Cyrillic Name Other Names" FROM table_3334 WHERE "Settlement" = 'Melenci' | 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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '孔婉丽' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 1836.29) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '孔婉丽' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 183... | css |
CREATE TABLE table_train_185 (
"id" int,
"dyscrasia" bool,
"bleeding" int,
"panic_disorder" bool,
"renal_disease" bool,
"anxiety" bool,
"creatinine_clearance_cl" float,
"alcohol_abuse" bool,
"retinopathy" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questio... | SELECT * FROM table_train_185 WHERE alcohol_abuse = 1 | criteria2sql |
CREATE TABLE table_22736523_1 (
result VARCHAR,
week__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For week number of the top 40, what was the results?
| SELECT result FROM table_22736523_1 WHERE week__number = "Top 40" | sql_create_context |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Rev... | SELECT COUNT(*) FROM Posts WHERE PostTypeId IN (1, 2) AND CreationDate >= DATEADD(DAY, -30, GETDATE()) | sede |
CREATE TABLE table_name_26 (
age_groups VARCHAR,
competition_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the age groups for the Big League World Series?
| SELECT age_groups FROM table_name_26 WHERE competition_name = "big league world series" | sql_create_context |
CREATE TABLE table_58997 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( \u00a3 )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the money with a Score of 76-70-75-72=293?
| SELECT "Money ( \u00a3 )" FROM table_58997 WHERE "Score" = '76-70-75-72=293' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE table_name_61 (
year VARCHAR,
organization VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year has an Organization of new york yankees, and a Team of johnson city yankees?
| SELECT year FROM table_name_61 WHERE organization = "new york yankees" AND team = "johnson city yankees" | sql_create_context |
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 MIN(demographic.age) FROM demographic WHERE demographic.age >= "83" AND demographic.days_stay = "43" | mimicsql_data |
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions... | SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_12802 (
"Draft" real,
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average pick of player paul maclean, who had a draft before 1978?
| SELECT AVG("Pick") FROM table_12802 WHERE "Player" = 'paul maclean' AND "Draft" < '1978' | 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 SUM(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 = '80471711' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-08-06' AND '2003-10-30' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_1745843_9 (
class VARCHAR,
part_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the class for boten
| SELECT class FROM table_1745843_9 WHERE part_3 = "boten" | sql_create_context |
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 bdmzjzjlb (
CYBQDM text,
CYBQ... | 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 = '16019866' 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 table_26635 (
"Episode #" text,
"Segment 1" text,
"Segment 2" text,
"Original airdate" text,
"Lessons taught" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the segment 1 for episode # 2/225
| SELECT "Segment 1" FROM table_26635 WHERE "Episode #" = '2/225' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean... | SELECT Id AS "post_link", Body, Tags, Score, AnswerCount, CommentCount FROM Posts WHERE PostTypeId = 1 AND ((Score <= 0 AND AnswerCount > 0 AND (AcceptedAnswerId = NULL OR AcceptedAnswerId > 0)) OR (Score = 0 AND CommentCount > 0) OR (Score > 0)) ORDER BY CreationDate DESC LIMIT 1000 | sede |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
ro... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_name_12 (
director VARCHAR,
release_date VARCHAR,
series VARCHAR,
production_num VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director of the movie having a release date of 1934-09-15, an MM Series and a production nu... | SELECT director FROM table_name_12 WHERE series = "mm" AND production_num < 6494 AND release_date = "1934-09-15" | sql_create_context |
CREATE TABLE table_name_32 (
pick__number INTEGER,
name VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pick # is the highest one that has a Name of william middleton, and a Round larger than 5?
| SELECT MAX(pick__number) FROM table_name_32 WHERE name = "william middleton" AND round > 5 | 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remove fb from perito... | mimic_iii |
CREATE TABLE table_14163 (
"Order" real,
"Published as serial" text,
"Published as novel" text,
"Fictional narrator" text,
"Year in novel" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Fictional narrator has a Published as serial of february ... | SELECT "Fictional narrator" FROM table_14163 WHERE "Published as serial" = 'february–july 1912, all-story' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EEB' AND course.number = 412 AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_name_75 (
time_retired VARCHAR,
qual VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which time/retired has a qual of 144.02?
| SELECT time_retired FROM table_name_75 WHERE qual = 144.02 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitaldischargetime IS NULL)) AND trea... | eicu |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
cha... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acd-a for crrt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')) | mimic_iii |
CREATE TABLE table_23959 (
"Season" text,
"GP" real,
"W (OT/SO)" text,
"L (OT/SO)" text,
"Pts" real,
"Pts/GP" text,
"GF \u2013 GA" text,
"Rank (league/conference)" text,
"Top Scorer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In ... | SELECT "W (OT/SO)" FROM table_23959 WHERE "Season" = '2008–09' | wikisql |
CREATE TABLE table_27756014_6 (
high_points VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people scored the most points during the game on December 10?
| SELECT COUNT(high_points) FROM table_27756014_6 WHERE date = "December 10" | sql_create_context |
CREATE TABLE table_33317 (
"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.
-- For the match with a home team score of 11.14 (8... | SELECT "Venue" FROM table_33317 WHERE "Home team score" = '11.14 (80)' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3775508' GROUP BY t_kc21.IN_DIAG_DIS_NM | css |
CREATE TABLE table_3588 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 10" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positions ar... | SELECT COUNT("Position") FROM table_3588 WHERE "Team(s)" = 'RB1 Motorsports' | 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 MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "41" | mimicsql_data |
CREATE TABLE table_23248910_9 (
high_points VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is every high points for the Pistons team?
| SELECT high_points FROM table_23248910_9 WHERE team = "Pistons" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'amylase, body fluid')) | mimic_iii |
CREATE TABLE table_5631 (
"Frequency (MHz)" real,
"Call letters" text,
"Licensed location" text,
"Type" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Frequency (MHz) that has a Type of primary, and a Call letters of ktbb-fm has what ... | SELECT COUNT("Frequency (MHz)") FROM table_5631 WHERE "Type" = 'primary' AND "Call letters" = 'ktbb-fm' | 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, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE table_25695027_1 (
valves VARCHAR,
years_built VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many types of valves were used on this engine that was built on 1902-05?
| SELECT COUNT(valves) FROM table_25695027_1 WHERE years_built = "1902-05" | sql_create_context |
CREATE TABLE table_name_97 (
race_winner VARCHAR,
fastest_lap VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won with the fastest lap of daijiro hiura on March 29?
| SELECT race_winner FROM table_name_97 WHERE fastest_lap = "daijiro hiura" AND date = "march 29" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
la... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', lab.labresulttime) >= '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_79478 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Elevation (m) of the Peak with a Prominence (m) larger than 2,143 and Col (m) o... | SELECT "Elevation (m)" FROM table_79478 WHERE "Prominence (m)" > '2,143' AND "Col (m)" = '2012' | wikisql |
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '44192397' AND t_kc22.STA_DATE BETWEEN '2016-04-29' AND '2016-04-30' AND t_kc22.SOC_SRT_DIRE_CD = '130906139' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID ... | css |
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE ... | SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 | spider |
CREATE TABLE table_name_51 (
losing_bonus VARCHAR,
drawn VARCHAR,
try_bonus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the losing bonus that had 1 draw and a 10 try bonus?
| SELECT losing_bonus FROM table_name_51 WHERE drawn = "1" AND try_bonus = "10" | sql_create_context |
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE vehicles (
vehicle_id number,
vehicle_details text
)
CREATE TABLE lessons (
lesson_id number,
customer_id number,
l... | SELECT first_name, last_name FROM customers WHERE amount_outstanding BETWEEN 1000 AND 3000 | spider |
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5091716' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-01-05' AND '2011-12-30' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 7482.56) AS T | css |
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 JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '7215353' AND BGRQ BETWEEN '2001-03-12' AND '2021-04-26' GROUP BY JCZBMC, JCZBJGDW | css |
CREATE TABLE table_56767 (
"Grade" text,
"Points" real,
"Sit-up (reps)" text,
"Standing Broad Jump (cm)" text,
"Chin-up (reps)" text,
"Shuttle Run (sec)" text,
"2.4km Run (min:sec)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shuttle... | SELECT "Shuttle Run (sec)" FROM table_56767 WHERE "2.4km Run (min:sec)" = '12:21-13:00' | wikisql |
CREATE TABLE table_name_27 (
round INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which highest Round has a Result of loss?
| SELECT MAX(round) FROM table_name_27 WHERE result = "loss" | sql_create_context |
CREATE TABLE table_name_25 (
publication_date VARCHAR,
fictional_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the publication date when the fictional date is 2112
| SELECT publication_date FROM table_name_25 WHERE fictional_date = "2112" | sql_create_context |
CREATE TABLE table_22466 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Township" FROM table_22466 WHERE "Land ( sqmi )" = '28.597' | wikisql |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_name_32 (
laps INTEGER,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of laps obtained by driver Nick Heidfeld?
| SELECT MIN(laps) FROM table_name_32 WHERE driver = "nick heidfeld" | sql_create_context |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
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 (
... | SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4 | eicu |
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 prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Cephalexin" | mimicsql_data |
CREATE TABLE table_name_43 (
career_sr VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the career SR with a 1r in 1985?
| SELECT career_sr FROM table_name_43 WHERE 1985 = "1r" | sql_create_context |
CREATE TABLE table_1341453_7 (
party VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party was first elected in 1974?
| SELECT party FROM table_1341453_7 WHERE first_elected = 1974 | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb... | css |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId ... | SELECT Id AS "post_link" FROM Posts ORDER BY CreationDate DESC LIMIT 10 | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_name_45 (
attendance INTEGER,
leading_scorer VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attended the game on 12/17 with stephen jackson as the leading scorer?
| SELECT SUM(attendance) FROM table_name_45 WHERE leading_scorer = "stephen jackson" AND date = "12/17" | sql_create_context |
CREATE TABLE table_204_722 (
id number,
"season" text,
"series" text,
"team" text,
"races" number,
"wins" number,
"poles" number,
"f/lap" number,
"podiums" number,
"points" number,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT MIN("points") FROM table_204_722 | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_i... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d9.0' AND d_ite... | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2186.0" AND diagnoses.long_title = "Hyperacusis" | mimicsql_data |
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Ar... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_31228 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed under L when t... | SELECT MAX("L") FROM table_31228 WHERE "Ends Won" = '21' | wikisql |
CREATE TABLE table_15803 (
"Riding" text,
"Candidate's Name" text,
"Gender" text,
"Residence" text,
"Occupation" text,
"Votes" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What job is at red bank?
| SELECT "Occupation" FROM table_15803 WHERE "Residence" = 'red bank' | wikisql |
CREATE TABLE table_59579 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game against away team queens park rangers on 23 january 1982?
| SELECT "Score" FROM table_59579 WHERE "Date" = '23 january 1982' AND "Away team" = 'queens park rangers' | wikisql |
CREATE TABLE table_1845 (
"Date(s)" text,
"Venue" text,
"City, state" text,
"Ticket price(s)" text,
"Ticket sold / available" text,
"Ticket grossing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much do the tickets cost for August 7, 1987?... | SELECT "Ticket price(s)" FROM table_1845 WHERE "Date(s)" = 'August 7, 1987' | wikisql |
CREATE TABLE table_63272 (
"Name" text,
"Games" text,
"A-League" text,
"Finals" text,
"Goals" real,
"Assists" real,
"Years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many finals had more than 0 goals and 8 assists?
| SELECT "Finals" FROM table_63272 WHERE "Goals" > '0' AND "Assists" = '8' | wikisql |
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.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '15:45' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester... | advising |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2024496' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-13' AND '2018-05-18' | css |
CREATE TABLE table_71765 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Deng Xuan first win Women's singles?
| SELECT MIN("Year") FROM table_71765 WHERE "Women's singles" = 'deng xuan' | wikisql |
CREATE TABLE table_55219 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the away team that played home team Foots... | SELECT "Away team" FROM table_55219 WHERE "Home team" = 'footscray' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2133" AND prescriptions.route = "PO" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.