instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE order_items (
item_id number,
order_item_status_code text,
order_id number,
product_id number,
item_status_code text,
item_delivered_datetime time,
item_order_quantity text
)
CREATE TABLE customers (
customer_id number,
payment_method text,
customer_name text,
c... | SELECT outcome_code, COUNT(*) FROM mailshot_customers GROUP BY outcome_code | spider |
CREATE TABLE table_name_10 (
season VARCHAR,
games VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the season that had a lost of 9 with 72 games?
| SELECT season FROM table_name_10 WHERE games = "72" AND lost = "9" | sql_create_context |
CREATE TABLE Allergy_type (
allergytype VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all allergy types and the number of allergies in each type.
| SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-27704')) AND intakeoutput.celllabel = 'po or... | eicu |
CREATE TABLE table_name_34 (
track VARCHAR,
catalogue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the track that has the catalogue of apbo 0280
| SELECT track FROM table_name_34 WHERE catalogue = "apbo 0280" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labi... | SELECT COUNT(DISTINCT t1.subject_id) 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_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'amphetamin depend-... | mimic_iii |
CREATE TABLE table_53414 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who holds third place in the tournament with a score of 2 6, 7 6(3), [10 5]?
| SELECT "Third Place" FROM table_53414 WHERE "Score" = '2–6, 7–6(3), [10–5]' | wikisql |
CREATE TABLE table_225095_4 (
reason_for_change VARCHAR,
successor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many reasons for change were listed when Edward Hempstead was the successor?
| SELECT COUNT(reason_for_change) FROM table_225095_4 WHERE successor = "Edward Hempstead" | sql_create_context |
CREATE TABLE table_29107 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed series episode number 201?
| SELECT "Director" FROM table_29107 WHERE "Series #" = '201' | wikisql |
CREATE TABLE table_53975 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the Player from Brampton, ON what is their NBA Draft status?
| SELECT "NBA Draft" FROM table_53975 WHERE "Hometown" = 'brampton, on' | wikisql |
CREATE TABLE table_name_29 (
pos VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Driver Brendan Gaughan's Pos?
| SELECT pos FROM table_name_29 WHERE driver = "brendan gaughan" | sql_create_context |
CREATE TABLE table_name_66 (
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Kirk Triplett's Place?
| SELECT place FROM table_name_66 WHERE player = "kirk triplett" | sql_create_context |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,... | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements | nvbench |
CREATE TABLE table_name_13 (
simplified VARCHAR,
density VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for simplified when the density is 52?
| SELECT simplified FROM table_name_13 WHERE density = "52" | sql_create_context |
CREATE TABLE table_2508633_3 (
player VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player went to college at Tennessee?
| SELECT player FROM table_2508633_3 WHERE college = "Tennessee" | sql_create_context |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
C... | SELECT DISTINCT fare.fare_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 (((flight.airline_code = 'DL') AND flight.flight_number = 106) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' ... | atis |
CREATE TABLE table_name_9 (
lost INTEGER,
goals_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the lowest lost has 111 as the goals against?
| SELECT MIN(lost) FROM table_name_9 WHERE goals_against = 111 | sql_create_context |
CREATE TABLE table_21676617_1 (
horse VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many horses are mentioned competing in 1985?
| SELECT COUNT(horse) FROM table_21676617_1 WHERE year = 1985 | sql_create_context |
CREATE TABLE table_34565 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall FHT points" text,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Rank is th... | SELECT MAX("Rank") FROM table_34565 WHERE "Points" < '256.6' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Government" | mimicsql_data |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, AboutMe, ProfileImageUrl FROM Users WHERE LOWER(Location) LIKE '%iasi%' ORDER BY Reputation DESC LIMIT 50 | sede |
CREATE TABLE party (
party_name VARCHAR,
party_id VARCHAR
)
CREATE TABLE Member (
party_name VARCHAR,
party_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show names of parties that does not have any members.
| SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member) | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2154-10-11 16:00:00" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "64" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE table_73822 (
"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.
-- What is the popu... | SELECT "Population (2011)" FROM table_73822 WHERE "Cyrillic Name Other Names" = 'Стари Жедник (Croatian: Stari Žednik)' | wikisql |
CREATE TABLE table_204_160 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- from what country did the last place compete for ?
| SELECT "nationality" FROM table_204_160 ORDER BY "rank" DESC LIMIT 1 | squall |
CREATE TABLE table_name_30 (
abb VARCHAR,
disorder VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the abbreviation of the enzyme involved in carbamoyl phosphate synthetase i deficiency?
| SELECT abb FROM table_name_30 WHERE disorder = "carbamoyl phosphate synthetase i deficiency" | sql_create_context |
CREATE TABLE table_27439 (
"City" text,
"Population" real,
"Registered voters" text,
"Democratic" text,
"Republican" text,
"D\u2013R spread" text,
"Other" text,
"No party preference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is... | SELECT "Other" FROM table_27439 WHERE "City" = 'Los Gatos' | wikisql |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74159) AND NOT transfers.wardid IS NULL AND STRFTIME('%y', transfers.intime) >= '2105' ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_55932 (
"Club" text,
"Position in 2012" text,
"First season" text,
"Number of seasons" real,
"First season of current spell" real,
"Titles" real,
"Last title" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the posi... | SELECT "Position in 2012" FROM table_55932 WHERE "Last title" = 'n/a' AND "First season" = '2011' | wikisql |
CREATE TABLE table_54644 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid total for david coulthard?
| SELECT SUM("Grid") FROM table_54644 WHERE "Driver" = 'david coulthard' | wikisql |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
... | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY AVG(Age) | nvbench |
CREATE TABLE table_dev_4 (
"id" int,
"hypothyroidism" bool,
"serum_bicarbonate" int,
"c_peptide_level" float,
"autoimmune_disease" bool,
"hemoglobin_a1c_hba1c" float,
"positive_serum" bool,
"inhaled_steroids" bool,
"diabetic_ketoacidosis" bool,
"creatinine_clearance_cl" float,
... | SELECT * FROM table_dev_4 WHERE c_peptide_level < 1 | criteria2sql |
CREATE TABLE stadium (
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many stadiums does each country have?
| SELECT country, COUNT(*) FROM stadium GROUP BY country | sql_create_context |
CREATE TABLE table_36744 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the incumbent from the south carolina 1 district first elected?
| SELECT "First elected" FROM table_36744 WHERE "District" = 'south carolina 1' | wikisql |
CREATE TABLE table_name_51 (
avg_g VARCHAR,
gain VARCHAR,
long VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Avg/G has a Long of 51, and a Loss of 333, and a Gain larger than 2013?
| SELECT COUNT(avg_g) FROM table_name_51 WHERE long = 51 AND loss = 333 AND gain > 2013 | sql_create_context |
CREATE TABLE table_24494 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is every vacator if date of successors formal in... | SELECT "Vacator" FROM table_24494 WHERE "Date of successors formal installation" = 'August 8, 1960' | wikisql |
CREATE TABLE table_43158 (
"Week" real,
"Date" text,
"Time ( PT )" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game site has w 10-3 as the result?
| SELECT "Game site" FROM table_43158 WHERE "Result" = 'w 10-3' | wikisql |
CREATE TABLE table_name_11 (
player VARCHAR,
pba_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player with the PBA team of Barangay Ginebra Kings?
| SELECT player FROM table_name_11 WHERE pba_team = "barangay ginebra kings" | sql_create_context |
CREATE TABLE table_name_41 (
silver INTEGER,
rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of silver owned by a nation that is not ranked number 1?
| SELECT MIN(silver) FROM table_name_41 WHERE rank < 1 | sql_create_context |
CREATE TABLE table_name_54 (
birthdate VARCHAR,
birthplace VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the player from Melrose, Massachusetts born?
| SELECT birthdate FROM table_name_54 WHERE birthplace = "melrose, massachusetts" | 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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '8966457' AND t_kc24.t_kc21_MED_ORG_DEPT_CD = '065') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-02-03' AND '2015-09-08' | css |
CREATE TABLE table_49815 (
"Date From" text,
"Date To" text,
"Pos." text,
"Name" text,
"Moving To" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Moving To, when Name is 'Leon Andreasen'?
| SELECT "Moving To" FROM table_49815 WHERE "Name" = 'leon andreasen' | wikisql |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varcha... | SELECT DISTINCT flight.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, equipment_sequence, flight WHERE (((aircraft.basic_type = '747' AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 ... | atis |
CREATE TABLE table_name_31 (
game VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game number includes a record of 1-2?
| SELECT game FROM table_name_31 WHERE record = "1-2" | sql_create_context |
CREATE TABLE table_24132054_1 (
directed_by VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed episode 28 in the series?
| SELECT directed_by FROM table_24132054_1 WHERE no_in_series = 28 | sql_create_context |
CREATE TABLE table_63388 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Episodes" real,
"Average Ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Romanji Title of a show on TBS with less than 11 episodes?
| SELECT "Romaji Title" FROM table_63388 WHERE "TV Station" = 'tbs' AND "Episodes" < '11' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT procedures.icd9_code FROM procedures WHERE procedures.subject_id = "14755" | mimicsql_data |
CREATE TABLE table_name_13 (
director VARCHAR,
producer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the director who directed the movie that Raintree Pictures produced?
| SELECT director FROM table_name_13 WHERE producer = "raintree pictures" | sql_create_context |
CREATE TABLE table_4181 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the championship venues where the score was 6 7 (4 ... | SELECT "Championship" FROM table_4181 WHERE "Score" = '6–7 (4–7) , 3–6' | wikisql |
CREATE TABLE table_23120 (
"Fleet #" text,
"Year" real,
"Manufacture" text,
"Model" text,
"Length (ft)" real,
"Engine" text,
"Transmission" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year had a transmission of Voith D863.4 and a Cu... | SELECT "Year" FROM table_23120 WHERE "Transmission" = 'Voith D863.4' AND "Engine" = 'Cummins ISM' | wikisql |
CREATE TABLE table_name_12 (
res VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the match against Ryan Schultz?
| SELECT res FROM table_name_12 WHERE opponent = "ryan schultz" | 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 WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.diagnosis = "LIVER TRANSPLANT" | mimicsql_data |
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.days_stay > "2" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE Products (
Product_ID VARCHAR(100),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Product_Description VARCHAR(255),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Invoices (
Invoice_ID INTEGER,
Order_ID INTEGER,
payment_method_code CHAR(15),
Product... | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY Store_Name | nvbench |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
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... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'AEROSP' AND COURSE_1.number ... | advising |
CREATE TABLE table_14364 (
"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 "Points" FROM table_14364 WHERE "Points for" = '255' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT IN_HOSP_DAYS FROM t_kc21 WHERE MED_CLINIC_ID = '26786067488' | css |
CREATE TABLE table_17327264_3 (
date_of_appointment VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date of appointment for petrik sander
| SELECT date_of_appointment FROM table_17327264_3 WHERE replaced_by = "Petrik Sander" | 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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0012194' AND t_kc21.OUT_DIAG_DIS_CD = 'I51.076') | css |
CREATE TABLE table_24644 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT COUNT("Winnings") FROM table_24644 WHERE "Avg. Finish" = '17.4' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE table_44786 (
"Name of Deity" text,
"Bhuta(Tatwa)" text,
"Name of the Stone (Sila)" text,
"Name of the River" text,
"Name of the State where found in India" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the stone fo... | SELECT "Name of the Stone (Sila)" FROM table_44786 WHERE "Name of the State where found in India" = 'andhra pradesh' | 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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "50818" | mimicsql_data |
CREATE TABLE table_23598 (
"Draw" real,
"Artist" text,
"Song" text,
"Regions" real,
"Studio Audience" real,
"Press Jury" real,
"Oil Rig" real,
"Total Points" real,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the oil... | SELECT MIN("Oil Rig") FROM table_23598 WHERE "Draw" = '9' | wikisql |
CREATE TABLE table_name_69 (
location VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the race on 28 dec 2010 held?
| SELECT location FROM table_name_69 WHERE date = "28 dec 2010" | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2150" AND lab."CATEGORY" = "Chemistry" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT demographic.name, demographic.dob FROM demographic WHERE demographic.subject_id = "2110" | mimicsql_data |
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 medication (
medi... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158689')) AND NOT vitalperiodic.heartrate IS NU... | eicu |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '74583279' AND t_kc21.MED_SER_ORG_NO = '4072141') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '013-3028' AND STRFTIME('%y', patient.hospitaldischargetime) = '2104' ORDER BY patient.hospitaldischargetime DESC LIMIT 1 | eicu |
CREATE TABLE table_47883 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Beverly Perdue" text,
"Republican: Pat McCrory" text,
"Libertarian: Michael Munger" text,
"Lead Margin" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "Democrat: Beverly Perdue" FROM table_47883 WHERE "Republican: Pat McCrory" = '37%' AND "Libertarian: Michael Munger" = '6%' | wikisql |
CREATE TABLE degrees (
year number,
campus number,
degrees number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE csu_fees (
campus number,
... | SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND fte_ay > 200 | spider |
CREATE TABLE table_33323 (
"Country" text,
"Area (km\u00b2) 2010" text,
"Population 2011" text,
"GDP (PPP) ( Intl. $ ) 2011" text,
"GDP (PPP) per capita ( Intl. $ ) 2011" text,
"Income inequality 1994\u20132011 (latest available)" text,
"HDI 2011" text,
"FSI 2012" text,
"CPI 2011" te... | SELECT "Income inequality 1994\u20132011 (latest available)" FROM table_33323 WHERE "Population 2011" = '21,315,135' | wikisql |
CREATE TABLE table_name_31 (
runner_up VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Runner-up when the game was played at Bells Beach?
| SELECT runner_up FROM table_name_31 WHERE location = "bells beach" | sql_create_context |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2125" AND lab.itemid = "50970" | mimicsql_data |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CR... | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week DESC | nvbench |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE transfers (
r... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 84476) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-61 month') ORDER BY labevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_26 (
role VARCHAR,
language VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What role is spoken in hindi in 2011?
| SELECT role FROM table_name_26 WHERE language = "hindi" AND year = 2011 | sql_create_context |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '腔隙性脑梗死' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '腔隙性脑梗死' | css |
CREATE TABLE table_12201 (
"Preferences" text,
"1. vs 2." real,
"1. vs 3." real,
"2. vs 3." real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2 vs 3 when total is bigger than 38?
| SELECT AVG("2. vs 3.") FROM table_12201 WHERE "Total" > '38' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dob_year < "2098" | mimicsql_data |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl... | css |
CREATE TABLE table_name_87 (
husband VARCHAR,
image VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the husband of the image of renata of lorraine?
| SELECT husband FROM table_name_87 WHERE image = "renata of lorraine" | sql_create_context |
CREATE TABLE table_13399573_4 (
points_against VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the 2008/2009 season one team had a season total points of 31, for that team how many total points were scored against them?
| SELECT points_against FROM table_13399573_4 WHERE points = "31" | sql_create_context |
CREATE TABLE table_14997 (
"Wrestler" text,
"Reigns" text,
"Days held" real,
"Location" text,
"Successful defenses" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event has Philadelphia, PA as the location and 41 days held?
| SELECT "Event" FROM table_14997 WHERE "Location" = 'philadelphia, pa' AND "Days held" = '41' | wikisql |
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.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Gus Marques" | 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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.admityear < "2145" | mimicsql_data |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT * 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 = '王涵菡' AND hz_info.YLJGDM = '0517581' AND NOT zyjzjlb.JZKSMC LIKE '%美容%' | css |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
-- Using valid SQLite, answer the follo... | SELECT DISTINCT range FROM mountain ORDER BY prominence DESC LIMIT 3 | spider |
CREATE TABLE table_29102100_1 (
prod_code INTEGER,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the production code of the episode directed by Rondell Sheridan?
| SELECT MAX(prod_code) FROM table_29102100_1 WHERE directed_by = "Rondell Sheridan" | 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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, SALARY 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_5345 (
"Year" text,
"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.
-- Who was the men's single in 1940?
| SELECT "Men's singles" FROM table_5345 WHERE "Year" = '1940' | wikisql |
CREATE TABLE table_1481865_1 (
number_of_episode VARCHAR,
title__english_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the episode number where the English title is Pilot?
| SELECT number_of_episode FROM table_1481865_1 WHERE title__english_ = "Pilot" | sql_create_context |
CREATE TABLE table_69659 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest attendance of a game that had a score of 3-5?
| SELECT MAX("Attendance") FROM table_69659 WHERE "Score" = '3-5' | wikisql |
CREATE TABLE table_name_4 (
role VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Pick #18's Role?
| SELECT role FROM table_name_4 WHERE pick__number = 18 | sql_create_context |
CREATE TABLE table_30584 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date (U.S.)" text,
"Original air date (International)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the episode w... | SELECT "Original air date (U.S.)" FROM table_30584 WHERE "Directed by" = 'Curt Geda' AND "Written by" = 'Mitch Watson' | wikisql |
CREATE TABLE table_39923 (
"School" text,
"Nickname" text,
"Colors" text,
"League" text,
"Class" text,
"Division" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the class of the Middletown High School team that is in the DSHA league?
| SELECT "Class" FROM table_39923 WHERE "League" = 'dsha' AND "School" = 'middletown high school' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.