instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_66660 (
"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 was the outcome of the match with a score of 3-6, 2-6?
| SELECT "Outcome" FROM table_66660 WHERE "Score" = '3-6, 2-6' | wikisql |
CREATE TABLE table_41109 (
"SEASON" text,
"FIRST" text,
"SECOND" text,
"THIRD" text,
"FOURTH" text,
"FIFTH" text,
"SIXTH" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is SECOND, when FIRST is Western Australia?
| SELECT "SECOND" FROM table_41109 WHERE "FIRST" = 'western australia' | wikisql |
CREATE TABLE table_name_21 (
record VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has an Event of tpf 5: stars and strikes?
| SELECT record FROM table_name_21 WHERE event = "tpf 5: stars and strikes" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "WHITE" | mimicsql_data |
CREATE TABLE Employees (
employee_id INTEGER,
role_code CHAR(15),
employee_name VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Roles (
role_code CHAR(15),
role_description VARCHAR(255)
)
CREATE TABLE ... | SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY receipt_date | nvbench |
CREATE TABLE table_18571 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what the the end number where albert rains was running
| SELECT COUNT("Result") FROM table_18571 WHERE "Incumbent" = 'Albert Rains' | wikisql |
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE budget ... | SELECT County, SUM(Enrollment) FROM School GROUP BY County | nvbench |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_21292 (
"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.
-- Name t... | SELECT MIN("Game") FROM table_21292 WHERE "Location Attendance" = 'ARCO Arena 13,330' | wikisql |
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL... | SELECT gender, COUNT(*) FROM Customers GROUP BY gender | nvbench |
CREATE TABLE table_47824 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average To Par, when Place is 'T3', and when Player is 'Ben Hogan'?
| SELECT AVG("To par") FROM table_47824 WHERE "Place" = 't3' AND "Player" = 'ben hogan' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | 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 = '002-73243')) AND intakeoutput.celllabel = 'ppn/t... | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4423' AND NOT patient.hospitaldischargetime IS NULL ORDER BY ... | eicu |
CREATE TABLE table_14239 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" real,
"Avg. Finish" real,
"Winnings" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How ... | SELECT COUNT("Wins") FROM table_14239 WHERE "Winnings" = '$184,190' AND "Top 10" > '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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_name_11 (
ns VARCHAR,
normal_total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the NS with normal total of 102
| SELECT ns FROM table_name_11 WHERE normal_total = "102" | sql_create_context |
CREATE TABLE table_name_53 (
variant__with_niqqud__ VARCHAR,
phonemic_value VARCHAR,
without_niqqud VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When a variant without niqqud is as middle letter: with a phonemic value of /v/, what is the variant with n... | SELECT variant__with_niqqud__ FROM table_name_53 WHERE phonemic_value = "/v/" AND without_niqqud = "as middle letter: וו" | sql_create_context |
CREATE TABLE table_60536 (
"Data" text,
"Headcount" real,
"Percent of total" text,
"Less than $25,000" text,
"$25,000 to $40,000" text,
"$40,000 to $50,000" text,
"$50,000 to $60,000" text,
"$60,000 to $70,000" text,
"$70,000 to $80,000" text,
"More than $80,000" text,
"Mean"... | SELECT "Percent of total" FROM table_60536 WHERE "$40,000 to $50,000" = 'n/a' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number... | SELECT patients.dob FROM patients WHERE patients.subject_id = 25847 | mimic_iii |
CREATE TABLE table_27218002_1 (
written_by VARCHAR,
originalairdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of written by for 26 july 2010
| SELECT COUNT(written_by) FROM table_27218002_1 WHERE originalairdate = "26 July 2010" | sql_create_context |
CREATE TABLE table_6186 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the game number that took place on April 27?
| SELECT "Game" FROM table_6186 WHERE "Date" = 'april 27' | wikisql |
CREATE TABLE table_name_11 (
date VARCHAR,
raiders_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did the Raiders score 17?
| SELECT date FROM table_name_11 WHERE raiders_points = 17 | sql_create_context |
CREATE TABLE table_23292220_4 (
scores VARCHAR,
seans_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the episode with john barrowman and vic reeves on sean's team?
| SELECT scores FROM table_23292220_4 WHERE seans_team = "John Barrowman and Vic Reeves" | sql_create_context |
CREATE TABLE table_14302582_1 (
result VARCHAR,
home_matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result when the team had contested 14 home games?
| SELECT result FROM table_14302582_1 WHERE home_matches = 14 | sql_create_context |
CREATE TABLE table_72570 (
"Rank" real,
"Country" text,
"Overall" text,
"Justice" text,
"Health" text,
"Education" text,
"Economics" text,
"Politics" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the economics score with justice ... | SELECT "Economics" FROM table_72570 WHERE "Justice" = '90.8' | wikisql |
CREATE TABLE table_name_71 (
number VARCHAR,
proto_polynesian VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Number has a Proto-Polynesian of *taha?
| SELECT number FROM table_name_71 WHERE proto_polynesian = "*taha" | sql_create_context |
CREATE TABLE table_45728 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score in the final has a Surf... | SELECT "Score in the final" FROM table_45728 WHERE "Surface" = 'hard' AND "Date" = 'august 20, 1989' | wikisql |
CREATE TABLE table_name_11 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result when the date is August 27, 1980?
| SELECT result FROM table_name_11 WHERE date = "august 27, 1980" | sql_create_context |
CREATE TABLE table_20325360_2 (
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The country, competing in the Mr. International competition, that holds a rank of 3, has how many 2nd runners up?
| SELECT COUNT(2 AS nd_runner_up) FROM table_20325360_2 WHERE rank = 3 | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter | nvbench |
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 zyjybgb.BGRQ FROM zyjybgb WHERE zyjybgb.BGDH = '76529320990' UNION SELECT mzjybgb.BGRQ FROM mzjybgb WHERE mzjybgb.BGDH = '76529320990' | css |
CREATE TABLE table_203_239 (
id number,
"year" number,
"title" text,
"chinese title" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was athena chu 's first role ?
| SELECT "role" FROM table_203_239 WHERE id = 1 | squall |
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 WHERE demographic.admityear < "2166" AND prescriptions.drug = "Glipizide" | mimicsql_data |
CREATE TABLE table_name_8 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score on January 23?
| SELECT score FROM table_name_8 WHERE date = "january 23" | sql_create_context |
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 MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'vasodilating agent - iv')) AND DATETIME(cost... | eicu |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
... | SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code | nvbench |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Date_of_Birth, Height FROM people ORDER BY Height | nvbench |
CREATE TABLE table_56832 (
"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.
-- If the Home team had a score of 3.15 (33), what ... | SELECT "Date" FROM table_56832 WHERE "Home team score" = '3.15 (33)' | wikisql |
CREATE TABLE table_23175 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many assists did the player who scor... | SELECT "Assists" FROM table_23175 WHERE "Points" = '251' | wikisql |
CREATE TABLE table_17427004_7 (
quarterfinals VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did Abdelhafid Benchebla face in the quarterfinals?
| SELECT quarterfinals FROM table_17427004_7 WHERE athlete = "Abdelhafid Benchebla" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-24126')) AND lab.labname = '-polys' ORDER BY lab.labresult DESC, lab.labresultt... | eicu |
CREATE TABLE table_6394 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest pick from the Furman School that is a round smaller than 8?
| SELECT MIN("Pick") FROM table_6394 WHERE "School" = 'furman' AND "Round" < '8' | wikisql |
CREATE TABLE table_22815568_1 (
poverty_rate VARCHAR,
market_income_per_capita VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the poverty rate in the county that has a market income per capita of $16,420?
| SELECT poverty_rate FROM table_22815568_1 WHERE market_income_per_capita = "$16,420" | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE Suppliers (
supplier_id INTEGER,
supplier_name VARCHAR(80),
supplier_phone VARCHAR(80)
)
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id I... | SELECT product_type_code, SUM(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY SUM(product_price) | nvbench |
CREATE TABLE table_4355 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the nationality of pick of 153
| SELECT "Nationality" FROM table_4355 WHERE "Pick" = '153' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Anemia in chronic kidney disease" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT COUNT(*) 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 = 1902)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tube #1' AND ... | mimic_iii |
CREATE TABLE table_name_95 (
fiscal_year INTEGER,
revenues VARCHAR,
employees VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest Fiscal Year with Revenues of $4.3 billion, and more than 85,335 employees?
| SELECT MAX(fiscal_year) FROM table_name_95 WHERE revenues = "$4.3 billion" AND employees > 85 OFFSET 335 | sql_create_context |
CREATE TABLE table_16432 (
"English name" text,
"Original name" text,
"Area in km\u00b2" text,
"Population at 2010 Census" real,
"Number of settlements and villages" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the original names of the d... | SELECT "Original name" FROM table_16432 WHERE "Population at 2010 Census" = '210450' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_71846 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year has has a Engine of maserati straight-6?
| SELECT COUNT("Year") FROM table_71846 WHERE "Engine" = 'maserati straight-6' | wikisql |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) | nvbench |
CREATE TABLE table_2668199_2 (
result VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for district pennsylvania 6?
| SELECT result FROM table_2668199_2 WHERE district = "Pennsylvania 6" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_co... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'nutren pulmonary' A... | mimic_iii |
CREATE TABLE table_19534 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest numbered?
| SELECT MAX("Division") FROM table_19534 | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '... | eicu |
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 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 = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '94029364' AND t_kc22.STA_DATE BETWEEN '2007-08-25' AND '2013-06-24' AND t_kc21.MED_SER_ORG_NO = '4819372' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_name_61 (
density__hab__km²__ VARCHAR,
altitude_m VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the density (hab/ km ) when the altitude m is 1300?
| SELECT density__hab__km²__ FROM table_name_61 WHERE altitude_m = "1300" | sql_create_context |
CREATE TABLE table_1483 (
"Series #" real,
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of Episode #2
| SELECT "Title" FROM table_1483 WHERE "Episode #" = '2' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
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 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 = '45714321' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2014-09-08') | css |
CREATE TABLE table_204_344 (
id number,
"player" text,
"games played" number,
"field goals" number,
"free throws" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player played more games , r.c hass or clyde alwood ?
| SELECT "player" FROM table_204_344 WHERE "player" IN ('r.c. haas', 'clyde alwood') ORDER BY "games played" DESC LIMIT 1 | squall |
CREATE TABLE table_204_617 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total of games where the opponent score... | SELECT COUNT(*) FROM table_204_617 WHERE "result" = 0 | squall |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6823656' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-09-28' AND '2011-05-10' | css |
CREATE TABLE table_49831 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Manufacturer has a Rider of daijiro kato?
| SELECT "Manufacturer" FROM table_49831 WHERE "Rider" = 'daijiro kato' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | 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 = '033-3992' AND patient.hospitaldischargetime IS NULL)) | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.icd9_code = "58089" | mimicsql_data |
CREATE TABLE table_66801 (
"January" text,
"February" text,
"March" text,
"April" text,
"June" text,
"July" text,
"August" text,
"September" text,
"October" text,
"November" text,
"December" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT "July" FROM table_66801 WHERE "February" = 'linda forsythe' | wikisql |
CREATE TABLE table_14358 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score in the Alfred Dunhill links championship?
| SELECT "Winning score" FROM table_14358 WHERE "Tournament" = 'alfred dunhill links championship' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "89" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SDH" AND demographic.age < "49" | mimicsql_data |
CREATE TABLE table_name_87 (
class VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- for the name of jamar jackson what is the class?
| SELECT class FROM table_name_87 WHERE name = "jamar jackson" | sql_create_context |
CREATE TABLE table_1859 (
"Class" text,
"Team" text,
"103lbs" text,
"112lbs" text,
"119lbs" text,
"125lbs" text,
"130lbs" text,
"135lbs" text,
"140lbs" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who weighed 135 lbs that was on th... | SELECT "135lbs" FROM table_1859 WHERE "125lbs" = 'Doug Del Porto (Galena)' | wikisql |
CREATE TABLE table_28138035_20 (
mens_singles VARCHAR,
mens_doubles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players are there for mens singles when chen qi ma lin played mens doubles?
| SELECT COUNT(mens_singles) FROM table_28138035_20 WHERE mens_doubles = "Chen Qi Ma Lin" | sql_create_context |
CREATE TABLE table_60302 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a To par of 5, what is Nick Faldo's Place?
| SELECT "Place" FROM table_60302 WHERE "To par" = '–5' AND "Player" = 'nick faldo' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
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,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TAB... | SELECT CreationDate, Tags, Score, ViewCount FROM Posts WHERE PostTypeId = 1 AND Score > 25 ORDER BY Score DESC | sede |
CREATE TABLE table_name_9 (
bore VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What bore goes with an 18 AB?
| SELECT bore FROM table_name_9 WHERE name = "18 ab" | sql_create_context |
CREATE TABLE table_46851 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT COUNT("Played") FROM table_46851 WHERE "Position" < '4' AND "Team" = 'witton albion' | wikisql |
CREATE TABLE table_48651 (
"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 is the total amount of money that the United States one with a To par of 2?
| SELECT COUNT("Money ( $ )") FROM table_48651 WHERE "Country" = 'united states' AND "To par" = '–2' | wikisql |
CREATE TABLE table_47084 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Opponent that has the Record of 7-7-1?
| SELECT "Opponent" FROM table_47084 WHERE "Record" = '7-7-1' | wikisql |
CREATE TABLE table_name_13 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Away team is associated with the Richmond Home team?
| SELECT away_team FROM table_name_13 WHERE home_team = "richmond" | sql_create_context |
CREATE TABLE table_204_269 (
id number,
"week" number,
"room" text,
"winning couple" text,
"2nd couple" text,
"3rd couple" text,
"chumps" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- after winning week 5 , alisa and lysandra had how many w... | SELECT COUNT("week") FROM table_204_269 WHERE "week" > 5 AND "winning couple" = 'alisa and lysandra' | squall |
CREATE TABLE table_62860 (
"Athlete" text,
"Class" text,
"Horse" text,
"Event" text,
"Result" text,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What class had a Championship Test event with a 62.516 result?
| SELECT "Class" FROM table_62860 WHERE "Event" = 'championship test' AND "Result" = '62.516' | wikisql |
CREATE TABLE table_56713 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people were at Washington's home game against Miami... | SELECT COUNT("Attendance") FROM table_56713 WHERE "Visitor" = 'miami' AND "Home" = 'washington' | wikisql |
CREATE TABLE table_name_93 (
surface VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surface has a Partner of sorana c rstea?
| SELECT surface FROM table_name_93 WHERE partner = "sorana cîrstea" | sql_create_context |
CREATE TABLE table_22342 (
"Transmitter" text,
"Service area" text,
"Radio 1 (MHz)" text,
"2FM (MHz)" text,
"RnaG (MHz)" text,
"Lyric FM (MHz)" text,
"ERP (kW)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lyric fm for rnag 93.... | SELECT "Lyric FM (MHz)" FROM table_22342 WHERE "RnaG (MHz)" = '93.2' | wikisql |
CREATE TABLE table_40916 (
"Title" text,
"Director" text,
"Producer" text,
"Production Cost" text,
"Singapore Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the film titled 1997, what was the gross in Singapore?
| SELECT "Singapore Gross" FROM table_40916 WHERE "Title" = '1997' | wikisql |
CREATE TABLE table_204_121 (
id number,
"year" text,
"game" text,
"developer" text,
"setting" text,
"platform" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games are there before 1990 ?
| SELECT COUNT("game") FROM table_204_121 WHERE "year" < 1990 | squall |
CREATE TABLE table_64052 (
"Rank\u2003" real,
"Largest U.S. City\u2003" text,
"Total" real,
"Partners\u2003" real,
"Other" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of partners for the firm with a rank under 71, other... | SELECT AVG("Partners\u2003") FROM table_64052 WHERE "Rank\u2003" < '71' AND "Largest U.S. City\u2003" = 'philadelphia' AND "Other" > '77' | wikisql |
CREATE TABLE table_28661 (
"Entered [A ]" text,
"Weeks in top 10" real,
"Single" text,
"Artist" text,
"Peak" real,
"Peak reached [A ]" text,
"Weeks at peak" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks in the top-10 did Beat... | SELECT "Weeks in top 10" FROM table_28661 WHERE "Artist" = 'Beats International' | wikisql |
CREATE TABLE table_name_4 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the home team score at Western Oval?
| SELECT home_team AS score FROM table_name_4 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text
)
CREATE TABLE ... | SELECT AVG(acc_bal), acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type | spider |
CREATE TABLE table_41188 (
"City" text,
"Comprehension of Danish" text,
"Comprehension of Swedish" text,
"Comprehension of Norwegian" text,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which City has an Average of 6.85?
| SELECT "City" FROM table_41188 WHERE "Average" = '6.85' | wikisql |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
-- Using valid SQLite, answer the following questions fo... | SELECT Snatch, Clean_Jerk FROM body_builder | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.