instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_17 (
player VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Opponent is source: . last updated: 28 june 2007.?
| SELECT player FROM table_name_17 WHERE opponent = "source: . last updated: 28 june 2007." | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "30" AND demographic.admityear >= "2195" | mimicsql_data |
CREATE TABLE table_68133 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Kerry number does Taylor county have with more than 65 others#?... | SELECT COUNT("Kerry#") FROM table_68133 WHERE "County" = 'taylor' AND "Others#" > '65' | wikisql |
CREATE TABLE table_203_295 (
id number,
"position" number,
"driver / passenger" text,
"equipment" text,
"points" number,
"wins" number,
"second" number,
"third" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of point... | SELECT "points" FROM table_203_295 WHERE "driver / passenger" = 'maris rupeiks' | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "BUSP10" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_47455 (
"Election" text,
"Candidate" text,
"Number of votes" text,
"Share of votes" text,
"Outcome of election" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the election with an outcome of ndc opposition and 2,728,241 vo... | SELECT "Election" FROM table_47455 WHERE "Outcome of election" = 'ndc opposition' AND "Number of votes" = '2,728,241' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52604 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) | mimic_iii |
CREATE TABLE table_48144 (
"Season" text,
"GP\u2013GS" text,
"Comp\u2013Att" text,
"Pct." text,
"Yards" text,
"Long" text,
"Avg/G" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the completion/attempts value for the year with an aver... | SELECT "Comp\u2013Att" FROM table_48144 WHERE "Avg/G" = '36.5' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'warfarin sodium 2.5 mg po tabs') | eicu |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name... | WITH Raw AS (SELECT UserId, DATEFROMPARTS(TIME_TO_STR(Date, '%Y'), TIME_TO_STR(Date, '%M'), TIME_TO_STR(Date, '%-d')) AS Date FROM Badges) SELECT UserId, UserId AS "user_link", Date, COUNT(*) AS N FROM Raw GROUP BY UserId, Date ORDER BY N DESC, UserId LIMIT 100 | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND diagnoses.long_title = "Abdominal pain, other specified site" | mimicsql_data |
CREATE TABLE table_name_75 (
drawn VARCHAR,
tries_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the draw when the tries against was 69?
| SELECT drawn FROM table_name_75 WHERE tries_against = "69" | sql_create_context |
CREATE TABLE table_12277 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Outcome that has a Tournament of milan , italy?
| SELECT "Outcome" FROM table_12277 WHERE "Tournament" = 'milan , italy' | wikisql |
CREATE TABLE table_name_1 (
upper_index_kcal__nm_3 INTEGER,
upper_index_mj__nm_3 VARCHAR,
lower_index_mj__nm_3 VARCHAR,
fuel_gas VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the entry for Upper index Kcal/ Nm 3 for the row with an entry tha... | SELECT SUM(upper_index_kcal__nm_3) FROM table_name_1 WHERE lower_index_mj__nm_3 > 47.91 AND fuel_gas = "propylene" AND upper_index_mj__nm_3 > 77.04 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2065')) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-2 year') | eicu |
CREATE TABLE table_14669 (
"Team" text,
"Manager" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the captain for the manufacturer Pony, and the manager Harry Redknapp?
| SELECT "Captain" FROM table_14669 WHERE "Kit manufacturer" = 'pony' AND "Manager" = 'harry redknapp' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_58610 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the overall total for players drafted from notre dame?
| SELECT SUM("Overall") FROM table_58610 WHERE "College" = 'notre dame' | wikisql |
CREATE TABLE table_name_37 (
builder VARCHAR,
country VARCHAR,
ship VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the builder of Brage from Norway?
| SELECT builder FROM table_name_37 WHERE country = "norway" AND ship = "brage" | sql_create_context |
CREATE TABLE table_name_59 (
place VARCHAR,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of places which has played more than 18
| SELECT COUNT(place) FROM table_name_59 WHERE played > 18 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2165" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int... | SELECT Name, Age FROM artist | nvbench |
CREATE TABLE table_74793 (
"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 what venue did an away team score 10.15 (75)?... | SELECT "Venue" FROM table_74793 WHERE "Away team score" = '10.15 (75)' | wikisql |
CREATE TABLE table_15456 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue has a Result of draw?
| SELECT "Venue" FROM table_15456 WHERE "Result" = 'draw' | wikisql |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE dual_carrier... | SELECT DISTINCT fare_basis_code FROM fare_basis | atis |
CREATE TABLE table_name_64 (
draw INTEGER,
artist VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average draw for Desi Dobreva, was it less than 6?
| SELECT AVG(draw) FROM table_name_64 WHERE artist = "desi dobreva" AND place < 6 | sql_create_context |
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_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE table_13535 (
"Event" text,
"Record" text,
"Nationality" text,
"Date" text,
"Games" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record of the 1991 Port of Spain Games?
| SELECT "Record" FROM table_13535 WHERE "Games" = '1991 port of spain' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC | nvbench |
CREATE TABLE table_43595 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many in total were in attendance at games where Chelsea was the away team?
| SELECT SUM("Attendance") FROM table_43595 WHERE "Away team" = 'chelsea' | wikisql |
CREATE TABLE table_74109 (
"Year (Ceremony)" text,
"English title" text,
"Spanish title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the English title fo the film that was a nominee?
| SELECT "English title" FROM table_74109 WHERE "Result" = 'Nominee' | wikisql |
CREATE TABLE table_24535095_2 (
crew_chief VARCHAR,
listed_owner_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the crew chief for rhonda thorson
| SELECT crew_chief FROM table_24535095_2 WHERE listed_owner_s_ = "Rhonda Thorson" | sql_create_context |
CREATE TABLE table_name_1 (
acquired VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who acquired tom norton?
| SELECT acquired FROM table_name_1 WHERE player = "tom norton" | sql_create_context |
CREATE TABLE table_29722 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who ha... | SELECT "High rebounds" FROM table_29722 WHERE "Game" = '69' | wikisql |
CREATE TABLE table_name_12 (
attendance VARCHAR,
away_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance total when Southend Manor is the away team and there are less than 93 ties?
| SELECT COUNT(attendance) FROM table_name_12 WHERE away_team = "southend manor" AND tie_no < 93 | sql_create_context |
CREATE TABLE table_name_97 (
points VARCHAR,
placings VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Points for the couple ranking 17 with Placings larger than 100?
| SELECT points FROM table_name_97 WHERE placings > 100 AND rank = 17 | sql_create_context |
CREATE TABLE table_7581 (
"1900s" real,
"1920s" real,
"1930s" real,
"1940s" real,
"1950s" real,
"1960s" real,
"1970s" real,
"1980s" real,
"1990s" real,
"2000s to date" real,
"Total to date" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT MIN("Total to date") FROM table_7581 WHERE "1980s" > '2' | wikisql |
CREATE TABLE table_2437 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whe... | SELECT "Tournament Venue (City)" FROM table_2437 WHERE "Regular Season Winner" = 'Weber State' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'elvtd prstate spcf antgn') AND STRFTIME('%y', diagnoses_icd.charttime) <= ... | mimic_iii |
CREATE TABLE table_25820786_2 (
win_loss VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the win-loss record for the player from Switzerland?
| SELECT win_loss FROM table_25820786_2 WHERE nationality = "Switzerland" | sql_create_context |
CREATE TABLE table_66566 (
"Year" text,
"Location" text,
"Gold" text,
"Silver" text,
"Bronze" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who received the bronze in 2011?
| SELECT "Bronze" FROM table_66566 WHERE "Year" = '2011' | wikisql |
CREATE TABLE table_203_93 (
id number,
"incumbent" text,
"reason for vacancy" text,
"appointed successor" text,
"date of appointment" text,
"elected successor" text,
"date of election" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was a... | SELECT "incumbent" FROM table_203_93 WHERE "date of appointment" < (SELECT "date of appointment" FROM table_203_93 WHERE "incumbent" = 'h. w. whillock') ORDER BY "date of appointment" DESC LIMIT 1 | squall |
CREATE TABLE table_name_28 (
party VARCHAR,
mayor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party was achille variati afilliated with?
| SELECT party FROM table_name_28 WHERE mayor = "achille variati" | 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 gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '苗慧捷' AND t_kc22.STA_DATE BETWEEN '2004-08-29' AND '2014-05-22' AND t_kc22.SELF_PAY_PRO < 0.71 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERS... | css |
CREATE TABLE table_53397 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Hakka" text,
"Area" real,
"Population" real,
"Density" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of densi... | SELECT COUNT("Density") FROM table_53397 WHERE "Population" > '393,390' | wikisql |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Statem... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code | nvbench |
CREATE TABLE table_1708050_3 (
poles INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most poles
| SELECT MIN(poles) FROM table_1708050_3 | sql_create_context |
CREATE TABLE table_2591 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many series numbers do ... | SELECT COUNT("No. in series") FROM table_2591 WHERE "Original air date" = 'October 28, 1990' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'ventr... | eicu |
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 jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '00808054413' | css |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '8991941' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 23 | css |
CREATE TABLE table_204_852 (
id number,
"year" number,
"film" text,
"language" text,
"character" text,
"co-star" text,
"music" text,
"banner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which year did the actress star in the most movi... | SELECT "year" FROM table_204_852 GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_44866 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much total money does player tommy bolt, who has a to par of 9, have?
| SELECT COUNT("Money ( $ )") FROM table_44866 WHERE "To par" = '9' AND "Player" = 'tommy bolt' | wikisql |
CREATE TABLE table_37381 (
"Train Number" text,
"Train Name" text,
"Origin" text,
"Destination" text,
"Frequency (inbound/outbound)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the destination of the rail with Dhanbad as the origin?
| SELECT "Destination" FROM table_37381 WHERE "Origin" = 'dhanbad' | wikisql |
CREATE TABLE table_24663 (
"Model" text,
"Engine" text,
"Power@rpm" text,
"torque@rpm" text,
"0\u2013100km/h acceleration" text,
"Top speed" text,
"Transmission" text,
"CO 2 emissions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name ... | SELECT "0\u2013100km/h acceleration" FROM table_24663 WHERE "Power@rpm" = 'PS (kW; hp) @5400' | wikisql |
CREATE TABLE table_name_95 (
points VARCHAR,
goals_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the points if the goals against were 260?
| SELECT points FROM table_name_95 WHERE goals_against = "260" | sql_create_context |
CREATE TABLE table_204_281 (
id number,
"map or catalog" text,
"creator" text,
"time created" text,
"contets" text,
"links" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which was the first chinese star map known to have been created ?
| SELECT "map or catalog" FROM table_204_281 ORDER BY id LIMIT 1 | squall |
CREATE TABLE table_75999 (
"Rank" real,
"College" text,
"First Season" real,
"Seasons" real,
"Wins" real,
"Losses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of First Season games with 1537 Wins and a Season greater than 10... | SELECT SUM("First Season") FROM table_75999 WHERE "Wins" = '1537' AND "Seasons" > '109' | wikisql |
CREATE TABLE table_20587 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" text,
"Left" text,
"Current Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the... | SELECT MAX("Founded") FROM table_20587 WHERE "Nickname" = 'Blue Hose' | 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 t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '86201848' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4274.44) | css |
CREATE TABLE table_203_133 (
id number,
"year" number,
"japanese title" text,
"english title" text,
"role" text,
"network" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total role in the year 2008 ?
| SELECT COUNT("role") FROM table_203_133 WHERE "year" = 2008 | squall |
CREATE TABLE table_20195922_3 (
divisions VARCHAR,
number_of_winning_tickets VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which divisions have 565 as the number of winning tickets?
| SELECT divisions FROM table_20195922_3 WHERE number_of_winning_tickets = 565 | sql_create_context |
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 bdmzjzjlb (
CYBQDM text,
CYBQ... | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSDM = '948' AND wdmzjzjlb.RYDJSJ BETWEEN '2016-10-07' AND '2020-12-24' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSDM = '948' AND bdmzjzjlb.RYDJSJ BETWEEN '2016-10-07' AND '2020-12-24' | css |
CREATE TABLE table_17311797_10 (
score VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in game 81?
| SELECT score FROM table_17311797_10 WHERE game = 81 | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-50177' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_65548 (
"Position" real,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the A Score when the B Score was 9.05, and position was larger than 6?
| SELECT AVG("A Score") FROM table_65548 WHERE "B Score" = '9.05' AND "Position" > '6' | wikisql |
CREATE TABLE table_31932 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the record for kazuhiro nakamura
| SELECT "Record" FROM table_31932 WHERE "Opponent" = 'kazuhiro nakamura' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND demographic.age < "85" | mimicsql_data |
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation... | SELECT keyword.keyword FROM conference, keyword, publication, publication_keyword WHERE conference.name = 'VLDB' AND publication_keyword.kid = keyword.kid AND publication.cid = conference.cid AND publication.pid = publication_keyword.pid GROUP BY keyword.keyword ORDER BY COUNT(DISTINCT (publication.title)) DESC LIMIT 1 | academic |
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,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) | nvbench |
CREATE TABLE table_2784 (
"Release" text,
"Oricon Albums Chart" text,
"Peak Position" real,
"Debut Sales (copies)" real,
"Sales Total (copies)" real,
"Chart Run" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many peak positions were there o... | SELECT COUNT("Peak Position") FROM table_2784 WHERE "Oricon Albums Chart" = 'Weekly Charts' | wikisql |
CREATE TABLE table_train_233 (
"id" int,
"serum_bicarbonate" int,
"language" string,
"hemoglobin_a1c_hba1c" float,
"creatinine_clearance_cl" float,
"admission_blood_glucose" int,
"urine_albumin" int,
"ketoacidosis" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answe... | SELECT * FROM table_train_233 WHERE age >= 18 AND age <= 45 | criteria2sql |
CREATE TABLE table_72588 (
"Position" real,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Corrected time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who we... | SELECT "Skipper" FROM table_72588 WHERE "Corrected time d:hh:mm:ss" = '3:15:07:27' | wikisql |
CREATE TABLE table_33678 (
"Team" text,
"Wins" real,
"Losses" real,
"Percentage" real,
"Home" text,
"Away" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of losses that a team who had an away record ... | SELECT MAX("Losses") FROM table_33678 WHERE "Away" = '1-6' AND "Wins" > '4' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND DAYS_1.day_name = ... | atis |
CREATE TABLE table_name_45 (
wins INTEGER,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the lowest wins for Australia?
| SELECT MIN(wins) FROM table_name_45 WHERE country = "australia" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT Title, Id, Score FROM Posts WHERE Score < -100 | sede |
CREATE TABLE table_66736 (
"Representative" text,
"Years" text,
"State" text,
"Party" text,
"Lifespan" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- James Hutchins Johnson, from New Hampshire, served during what years?
| SELECT "Years" FROM table_66736 WHERE "State" = 'new hampshire' AND "Representative" = 'james hutchins johnson' | wikisql |
CREATE TABLE table_37441 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the class A with class AAAA of longview pine tree and school y... | SELECT "Class A" FROM table_37441 WHERE "Class AAAA" = 'longview pine tree' AND "School Year" = '1995-96' | wikisql |
CREATE TABLE table_77232 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of rounds that has a pick of 9 and is named jim pyburn?
| SELECT SUM("Round") FROM table_77232 WHERE "Pick" = '9' AND "Name" = 'jim pyburn' | wikisql |
CREATE TABLE table_name_32 (
score VARCHAR,
outcome VARCHAR,
edition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Outcome is Loser, and when Edition is 2011?
| SELECT score FROM table_name_32 WHERE outcome = "loser" AND edition = 2011 | sql_create_context |
CREATE TABLE Customer_Payments (
customer_id VARCHAR
)
CREATE TABLE Customers (
customer_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the number of customers that did not have any payment history.
| SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments) | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '沙眼' AND jyjgzbb.JCZBMC = '甘油三酯' | css |
CREATE TABLE table_21604 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High assists" FROM table_21604 WHERE "Game" = '80' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BOWEL OBSTRUCTION" | mimicsql_data |
CREATE TABLE table_name_8 (
syndicate VARCHAR,
yacht VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which syndicate is associated with the stars & stripes yacht?
| SELECT syndicate FROM table_name_8 WHERE yacht = "stars & stripes" | sql_create_context |
CREATE TABLE table_name_26 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2006 when the 2010 is 27
| SELECT 2006 FROM table_name_26 WHERE 2010 = "27" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE table_203_735 (
id number,
"rd" number,
"pick" number,
"player" text,
"position" text,
"school" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was picked after frank burns ?
| SELECT "player" FROM table_203_735 WHERE "pick" > (SELECT "pick" FROM table_203_735 WHERE "player" = 'frank burns') ORDER BY "pick" LIMIT 1 | squall |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2087" AND procedures.icd9_code = "966" | mimicsql_data |
CREATE TABLE table_78199 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mean road number when Moe Lemay is the player?
| SELECT AVG("Rd #") FROM table_78199 WHERE "Player" = 'moe lemay' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Research for the Social Sciences or Humanities%' AND NOT instructor.name LIKE '%Lara%' AND offering_instr... | advising |
CREATE TABLE table_11572 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average grid for giorgio pantano?
| SELECT AVG("Grid") FROM table_11572 WHERE "Driver" = 'giorgio pantano' | 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_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY Team_ID DESC | nvbench |
CREATE TABLE table_23128286_1 (
flaps INTEGER,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many flaps did he have when he had 109 points?
| SELECT MAX(flaps) FROM table_23128286_1 WHERE points = 109 | sql_create_context |
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.icd9_code = "45829" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address ... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_204_48 (
id number,
"date" text,
"race name" text,
"location" text,
"uci rating" text,
"winner" text,
"team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the winner name and team for the copa am rica de ciclismo ... | SELECT "winner", "team" FROM table_204_48 WHERE "race name" = 'copa america de ciclismo' | squall |
CREATE TABLE table_8121 (
"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.
-- Which Runner(s)-up has a Date of may 19, 1973?
| SELECT "Runner(s)-up" FROM table_8121 WHERE "Date" = 'may 19, 1973' | wikisql |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BALTIMORE' AND ground_service.... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.