instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "HYPOXIA" | mimicsql_data |
CREATE TABLE table_256286_8 (
type VARCHAR,
description VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the type of ballot measure with the description of Department of Industry and Public Works Amendment?
| SELECT type FROM table_256286_8 WHERE description = "Department of Industry and Public Works Amendment" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'analgesics - narcotic analgesic' AND DATETIME(treatment.treatmenttime, 's... | eicu |
CREATE TABLE table_6274 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Top-5 is the lowest one that has Wins smaller than 0?
| SELECT MIN("Top-5") FROM table_6274 WHERE "Wins" < '0' | 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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Games | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "PTT" | mimicsql_data |
CREATE TABLE table_204_300 (
id number,
"date from" text,
"date to" text,
"pos." text,
"name" text,
"from" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players were dfs ?
| SELECT COUNT("name") FROM table_204_300 WHERE "pos." = 'df' | squall |
CREATE TABLE table_58901 (
"Glenelg FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins were there when draws were more than 0?
| SELECT MIN("Wins") FROM table_58901 WHERE "Draws" > '0' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_10361625_1 (
overall VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Rice's collage score?
| SELECT overall FROM table_10361625_1 WHERE college = "Rice" | sql_create_context |
CREATE TABLE table_name_21 (
tackles VARCHAR,
yards VARCHAR,
fumr VARCHAR,
totaltk VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of tackles when fumr is 0, totaltk is 54 and yards is less than 0?
| SELECT COUNT(tackles) FROM table_name_21 WHERE fumr = 0 AND totaltk = 54 AND yards < 0 | sql_create_context |
CREATE TABLE table_20392 (
"N\u00b0" text,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many PPV ... | SELECT COUNT("PPV") FROM table_20392 WHERE "Television service" = 'Sky Cinema 1' | wikisql |
CREATE TABLE table_37122 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what game had an attendance of 21,629
| SELECT "Record" FROM table_37122 WHERE "Attendance" = '21,629' | wikisql |
CREATE TABLE table_name_95 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the venue that they away team Collingwood played at?
| SELECT venue FROM table_name_95 WHERE away_team = "collingwood" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
chart... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9294) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_name_93 (
time VARCHAR,
bike VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time was there when the bike was Ducati 999 F06 and the grid number was 15?
| SELECT time FROM table_name_93 WHERE bike = "ducati 999 f06" AND grid = 15 | sql_create_context |
CREATE TABLE table_20182 (
"Week" real,
"Date" text,
"Result" text,
"Record" text,
"Opponent" text,
"Points For" real,
"Points Against" real,
"First Downs" real,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the re... | SELECT "Record" FROM table_20182 WHERE "Opponent" = 'New York Giants' | wikisql |
CREATE TABLE table_55634 (
"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.
-- How much did the home team score that played the... | SELECT "Home team score" FROM table_55634 WHERE "Away team score" = '10.14 (74)' | wikisql |
CREATE TABLE table_46664 (
"Country" text,
"Preliminary" real,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Evening Gown scores where the swimsuit score is hi... | SELECT SUM("Evening Gown") FROM table_46664 WHERE "Swimsuit" > '9.4' AND "Average" < '9.733' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT PostId AS "post_link", UserId AS "user_link", COUNT(*) FROM Comments GROUP BY PostId, UserId ORDER BY COUNT(*) DESC LIMIT 1000 | sede |
CREATE TABLE table_name_29 (
team VARCHAR,
draw VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team had a draw of 0?
| SELECT team FROM table_name_29 WHERE draw = "0" | sql_create_context |
CREATE TABLE table_name_37 (
constructor VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the constructor for a FW20 chassis?
| SELECT constructor FROM table_name_37 WHERE chassis = "fw20" | sql_create_context |
CREATE TABLE table_35742 (
"Name" text,
"Location" text,
"State" text,
"Opened (closing date if defunct)" text,
"Surface" text,
"Length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What State has an Opened (closing date if defunct) that shows... | SELECT "State" FROM table_35742 WHERE "Opened (closing date if defunct)" = '1960' | wikisql |
CREATE TABLE table_name_39 (
score_ VARCHAR,
a_ VARCHAR,
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score [A] of the match at Vanuatu (n) on 5 September 1998?
| SELECT score_ AS "a_" FROM table_name_39 WHERE venue = "vanuatu (n)" AND date = "5 september 1998" | sql_create_context |
CREATE TABLE table_name_30 (
score VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score in 2000?
| SELECT score FROM table_name_30 WHERE year = 2000 | sql_create_context |
CREATE TABLE table_23670057_4 (
height__m_ VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How tall is the basket ball player lior eliyahu in meters?
| SELECT height__m_ FROM table_23670057_4 WHERE player = "Lior Eliyahu" | sql_create_context |
CREATE TABLE table_24565004_7 (
appearances¹ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of appearances a player had
| SELECT MIN(appearances¹) FROM table_24565004_7 | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE state (
... | 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, date_day, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 25 AND da... | atis |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_11951237_1 (
directed_by VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director of the Series 1 episode?
| SELECT directed_by FROM table_11951237_1 WHERE series__number = 1 | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Thyroxine (T4), Free" | mimicsql_data |
CREATE TABLE table_27892 (
"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.
-- How many types o... | SELECT COUNT("Type") FROM table_27892 WHERE "Settlement" = 'Neradin' | wikisql |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(Investor) DESC | nvbench |
CREATE TABLE table_53288 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What driver has a ime/Retired of +1 lap, and a Constructor of bar - honda?
| SELECT "Driver" FROM table_53288 WHERE "Time/Retired" = '+1 lap' AND "Constructor" = 'bar - honda' | wikisql |
CREATE TABLE table_40134 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Socialist Labor ticket" text,
"Prohibition ticket" text,
"Independent Citizens' ticket" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Socialist... | SELECT "Socialist Labor ticket" FROM table_40134 WHERE "Office" = 'secretary of state' | wikisql |
CREATE TABLE table_name_96 (
parent VARCHAR,
order VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the parent on the order of 6?
| SELECT parent FROM table_name_96 WHERE order = 6 | sql_create_context |
CREATE TABLE table_1342249_5 (
first_elected INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest years any of the incumbents were first elected?
| SELECT MIN(first_elected) FROM table_1342249_5 | 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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Other second degree atrioventricular block" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Heparin Flush (10 units/ml)" | mimicsql_data |
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE accounts (
account_id number,
statement_id number,
account_details text
)
CREATE TABLE statements (
statement_id number,
statement_details text
)
CREATE TABLE documen... | SELECT COUNT(*) FROM documents WHERE NOT document_id IN (SELECT document_id FROM documents_with_expenses) | spider |
CREATE TABLE table_11960407_2 (
score VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game when the raptors played @ cleveland?
| SELECT score FROM table_11960407_2 WHERE team = "@ Cleveland" | sql_create_context |
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CREATE TABLE apartment_bookings (
apt_booking_id number,
apt_id number,
guest_id number,
booking_status_code text,... | SELECT T1.booking_start_date, T1.booking_start_date FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 | spider |
CREATE TABLE table_42353 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Assists" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest rank when there are more than 2 games?
| SELECT MIN("Rank") FROM table_42353 WHERE "Games" > '2' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT Time, meter_100 FROM swimmer ORDER BY Time DESC | nvbench |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | SELECT dates.Date AS "date", COUNT(dates.Date) AS "score" FROM (SELECT DATEADD(MONTH, MONTH(CreationDate) - 1, DATEADD(YEAR, YEAR(CreationDate) - 1900, 0)) AS Date FROM Posts WHERE PostTypeId = 2 AND ParentId = @postId) AS dates GROUP BY dates.Date ORDER BY dates.Date | sede |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '杨玉泉' AND MED_SER_ORG_NO = '3427917' AND IN_DIAG_DIS_NM LIKE '%紧张%' | css |
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 demographic.days_stay, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "11221" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_65117 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue is listed as having a competition titled Friendly?
| SELECT "Venue" FROM table_65117 WHERE "Competition" = 'friendly' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO... | mimic_iii |
CREATE TABLE races (
raceid number,
year number,
round number,
circuitid number,
name text,
date text,
time text,
url text
)
CREATE TABLE constructors (
constructorid number,
constructorref text,
name text,
nationality text,
url text
)
CREATE TABLE drivers (
dri... | SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20 | spider |
CREATE TABLE table_name_45 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has Dave Barr as a player?
| SELECT country FROM table_name_45 WHERE player = "dave barr" | sql_create_context |
CREATE TABLE table_name_8 (
family_friendly VARCHAR,
decade VARCHAR,
genre VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the family friendly status of the punk genre song from the 1970s?
| SELECT family_friendly FROM table_name_8 WHERE decade = "1970s" AND genre = "punk" | sql_create_context |
CREATE TABLE table_204_898 (
id number,
"seed" text,
"school" text,
"conf (overall)" text,
"tiebreaker" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what school had the most wins overall ?
| SELECT "school" FROM table_204_898 ORDER BY "conf (overall)" DESC LIMIT 1 | squall |
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | 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 = 739 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d... | 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 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 prescriptions.formulary_drug_cd = "HEPA10SYR" | mimicsql_data |
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 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 = 19428)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... | mimic_iii |
CREATE TABLE table_33113 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the crowd size of the match where the h... | SELECT SUM("Crowd") FROM table_33113 WHERE "Home team score" = '7.7 (49)' AND "Away team" = 'geelong' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airport_servic... | 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare.round_trip_required = 'NO' AND flight_fare.far... | atis |
CREATE TABLE table_name_23 (
total INTEGER,
bronze VARCHAR,
rank VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a greater than 4 rank, and the silver medal greater than 0, and the bronze medal less than 1, what is the average tot... | SELECT AVG(total) FROM table_name_23 WHERE rank > 4 AND silver > 0 AND bronze < 1 | sql_create_context |
CREATE TABLE table_64951 (
"Rank" text,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Tom Silver's rank?
| SELECT "Rank" FROM table_64951 WHERE "Rider" = 'tom silver' | wikisql |
CREATE TABLE table_16134 (
"Sepal length" text,
"Sepal width" text,
"Petal length" text,
"Petal width" text,
"Species" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the species when petal width is 2.0 and petal length is 4.9
| SELECT "Species" FROM table_16134 WHERE "Petal width" = '2.0' AND "Petal length" = '4.9' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '4618778' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 1... | css |
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_ID = '04686817' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 9433.92) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '04686817' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k... | css |
CREATE TABLE table_name_49 (
outcome VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Outcome with a Date that is may 5, 2012?
| SELECT outcome FROM table_name_49 WHERE date = "may 5, 2012" | sql_create_context |
CREATE TABLE table_1558077_8 (
number_of_s_eva INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number of s eva
| SELECT MAX(number_of_s_eva) FROM table_1558077_8 | sql_create_context |
CREATE TABLE table_5155 (
"Player" text,
"Country" text,
"Major" text,
"Date" text,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Tom Weiskopf's Finish?
| SELECT "Finish" FROM table_5155 WHERE "Player" = 'tom weiskopf' | wikisql |
CREATE TABLE table_name_44 (
sales VARCHAR,
peak_position VARCHAR,
certification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many sales had a peak position more than 2 and a Certification of 3x platinum?
| SELECT COUNT(sales) FROM table_name_44 WHERE peak_position > 2 AND certification = "3x platinum" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "WBC, Joint Fluid" | mimicsql_data |
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 t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1035926' AND t_kc21.IN_HOSP_DATE BETWEEN '2018-04-14' AND '2018-10-22' AND t_kc21.INSU_TYPE = '儿童' | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136' AND patient.hospitaldischargetime IS NULL) | eicu |
CREATE TABLE table_6160 (
"Name" text,
"Status" text,
"Population" real,
"District" text,
"Former local authority" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the population of the area that was formerly under the authority of the Audens... | SELECT "Population" FROM table_6160 WHERE "Former local authority" = 'audenshaw urban district' | wikisql |
CREATE TABLE table_44652 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Opponents In The Final, is Ma... | SELECT "Date" FROM table_44652 WHERE "Opponents in the final" = 'maria-fernanda alves stéphanie dubois' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | 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 = "Athscl extrm ntv art NOS" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_92 (
ben_tahir VARCHAR,
doucet VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Ben-Tahir with a 3269 Doucet?
| SELECT ben_tahir FROM table_name_92 WHERE doucet = "3269" | 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 (
HXPLC number,
HZX... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.JZZDBM = 'M79.046' GROUP BY person_info.JGDM UNION SELECT... | css |
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_569 (
"Club" text,
"Played" text,
"Won" 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 followi... | SELECT "Won" FROM table_569 WHERE "Club" = 'Ammanford RFC' | wikisql |
CREATE TABLE table_40702 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game attended by 54,110?
| SELECT "Result" FROM table_40702 WHERE "Attendance" = '54,110' | wikisql |
CREATE TABLE table_75182 (
"Company" text,
"Type" text,
"Principal activities" text,
"Incorporated in" text,
"Group's Equity Shareholding (10 March 2010)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Group's equity share percentage for... | SELECT "Group's Equity Shareholding (10 March 2010)" FROM table_75182 WHERE "Company" = 'vn/cx catering services limited' | wikisql |
CREATE TABLE table_name_79 (
winning_constructor VARCHAR,
winning_driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the winner constructor with driver riccardo patrese?
| SELECT winning_constructor FROM table_name_79 WHERE winning_driver = "riccardo patrese" | sql_create_context |
CREATE TABLE table_15938543_1 (
written_by VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode that was directed by Dennie Gordon
| SELECT written_by FROM table_15938543_1 WHERE directed_by = "Dennie Gordon" | sql_create_context |
CREATE TABLE table_name_9 (
years VARCHAR,
decile VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years does Kakahi school, with a decile of 3, have?
| SELECT years FROM table_name_9 WHERE decile = 3 AND name = "kakahi school" | sql_create_context |
CREATE TABLE table_35607 (
"Team" text,
"Copa Libertadores 1996" text,
"Supercopa Sudamericana 1996" text,
"Copa CONMEBOL 1996" text,
"Recopa Sudamericana 1996" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the copa conmebol 1996 result of ... | SELECT "Copa CONMEBOL 1996" FROM table_35607 WHERE "Recopa Sudamericana 1996" = 'champions' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
... | SELECT Id AS "post_link", * FROM Posts WHERE PostTypeId IN (2, 3) AND (Body LIKE '% i % i %' OR (NOT Body LIKE '%.%' AND NOT Body LIKE '%?%' AND NOT Body LIKE '%!%') OR Body LIKE '% u %') ORDER BY Score DESC, LastActivityDate DESC LIMIT 100 | sede |
CREATE TABLE table_24693 (
"Location" text,
"July (\u00b0C)" text,
"July (\u00b0F)" text,
"January (\u00b0C)" text,
"January (\u00b0F)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the January ( F) temperatures in the Corner Brook locati... | SELECT "January (\u00b0F)" FROM table_24693 WHERE "Location" = 'Corner Brook' | wikisql |
CREATE TABLE table_9066 (
"Year (January)" real,
"Population ('000)" real,
"Rural, %" real,
"Urban, %" real,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the rural % where the source estimate was census and the urban % was larger... | SELECT SUM("Rural, %") FROM table_9066 WHERE "Source" = 'estimate' AND "Urban, %" > '57' | wikisql |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | SELECT city, MAX(lat) FROM station GROUP BY city ORDER BY MAX(lat) | nvbench |
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 labevents (
row... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77177 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.route = 'ou' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 countries (
COUNTRY_ID... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY) | nvbench |
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 person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 table_27054 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power kW" text,
"Station Type" text,
"Location (Transmitter site)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the power in kilowatts of TV-12?
| SELECT "Power kW" FROM table_27054 WHERE "Ch. #" = 'TV-12' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewRejectionReasons (
Id ... | SELECT COUNT(1) * 5 FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND p.OwnerUserId = '##UserId##' AND v.VoteTypeId = 2 | sede |
CREATE TABLE table_name_48 (
assists INTEGER,
goals INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the most assists when the goals is less than 0?
| SELECT MAX(assists) FROM table_name_48 WHERE goals < 0 | sql_create_context |
CREATE TABLE table_name_29 (
bronze INTEGER,
nation VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average bronze medals of Uganda's swimmers when they earned over 2 medals?
| SELECT AVG(bronze) FROM table_name_29 WHERE nation = "uganda" AND total > 2 | sql_create_context |
CREATE TABLE table_name_81 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the record 4 0 0?
| SELECT date FROM table_name_81 WHERE record = "4–0–0" | sql_create_context |
CREATE TABLE table_name_99 (
date VARCHAR,
opponent_in_the_final VARCHAR,
surface VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the opponent in the Toshiaki Sakai final play on a grass surface?
| SELECT date FROM table_name_99 WHERE opponent_in_the_final = "toshiaki sakai" AND surface = "grass" | sql_create_context |
CREATE TABLE table_65985 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the rowers who had a time of 7:39.70?
| SELECT "Rowers" FROM table_65985 WHERE "Time" = '7:39.70' | wikisql |
CREATE TABLE table_name_9 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is 1980 when 1979 is 951?
| SELECT 1980 FROM table_name_9 WHERE 1979 = "951" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STERNAL WOUND INFECTION" AND demographic.age < "82" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.