instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '55748768' AND hz_info.YLJGDM = '3373155' AND mzjzjlb.JZKSMC LIKE '%推拿%' | css |
CREATE TABLE table_45361 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Event, when Method is 'Submission (Armbar)', and when Oppone... | SELECT "Event" FROM table_45361 WHERE "Method" = 'submission (armbar)' AND "Opponent" = 'jason st. louis' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required t... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOE... | atis |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE proce... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21454) AND STRFTIME('%y', labevents.charttime) >= '2102' | mimic_iii |
CREATE TABLE table_name_25 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT COUNTRY HAS A PLAYER NAMED JACK NICKLAUS?
| SELECT country FROM table_name_25 WHERE player = "jack nicklaus" | sql_create_context |
CREATE TABLE table_name_73 (
nationality VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the Team Purdue?
| SELECT nationality FROM table_name_73 WHERE school_club_team = "purdue" | 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 procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
... | SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'TW' AND flight_number = 539 | atis |
CREATE TABLE table_204_10 (
id number,
"ecclesiastical jurisdictions" text,
"latin name" text,
"type" text,
"rite" text,
"ecclesiastical province" text,
"established" text,
"area (km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ho... | SELECT COUNT("ecclesiastical jurisdictions") FROM table_204_10 WHERE "established" < 1978 | squall |
CREATE TABLE table_9284 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had... | SELECT "High rebounds" FROM table_9284 WHERE "Date" = 'december 30' | wikisql |
CREATE TABLE table_27535 (
"Round" text,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the circuit for 13 july
| SELECT "Circuit" FROM table_27535 WHERE "Date" = '13 July' | wikisql |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return a bar chart on what ... | SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age) DESC | nvbench |
CREATE TABLE table_204_697 (
id number,
"song" text,
"artist(s)" text,
"concert" number,
"film" number,
"1978 album" number,
"2002 album" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which song is previous to georgia on my mind
| SELECT "song" FROM table_204_697 WHERE id = (SELECT id FROM table_204_697 WHERE "song" = '"georgia on my mind"') - 1 | squall |
CREATE TABLE table_204_888 (
id number,
"location" text,
"mile" number,
"destinations" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what note is before former md 453 ?
| SELECT "notes" FROM table_204_888 WHERE id = (SELECT id FROM table_204_888 WHERE "notes" = 'former md 453') - 1 | squall |
CREATE TABLE products (
product_id number,
product_name text,
product_price number,
product_description text
)
CREATE TABLE order_deliveries (
location_code text,
actual_order_id number,
delivery_status_code text,
driver_employee_id number,
truck_id number,
delivery_date time
)
... | SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county | spider |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_45660 (
"Country" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Country which has Stolen Ends larger than 7, a... | SELECT "Country" FROM table_45660 WHERE "Stolen Ends" > '7' AND "Skip" = 'david murdoch' | wikisql |
CREATE TABLE table_name_73 (
population_in_millions VARCHAR,
gdp_2012_millions_of_euro VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Population in Millions, when GDP 2012 Millions of Euro is 600,638?
| SELECT population_in_millions FROM table_name_73 WHERE gdp_2012_millions_of_euro = "600,638" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_27320 (
"Region" text,
"Prison inmates Men" real,
"Prison inmates Women" real,
"Prison inmates Total" real,
"Incarceration rate Male" real,
"Incarceration rate Female" real,
"Incarceration rate Total" real,
"Country comparison" text
)
-- Using valid SQLite, answer th... | SELECT COUNT("Incarceration rate Total") FROM table_27320 WHERE "Prison inmates Women" = '153' | wikisql |
CREATE TABLE table_14518 (
"State" text,
"Abbr." text,
"Capital" text,
"Largest city" text,
"Statehood" text,
"Population est. (2012)" real,
"House seat(s)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2012 population for the s... | SELECT "Population est. (2012)" FROM table_14518 WHERE "Capital" = 'santa fe' | wikisql |
CREATE TABLE table_name_53 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent of the team with a 1-1-0 record?
| SELECT opponent FROM table_name_53 WHERE record = "1-1-0" | sql_create_context |
CREATE TABLE dependent (
sex VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many female dependents are there?
| SELECT COUNT(*) FROM dependent WHERE sex = 'F' | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230')) AND medication.drugname = 'dulcolax' AND DATETIME(medication.d... | eicu |
CREATE TABLE table_20522228_2 (
episode VARCHAR,
share VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the episode name when share was 8?
| SELECT episode FROM table_20522228_2 WHERE share = 8 | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) | nvbench |
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.days_stay > "11" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
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_INV_ITEM_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '68219842668' AND SOC_SRT_DIRE_NM = '蒙脱石散' | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3267) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid I... | mimic_iii |
CREATE TABLE table_204_301 (
id number,
"nationality" text,
"name" text,
"term as a deputy judge" text,
"reason for termination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which country had the most deputy judges ?
| SELECT "nationality" FROM table_204_301 GROUP BY "nationality" ORDER BY COUNT("name") DESC LIMIT 1 | squall |
CREATE TABLE table_48128 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the match against carlisle united?
| SELECT "Date" FROM table_48128 WHERE "Away team" = 'carlisle united' | wikisql |
CREATE TABLE table_203_224 (
id number,
"title" text,
"year" number,
"channel" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the title of the last television appearance she had in 2010 ?
| SELECT "title" FROM table_203_224 WHERE "year" = 2010 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_70784 (
"Lithium" text,
"Sodium" text,
"Potassium" text,
"Rubidium" text,
"Caesium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the properties of sodium when rubidium is nacl (2.1)?
| SELECT "Sodium" FROM table_70784 WHERE "Rubidium" = 'nacl (2.1)' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Lidocaine Viscous 2%" | mimicsql_data |
CREATE TABLE table_name_58 (
year INTEGER,
team VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year is the highest that has a Team of walker racing, and Wins larger than 1?
| SELECT MAX(year) FROM table_name_58 WHERE team = "walker racing" AND wins > 1 | sql_create_context |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name ... | 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, food_service WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_se... | atis |
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.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.long_title = "Unspecified erythematous condition" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.dob_year < "2167" | mimicsql_data |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '55566777' AND jyjgzbb.JYRQ BETWEEN '2003-03-23' AND '2015-1... | css |
CREATE TABLE table_name_49 (
agg VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the aggregate total for the match against Koper?
| SELECT agg FROM table_name_49 WHERE opponent = "koper" | sql_create_context |
CREATE TABLE table_name_49 (
population__2011_ VARCHAR,
population__2006_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of people in 2011 speaking the mother tongue language spoken by 120 in 2006?
| SELECT COUNT(population__2011_) FROM table_name_49 WHERE population__2006_ = 120 | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsO... | SELECT * FROM Posts LIMIT 10000 | sede |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428 AND admissio... | mimic_iii |
CREATE TABLE courses (
course_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of courses in alphabetical order?
| SELECT course_name FROM courses ORDER BY course_name | sql_create_context |
CREATE TABLE table_26368963_1 (
year VARCHAR,
under_15 VARCHAR,
under_19 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years are there where the the under-15 is Arturo Salazar Martinez and the under-19 is Moises Galvez?
| SELECT COUNT(year) FROM table_26368963_1 WHERE under_15 = "Arturo Salazar Martinez" AND under_19 = "Moises Galvez" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-93519') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE problem_category_codes (
problem_category_code text,
problem_category_description text
)
CREATE TABLE problems (
problem_id number,
product_id number,
closure_authorised_by_staff_id number,
reported_by_staff_id number,
date_problem_reported time,
date_problem_closed time,
... | SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < (SELECT MIN(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Lysanne" AND T4.staff_last_name = "Turcotte") | spider |
CREATE TABLE table_71029 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player with a Place of T10 had a Score of 80-70-72-72=294?
| SELECT "Player" FROM table_71029 WHERE "Place" = 't10' AND "Score" = '80-70-72-72=294' | wikisql |
CREATE TABLE table_203_9 (
id number,
"state" text,
"last execution date" text,
"name" text,
"crime" text,
"method" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of states that have never used capital punishment ?
| SELECT COUNT("state") FROM table_203_9 WHERE "last execution date" = 'never used' | squall |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Anxiety state NOS" AND prescriptions.route = "ORAL" | mimicsql_data |
CREATE TABLE table_68556 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which outcome has a Surface of clay and a Score of 4 6, 7 5, 2 6?
| SELECT "Outcome" FROM table_68556 WHERE "Surface" = 'clay' AND "Score" = '4–6, 7–5, 2–6' | wikisql |
CREATE TABLE table_name_61 (
area_km_2 INTEGER,
member_state VARCHAR,
population_in_millions VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest area km2 of the member state of the Czech Republic and has a population in millions lesss than ... | SELECT MIN(area_km_2) FROM table_name_61 WHERE member_state = "czech republic" AND population_in_millions < 10.3 | sql_create_context |
CREATE TABLE table_name_71 (
team VARCHAR,
previous_team VARCHAR,
pos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team has a Previous team of san diego rockets, and a Position of f?
| SELECT team FROM table_name_71 WHERE previous_team = "san diego rockets" AND pos = "f" | 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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '口齿病(龋齿病)' AND jyjgzbb.JCZBDM = '396011' | css |
CREATE TABLE table_77554 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team was the visitor on January 10?
| SELECT "Visitor" FROM table_77554 WHERE "Date" = 'january 10' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "GASTROINTESTINAL BLEED" | mimicsql_data |
CREATE TABLE table_47921 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who repla... | SELECT "Replaced by" FROM table_47921 WHERE "Team" = 'arminia bielefeld' | wikisql |
CREATE TABLE table_40014 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away captain with a result of Eng by 1 wkt?
| SELECT "Away captain" FROM table_40014 WHERE "Result" = 'eng by 1 wkt' | wikisql |
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE domain (
did int... | SELECT abstract FROM publication WHERE title = 'Making database systems usable' | academic |
CREATE TABLE table_name_81 (
winner VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner after 2011?
| SELECT winner FROM table_name_81 WHERE year > 2011 | sql_create_context |
CREATE TABLE table_22589 (
"No. in series" 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.
-- Name the total number of production code by david ri... | SELECT COUNT("Production code") FROM table_22589 WHERE "Written by" = 'David Richardson' AND "Directed by" = 'Todd Holland' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT ZYZYZDZZBM, ZYZYZDZZMC FROM zyjzjlb WHERE JZLSH = '64067392634' | css |
CREATE TABLE candidates (
candidate_id number,
candidate_details text
)
CREATE TABLE students (
student_id number,
student_details text
)
CREATE TABLE candidate_assessments (
candidate_id number,
qualification text,
assessment_date time,
asessment_outcome_code text
)
CREATE TABLE addr... | SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance | spider |
CREATE TABLE table_34190 (
"Name" text,
"Term" text,
"Games" real,
"Record (W\u2013L\u2013T / OTL)" text,
"Points" real,
"Win percentage" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Win percentage has a Name of red kelly?
| SELECT SUM("Win percentage") FROM table_34190 WHERE "Name" = 'red kelly' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | WITH Rankings AS (SELECT Id, Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC) FROM Users WHERE UPPER(Users.Location) LIKE UPPER('##Country##')), Counts AS (SELECT Count = COUNT(*) FROM Users WHERE Reputation > '##ReputationCutoff##') SELECT Id, Ranking, 100 - (100 * (CAST(Ranking AS FLOAT(20, 5)) / (SELECT Count ... | sede |
CREATE TABLE table_61609 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the To Par of Peter Senior from Australia?
| SELECT "To par" FROM table_61609 WHERE "Country" = 'australia' AND "Player" = 'peter senior' | wikisql |
CREATE TABLE table_29786 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT "Score" FROM table_29786 WHERE "Team" = 'Detroit' | wikisql |
CREATE TABLE table_23177573_1 (
rank__week_ VARCHAR,
written_by VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the week ranking of the episode written by Thomas L. Moran and directed by Andrew Bernstein?
| SELECT rank__week_ FROM table_23177573_1 WHERE written_by = "Thomas L. Moran" AND directed_by = "Andrew Bernstein" | sql_create_context |
CREATE TABLE table_1448 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the home team scores when carlton was ... | SELECT "Home team score" FROM table_1448 WHERE "Home team" = 'Carlton' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2004-04-21' AND '2012-11-26' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 5 | 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 jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '35605162695' | css |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | nvbench |
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,... | SELECT grape, appelation FROM wine | spider |
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 allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND DATETIME(allergy.allergytime, 'start of month') = DATETI... | eicu |
CREATE TABLE table_name_27 (
street_address VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the address of the union bank of California tower?
| SELECT street_address FROM table_name_27 WHERE name = "union bank of california tower" | sql_create_context |
CREATE TABLE table_name_99 (
round VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Round is in Ullevaal?
| SELECT round FROM table_name_99 WHERE venue = "ullevaal" | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hx traumatic fracture" AND lab.fluid = "Joint Fluid" | mimicsql_data |
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '韩文丽' AND t_kc21.MED_SER_ORG_NO = '7659093' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%炭末%' | css |
CREATE TABLE table_2116 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year did the Lions join?
| SELECT MIN("Joined") FROM table_2116 WHERE "Nickname" = 'Lions' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE pat... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '水高翰' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-01-07' AND '2004-02-14' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careuni... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE table_name_63 (
finish VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the finish of South Africa?
| SELECT finish FROM table_name_63 WHERE country = "south africa" | sql_create_context |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
... | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) | nvbench |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp... | atis |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT AVG(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-202970') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE table_name_51 (
eruptions VARCHAR,
country VARCHAR,
location VARCHAR,
volcanic_explosivity_index VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Eruptions have a Location of pacific ring of fire, and a Volcanic Explosivity Index of ... | SELECT eruptions FROM table_name_51 WHERE location = "pacific ring of fire" AND volcanic_explosivity_index = "6" AND country = "peru" | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '73994470317' | css |
CREATE TABLE climber (
Country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many distinct countries are the climbers from?
| SELECT COUNT(DISTINCT Country) FROM climber | sql_create_context |
CREATE TABLE table_204_944 (
id number,
"mine" text,
"province" text,
"coordinates" text,
"town" text,
"dates" text,
"comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what province is the town of temagami ?
| SELECT "province" FROM table_204_944 WHERE "town" = 'temagami' | squall |
CREATE TABLE table_20684390_1 (
mccain_percentage VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the McCain vote percentage in Jerome county?
| SELECT mccain_percentage FROM table_20684390_1 WHERE county = "Jerome" | sql_create_context |
CREATE TABLE table_name_25 (
rank VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank that shows 276 games?
| SELECT rank FROM table_name_25 WHERE games = "276" | sql_create_context |
CREATE TABLE table_41381 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the Outstanding director of a musical category?
| SELECT "Result" FROM table_41381 WHERE "Category" = 'outstanding director of a musical' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate tim... | SELECT Score, Title FROM Posts WHERE OwnerUserId = 251299 | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.admityear < "2133" | mimicsql_data |
CREATE TABLE table_203_675 (
id number,
"match" number,
"date" text,
"round" text,
"home/away" text,
"opponent team" text,
"score" text,
"scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what number of games did both teams score n... | SELECT COUNT(*) FROM table_203_675 WHERE "score" = 0 AND "score" = 0 | squall |
CREATE TABLE table_57568 (
"Coach" text,
"Season" text,
"Record" text,
"Home" text,
"Away" text,
"Win %" real,
"Average (Total) Home Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest win% with an away score of 3-... | SELECT MIN("Win %") FROM table_57568 WHERE "Away" = '3-2' AND "Season" = '2011' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefin... | SELECT COUNT(Id) FROM Posts AS q WHERE PostTypeId = 1 AND DATEDIFF(m, q.CreationDate, GETDATE()) >= 6 AND AnswerCount >= 1 AND ViewCount >= 1000 | sede |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_24330912_1 (
money_list_rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest overall money list rank?
| SELECT MIN(money_list_rank) FROM table_24330912_1 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.