instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_4 (
event VARCHAR,
res VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Event resulted in a Win for Opponent, Shane Ott?
| SELECT event FROM table_name_4 WHERE res = "win" AND opponent = "shane ott" | sql_create_context |
CREATE TABLE table_204_671 (
id number,
"airing\ndate" text,
"english title\n(chinese title)" text,
"number of episodes" number,
"main cast" text,
"theme song (t)\nsub-theme song (st)" text,
"genre" text,
"notes" text,
"official website" text
)
-- Using valid SQLite, answer the fol... | SELECT COUNT(*) FROM table_204_671 WHERE "number of episodes" < 20 | squall |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT lab.fluid FROM lab WHERE lab.subject_id = "6983" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2203" AND procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)" | mimicsql_data |
CREATE TABLE table_204_465 (
id number,
"#" number,
"temple name" text,
"hangul" text,
"hanja" text,
"period of reign" text,
"personal name" text,
"relationship" text,
"note" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was th... | SELECT "temple name" FROM table_204_465 WHERE "#" = 1 | squall |
CREATE TABLE table_name_45 (
attendance INTEGER,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Loss of francis (4 9) has what highest attendance figure?
| SELECT MAX(attendance) FROM table_name_45 WHERE loss = "francis (4–9)" | sql_create_context |
CREATE TABLE table_13426649_1 (
written_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode with production code 1ANJ01?
| SELECT written_by FROM table_13426649_1 WHERE production_code = "1ANJ01" | sql_create_context |
CREATE TABLE table_name_93 (
week INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week has a result L 56-3?
| SELECT AVG(week) FROM table_name_93 WHERE result = "l 56-3" | sql_create_context |
CREATE TABLE table_name_31 (
years VARCHAR,
nationality VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the years for spain with 215 goals
| SELECT years FROM table_name_31 WHERE nationality = "spain" AND goals = 215 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | SELECT t.TagName, p.Body FROM Posts AS p LEFT JOIN Tags AS t ON t.ExcerptPostId = p.Id WHERE t.Id > 0 AND p.PostTypeId = 4 AND LENGTH(p.Body) < 35 ORDER BY t.TagName | sede |
CREATE TABLE table_name_98 (
roll VARCHAR,
area VARCHAR,
decile VARCHAR,
authority VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total roll with a decile less than 7, and an authority of state, in the Macraes Flat area?
| SELECT COUNT(roll) FROM table_name_98 WHERE decile = 7 AND authority = "state" AND area = "macraes flat" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 T... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '9519124' AND qtb.MED_ORG_DEPT_NM = '小儿青光眼科' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '9519124' AND gyb.MED_ORG_DEPT_NM = '小儿青光眼科' UNION SELECT zyb.MED_CLINIC_ID... | css |
CREATE TABLE table_48541 (
"Gatchaman" text,
"Eagle Riders" text,
"Rank" text,
"Bird Uniform" text,
"Weapon" text,
"Mecha" text,
"Japanese voice actor" text,
"Voice actor (Eagle Riders)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Bird Uniform" FROM table_48541 WHERE "Rank" = 'g2' | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'calcium carbonate' AND DATETIME(prescriptions.startdate, 'start o... | mimic_iii |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 varchar(12),
CITY ... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_31490 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the civil parishes of the townlands with an area of 119 acres?
| SELECT "Civil parish" FROM table_31490 WHERE "Area( acres )" = '119' | wikisql |
CREATE TABLE table_24162080_3 (
date_of_appointment VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 1. fc k ln is the team what is the date of appointment?
| SELECT date_of_appointment FROM table_24162080_3 WHERE team = "1. FC Köln" | sql_create_context |
CREATE TABLE table_34539 (
"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 tournament was held on 9 Jun 2002?
| SELECT "Tournament" FROM table_34539 WHERE "Date" = '9 jun 2002' | wikisql |
CREATE TABLE table_23286158_9 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the game when the record was 37-27?
| SELECT score FROM table_23286158_9 WHERE record = "37-27" | sql_create_context |
CREATE TABLE table_43225 (
"Card" text,
"Weight Class" text,
"Round" real,
"Time" text,
"Method" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the time for a round less than 3?
| SELECT "Time" FROM table_43225 WHERE "Round" < '3' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.insurance = "Government" | mimicsql_data |
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.name, course.number, program_course.workload FROM course, program_course WHERE course.department LIKE '%ACC%' AND program_course.course_id = course.course_id AND program_course.workload < 3 | advising |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDa... | SELECT Id AS "post_link", CreationDate FROM Posts WHERE (Body LIKE '%##keyword##%') ORDER BY CreationDate DESC LIMIT 100 | sede |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | 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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 152... | mimic_iii |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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),
EMAIL varch... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_17790 (
"Day (see Irregularities )" text,
"Sunday Day One" text,
"Monday Day Two" text,
"Tuesday Day Three" text,
"Wednesday Day Four" text,
"Thursday Day Five" text,
"Friday Day Six" text,
"Saturday Day Seven" text
)
-- Using valid SQLite, answer the following quest... | SELECT "Tuesday Day Three" FROM table_17790 WHERE "Thursday Day Five" = 'Kamis' | wikisql |
CREATE TABLE table_58357 (
"Position" text,
"Game 1" text,
"Game 2" text,
"Game 3" text,
"Game 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During Game 2, which position did Andrew Farrar play?
| SELECT "Position" FROM table_58357 WHERE "Game 2" = 'andrew farrar' | wikisql |
CREATE TABLE table_8247 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance of the match with Carlisle united as the home team?
| SELECT "Attendance" FROM table_8247 WHERE "Home team" = 'carlisle united' | wikisql |
CREATE TABLE table_37436 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date was held at Laguna Seca Raceway, in class GTX/GTO?
| SELECT "Date" FROM table_37436 WHERE "Circuit" = 'laguna seca raceway' AND "Class" = 'gtx/gto' | wikisql |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average age for all people in the tabl... | SELECT AVG(age) FROM person | spider |
CREATE TABLE table_39314 (
"Player" text,
"Played" real,
"Legs Won" real,
"Legs Lost" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many legs we... | SELECT SUM("Legs Won") FROM table_39314 WHERE "100+" < '84' AND "Legs Lost" < '14' AND "Played" < '3' | wikisql |
CREATE TABLE table_name_3 (
mult VARCHAR,
part_number_s_ VARCHAR,
socket VARCHAR,
voltage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Socket of fcbga1088, and a Voltage of 1v, and a Part number(s) of nu80579ez600cnu80579ez600ct is what mult?
| SELECT mult FROM table_name_3 WHERE socket = "fcbga1088" AND voltage = "1v" AND part_number_s_ = "nu80579ez600cnu80579ez600ct" | sql_create_context |
CREATE TABLE table_name_12 (
overall VARCHAR,
nationality VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for Canada during round 2?
| SELECT overall FROM table_name_12 WHERE nationality = "canada" AND round = 2 | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 511 AND NOT instructor.name LIKE '%Daniel Irvine%' AND offering_instructor.instructor_id = instructor.instructor_id AND offe... | advising |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2640814' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-03-08' AND '2019-01-15' GROUP B... | css |
CREATE TABLE table_24853015_1 (
date VARCHAR,
class_b_winner VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Alan Hutcheson won Class B on round 1?
| SELECT date FROM table_24853015_1 WHERE class_b_winner = "Alan Hutcheson" AND round = 1 | sql_create_context |
CREATE TABLE table_204_735 (
id number,
"rank" number,
"team" text,
"names" text,
"time" text,
"qualification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team ranked after germany while qualifying ?
| SELECT "team" FROM table_204_735 WHERE "rank" = (SELECT "rank" FROM table_204_735 WHERE "team" = 'germany') + 1 | squall |
CREATE TABLE table_25034 (
"Year" text,
"Network" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Ice level reporters" text,
"Studio host" text,
"Studio analysts" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which play-by-play has... | SELECT "Play-by-play" FROM table_25034 WHERE "Studio analysts" = 'Mike Milbury' AND "Ice level reporters" = 'Darren Pang' | wikisql |
CREATE TABLE table_4283 (
"Umpire" text,
"Country" text,
"Panel" text,
"Matches" real,
"WC Matches" real,
"2011 WC" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in which country whe wc maches was 15
| SELECT "Country" FROM table_4283 WHERE "WC Matches" = '15' | wikisql |
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_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9480840' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other anomalies of larynx, trachea, and bronchus" | mimicsql_data |
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_ID = '79161122' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 2229.22) | css |
CREATE TABLE table_66213 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the notes when the time is 7:58.71?
| SELECT "Notes" FROM table_66213 WHERE "Time" = '7:58.71' | wikisql |
CREATE TABLE table_15887683_6 (
hdtv VARCHAR,
n° VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the hdtv when number is 378
| SELECT hdtv FROM table_15887683_6 WHERE n° = 378 | sql_create_context |
CREATE TABLE table_13762472_4 (
high_rebounds VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who had all the high rebounds when high assists is by dwyane wade (9)
| SELECT high_rebounds FROM table_13762472_4 WHERE high_assists = "Dwyane Wade (9)" | sql_create_context |
CREATE TABLE table_9343 (
"Episode" text,
"7 Deadly Sin" text,
"Challenge Winner" text,
"Challenge Loser" text,
"Voted In To 'El Duelo'" text,
"Eliminated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode has a 7 Deadly Sin of fire?
| SELECT "Episode" FROM table_9343 WHERE "7 Deadly Sin" = 'fire' | wikisql |
CREATE TABLE table_name_37 (
rank VARCHAR,
tally VARCHAR,
opposition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Rank has a Tally of 0-10, and an Opposition of cork?
| SELECT COUNT(rank) FROM table_name_37 WHERE tally = "0-10" AND opposition = "cork" | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7349327' AND t_kc22.STA_DATE BETWEEN '2012-03-19' AND '2013-05-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_11677691_1 (
college VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players attended Hillcrest High School?
| SELECT COUNT(college) FROM table_11677691_1 WHERE school = "Hillcrest High school" | sql_create_context |
CREATE TABLE table_name_52 (
shigella VARCHAR,
yersinia VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the shigella for yersinia yopb
| SELECT shigella FROM table_name_52 WHERE yersinia = "yopb" | sql_create_context |
CREATE TABLE playlisttrack (
playlistid number,
trackid number
)
CREATE TABLE employee (
employeeid number,
lastname text,
firstname text,
title text,
reportsto number,
birthdate time,
hiredate time,
address text,
city text,
state text,
country text,
postalcode t... | SELECT COUNT(*) FROM mediatype AS T1 JOIN track AS T2 ON T1.mediatypeid = T2.mediatypeid WHERE T1.name = "AAC audio file" | spider |
CREATE TABLE table_65665 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the duration of the character Bartha Zsolt?
| SELECT "Duration" FROM table_65665 WHERE "Character" = 'bartha zsolt' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT demographic.gender, demographic.religion FROM demographic WHERE demographic.subject_id = "71798" | mimicsql_data |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE STUDENT ... | SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY COUNT(CRS_CODE) | nvbench |
CREATE TABLE table_19115414_4 (
stage__winner_ VARCHAR,
team_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of stage winners for team columbia
| SELECT COUNT(stage__winner_) FROM table_19115414_4 WHERE team_classification = "Team Columbia" | sql_create_context |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE Plays_Games (
S... | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName | nvbench |
CREATE TABLE table_24108789_6 (
_number INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number for steve stricker
| SELECT MAX(_number) FROM table_24108789_6 WHERE player = "Steve Stricker" | sql_create_context |
CREATE TABLE table_79790 (
"Vehicle Flight #" text,
"Date" text,
"Pilot" text,
"Velocity (km/h)" real,
"Altitude (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- on august 16, 1963, what is the velocity?
| SELECT SUM("Velocity (km/h)") FROM table_79790 WHERE "Date" = 'august 16, 1963' | wikisql |
CREATE TABLE table_73737 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players did the philadelphia eagles pick?
| SELECT COUNT("Position") FROM table_73737 WHERE "NFL Team" = 'Philadelphia Eagles' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_... | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... | advising |
CREATE TABLE table_50649 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest score for a California home game with over 10,8... | SELECT MAX("Points") FROM table_50649 WHERE "Attendance" > '10,870' AND "Home" = 'california' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Private" | mimicsql_data |
CREATE TABLE table_11390 (
"Name" text,
"Birth" text,
"Monarch From" text,
"Monarch Until" text,
"Relationship with Predecessor(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the brother of Edward VIII?
| SELECT "Name" FROM table_11390 WHERE "Relationship with Predecessor(s)" = 'brother of edward viii' | wikisql |
CREATE TABLE table_49320 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position... | SELECT "Position" FROM table_49320 WHERE "Podiums" = '3' AND "F/Laps" = '4' | wikisql |
CREATE TABLE table_4282 (
"Umpire" text,
"Country" text,
"Panel" text,
"Matches" real,
"WC Matches" real,
"2011 WC" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of the wc matches if the matches were 79
| SELECT MAX("WC Matches") FROM table_4282 WHERE "Matches" = '79' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'intracranial injury - with subarachnoid hemorrhage' AND STRFTIME('%y', diagnosis.diagnosistime) = '2... | eicu |
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 patient (
uniquep... | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-17096') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.unitadmittime DESC LIMI... | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" | mimicsql_data |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int... | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CHEMBIO' AND course.number = 502 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... | advising |
CREATE TABLE table_45918 (
"Date" text,
"Opponents" text,
"Venue" text,
"Result" text,
"Score F\u2013A" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score F-A when the result was D?
| SELECT "Score F\u2013A" FROM table_45918 WHERE "Result" = 'd' | wikisql |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ... | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title | nvbench |
CREATE TABLE table_38126 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pick number for the player(s) drafted in round 8?
| SELECT "Pick #" FROM table_38126 WHERE "Round" = 'round 8' | wikisql |
CREATE TABLE table_train_12 (
"id" int,
"sequential_organ_failure_assessment_sofa" int,
"active_infection" bool,
"taking_pioglitazone" bool,
"taking_rosiglitazone" bool,
"body_weight" float,
"diabetic" string,
"organ_failure" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQ... | SELECT * FROM table_train_12 WHERE body_weight < 30 OR body_weight > 90 | criteria2sql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韦文心' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2006-05-29') | css |
CREATE TABLE book (
Title VARCHAR,
Issues VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the titles of the books in ascending order of issues.
| SELECT Title FROM book ORDER BY Issues | sql_create_context |
CREATE TABLE table_39518 (
"Source" text,
"Date" text,
"DeSUS" text,
"Zares" text,
"NLPD" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the source for 7% DeSUS?
| SELECT "Source" FROM table_39518 WHERE "DeSUS" = '7%' | wikisql |
CREATE TABLE member_of (
facid number,
dno number,
appt_type text
)
CREATE TABLE course (
cid text,
cname text,
credits number,
instructor number,
days text,
hours text,
dno number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
se... | SELECT cname FROM course WHERE credits = 1 | spider |
CREATE TABLE table_name_49 (
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place is Ben Hogan?
| SELECT place FROM table_name_49 WHERE player = "ben hogan" | sql_create_context |
CREATE TABLE table_63843 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Format of the release with Catalog number RTRADLP491?
| SELECT "Format" FROM table_63843 WHERE "Catalog" = 'rtradlp491' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 44848 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE table_17118657_7 (
record VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record when Canty (5) was the high assists?
| SELECT record FROM table_17118657_7 WHERE high_assists = "Canty (5)" | 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 WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" AND demographic.dod_year <= "2148.0" | mimicsql_data |
CREATE TABLE table_name_24 (
away VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Away, when Home is Guelph Gargoyles?
| SELECT away FROM table_name_24 WHERE home = "guelph gargoyles" | sql_create_context |
CREATE TABLE table_75865 (
"Round" text,
"Opposition" text,
"First leg" text,
"Second leg" text,
"Aggregate score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the first leg score against Real Sociedad?
| SELECT "First leg" FROM table_75865 WHERE "Opposition" = 'real sociedad' | wikisql |
CREATE TABLE table_name_54 (
score VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the home team was Shrewsbury town, what was the score?
| SELECT score FROM table_name_54 WHERE home_team = "shrewsbury town" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_29565858_2 (
l VARCHAR,
stolen_ends VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed under L when the stolen ends is 1?
| SELECT l FROM table_29565858_2 WHERE stolen_ends = 1 | sql_create_context |
CREATE TABLE table_name_53 (
partial_failures INTEGER,
launches VARCHAR,
family VARCHAR,
country VARCHAR,
failures VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the partial failure for the Country of russia, and a Failure larger than 0, ... | SELECT AVG(partial_failures) FROM table_name_53 WHERE country = "russia" AND failures > 0 AND family = "angara" AND launches > 1 | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND prescriptions.drug = 'levofloxacin' AND STRFTIME('%y', prescriptions.startdate) = '2105' | mimic_iii |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'swab' AND STRFTIME('%y', microbiologyevents.charttime) <= '2104') | mimic_iii |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
Accepted... | SELECT A.Id, A.PostTypeId, A.Title, A.Body, A.ParentId, A.Tags, A.CreationDate FROM Posts AS A LEFT JOIN Users AS U ON A.OwnerUserId = U.Id WHERE U.Reputation > '##num##' AND A.PostTypeId = 1 AND A.CreationDate > 2018 | sede |
CREATE TABLE table_20159025_1 (
driver VARCHAR,
no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver was number 2 ?
| SELECT driver FROM table_20159025_1 WHERE no = "2‡" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSMC = '化疗科' AND zyjzjlb.RYDJSJ BETWEEN '2007-11-14' AND '2020-09-19' | css |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
... | SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location | nvbench |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '72329' AND IN_HOSP_DATE BETWEEN '2001-04-03' AND '2005-06-30' AND IN_DIAG_DIS_CD = 'J47.822' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_65568 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time of the swimmer from Chinese Taipei in Heat 3?
| SELECT "Time" FROM table_65568 WHERE "Heat" = '3' AND "Lane" > '3' AND "Nationality" = 'chinese taipei' | wikisql |
CREATE TABLE table_36889 (
"Year" real,
"Trim" text,
"Engine" text,
"Power" text,
"Torque" text,
"EPA (2008) City" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Torque has a Power of HP (KW)?
| SELECT "Torque" FROM table_36889 WHERE "Power" = 'hp (kw)' | wikisql |
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 treatment (
treat... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND medication.drugname IN ('famotidine', 'acetaminophen 325 ... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.