instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id nu... | 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 = 'replace trach tube') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31243) AND STRFTIME('%y', pr... | mimic_iii |
CREATE TABLE table_23286223_8 (
record VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record at the game where Deron Williams (6) did the high assists?
| SELECT record FROM table_23286223_8 WHERE high_assists = "Deron Williams (6)" | sql_create_context |
CREATE TABLE table_32295 (
"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 was the smallest crowd for a Carlton away g... | SELECT MIN("Crowd") FROM table_32295 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE table_12407 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player with a 70-68-74=212 score?
| SELECT "Player" FROM table_12407 WHERE "Score" = '70-68-74=212' | wikisql |
CREATE TABLE table_40552 (
"Race" text,
"Pole position" text,
"Fastest lap" text,
"Most laps led" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Winning Driver, when Fastest ... | SELECT "Winning driver" FROM table_40552 WHERE "Fastest lap" = 'ryan hunter-reay' AND "Most laps led" = 'ryan briscoe' | wikisql |
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 diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-866')) AND diagnosis.diagnosisname = 'acute pulmonary edema' ... | eicu |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
... | SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_name_22 (
crowd INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest crowd at victoria park?
| SELECT MIN(crowd) FROM table_name_22 WHERE venue = "victoria park" | sql_create_context |
CREATE TABLE gyb (
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_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '47601904' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 871.18) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '47601904' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k... | css |
CREATE TABLE table_255885_1 (
municipality VARCHAR,
area__km²_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the municipality that has an area of exactly 214.44 sq. km?
| SELECT municipality FROM table_255885_1 WHERE area__km²_ = "214.44" | sql_create_context |
CREATE TABLE table_34205 (
"Year" text,
"Flagship Station" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Studio host" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Year of 2006-07 had what studio host?
| SELECT "Studio host" FROM table_34205 WHERE "Year" = '2006-07' | wikisql |
CREATE TABLE table_name_99 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most bronze when the total is 14, and there are more than 6 gold?
| SELECT MAX(bronze) FROM table_name_99 WHERE total = 14 AND gold > 6 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.days_stay, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "17787" | mimicsql_data |
CREATE TABLE table_name_38 (
cpc_blend_kazakhstan INTEGER,
draugen_north_sea VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest CPC Blend Kazakhstan number when Draugen North Sea is 17?
| SELECT MIN(cpc_blend_kazakhstan) FROM table_name_38 WHERE draugen_north_sea = 17 | sql_create_context |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEP... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
... | SELECT Arrival, COUNT(Arrival) FROM train GROUP BY Arrival | nvbench |
CREATE TABLE table_name_26 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2007 value at the 2012 Grand Slam Tournaments?
| SELECT 2007 FROM table_name_26 WHERE 2012 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_2401326_1 (
kerry_percentage VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of the votes in Oneida did Kerry win?
| SELECT kerry_percentage FROM table_2401326_1 WHERE county = "Oneida" | sql_create_context |
CREATE TABLE table_14209455_1 (
mon_26_may VARCHAR,
fri_30_may VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what time is mon may 26 and fri may 30 is 18' 28.27 122.599mph?
| SELECT mon_26_may FROM table_14209455_1 WHERE fri_30_may = "18' 28.27 122.599mph" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
require... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Lisa Neidert%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = ... | advising |
CREATE TABLE table_55004 (
"Year" text,
"Make & Model" text,
"Length" text,
"Engine Type" text,
"Numbers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lenth of a 2003 Make & Model of nabi 35-lfw?
| SELECT "Length" FROM table_55004 WHERE "Year" = '2003' AND "Make & Model" = 'nabi 35-lfw' | wikisql |
CREATE TABLE gwyjzb (
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_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '邹承天' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '邹承天' GROUP BY fgwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_3 (
cultural_and_educational_panel INTEGER,
university_of_dublin VARCHAR,
administrative_panel VARCHAR,
agricultural_panel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the Cultural and Educational Panels t... | SELECT SUM(cultural_and_educational_panel) FROM table_name_3 WHERE administrative_panel > 1 AND agricultural_panel = 11 AND university_of_dublin < 3 | sql_create_context |
CREATE TABLE table_27293285_2 (
points_against VARCHAR,
points_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points against did the club who had 353 points for have?
| SELECT points_against FROM table_27293285_2 WHERE points_for = "353" | sql_create_context |
CREATE TABLE table_11209 (
"Player" text,
"Pos." text,
"From" text,
"School/Country" text,
"Rebs" real,
"Asts" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the school/country of the player with 337 assists?
| SELECT "School/Country" FROM table_11209 WHERE "Asts" = '337' | wikisql |
CREATE TABLE table_name_6 (
result VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHat was the result of the friendly match that was played on october 8, 2012?
| SELECT result FROM table_name_6 WHERE competition = "friendly match" AND date = "october 8, 2012" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | SELECT CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(7)) AS date, COUNT(1) AS answers FROM Posts WHERE PostTypeId = 2 GROUP BY CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(7)) ORDER BY date | sede |
CREATE TABLE table_name_83 (
career_w_l VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for Career W-L for the Grand Slam Tournaments?
| SELECT career_w_l FROM table_name_83 WHERE tournament = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_55643 (
"Round" real,
"Grand Prix" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Date" FROM table_55643 WHERE "Grand Prix" = 'australian grand prix' | wikisql |
CREATE TABLE table_54601 (
"Year" real,
"Date" text,
"Type" text,
"President" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location with a Year larger than 2011, and a President with herman van rompuy (2nd term), and a... | SELECT "Location" FROM table_54601 WHERE "Year" > '2011' AND "President" = 'herman van rompuy (2nd term)' AND "Date" = '28–29 june' AND "Type" = 'scheduled' | wikisql |
CREATE TABLE table_name_42 (
penalty VARCHAR,
team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the penalty for the DET team player Andreas Lilja?
| SELECT penalty FROM table_name_42 WHERE team = "det" AND player = "andreas lilja" | sql_create_context |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid... | SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Multiuser Receiver', 'Decision Feedback') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1 | scholar |
CREATE TABLE table_name_78 (
name VARCHAR,
snatch VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a Snatch of 157.0?
| SELECT name FROM table_name_78 WHERE snatch = "157.0" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
Revision... | SELECT FavoriteCount, COUNT(*), MIN(Id) AS "post_link" FROM Posts WHERE PostTypeId = 1 GROUP BY FavoriteCount ORDER BY FavoriteCount | sede |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY Name DESC | nvbench |
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, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT p.Id AS "post_link", CASE WHEN vt.Id = 15 THEN 'moderator review' WHEN vt.Id = 4 THEN 'offenisive' WHEN vt.Id = 12 THEN 'spam' END FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id INNER JOIN Posts AS p ON p.Id = v.PostId WHERE vt.Id IN (15, 4, 12) AND p.OwnerUserId = '##userid##' | sede |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 46590 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ptt'... | mimic_iii |
CREATE TABLE table_3356 (
"meas. num." real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every entry for descripti... | SELECT "description" FROM table_3356 WHERE "% YES" = '51.82%' | wikisql |
CREATE TABLE weather (
zip_code VARCHAR,
max_wind_Speed_mph VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each zip code, return how many times max wind speed reached 25?
| SELECT zip_code, COUNT(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code | sql_create_context |
CREATE TABLE table_name_71 (
built VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who built the conant creek pegram truss railroad bridge?
| SELECT built FROM table_name_71 WHERE name = "conant creek pegram truss railroad bridge" | 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '84177470' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate ... | WITH FirstQuestions AS (SELECT * FROM Posts AS Q WHERE Q.PostTypeId = 1 AND NOT EXISTS(SELECT * FROM Posts AS P WHERE P.OwnerUserId = Q.OwnerUserId AND P.PostTypeId = 1 AND P.CreationDate < Q.CreationDate)), UserQuestions AS (SELECT U.*, (CASE WHEN Q.Tags LIKE @Pattern THEN 1 ELSE 0 END) AS "isid" FROM Users AS U INNER... | sede |
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_MED_SER_ORG_NO = '0195557' AND t_kc22.SOC_SRT_DIRE_CD = '0152' | css |
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
)
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
-- Using valid SQLite, answer the following questions for the tab... | SELECT class FROM captain GROUP BY class HAVING COUNT(*) > 2 | spider |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '杨星波' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3838.71) | css |
CREATE TABLE table_1874 (
"Species" text,
"Common name" text,
"Trinidad" text,
"Tobago" text,
"Bocas Is." text,
"Other" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- are in tobago species liophis cobellus cobellus?
| SELECT "Tobago" FROM table_1874 WHERE "Species" = 'Liophis cobellus cobellus' | wikisql |
CREATE TABLE table_1067441_1 (
_in_€_ VARCHAR,
gdp_per_cap__2003 INTEGER,
province VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Friesland's gdp per capita?
| SELECT MIN(gdp_per_cap__2003), _in_€_ FROM table_1067441_1 WHERE province = "Friesland" | sql_create_context |
CREATE TABLE table_name_64 (
winning_score VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What winning score has in-kyung kim as the runner(s)-up?
| SELECT winning_score FROM table_name_64 WHERE runner_s__up = "in-kyung kim" | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
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... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 8 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_58794 (
"Name" text,
"Tournaments" real,
"Pro Debut" text,
"Top division debut" text,
"Highest rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Pro Debut, when Tournament is greater than 11, and when Highest Rank is 'M... | SELECT "Pro Debut" FROM table_58794 WHERE "Tournaments" > '11' AND "Highest rank" = 'maegashira 1' | wikisql |
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,... | SELECT COUNT(*) FROM wine WHERE winery = "Robert Biale" | spider |
CREATE TABLE table_73432 (
"P" real,
"Player" text,
"League" real,
"Scottish Cup" real,
"League Cup" real,
"Challenge Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did player 7 score in the challenge cup?
| SELECT COUNT("Challenge Cup") FROM table_73432 WHERE "P" = '7' | wikisql |
CREATE TABLE table_39558 (
"Paul McCartney" text,
"Stuart" text,
"McIntosh" text,
"Whitten" text,
"Linda McCartney" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Paul McCartney has a Linda McCartney of keyboards?
| SELECT "Paul McCartney" FROM table_39558 WHERE "Linda McCartney" = 'keyboards' | wikisql |
CREATE TABLE table_1597866_3 (
regular_judge VARCHAR,
host VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the regular judge when host is anja rubik
| SELECT regular_judge FROM table_1597866_3 WHERE host = "Anja Rubik" | sql_create_context |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE table_76811 (
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"1980" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is 1976 when 1980 is 2.0?
| SELECT "1976" FROM table_76811 WHERE "1980" = '2.0' | wikisql |
CREATE TABLE table_name_30 (
visitor VARCHAR,
home VARCHAR,
decision VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Visitor has a Home of vancouver, and a Decision of cloutier?
| SELECT visitor FROM table_name_30 WHERE home = "vancouver" AND decision = "cloutier" | sql_create_context |
CREATE TABLE table_23248967_5 (
location_attendance VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many locations was game 3 played at?
| SELECT COUNT(location_attendance) FROM table_23248967_5 WHERE game = 3 | sql_create_context |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1 | advising |
CREATE TABLE table_1998037_9 (
television_commentator VARCHAR,
radio_commentator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the television commentator when the radio commentator is Galyna Babiy?
| SELECT television_commentator FROM table_1998037_9 WHERE radio_commentator = "Galyna Babiy" | sql_create_context |
CREATE TABLE table_17483 (
"Rd." real,
"Grand Prix" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the report with fastest lap... | SELECT "Report" FROM table_17483 WHERE "Fastest lap" = 'Felipe Massa' AND "Winning driver" = 'Jenson Button' | 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.KSBM, jybgb.KSMC 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 = '沈... | css |
CREATE TABLE table_name_33 (
high_rebounds VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the highest rebounds on game 5?
| SELECT high_rebounds FROM table_name_33 WHERE game = 5 | sql_create_context |
CREATE TABLE table_70525 (
"Name" text,
"Country" text,
"Status" text,
"Transfer window" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows as the status for the name of de la red?
| SELECT "Status" FROM table_70525 WHERE "Name" = 'de la red' | wikisql |
CREATE TABLE table_name_76 (
draw INTEGER,
english_translation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the English translation Someone Like You, what is the lowest draw?
| SELECT MIN(draw) FROM table_name_76 WHERE english_translation = "someone like you" | sql_create_context |
CREATE TABLE table_name_87 (
bronze_medals VARCHAR,
silver_medals VARCHAR,
gold_medals VARCHAR,
total_medals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of bronze medals when gold medals was 2, total medals more than 4 and si... | SELECT COUNT(bronze_medals) FROM table_name_87 WHERE gold_medals = 2 AND total_medals > 4 AND silver_medals < 5 | sql_create_context |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz... | css |
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '62645586' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ... | css |
CREATE TABLE table_9396 (
"Year" real,
"Manufacturer" text,
"Start" text,
"Finish" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the start when the finish is 1?
| SELECT "Start" FROM table_9396 WHERE "Finish" = '1' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,... | SELECT MAX(CreationDate) FROM Comments | sede |
CREATE TABLE table_name_74 (
host_city VARCHAR,
silver VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Host City has more than 6 Silver and a Total of 22?
| SELECT host_city FROM table_name_74 WHERE silver > 6 AND total = 22 | sql_create_context |
CREATE TABLE table_394 (
"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 was... | SELECT "Location Attendance" FROM table_394 WHERE "High points" = 'Pierce (22)' | wikisql |
CREATE TABLE table_name_40 (
novelty VARCHAR,
name VARCHAR,
status VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the novel that has a valid status, located in Mongolia, and named Prenocephale?
| SELECT novelty FROM table_name_40 WHERE status = "valid" AND location = "mongolia" AND name = "prenocephale" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Opn rt hemicolectomy NEC" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | SELECT MZZYZDZZBM FROM zyjzjlb WHERE JZLSH = '49009000615' | css |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating number,
languages text,
releasedate time,
resolution number
)
... | SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE table_203_640 (
id number,
"name" text,
"college" text,
"years" text,
"reign" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which monarchs attended the same college at the university of oxford as seretse khama ?
| SELECT "name" FROM table_203_640 WHERE "name" <> 'seretse khama' AND "college" = (SELECT "college" FROM table_203_640 WHERE "name" = 'seretse khama') | squall |
CREATE TABLE table_2560 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT MIN("Wins") FROM table_2560 | wikisql |
CREATE TABLE table_name_27 (
score VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which score has t3 as the place?
| SELECT score FROM table_name_27 WHERE place = "t3" | sql_create_context |
CREATE TABLE table_18893428_1 (
location VARCHAR,
constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the car that has a constructor of Lorraine-Dietrich?
| SELECT location FROM table_18893428_1 WHERE constructor = "Lorraine-Dietrich" | sql_create_context |
CREATE TABLE table_name_51 (
surface VARCHAR,
outcome VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the surface when the opponent was judith wiesner, and the outcome was winner?
| SELECT surface FROM table_name_51 WHERE outcome = "winner" AND opponent = "judith wiesner" | sql_create_context |
CREATE TABLE table_name_52 (
partner VARCHAR,
surface VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the partner that played a match on a grass court?
| SELECT partner FROM table_name_52 WHERE surface = "grass" | sql_create_context |
CREATE TABLE attribute_definitions (
attribute_id number,
attribute_name text,
attribute_data_type text
)
CREATE TABLE catalog_contents_additional_attributes (
catalog_entry_id number,
catalog_level_number number,
attribute_id number,
attribute_value text
)
CREATE TABLE catalog_contents (
... | SELECT catalog_level_name, catalog_level_number FROM catalog_structure WHERE catalog_level_number BETWEEN 5 AND 10 | spider |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-47098' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-47098' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_2822 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name th... | SELECT "High points" FROM table_2822 WHERE "Score" = 'L 109–112 (OT)' | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varc... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_47438 (
"Year" real,
"Nominated/Won" text,
"Award/category" text,
"Festival/organization" text,
"Role" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What role was nominated at the Sydney Film Festival?
| SELECT "Role" FROM table_47438 WHERE "Festival/organization" = 'sydney film festival' | wikisql |
CREATE TABLE table_name_32 (
laps INTEGER,
driver VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average laps for ralph firman with a grid of over 19?
| SELECT AVG(laps) FROM table_name_32 WHERE driver = "ralph firman" AND grid > 19 | 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 Users."count" FROM (SELECT COUNT(*) AS "count", CreationDate FROM Users GROUP BY CreationDate) AS users | sede |
CREATE TABLE table_name_43 (
competition VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the competition in 2003?
| SELECT competition FROM table_name_43 WHERE year = 2003 | sql_create_context |
CREATE TABLE customers (
customer_id number,
customer_name text
)
CREATE TABLE claims (
claim_id number,
fnol_id number,
effective_date time
)
CREATE TABLE available_policies (
policy_id number,
policy_type_code text,
customer_phone text
)
CREATE TABLE services (
service_id number... | SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_... | spider |
CREATE TABLE table_57908 (
"Year" real,
"Title" text,
"Original channel" text,
"Role" text,
"Note" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the original channel when the note is co-star in year 2012?
| SELECT "Original channel" FROM table_57908 WHERE "Note" = 'co-star' AND "Year" = '2012' | wikisql |
CREATE TABLE table_name_86 (
innings INTEGER,
runs VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest number of innings with less than 342 runs and more than 4 matches?
| SELECT MAX(innings) FROM table_name_86 WHERE runs < 342 AND matches > 4 | sql_create_context |
CREATE TABLE table_18007 (
"No." real,
"#" 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.
-- What is the O... | SELECT "Original air date" FROM table_18007 WHERE "Written by" = 'Peter Ocko' | wikisql |
CREATE TABLE t_kc21 (
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '云光霁' AND t_kc21.MED_SER_ORG_NO = '2394218' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%他%' | css |
CREATE TABLE table_name_72 (
score VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the match in which mardy fish was the partner?
| SELECT score FROM table_name_72 WHERE partner = "mardy fish" | sql_create_context |
CREATE TABLE table_10592536_8 (
date_of_appointment VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of appointment when replaced by is roy hodgson?
| SELECT date_of_appointment FROM table_10592536_8 WHERE replaced_by = "Roy Hodgson" | sql_create_context |
CREATE TABLE table_203_450 (
id number,
"team" text,
"outgoing manager" text,
"manner of departure" text,
"date of vacancy" text,
"replaced by" text,
"date of appointment" text,
"position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "team" FROM table_203_450 WHERE "position in table" = 5 | squall |
CREATE TABLE table_name_62 (
date VARCHAR,
round VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the match take place in a round of 1r and have a result 2 6, 5 7, 2 6?
| SELECT date FROM table_name_62 WHERE round = "1r" AND result = "2–6, 5–7, 2–6" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.