instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_31597 (
"Year" real,
"Date" text,
"Event" text,
"Days" text,
"Stages" text,
"Acts" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the event for 6 bands
| SELECT "Event" FROM table_31597 WHERE "Acts" = '6 bands' | wikisql |
CREATE TABLE table_31455 (
"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 "Location Attendance" FROM table_31455 WHERE "Team" = 'Los Angeles' | wikisql |
CREATE TABLE table_1555308_1 (
bleeding_time VARCHAR,
prothrombin_time VARCHAR,
platelet_count VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the possible bleeding time results where prothrombin time and platelet count are both unaffected?
| SELECT bleeding_time FROM table_1555308_1 WHERE prothrombin_time = "Unaffected" AND platelet_count = "Unaffected" | sql_create_context |
CREATE TABLE table_12032893_1 (
year VARCHAR,
weight VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which year was the Weight 170?
| SELECT year FROM table_12032893_1 WHERE weight = 170 | sql_create_context |
CREATE TABLE table_29660 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who w... | SELECT "Written by" FROM table_29660 WHERE "Prod. code" = '211' | wikisql |
CREATE TABLE table_203_459 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
)
-- U... | SELECT "township" FROM table_203_459 ORDER BY "population" LIMIT 1 | squall |
CREATE TABLE table_name_86 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game when the Blue Jays were 55-39?
| SELECT score FROM table_name_86 WHERE record = "55-39" | sql_create_context |
CREATE TABLE table_61353 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of fightfest 2, which has 3 ro... | SELECT "Location" FROM table_61353 WHERE "Round" = '3' AND "Event" = 'fightfest 2' | 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 prescription... | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Simethicone" | mimicsql_data |
CREATE TABLE Ref_Document_Status (
document_status_code CHAR(15),
document_status_description VARCHAR(255)
)
CREATE TABLE Documents (
document_id INTEGER,
document_status_code CHAR(15),
document_type_code CHAR(15),
shipping_agent_code CHAR(15),
receipt_date DATETIME,
receipt_number VARC... | SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY COUNT(receipt_date) DESC | nvbench |
CREATE TABLE table_26950 (
"Name" text,
"Position" text,
"Period" text,
"Appearances\u00b9" real,
"Goals\u00b9" real,
"Nationality\u00b2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the nationality for defender 201
| SELECT "Nationality\u00b2" FROM table_26950 WHERE "Position" = 'Defender' AND "Appearances\u00b9" = '201' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC | nvbench |
CREATE TABLE table_32470 (
"Year" real,
"Championship" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which championship had a margin of 10 strokes?
| SELECT "Championship" FROM table_32470 WHERE "Margin" = '10 strokes' | wikisql |
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '1714876' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-08' AND '2016-11-26' GROUP B... | css |
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, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
... | 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 trust (
source_u_id number,
target_u_id number,
trust number
)
CREATE TABLE useracct (
u_id number,
name text
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE item (
i_id number,
title text
)
-- Usi... | SELECT * FROM item | spider |
CREATE TABLE table_16581695_4 (
production_code VARCHAR,
no_in_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code for episode 15 in season 3?
| SELECT production_code FROM table_16581695_4 WHERE no_in_season = "15" | sql_create_context |
CREATE TABLE table_61405 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Film title used in nomination of Cilv ka B rns?
| SELECT "Film title used in nomination" FROM table_61405 WHERE "Original title" = 'cilvēka bērns' | wikisql |
CREATE TABLE table_name_18 (
date VARCHAR,
week VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for a week before 9, and a opponent of dallas cowboys?
| SELECT date FROM table_name_18 WHERE week < 9 AND opponent = "dallas cowboys" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents ... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 99883) AND icustays.outtime IS NULL) ORDER... | mimic_iii |
CREATE TABLE table_45206 (
"Name" text,
"Location" text,
"Height (m)" real,
"Stories" real,
"Year of completion" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest number of stories in Recife completed later than 2007 with a height l... | SELECT MAX("Stories") FROM table_45206 WHERE "Location" = 'recife' AND "Year of completion" > '2007' AND "Height (m)" < '135' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.icd9_code = "496" | mimicsql_data |
CREATE TABLE table_64008 (
"Serial No." real,
"District" text,
"Headquartered City" text,
"City Population (2009)" real,
"City Area(km 2 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total city area for vehari city with a serial num... | SELECT COUNT("City Area(km 2 )") FROM table_64008 WHERE "Headquartered City" = 'vehari city' AND "Serial No." > '36' | wikisql |
CREATE TABLE table_name_2 (
goal_difference INTEGER,
draw VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average goal difference for draw of 7 and played more than 18
| SELECT AVG(goal_difference) FROM table_name_2 WHERE draw = 7 AND played > 18 | sql_create_context |
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
CREATE TABLE tags (
index number,
id number,
tag text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT(*), artist FROM torrents GROUP BY artist | whatcdhiphop |
CREATE TABLE table_21940 (
"Season" text,
"The Mole" text,
"Winner" text,
"Runner-up" text,
"International destination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many won the prize when Regina was the runner-up?
| SELECT COUNT("Winner") FROM table_21940 WHERE "Runner-up" = 'Regina' | wikisql |
CREATE TABLE table_64094 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the IHSAA Class of aaa school with... | SELECT "Location" FROM table_64094 WHERE "IHSAA Class" = 'aaa' AND "Enrollment" > '590' | wikisql |
CREATE TABLE table_24565004_22 (
appearances¹ INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- at least how many times was Pierre Vermeulen at a game?
| SELECT MIN(appearances¹) FROM table_24565004_22 WHERE name = "Pierre Vermeulen" | sql_create_context |
CREATE TABLE table_30853 (
"Series" real,
"Premiere" text,
"Finale" text,
"Runners-up" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the season for which Brendan Lynch is the runner-up?
| SELECT "Winner" FROM table_30853 WHERE "Runners-up" = 'Brendan Lynch' | wikisql |
CREATE TABLE table_19304764_2 (
total_seats VARCHAR,
discipline VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total seats for otorhinolaryngology
| SELECT total_seats FROM table_19304764_2 WHERE discipline = "Otorhinolaryngology" | sql_create_context |
CREATE TABLE table_name_14 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1994 finish for the Miami tournament?
| SELECT 1994 FROM table_name_14 WHERE tournament = "miami" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '99198987' AND t_kc22.STA_DATE BETWEEN '2013-05-27' AND '2021-01-31' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_38629 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Charleston, SC ERP W?
| SELECT "ERP W" FROM table_38629 WHERE "City of license" = 'charleston, sc' | wikisql |
CREATE TABLE table_38528 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What the result for the hypo-meeting tournament in 1994?
| SELECT "Result" FROM table_38528 WHERE "Year" = '1994' AND "Tournament" = 'hypo-meeting' | wikisql |
CREATE TABLE table_name_40 (
february VARCHAR,
points VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many February days have Points of 63 and a Score of 1 2?
| SELECT COUNT(february) FROM table_name_40 WHERE points = 63 AND score = "1–2" | sql_create_context |
CREATE TABLE table_name_65 (
lost VARCHAR,
goal_difference VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of games lost when goal difference is +13 and draws are more than 12?
| SELECT COUNT(lost) FROM table_name_65 WHERE goal_difference = "+13" AND drawn > 12 | sql_create_context |
CREATE TABLE table_3390 (
"January\u2013December 2012" text,
"Birth/2012" real,
"Birth/2011" real,
"Death/2012" real,
"Death/2011" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the total number of 2012 deaths when 2012 births were 127?
| SELECT "Death/2012" FROM table_3390 WHERE "Birth/2012" = '127' | wikisql |
CREATE TABLE table_name_11 (
points_classification_navy_blue_jersey VARCHAR,
mountains_classification_green_jersey VARCHAR,
team_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Points Classification Navy Blue Jersey that has Yoa... | SELECT points_classification_navy_blue_jersey FROM table_name_11 WHERE mountains_classification_green_jersey = "yoann le boulanger" AND team_classification = "gerolsteiner" | sql_create_context |
CREATE TABLE table_name_47 (
year INTEGER,
laps VARCHAR,
co_driver VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Year, when Co-Driver is Warren Luff, when Position is 7th, and when Laps is less than 161?
| SELECT MIN(year) FROM table_name_47 WHERE co_driver = "warren luff" AND position = "7th" AND laps < 161 | sql_create_context |
CREATE TABLE table_78462 (
"Series #" real,
"Title" text,
"Directed by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the 'Downtown Girl' episode, what was the original air date?
| SELECT "Original air date" FROM table_78462 WHERE "Title" = 'downtown girl' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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,
sp... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'contr abd arteriogrm nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3535) AND DATETIME(pro... | mimic_iii |
CREATE TABLE table_48799 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid of rider shinya nakano?
| SELECT "Grid" FROM table_48799 WHERE "Rider" = 'shinya nakano' | wikisql |
CREATE TABLE table_train_156 (
"id" int,
"anemia" bool,
"abnormal_bilirubin" bool,
"hemoglobin_a1c_hba1c" float,
"body_mass_index_bmi" float,
"bilirubin" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- body mass index greater ... | SELECT * FROM table_train_156 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi < 35 | criteria2sql |
CREATE TABLE table_72162 (
"Character" text,
"Fate" text,
"Actor" text,
"First Episode" text,
"Final Episode" text,
"Duration" text,
"Final Episode Count" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the total number of final epbein... | SELECT COUNT("Final Episode Count") FROM table_72162 WHERE "First Episode" = 'L.A.' | wikisql |
CREATE TABLE table_name_84 (
sample_size VARCHAR,
date_s__administered VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people were surveyed in the poll from June 30, 2010?
| SELECT sample_size FROM table_name_84 WHERE date_s__administered = "june 30, 2010" | sql_create_context |
CREATE TABLE table_69537 (
"Clinical Status" text,
"Compound Name" text,
"Trademark" text,
"Marine Organism \u03b1" text,
"Chemical Class" text,
"Molecular Target" text,
"Clinical Trials \u03b2" text,
"Disease Area" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "Molecular Target" FROM table_69537 WHERE "Disease Area" = 'antiviral' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | 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.icd9_code = "59654" | mimicsql_data |
CREATE TABLE table_45137 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in final" text,
"Score in final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the partnering that had the opponents of Marcelo Melo... | SELECT "Partnering" FROM table_45137 WHERE "Opponents in final" = 'marcelo melo andré sá' | wikisql |
CREATE TABLE table_77587 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the rider with a 399cc Kawasaki?
| SELECT "Rider" FROM table_77587 WHERE "Team" = '399cc kawasaki' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(*) FROM jybgb WHERE JZLSH = '21319926440' | css |
CREATE TABLE table_18646432_4 (
title VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the episode originally aired on September 29, 1999?
| SELECT title FROM table_18646432_4 WHERE original_air_date = "September 29, 1999" | 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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'mcv') | eicu |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id ... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'obstructive sleep apnea') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 75762 AND NOT admi... | mimic_iii |
CREATE TABLE stock (
Shop_ID int,
Device_ID int,
Quantity int
)
CREATE TABLE device (
Device_ID int,
Device text,
Carrier text,
Package_Version text,
Applications text,
Software_Platform text
)
CREATE TABLE shop (
Shop_ID int,
Shop_Name text,
Location text,
Open_Dat... | SELECT Carrier, COUNT(Carrier) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Carrier ORDER BY Carrier | nvbench |
CREATE TABLE table_6179 (
"Model" text,
"Platform & Frequency [MHz]" text,
"RAM [MB]" text,
"Flash Memory [MB]" text,
"Wireless NIC" text,
"WLAN standard [802.11]" text,
"Ethernet port count" text,
"Voltage Input [V/A]" text
)
-- Using valid SQLite, answer the following questions for t... | SELECT "Platform & Frequency [MHz]" FROM table_6179 WHERE "Model" = 'whr-g54s' | wikisql |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr ... | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary) | nvbench |
CREATE TABLE table_name_74 (
package_option VARCHAR,
television_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Package/Option, when Television Service is Sky Inside?
| SELECT package_option FROM table_name_74 WHERE television_service = "sky inside" | sql_create_context |
CREATE TABLE table_51993 (
"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 average amount of silver medals Montenegro, who has less than 15 bronze and more than 11 total me... | SELECT AVG("Silver") FROM table_51993 WHERE "Bronze" < '15' AND "Nation" = 'montenegro' AND "Total" > '11' | wikisql |
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
... | SELECT Years_Played, COUNT(Years_Played) FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" GROUP BY Years_Played ORDER BY Years_Played DESC | nvbench |
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-258... | eicu |
CREATE TABLE table_name_84 (
score VARCHAR,
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the replay game when watford was the away team?
| SELECT score FROM table_name_84 WHERE tie_no = "replay" AND away_team = "watford" | sql_create_context |
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE customers (
customer_id number,
customer_name text,
customer_details text
)
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status text,
order_i... | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_9 (
win_percentage VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where the wins are 46, what is the win%?
| SELECT win_percentage FROM table_name_9 WHERE wins = "46" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
lan... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_5446 (
"Pos." real,
"Car #" real,
"Driver" text,
"Make" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team drove a Dodge vehicle?
| SELECT "Team" FROM table_5446 WHERE "Make" = 'dodge' | wikisql |
CREATE TABLE table_12583 (
"Standard order" real,
"English translation" text,
"Transcription (based on Pinyin)" text,
"Traditional Chinese" text,
"Simplified Chinese" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the english translation of ... | SELECT "English translation" FROM table_12583 WHERE "Traditional Chinese" = '哀郢' | wikisql |
CREATE TABLE table_52997 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Result for the Competition of 1994 FIFA World Cup Qualification, with the Date of May 15, 1993... | SELECT "Result" FROM table_52997 WHERE "Competition" = '1994 fifa world cup qualification' AND "Date" = 'may 15, 1993' | wikisql |
CREATE TABLE table_name_60 (
pick VARCHAR,
year VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pick number in a year earlier than 2009, with a round higher than 1?
| SELECT COUNT(pick) FROM table_name_60 WHERE year < 2009 AND round > 1 | sql_create_context |
CREATE TABLE table_name_21 (
against INTEGER,
draws INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number against when the draws are less than 0?
| SELECT MIN(against) FROM table_name_21 WHERE draws < 0 | sql_create_context |
CREATE TABLE gas_station (
station_id number,
open_year number,
location text,
manager_name text,
vice_manager_name text,
representative_name text
)
CREATE TABLE station_company (
station_id number,
company_id number,
rank_of_the_year number
)
CREATE TABLE company (
company_id ... | SELECT company, rank FROM company ORDER BY sales_billion DESC | spider |
CREATE TABLE table_23074 (
"Region" text,
"Wing" text,
"Inspection" real,
"Standard" real,
"Indoor" real,
"Outdoor" real,
"Written" real,
"Panel Quiz" real,
"Mile Run" real,
"Points" real,
"Overall" text
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "Indoor" FROM table_23074 WHERE "Wing" = 'NJ' | wikisql |
CREATE TABLE table_269920_3 (
tdp__w_ INTEGER,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the TDP for the 7130N model?
| SELECT MIN(tdp__w_) FROM table_269920_3 WHERE model = "7130N" | sql_create_context |
CREATE TABLE table_name_41 (
venue VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did Footscray play as the home team?
| SELECT venue FROM table_name_41 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_203_137 (
id number,
"title" text,
"album details" text,
"peak chart positions\nus" number,
"peak chart positions\nus r&b" number,
"certifications" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did a can i bus ... | SELECT COUNT(*) FROM table_203_137 WHERE "title" = 'can-i-bus' | squall |
CREATE TABLE table_28762 (
"Dist." real,
"Democratic Coalition" text,
"Alliance" text,
"Together We Can Do More" text,
"Independent Regional Force" text,
"Independents" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the independent regio... | SELECT "Independent Regional Force" FROM table_28762 WHERE "Alliance" = '(R) Iván Norambuena ( UDI )' | wikisql |
CREATE TABLE table_name_70 (
ungegn VARCHAR,
word_form VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the ungen for ?
| SELECT ungegn FROM table_name_70 WHERE word_form = "ត្រីទស" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE i... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE table_61570 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Against, when Date is '27/02/2005'?
| SELECT COUNT("Against") FROM table_61570 WHERE "Date" = '27/02/2005' | wikisql |
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pigs real,
Sheep_and_Goats real
)
CREATE TABLE city (
City_ID int,
Official_Name text,
Status text,
Area_km_2 real,
Populat... | SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population) | nvbench |
CREATE TABLE table_204_357 (
id number,
"year" number,
"div." text,
"pos." text,
"cup" text,
"top scorer (league)" text,
"score" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the first year listed ?
| SELECT "year" FROM table_204_357 WHERE id = 1 | squall |
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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dup... | SELECT v.VoteTypeId, COUNT(*) FROM Votes AS v WHERE v.UserId = '##UserID##' GROUP BY v.VoteTypeId | sede |
CREATE TABLE table_name_40 (
hometown_school VARCHAR,
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hometown of Mike White?
| SELECT hometown_school FROM table_name_40 WHERE position = "of" AND player = "mike white" | sql_create_context |
CREATE TABLE table_15609 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did they lose to on May 20?
| SELECT "Loss" FROM table_15609 WHERE "Date" = 'may 20' | wikisql |
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,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'arterial catheterization') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24547) AND... | mimic_iii |
CREATE TABLE ref_budget_codes (
budget_type_code text,
budget_type_description text
)
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_document_types... | SELECT account_id, account_details FROM accounts | spider |
CREATE TABLE table_50549 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tire" text,
"Sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine does the Tasman Motorsports team have?
| SELECT "Engine" FROM table_50549 WHERE "Team" = 'tasman motorsports' | wikisql |
CREATE TABLE table_74767 (
"Year" text,
"League" text,
"Reg. Season" text,
"Finish" text,
"Owner(s)" text,
"Attendance Average" real,
"Slogan" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has the wild side of soccer! as the sloga... | SELECT "Year" FROM table_74767 WHERE "Slogan" = 'the wild side of soccer!' | wikisql |
CREATE TABLE table_24186 (
"Station" text,
"Line" text,
"Planned" real,
"Cancelled" real,
"Proposal" text,
"Details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of details for emlyn road
| SELECT COUNT("Details") FROM table_24186 WHERE "Station" = 'Emlyn Road' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CR... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Ahmedabad%' OR UPPER(Location) LIKE '%Ahmedabad%' OR Location LIKE '%Ahmedabad%' AND Reputation >= 1000 ORDER BY Reputation DESC | sede |
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 txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE qtb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '48799651' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '48799651' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHE... | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
... | SELECT COUNT(Posts.Id) AS "questions_posted" FROM Posts LEFT JOIN PostHistory AS PH ON PH.PostId = Posts.Id WHERE Posts.PostTypeId = 1 AND STR_POSITION(Posts.Tags, @tag) > 0 AND NOT Posts.ClosedDate IS NULL AND PH.PostHistoryTypeId = @offtopic | sede |
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 WHERE demographic.gender = "F" AND demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" | mimicsql_data |
CREATE TABLE table_name_89 (
penalty VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was a penalty given for at time 29:17?
| SELECT penalty FROM table_name_89 WHERE time = "29:17" | sql_create_context |
CREATE TABLE table_204_57 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many movies did madhurima take part in total ?
| SELECT COUNT("film") FROM table_204_57 | squall |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PHYSED' AND course.number = 336 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off... | advising |
CREATE TABLE table_59695 (
"Election" text,
"First member" text,
"First party" text,
"Second member" text,
"Second party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which of the second parties has second member Charles Robert Colvile, a conserva... | SELECT "Second party" FROM table_59695 WHERE "Second member" = 'charles robert colvile' AND "First party" = 'conservative' AND "First member" = 'william mundy' | wikisql |
CREATE TABLE table_name_47 (
points INTEGER,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total points before 1963?
| SELECT SUM(points) FROM table_name_47 WHERE year < 1963 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.