instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158759')) AND medication.routeadmin = 'intravenous' AND DATETIM... | eicu |
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_stock int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier | nvbench |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '方刚洁' AND MED_SER_ORG_NO = '0788925' AND NOT OUT_DIAG_DIS_NM LIKE '%牙隐裂%' | css |
CREATE TABLE table_name_44 (
balls VARCHAR,
runs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the total number of 100s that has the Balls larger than 325, and the Runs smaller than 572?
| SELECT COUNT(100 AS s) FROM table_name_44 WHERE balls > 325 AND runs < 572 | sql_create_context |
CREATE TABLE table_10748727_1 (
season VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year had a score of 9?
| SELECT season FROM table_10748727_1 WHERE points = "9" | sql_create_context |
CREATE TABLE table_11803648_22 (
player VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players had overall 78?
| SELECT COUNT(player) FROM table_11803648_22 WHERE overall = "78" | sql_create_context |
CREATE TABLE table_77094 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended in the game against morton?
| SELECT "Attendance" FROM table_77094 WHERE "Opponent" = 'morton' | wikisql |
CREATE TABLE table_name_59 (
proxy VARCHAR,
license VARCHAR,
image_quality VARCHAR,
encryption VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the proxy when the image quality is , the encryption is ssl and the license is proprietary?
| SELECT proxy FROM table_name_59 WHERE image_quality = "✓" AND encryption = "ssl" AND license = "proprietary" | sql_create_context |
CREATE TABLE table_name_49 (
attendance INTEGER,
game VARCHAR,
location VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Location of ebbets field, and a Time of 2:56, and a Game larger than 6 has what sum of attendance?
| SELECT SUM(attendance) FROM table_name_49 WHERE location = "ebbets field" AND time = "2:56" AND game > 6 | sql_create_context |
CREATE TABLE table_26986076_2 (
sat_29_aug VARCHAR,
fri_27_aug VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many time is fri 27 aug 19' 38.87 115.219mph?
| SELECT COUNT(sat_29_aug) FROM table_26986076_2 WHERE fri_27_aug = "19' 38.87 115.219mph" | sql_create_context |
CREATE TABLE table_59387 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" text,
"Purse (\u00a5)" real,
"Winner's share (\u00a5)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is the purse worth ( ) after 2012?
| SELECT SUM("Purse (\u00a5)") FROM table_59387 WHERE "Year" > '2012' | wikisql |
CREATE TABLE table_66221 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the position in round 3?
| SELECT "Position" FROM table_66221 WHERE "Round" = '3' | wikisql |
CREATE TABLE table_name_53 (
service_name VARCHAR,
owner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Service name of BBC?
| SELECT service_name FROM table_name_53 WHERE owner = "bbc" | sql_create_context |
CREATE TABLE table_27607 (
"Team" text,
"Played" real,
"Won" real,
"Lost" real,
"No-Result" real,
"Abandoned" real,
"Bonus Points" real,
"Total Points" real,
"Net Run Rate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many diff... | SELECT COUNT("Net Run Rate") FROM table_27607 WHERE "Total Points" = '19' | wikisql |
CREATE TABLE table_73168 (
"Season" real,
"Class" text,
"Team" text,
"Motorcycle" text,
"Type" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"Fastest Laps" real,
"Pts" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the... | SELECT "Team" FROM table_73168 WHERE "Motorcycle" = 'Honda' | wikisql |
CREATE TABLE table_203_295 (
id number,
"position" number,
"driver / passenger" text,
"equipment" text,
"points" number,
"wins" number,
"second" number,
"third" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many more points did ja... | SELECT (SELECT "points" FROM table_203_295 WHERE "driver / passenger" = 'jan hendrickx') - (SELECT "points" FROM table_203_295 WHERE "driver / passenger" = 'marco happich') | squall |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antihypertensive drug - labetalol' AND STRFTIME('%y'... | eicu |
CREATE TABLE table_26634 (
"Name" text,
"Deceased Spouse" text,
"Cause of Death" text,
"Date of Spouses Death" text,
"Length of Marriage" text,
"Children Together" text,
"Current Marital Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "Children Together" FROM table_26634 WHERE "Name" = 'Benjamin Harrison' | wikisql |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
CREATE TABLE table_28229 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Team classification" text,
"Combativity award" text
)
-- Using valid SQLite, answer the following qu... | SELECT "Young rider classification" FROM table_28229 WHERE "Combativity award" = 'Yannick Talabardon' | wikisql |
CREATE TABLE complaints (
complaint_id number,
product_id number,
customer_id number,
complaint_outcome_code text,
complaint_status_code text,
complaint_type_code text,
date_complaint_raised time,
date_complaint_closed time,
staff_id number
)
CREATE TABLE customers (
customer_id... | SELECT email_address, phone_number FROM customers ORDER BY email_address, phone_number | spider |
CREATE TABLE table_700 (
"District" text,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text,
"Opponent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party was Lane Evans?
| SELECT "Party" FROM table_700 WHERE "Incumbent" = 'Lane Evans' | 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.language FROM demographic WHERE demographic.subject_id = "6983" | mimicsql_data |
CREATE TABLE table_3015 (
"Institution" text,
"Nickname" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Sport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the school that is cougars
| SELECT "Institution" FROM table_3015 WHERE "Nickname" = 'Cougars' | wikisql |
CREATE TABLE table_3318 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode number in the ... | SELECT "No. in season" FROM table_3318 WHERE "Title" = 'Parent Trap' | wikisql |
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 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.admission_type = "URGENT" | mimicsql_data |
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 patient (
... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'abscess drainage procedure') | eicu |
CREATE TABLE table_66208 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent has a record of 4-2?
| SELECT "Opponent" FROM table_66208 WHERE "Record" = '4-2' | wikisql |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT * FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb... | css |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_75 (
money___ INTEGER,
place VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest money ($) that has t8 as the place, with a to par greater than 19?
| SELECT MIN(money___) AS $__ FROM table_name_75 WHERE place = "t8" AND to_par > 19 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47295) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2104-09' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_204_757 (
id number,
"state" text,
"interview" number,
"swimsuit" number,
"evening gown" number,
"average" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which state placed first in the 1989 miss teen usa competition ?
| SELECT "state" FROM table_204_757 ORDER BY id LIMIT 1 | squall |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0953235' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-03-17' AND '2019-09-21' | css |
CREATE TABLE table_14325 (
"Name" text,
"Type" text,
"Inaug." real,
"No Blocks" real,
"No Units" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average No Units, when the Name is Fung Shing Court, and when the No Blocks is fewer than 3?
| SELECT AVG("No Units") FROM table_14325 WHERE "Name" = 'fung shing court' AND "No Blocks" < '3' | wikisql |
CREATE TABLE Suppliers (
supplier_id INTEGER,
supplier_name VARCHAR(80),
supplier_phone VARCHAR(80)
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Addresses (
address_id INTEGER,
address_deta... | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY payment_method_code | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'cholangitis' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102' GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_40072 (
"Ring name" text,
"Current rank" text,
"Debut" text,
"Stable" text,
"Birthplace" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Ring Name, when Current Rank is E0 Maegashira 9 West?
| SELECT "Ring name" FROM table_40072 WHERE "Current rank" = 'e0 maegashira 9 west' | wikisql |
CREATE TABLE table_name_29 (
power_output VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the power output for model of s-13
| SELECT power_output FROM table_name_29 WHERE model = "s-13" | sql_create_context |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varch... | 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 (((flight.departure_time <= 0 AND flight.departure_time >= 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND flight.t... | atis |
CREATE TABLE table_name_22 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 2011 Wimbledon result?
| SELECT 2011 FROM table_name_22 WHERE tournament = "wimbledon" | sql_create_context |
CREATE TABLE table_12377 (
"Team" text,
"Wins" text,
"Losses" text,
"Points" text,
"WPct." text,
"G.F." text,
"G.A." text,
"Assists" text,
"Penalties" text,
"P.I.M." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the P.I.M... | SELECT "P.I.M." FROM table_12377 WHERE "G.F." = '55' | wikisql |
CREATE TABLE table_name_66 (
number INTEGER,
opponent VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number has the opponent Fokker d.vii with a time of 600?
| SELECT SUM(number) FROM table_name_66 WHERE opponent = "fokker d.vii" AND time = 600 | sql_create_context |
CREATE TABLE table_name_71 (
place VARCHAR,
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place that has a To standard of 1, and a Score of 71-68-76=215?
| SELECT place FROM table_name_71 WHERE to_par = "–1" AND score = 71 - 68 - 76 = 215 | sql_create_context |
CREATE TABLE table_203_610 (
id number,
"institution" text,
"location" text,
"nickname" text,
"founded" number,
"historical affiliation" text,
"enrollment" number,
"primary conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what ... | SELECT SUM("enrollment") FROM table_203_610 WHERE "institution" IN ('brown university', 'union college') | squall |
CREATE TABLE table_72172 (
"Round" real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the report of the Belgi... | SELECT "Report" FROM table_72172 WHERE "Grand Prix" = 'Belgian Grand Prix' | wikisql |
CREATE TABLE table_46858 (
"Sport" text,
"League" text,
"Club" text,
"Founded" real,
"Venue" text,
"League championships" real,
"Championship years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue has a League of ncaa, and a Found... | SELECT "Venue" FROM table_46858 WHERE "League" = 'ncaa' AND "Founded" < '1965' AND "Club" = 'penn state nittany lions men''s ice hockey' | wikisql |
CREATE TABLE table_name_54 (
score VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game where the venue was cairns convention centre?
| SELECT score FROM table_name_54 WHERE venue = "cairns convention centre" | sql_create_context |
CREATE TABLE table_204_511 (
id number,
"number" number,
"driver" text,
"entrant" text,
"chassis" text,
"engine" text,
"tyre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the only engine used one time ?
| SELECT "engine" FROM table_204_511 GROUP BY "engine" HAVING COUNT(*) = 1 | squall |
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type... | SELECT Home_city, AVG(Age) FROM driver GROUP BY Home_city | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '68054249569' | css |
CREATE TABLE table_52924 (
"Class" text,
"Wheels" text,
"Date" text,
"No. built" real,
"Loco Nos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the number of locomotives 421-6?
| SELECT "Date" FROM table_52924 WHERE "Loco Nos." = '421-6' | wikisql |
CREATE TABLE table_67175 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament happened on 12 november 2006?
| SELECT "Tournament" FROM table_67175 WHERE "Date" = '12 november 2006' | wikisql |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY activity_name DESC | nvbench |
CREATE TABLE table_name_58 (
record VARCHAR,
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team's record on may 12 when they play the giants?
| SELECT record FROM table_name_58 WHERE opponent = "giants" AND date = "may 12" | sql_create_context |
CREATE TABLE table_name_8 (
width_feet__m_ VARCHAR,
source__year_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the width for hte truss with a source of zacher (1994)?
| SELECT width_feet__m_ FROM table_name_8 WHERE source__year_ = "zacher (1994)" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Colin Gunckel%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id =... | advising |
CREATE TABLE table_48949 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country that has Richard Buck Lane higher than 3?
| SELECT "Country" FROM table_48949 WHERE "Lane" > '3' AND "Name" = 'richard buck' | wikisql |
CREATE TABLE table_name_88 (
l1_cache VARCHAR,
model_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the L1 Cache, when the Model Number is X5-133 ADY?
| SELECT l1_cache FROM table_name_88 WHERE model_number = "x5-133 ady" | sql_create_context |
CREATE TABLE table_73310 (
"Regional County Municipality (RCM)" text,
"Population Canada 2011 Census" real,
"Land Area" text,
"Density (pop. per km2)" text,
"Seat of RCM" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the land area for the R... | SELECT "Land Area" FROM table_73310 WHERE "Population Canada 2011 Census" = '18847' | wikisql |
CREATE TABLE table_34481 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Score of 3 4?
| SELECT MIN("Game") FROM table_34481 WHERE "Score" = '3–4' | wikisql |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE table_28541 (
"Candidate" text,
"Background" text,
"Original team" text,
"Age" real,
"Hometown" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was the background university student?
| SELECT COUNT("Result") FROM table_28541 WHERE "Background" = 'University Student' | wikisql |
CREATE TABLE table_27501971_2 (
año INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest a o?
| SELECT MIN(año) FROM table_27501971_2 | sql_create_context |
CREATE TABLE table_77137 (
"PMSC No." text,
"Year" real,
"1st Prize" text,
"2nd Prize" text,
"3rd Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year in which the 1st price went to Che-Yen (Brian) Chen?
| SELECT MIN("Year") FROM table_77137 WHERE "1st Prize" = 'che-yen (brian) chen' | wikisql |
CREATE TABLE table_36108 (
"Year" real,
"Player" text,
"Country" text,
"Score" text,
"Margin of victory" text,
"Winner's share ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Year larger than 1980, and a Margin of victory... | SELECT "Score" FROM table_36108 WHERE "Year" > '1980' AND "Margin of victory" = '2 strokes' AND "Country" = 'united states' AND "Player" = 'jim furyk' | wikisql |
CREATE TABLE table_name_57 (
date VARCHAR,
label VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the RCA release with Catalog number SF-7635?
| SELECT date FROM table_name_57 WHERE label = "rca" AND catalog = "sf-7635" | sql_create_context |
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 prescription... | 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.drug_type = "BASE" AND lab.label = "Potassium" | mimicsql_data |
CREATE TABLE table_4383 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the w 20-19 happen?
| SELECT "Date" FROM table_4383 WHERE "Result" = 'w 20-19' | wikisql |
CREATE TABLE table_9611 (
"Missouri vs." text,
"Overall Record" text,
"at Columbia" text,
"at Opponent's Venue" text,
"at Neutral Site" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text,
"During Time in Big 12" text
)
-- Using valid SQLite, answer the fol... | SELECT "at Opponent's Venue" FROM table_9611 WHERE "Current Streak" = 'w 4' | wikisql |
CREATE TABLE table_23606500_4 (
_percentage_40_59 VARCHAR,
_percentage_60_74 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for % 40-59 if % 60-74 is 12,40%?
| SELECT _percentage_40_59 FROM table_23606500_4 WHERE _percentage_60_74 = "12,40%" | sql_create_context |
CREATE TABLE table_204_582 (
id number,
"model" text,
"launch" text,
"code name" text,
"fab (nm)" number,
"bus interface" text,
"memory (mib)" text,
"core clock (mhz)" number,
"memory clock (mhz)" number,
"config core1" text,
"fillrate\nmoperations/s" number,
"fillrate\nm... | SELECT COUNT(*) FROM table_204_582 WHERE "fab (nm)" = 500 | squall |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,... | SELECT Posts.OwnerUserId AS "user_link", CAST(TIME_TO_STR(Votes.CreationDate, '%Y.%m.%d') AS TEXT(7)) AS LeMonth, COUNT(*) AS Downvotes FROM Votes INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE Votes.VoteTypeId = 3 AND Posts.OwnerUserId = '##userid##' GROUP BY Posts.OwnerUserId, CAST(TIME_TO_STR(Votes.CreationDate, ... | sede |
CREATE TABLE table_74773 (
"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 day does the team play at punt road oval?
| SELECT "Date" FROM table_74773 WHERE "Venue" = 'punt road oval' | wikisql |
CREATE TABLE table_name_89 (
total INTEGER,
bronze VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the smallest total with a bronze count of 5 and a gold count less than 8?
| SELECT MIN(total) FROM table_name_89 WHERE bronze = 5 AND gold < 8 | sql_create_context |
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 wdmzjzjlb.JZKSBM, wdmzjzjlb.JZKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '77683905641' UNION SELECT bdmzjzjlb.JZKSBM, bdmzjzjlb.JZKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '77683905641' | css |
CREATE TABLE table_39185 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Score of 3 6?
| SELECT SUM("Game") FROM table_39185 WHERE "Score" = '3–6' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "PNEUMONIA" | mimicsql_data |
CREATE TABLE table_name_1 (
studio_host VARCHAR,
year VARCHAR,
play_by_play VARCHAR,
flagship_station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Play-by-play of sean grande, and a Flagship Station of wrko, and a Year of 2005-06 had what studio ho... | SELECT studio_host FROM table_name_1 WHERE play_by_play = "sean grande" AND flagship_station = "wrko" AND year = "2005-06" | sql_create_context |
CREATE TABLE table_4825 (
"Award" text,
"Year" real,
"Category" text,
"Nominated Work" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the bodil award winning film from before 2005 in the best actress category?
| SELECT "Result" FROM table_4825 WHERE "Award" = 'bodil award' AND "Category" = 'best actress' AND "Year" = '2005' | wikisql |
CREATE TABLE table_name_69 (
recipient VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the recipientof the year for 1976
| SELECT recipient FROM table_name_69 WHERE year = 1976 | sql_create_context |
CREATE TABLE table_54981 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least number of Silvers with a ranking of less than 4 where the bronze number wa... | SELECT MIN("Silver") FROM table_54981 WHERE "Rank" < '4' AND "Bronze" > '9' | wikisql |
CREATE TABLE table_name_90 (
to_par VARCHAR,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many strokes off par was the winner in 1978?
| SELECT to_par FROM table_name_90 WHERE year_s__won = "1978" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '华萍雅' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-05-05' AND '2021-10-18' | css |
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 allergy (
allergy... | SELECT COUNT(*) FROM medication WHERE medication.drugname = '1 ml : hydromorphone hcl pf 1 mg/ml ij soln' | eicu |
CREATE TABLE table_77377 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the time was 14:00?
| SELECT "Score" FROM table_77377 WHERE "Time" = '14:00' | wikisql |
CREATE TABLE table_name_61 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team when Hawthorn was the away team?
| SELECT home_team FROM table_name_61 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE Ref_locations (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the number of locations.
| SELECT COUNT(*) FROM Ref_locations | sql_create_context |
CREATE TABLE table_25691838_6 (
the_wørd VARCHAR,
episode__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of 'The Word' segments for episode number 727?
| SELECT COUNT(the_wørd) FROM table_25691838_6 WHERE episode__number = 727 | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70950) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '11' | mimic_iii |
CREATE TABLE table_204_230 (
id number,
"team #1" text,
"agg." text,
"team #2" text,
"1st match" text,
"2nd match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was the 1st match score combined between empor rostock and conflans at least 40 ?
| SELECT (SELECT "1st match" + "1st match" FROM table_204_230 WHERE "team #1" = 'empor rostock') >= 40 | squall |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '54888449' AND t_kc22.STA_DATE BETWEEN '2016-04-25' AND '2020-10-09' AND t_kc21.MED_SER_ORG_NO = '7077401' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_name_42 (
result VARCHAR,
theme VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Result when the Theme was by Dolly Parton?
| SELECT result FROM table_name_42 WHERE theme = "dolly parton" | sql_create_context |
CREATE TABLE table_22904780_1 (
original_air_date VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the 1st air date for the show where the writers are russel friend & garrett lerner.
| SELECT original_air_date FROM table_22904780_1 WHERE written_by = "Russel Friend & Garrett Lerner" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-188709' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'crea... | eicu |
CREATE TABLE table_56220 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the crowd size when the away team was So... | SELECT SUM("Crowd") FROM table_56220 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_57813 (
"Year" real,
"Theme" text,
"Artist" text,
"Composition" text,
"Mintage" real,
"Issue Price" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which artist has a Mintage of 500?
| SELECT "Artist" FROM table_57813 WHERE "Mintage" = '500' | wikisql |
CREATE TABLE table_3616 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the district for first elected 1810
| SELECT "District" FROM table_3616 WHERE "First elected" = '1810' | 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND diagnoses.short_title = "Neuropathy in diabetes" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.