instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_22 (
player VARCHAR,
position VARCHAR,
nhl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who plays goaltender for the Vancouver Canucks?
| SELECT player FROM table_name_22 WHERE position = "goaltender" AND nhl_team = "vancouver canucks" | sql_create_context |
CREATE TABLE district (
District_name VARCHAR,
city_area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all the distinct district names ordered by city area in descending.
| SELECT DISTINCT District_name FROM district ORDER BY city_area DESC | sql_create_context |
CREATE TABLE table_68181 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance (Miles)" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What jockey rode for Michael House before 2012
| SELECT "Jockey" FROM table_68181 WHERE "Year" < '2012' AND "Owner" = 'michael house' | wikisql |
CREATE TABLE table_69463 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest attendance when the opponent was the Indians and the record was 1... | SELECT MAX("Attendance") FROM table_69463 WHERE "Opponent" = 'indians' AND "Record" = '13-4' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id num... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'emtricitabine') | mimic_iii |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '48127032778' AND jybgb.KSMC LIKE '%男科%' | css |
CREATE TABLE table_10236830_6 (
film_name VARCHAR,
actors_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which films does the actor Alla Sergiyko star in?
| SELECT film_name FROM table_10236830_6 WHERE actors_name = "Alla Sergiyko" | sql_create_context |
CREATE TABLE table_test_19 (
"id" int,
"gender" string,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"acute_infectious" bool,
"hypertensive_retinopathy" bool,
"leukocyte_count" int,
"severe_uncontrolled_hypertension" bool,
"chronic_infectious" boo... | SELECT * FROM table_test_19 WHERE severe_uncontrolled_hypertension = 1 OR systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 110 OR hypertensive_retinopathy = 1 | criteria2sql |
CREATE TABLE table_name_34 (
rank VARCHAR,
qual VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the 150.163 qual?
| SELECT rank FROM table_name_34 WHERE qual = "150.163" | sql_create_context |
CREATE TABLE table_75878 (
"Rank" real,
"Main span metres" text,
"Main span feet" text,
"Year opened" real,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the oldest year with a main span feet of 1,640 in South Korea?
| SELECT MIN("Year opened") FROM table_75878 WHERE "Main span feet" = '1,640' AND "Country" = 'south korea' | wikisql |
CREATE TABLE table_20538157_2 (
written_by VARCHAR,
no_in_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the writers of episode 20?
| SELECT written_by FROM table_20538157_2 WHERE no_in_season = 20 | sql_create_context |
CREATE TABLE table_10953197_4 (
title VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of episodes with the production code 2395113A?
| SELECT COUNT(title) FROM table_10953197_4 WHERE production_code = "2395113A" | sql_create_context |
CREATE TABLE table_1342359_5 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the district with incumbent being richard j. welch
| SELECT district FROM table_1342359_5 WHERE incumbent = "Richard J. Welch" | sql_create_context |
CREATE TABLE table_28846752_4 (
player VARCHAR,
highest_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player when the highest score is 84?
| SELECT player FROM table_28846752_4 WHERE highest_score = "84" | sql_create_context |
CREATE TABLE sales (
sales_transaction_id number,
sales_details text
)
CREATE TABLE investors (
investor_id number,
investor_details text
)
CREATE TABLE purchases (
purchase_transaction_id number,
purchase_details text
)
CREATE TABLE transactions (
transaction_id number,
investor_id n... | SELECT lot_details FROM lots EXCEPT SELECT T1.lot_details FROM lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id | spider |
CREATE TABLE table_name_28 (
icelandic_title VARCHAR,
norwegian_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Icelandic title for the Norweigan titled galgeblomsten?
| SELECT icelandic_title FROM table_name_28 WHERE norwegian_title = "galgeblomsten" | sql_create_context |
CREATE TABLE table_name_11 (
home_ground_s_ VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Home ground(s) listed for the Name Melville Cricket Club?
| SELECT home_ground_s_ FROM table_name_11 WHERE name = "melville cricket club" | sql_create_context |
CREATE TABLE table_name_29 (
goals VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals were there in game 47?
| SELECT goals FROM table_name_29 WHERE games = "47" | sql_create_context |
CREATE TABLE table_name_9 (
score VARCHAR,
location_attendance VARCHAR,
high_rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Location Attendance is 'Madison Square Garden Unknown', and when High Rebounds is 'Sidney Green (10)'... | SELECT score FROM table_name_9 WHERE location_attendance = "madison square garden unknown" AND high_rebounds = "sidney green (10)" | sql_create_context |
CREATE TABLE table_204_785 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many bronze medals did el salvador win ?
| SELECT "bronze" FROM table_204_785 WHERE "nation" = 'el salvador' | squall |
CREATE TABLE table_name_47 (
area__km_2__ INTEGER,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Area (km 2) is lowest with a type being Apostolic Administration?
| SELECT MIN(area__km_2__) FROM table_name_47 WHERE type = "apostolic administration" | sql_create_context |
CREATE TABLE table_12280396_1 (
county VARCHAR,
peak VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the county with the peak being indre russetind?
| SELECT county FROM table_12280396_1 WHERE peak = "Indre Russetind" | sql_create_context |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL... | atis |
CREATE TABLE table_26401 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the original air date for harry hannigan directed by adam... | SELECT "Original air date" FROM table_26401 WHERE "Written by" = 'Harry Hannigan' AND "Directed by" = 'Adam Weissman' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8450909' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM | css |
CREATE TABLE table_name_38 (
byes INTEGER,
south_west_dfl VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the team Heathmere of the South West DFL won more than 11 games, what is the maximum byes?
| SELECT MAX(byes) FROM table_name_38 WHERE south_west_dfl = "heathmere" AND wins > 11 | sql_create_context |
CREATE TABLE table_name_30 (
name VARCHAR,
law_school_attended VARCHAR,
appointed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who attended Columbia law school and was appointed in 2004?
| SELECT name FROM table_name_30 WHERE law_school_attended = "columbia law school" AND appointed = 2004 | sql_create_context |
CREATE TABLE table_50756 (
"Year" text,
"Total matches" real,
"Total W-L-H" text,
"Singles W-L-H" text,
"Points won" real,
"Points %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT YEAR HAD 5 TOTAL MATCHES?
| SELECT "Year" FROM table_50756 WHERE "Total matches" = '5' | wikisql |
CREATE TABLE table_53708 (
"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.
-- For Venue vfl park, what was the home team score... | SELECT "Home team score" FROM table_53708 WHERE "Venue" = 'vfl park' | wikisql |
CREATE TABLE table_1319 (
"Episode" real,
"Title" text,
"Story" text,
"Adapted by" text,
"Director" text,
"Airdate" text,
"Exists?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of episodes for alan nourse
| SELECT COUNT("Episode") FROM table_1319 WHERE "Story" = 'Alan Nourse' | wikisql |
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, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_30878 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the parter for w/o
| SELECT "Partner" FROM table_30878 WHERE "Score" = 'w/o' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '凤飞尘' AND jy... | css |
CREATE TABLE drivers (
driverid VARCHAR,
forename VARCHAR,
surname VARCHAR
)
CREATE TABLE laptimes (
driverid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the id, forname and surname of the driver who had the first position in terms of lap... | SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_10972 (
"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.
-- At the match in windy hill, how much did the hom... | SELECT "Home team score" FROM table_10972 WHERE "Venue" = 'windy hill' | wikisql |
CREATE TABLE table_34466 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the outcome on 25 october 2004?
| SELECT "Outcome" FROM table_34466 WHERE "Date" = '25 october 2004' | wikisql |
CREATE TABLE table_32754 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the away team whose venue is... | SELECT "Away team" FROM table_32754 WHERE "Venue" = 'kardinia park' | wikisql |
CREATE TABLE table_68304 (
"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 are Tiger Woods' average earnings?
| SELECT AVG("Money ( $ )") FROM table_68304 WHERE "Player" = 'tiger woods' | wikisql |
CREATE TABLE table_26375386_23 (
rank INTEGER,
vote_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum rank for the vote percentage of 5.6%
| SELECT MIN(rank) FROM table_26375386_23 WHERE vote_percentage = "5.6%" | sql_create_context |
CREATE TABLE table_37412 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game on January 18?
| SELECT "Score" FROM table_37412 WHERE "Date" = 'january 18' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrilla... | eicu |
CREATE TABLE table_66223 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which High as... | SELECT "High assists" FROM table_66223 WHERE "Score" = 'w 71-56' | wikisql |
CREATE TABLE table_1825751_14 (
pageant VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many pageants were in san fernando, pampanga?
| SELECT COUNT(pageant) FROM table_1825751_14 WHERE hometown = "San Fernando, Pampanga" | sql_create_context |
CREATE TABLE table_32079 (
"Model" text,
"Release date" text,
"Sensor res., size" text,
"Lens(35mmequiv.) zoom, aperture" text,
"Screen size,pixels" text,
"Dimensions W\u00d7H\u00d7D (mm)" text,
"Weight" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Screen size,pixels" FROM table_32079 WHERE "Dimensions W\u00d7H\u00d7D (mm)" = '115.5×83.7×102.5' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREA... | SELECT DISTINCT department, name, number FROM course WHERE course_id IN (SELECT PROGRAM_COURSE_ID FROM program_course AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')) AND num_enrolled = (S... | advising |
CREATE TABLE table_44647 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the name Derek Smith when the round is higher than 3?
| SELECT COUNT("Overall") FROM table_44647 WHERE "Name" = 'derek smith' AND "Round" > '3' | 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 Id, Id AS "post_link", ParentId, Title, OwnerUserId FROM Posts WHERE ParentId = 3368246 AND PostTypeId = 2 | sede |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TI... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
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 WHERE demographic.expire_flag = "1" AND demographic.age < "70" | mimicsql_data |
CREATE TABLE table_44101 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the moving from location wit... | SELECT "Moving from" FROM table_44101 WHERE "Transfer window" = 'summer' AND "Source" = 'kerkida.net' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | SELECT FIRST_NAME, COUNT(FIRST_NAME) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME | nvbench |
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 zyjybgb.KSBM, zyjybgb.KSMC FROM zyjybgb WHERE zyjybgb.BGDH = '41571015009' UNION SELECT mzjybgb.KSBM, mzjybgb.KSMC FROM mzjybgb WHERE mzjybgb.BGDH = '41571015009' | css |
CREATE TABLE table_name_80 (
wins INTEGER,
against INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins has more than 165 against?
| SELECT MAX(wins) FROM table_name_80 WHERE against > 165 | sql_create_context |
CREATE TABLE People (
person_id INTEGER,
first_name VARCHAR(255),
middle_name VARCHAR(255),
last_name VARCHAR(255),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
login_name VARCHAR(40),
password VARCHAR(40)
)
CREATE TABLE Courses (
course_id VARCHAR(100),
course_nam... | SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY COUNT(course_name) | nvbench |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '46607257909' | css |
CREATE TABLE table_2911 (
"Episode" text,
"First broadcast" text,
"Davids team" text,
"Lees team" text,
"Scores" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the lees team is Clare Balding and Miranda Hart, what is the first broadcast total num... | SELECT COUNT("First broadcast") FROM table_2911 WHERE "Lees team" = 'Clare Balding and Miranda Hart' | wikisql |
CREATE TABLE table_name_38 (
score VARCHAR,
outcome VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when she was a runner-up?
| SELECT score FROM table_name_38 WHERE outcome = "runner-up" | sql_create_context |
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the last names of the students in thi... | SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> "COVIN" AND T2.lastname <> "JEROME" | spider |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id ... | SELECT 100 - COUNT(*) AS "Edits To Strunk & White" FROM Posts WHERE PostTypeId = 1 AND LastEditorUserId = @UserId AND OwnerUserId != @UserId | sede |
CREATE TABLE table_40324 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most top-10 of the team with 8 cuts made and less th... | SELECT MAX("Top-10") FROM table_40324 WHERE "Cuts made" = '8' AND "Events" < '11' | wikisql |
CREATE TABLE table_68845 (
"Round" real,
"Name" text,
"Position" text,
"School" text,
"Signed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the school when signed is no and round is 50?
| SELECT "School" FROM table_68845 WHERE "Signed" = 'no' AND "Round" = '50' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT * FROM t_kc21 WHERE t_kc21.PERSON_ID = '58275827' AND t_kc21.MED_SER_ORG_NO = '6736860' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%儿保科%' | css |
CREATE TABLE table_name_40 (
run_1 INTEGER,
run_2 VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the run 1 of athlete matthias guggenberger, who has a run 2 greater than 55.24?
| SELECT SUM(run_1) FROM table_name_40 WHERE run_2 > 55.24 AND athlete = "matthias guggenberger" | sql_create_context |
CREATE TABLE table_name_16 (
date_of_release VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was twenty released?
| SELECT date_of_release FROM table_name_16 WHERE title = "twenty" | 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.icd9_code = "6824" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_14914 (
"Season" text,
"Series" text,
"Races" text,
"Wins" text,
"Podiums" text,
"Points" text,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Podium has 1 Race and a Final Place of 5th?
| SELECT "Podiums" FROM table_14914 WHERE "Races" = '1' AND "Final Placing" = '5th' | wikisql |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
... | SELECT date, COUNT(date) FROM weather WHERE zip_code = 94107 AND events <> "Fog" AND events <> "Rain" ORDER BY COUNT(date) | nvbench |
CREATE TABLE table_204_155 (
id number,
"rank" number,
"heat" number,
"athlete" text,
"nationality" text,
"time" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did adrienne power or kim wall have a faster time ?
| SELECT "athlete" FROM table_204_155 WHERE "athlete" IN ('adrienne power', 'kim wall') ORDER BY "time" LIMIT 1 | squall |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '许天蓝' AND gwyjzb.MED_SER_ORG_NO = '0791593' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%阻塞性%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '许天蓝' AND fgwyjzb.MED_SER_ORG_NO = '0791593' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%阻塞性%' | css |
CREATE TABLE table_35098 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What incumbent was re-elected in the district in california 3?
| SELECT "Incumbent" FROM table_35098 WHERE "Result" = 're-elected' AND "District" = 'california 3' | wikisql |
CREATE TABLE table_3958 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT MIN("Series #") FROM table_3958 WHERE "Production code" = 'BDF409' | wikisql |
CREATE TABLE table_19514 (
"DVD name" text,
"Ep No." real,
"DVD No." real,
"Release date" real,
"Additional information" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many release dates does volume 4 DVD have?
| SELECT COUNT("Release date") FROM table_19514 WHERE "DVD name" = 'Volume 4' | wikisql |
CREATE TABLE table_204_28 (
id number,
"election" text,
"name of the party/alliance" text,
"number of votes" number,
"percentage" text,
"seats in the parliament" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- compared to 1998 , what is the dif... | SELECT ABS((SELECT "seats in the parliament" FROM table_204_28 WHERE "election" = 2001) - (SELECT "seats in the parliament" FROM table_204_28 WHERE "election" = 1998)) | squall |
CREATE TABLE table_53718 (
"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.
-- What is the lowest attendance on November 18?
| SELECT MIN("Attendance") FROM table_53718 WHERE "Date" = 'november 18' | wikisql |
CREATE TABLE table_70177 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the player on the Los Angeles Kings?... | SELECT "Position" FROM table_70177 WHERE "NHL team" = 'los angeles kings' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microb... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015... | eicu |
CREATE TABLE table_28073 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player for 1 touchdowns
| SELECT "Player" FROM table_28073 WHERE "Touchdowns" = '1' | wikisql |
CREATE TABLE table_398 (
"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.
-- How many... | SELECT MIN("Game") FROM table_398 WHERE "High points" = 'Damien Wilkins (27)' | wikisql |
CREATE TABLE table_50188 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Nickname" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is affiliated with the nickname Ramblers?
| SELECT "Affiliation" FROM table_50188 WHERE "Nickname" = 'ramblers' | wikisql |
CREATE TABLE table_name_28 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Gene Sauers' to par?
| SELECT to_par FROM table_name_28 WHERE player = "gene sauers" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | SELECT DISTINCT edits.PostId AS "post_link", edits.Comment AS "edit_comment", edits.CreationDate AS "edit_date", rollbacks.Comment AS "rollback_comment", rollbacks.CreationDate AS "rollback_date" FROM PostHistory AS edits INNER JOIN PostHistory AS rollbacks ON edits.PostId = rollbacks.PostId AND rollbacks.CreationDate ... | sede |
CREATE TABLE table_55982 (
"Name" text,
"Current version" text,
"System" text,
"Platform" text,
"License" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the System with a freeware License?
| SELECT "System" FROM table_55982 WHERE "License" = 'freeware' | wikisql |
CREATE TABLE table_54623 (
"Pitcher" text,
"Date" text,
"Team" text,
"Result" text,
"Site" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the date for rockies
| SELECT "Date" FROM table_54623 WHERE "Team" = 'rockies' | wikisql |
CREATE TABLE table_69313 (
"Nat." text,
"Name" text,
"Since" text,
"Goals" real,
"Ends" real,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Add up all the Ends columns that have goals smaller than 0.
| SELECT SUM("Ends") FROM table_69313 WHERE "Goals" < '0' | wikisql |
CREATE TABLE table_62967 (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country's Author is based on Sophocles and Euripides?
| SELECT "country" FROM table_62967 WHERE "author" = 'based on sophocles and euripides' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Adm inhal nitric oxide" | mimicsql_data |
CREATE TABLE table_8749 (
"Name/Designation" text,
"Class" text,
"Range (varies with payload weight)" text,
"Payload" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the payload for Class MRBM, and a range of 1,930km?
| SELECT "Payload" FROM table_8749 WHERE "Class" = 'mrbm' AND "Range (varies with payload weight)" = '1,930km' | wikisql |
CREATE TABLE table_name_76 (
fastest_time__s_ INTEGER,
location VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the top fastest time, larger than 2, in Enugu?
| SELECT MAX(fastest_time__s_) FROM table_name_76 WHERE location = "enugu" AND rank > 2 | sql_create_context |
CREATE TABLE table_23180638_1 (
peak_position VARCHAR,
oricon_albums_chart VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many peak positions were there on the daily charts?
| SELECT peak_position FROM table_23180638_1 WHERE oricon_albums_chart = "Daily Charts" | sql_create_context |
CREATE TABLE table_name_24 (
score_in_the_final VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score on March 22, 1993?
| SELECT score_in_the_final FROM table_name_24 WHERE date = "march 22, 1993" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT demographic.insurance FROM demographic WHERE demographic.subject_id = "3284" | 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 jybgb.BBCJBW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 WHERE person_info.XM = ... | css |
CREATE TABLE table_43033 (
"Season" text,
"Team" text,
"Country" text,
"League" text,
"Level" real,
"Apps" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Goals for team Kairat, in the 2002 season with more t... | SELECT AVG("Goals") FROM table_43033 WHERE "Team" = 'kairat' AND "Season" = '2002' AND "Apps" > '29' | wikisql |
CREATE TABLE table_32382 (
"Stage" text,
"Date" text,
"Route" text,
"Terrain" text,
"Length" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has a Terrain of plain stage, and a Stage of 4?
| SELECT "Date" FROM table_32382 WHERE "Terrain" = 'plain stage' AND "Stage" = '4' | wikisql |
CREATE TABLE table_name_14 (
rider VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Rider had a Time of +1:08.291?
| SELECT rider FROM table_name_14 WHERE time = "+1:08.291" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.dod, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "15898" | mimicsql_data |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airport_servic... | 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 = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU... | atis |
CREATE TABLE table_name_18 (
runner_up VARCHAR,
rank VARCHAR,
champion VARCHAR,
fourth_place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the runner-up when champion is 0, 4th place is 0 and rank is 6?
| SELECT runner_up FROM table_name_18 WHERE champion = "0" AND fourth_place = "0" AND rank = 6 | 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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT HIRE_DATE, AVG(SALARY) FROM employees | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.