instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_name_83 (
high_rebounds VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the high rebounds for the game that had a score of w 76-66?
| SELECT high_rebounds FROM table_name_83 WHERE score = "w 76-66" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6493695' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-05-01' AND '2010-01-25' | css |
CREATE TABLE table_42593 (
"Title" text,
"Length" text,
"Writer" text,
"Composer" text,
"Arranger" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the composer of El Hanone?
| SELECT "Composer" FROM table_42593 WHERE "Title" = 'el hanone' | wikisql |
CREATE TABLE table_name_66 (
match VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Match has a Competition of Group Stage on 2000-09-17?
| SELECT match FROM table_name_66 WHERE competition = "group stage" AND date = "2000-09-17" | sql_create_context |
CREATE TABLE table_43004 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" real,
"Time" text,
"Jockey" text,
"Winner/2nd" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Ra... | SELECT "Race" FROM table_43004 WHERE "Jockey" = 'd. nikolic' | wikisql |
CREATE TABLE table_name_63 (
lost VARCHAR,
conv VARCHAR,
span VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lost for span 2006- when conv is 0?
| SELECT lost FROM table_name_63 WHERE conv = "0" AND span = "2006-" | sql_create_context |
CREATE TABLE table_name_62 (
circumstances VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the circumstances for the Baghlan location?
| SELECT circumstances FROM table_name_62 WHERE location = "baghlan" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65569) AND prescriptions.route = 'iv' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m',... | mimic_iii |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Blood in stool" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE domain_... | SELECT SUM(publication.citation_num) FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid AND publication.year < 2005 | academic |
CREATE TABLE Rating (
mID VARCHAR,
stars INTEGER
)
CREATE TABLE Movie (
title VARCHAR,
director VARCHAR,
mID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the titles and directors of the movies whose star is greater than the average st... | SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = "James Cameron") | sql_create_context |
CREATE TABLE table_name_99 (
home_captain VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Home captain for the Test match of Australia in England at the Edgbaston Venue?
| SELECT home_captain FROM table_name_99 WHERE venue = "edgbaston" | sql_create_context |
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '沈敏博' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_74 (
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which date did Geelong play at home?
| SELECT date FROM table_name_74 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_204_548 (
id number,
"team" text,
"basic elements" number,
"tumbling" number,
"stunts" number,
"tosses" number,
"pyramids" number,
"deductions" number,
"total score" number,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT SUM("deductions") FROM table_204_548 | squall |
CREATE TABLE table_name_12 (
rank VARCHAR,
nationality VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ranks have a ationality of canada, and a Time of dns?
| SELECT COUNT(rank) FROM table_name_12 WHERE nationality = "canada" AND time = "dns" | sql_create_context |
CREATE TABLE table_24481478_1 (
kickoff VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time did the game start on saturday, april 20?
| SELECT kickoff FROM table_24481478_1 WHERE date = "Saturday, April 20" | 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 a... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-69376' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '005-69376' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_63011 (
"Driver" text,
"Navigator" text,
"Vehicle" text,
"Class" text,
"Capacity" real,
"Total Time" text,
"Margin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Capacity has a Class of cm22, and a Vehicle of 1999 s... | SELECT MIN("Capacity") FROM table_63011 WHERE "Class" = 'cm22' AND "Vehicle" = '1999 subaru impreza wrx sti' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT TagName, COUNT(ClosedPost.Id) / CAST(COUNT(*) AS FLOAT) AS ClosedRatio, COUNT(*) AS QuestionCount FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id LEFT JOIN Posts AS ClosedPost ON Posts.Id = ClosedPost.Id AND ClosedPost.ClosedDate != '' WHERE Posts.PostType... | sede |
CREATE TABLE table_14347 (
"Pick" real,
"Player" text,
"Country of Origin*" text,
"PBA team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of pick for philippines and erwin velez
| SELECT SUM("Pick") FROM table_14347 WHERE "Country of Origin*" = 'philippines' AND "Player" = 'erwin velez' | wikisql |
CREATE TABLE table_name_49 (
date VARCHAR,
opponent_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the match with Opponent in the final of Filip Pol ek?
| SELECT date FROM table_name_49 WHERE opponent_in_the_final = "filip polášek" | sql_create_context |
CREATE TABLE table_71699 (
"Builder" text,
"Model" text,
"Length (ft/m)" text,
"Order Year" text,
"Fuel Propulsion" text,
"Fleet Series (Quantity)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Fuel Propulsion has a Fleet Series (Quantity... | SELECT "Fuel Propulsion" FROM table_71699 WHERE "Fleet Series (Quantity)" = '04001-04125 (125)' | 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 medication (
medi... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-31956')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '吴涵润' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-12-31' AND '2011-07-11' | css |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '6114875' AND jybgb.BGRQ BETWEEN '2001-06-25' AND '2009-03-18' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 20) AS T | css |
CREATE TABLE table_2383498_4 (
qld_cup_premierships VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the QLD Cup Premierships if team is Gold Coast Vikings?
| SELECT qld_cup_premierships FROM table_2383498_4 WHERE team = "Gold Coast Vikings" | sql_create_context |
CREATE TABLE table_76958 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many spectators attended the game that ended in a result of w29-7?
| SELECT "Attendance" FROM table_76958 WHERE "Result" = 'w29-7' | wikisql |
CREATE TABLE addresses (
address_id number,
address_content text,
city text,
zip_postcode text,
state_province_county text,
country text,
other_address_details text
)
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_address_from time,
address_typ... | SELECT customer_name FROM customers WHERE payment_method <> 'Cash' | spider |
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 Team_Name, School_ID FROM basketball_match ORDER BY Team_Name | nvbench |
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 Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name DESC | nvbench |
CREATE TABLE table_name_52 (
language VARCHAR,
publisher VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What language has 20th century fox as the publisher?
| SELECT language FROM table_name_52 WHERE publisher = "20th century fox" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND microlab.culturesite = 'urine, voided specimen' AND STRF... | eicu |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_... | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_name_51 (
opponent VARCHAR,
november VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Opponent that has the November larger than 26, and the Game larger than 18?
| SELECT opponent FROM table_name_51 WHERE november > 26 AND game > 18 | sql_create_context |
CREATE TABLE table_name_75 (
event VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event was Tatyana Lebedeva in?
| SELECT event FROM table_name_75 WHERE athlete = "tatyana lebedeva" | 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_61 (
losses INTEGER,
team VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of losses for Presidente Hayes, when the draws were more than 4?
| SELECT MAX(losses) FROM table_name_61 WHERE team = "presidente hayes" AND draws > 4 | sql_create_context |
CREATE TABLE table_29699 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entri... | SELECT COUNT("Points") FROM table_29699 WHERE "Position" = '6th' | wikisql |
CREATE TABLE table_name_71 (
population INTEGER,
area_km_2 VARCHAR,
official_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average population vlue for an area smaller than 26.69 square km and has an official name of Rogersville?
| SELECT AVG(population) FROM table_name_71 WHERE area_km_2 < 26.69 AND official_name = "rogersville" | sql_create_context |
CREATE TABLE table_203_613 (
id number,
"formula" text,
"color" text,
"symmetry" text,
"space group" text,
"no" number,
"pearson symbol" text,
"a (pm)" number,
"b (pm)" number,
"c (pm)" number,
"z" number,
"density, g/cm3" number
)
-- Using valid SQLite, answer the foll... | SELECT COUNT("formula") FROM table_203_613 WHERE "color" = 'white' | squall |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '30139154' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 4566.82) | css |
CREATE TABLE table_test_7 (
"id" int,
"bleeding" int,
"left_ventricular_ejection_fraction_lvef" int,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"dialysis" bool,
"intravenous_pressors" bool,
"non_infarct_related_vessel" bool,
"heart_disease" bool,
"b... | SELECT * FROM table_test_7 WHERE cardiogenic_shock = 1 OR (systolic_blood_pressure_sbp < 80 OR intravenous_pressors = 1 OR intra_aortic_balloon_pump_iabp = 1 OR hemodynamic_instability = 1) | criteria2sql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE state (
... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, airport_service AS AIRPORT_SERVICE_4, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, city AS CITY... | atis |
CREATE TABLE table_name_23 (
division VARCHAR,
team_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which division were the Brewers a part of in the 1987 season?
| SELECT division FROM table_name_23 WHERE team_season = "1987" | sql_create_context |
CREATE TABLE table_54661 (
"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 home team plays at victoria park?
| SELECT "Home team" FROM table_54661 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_49768 (
"Game" real,
"Date" text,
"Opponent" 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.
-- Wh... | SELECT "Record" FROM table_49768 WHERE "Date" = 'june 29' | wikisql |
CREATE TABLE table_70400 (
"Year" real,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What open cup did they play in when they finished 2nd, northeast in the reg. s... | SELECT "Open Cup" FROM table_70400 WHERE "Reg. Season" = '2nd, northeast' | wikisql |
CREATE TABLE table_53878 (
"Interregnum began" text,
"Interregnum ended" text,
"Duration" text,
"Count Palatine of Saxony" text,
"Count Palatine of the Rhine" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the duration for Count Palatine of ... | SELECT "Duration" FROM table_53878 WHERE "Count Palatine of the Rhine" = 'charles albert, elector of bavaria' | wikisql |
CREATE TABLE table_name_3 (
game VARCHAR,
score VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Score of 4 0 and Points of 44?
| SELECT game FROM table_name_3 WHERE score = "4–0" AND points = 44 | sql_create_context |
CREATE TABLE table_25991 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions... | SELECT COUNT("Rebounds") FROM table_25991 WHERE "Player" = 'Crystal Ayers' | wikisql |
CREATE TABLE table_16048 (
"\u2193 Function / Genus \u2192" text,
"Shigella" text,
"Salmonella" text,
"Yersinia" text,
"Escherichia" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the salmonella with shigella being ipgc
| SELECT "Salmonella" FROM table_16048 WHERE "Shigella" = 'IpgC' | wikisql |
CREATE TABLE table_53515 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the visitor on March 24?
| SELECT "Visitor" FROM table_53515 WHERE "Date" = 'march 24' | wikisql |
CREATE TABLE table_15431959_1 (
no_in_season INTEGER,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seasons did Peter Deluise direct Stargate SG-1?
| SELECT MAX(no_in_season) FROM table_15431959_1 WHERE directed_by = "Peter DeLuise" | sql_create_context |
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE T... | SELECT Team, COUNT(*) FROM technician GROUP BY Team | nvbench |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
... | SELECT COUNT(DISTINCT course_offering.section_number) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id WHERE course.department = 'CLIMATE' AND course.number = 451 | advising |
CREATE TABLE table_train_92 (
"id" int,
"thyroid_disease" bool,
"heart_disease" bool,
"global_deterioration_scale" int,
"rosen_modified_hachinski_ischemic_score" int,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT * FROM table_train_92 WHERE rosen_modified_hachinski_ischemic_score >= 4 | criteria2sql |
CREATE TABLE table_name_38 (
games VARCHAR,
goals_against VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games have more than 288 goals and less than 34 losses?
| SELECT COUNT(games) FROM table_name_38 WHERE goals_against > 288 AND lost < 34 | sql_create_context |
CREATE TABLE table_name_45 (
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did Melbourne play as the home team?
| SELECT date FROM table_name_45 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" | mimicsql_data |
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 WHERE demographic.admission_location = "** INFO NOT AVAILABLE **" | mimicsql_data |
CREATE TABLE table_53399 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance on July 30?
| SELECT AVG("Attendance") FROM table_53399 WHERE "Date" = 'july 30' | wikisql |
CREATE TABLE table_16575609_1 (
position VARCHAR,
cfl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did the winnipeg blue bombers draft?
| SELECT position FROM table_16575609_1 WHERE cfl_team = "Winnipeg Blue Bombers" | sql_create_context |
CREATE TABLE table_29225103_2 (
gm_winning_team VARCHAR,
ep_winning_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who the GM winning team when the EP winning team was #37 Porsche?
| SELECT gm_winning_team FROM table_29225103_2 WHERE ep_winning_team = "#37 Porsche" | sql_create_context |
CREATE TABLE table_name_17 (
entrant VARCHAR,
points VARCHAR,
chassis VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What entrant had a Maserati 250F chassis and fewer than 6 points before 1957?
| SELECT entrant FROM table_name_17 WHERE chassis = "maserati 250f" AND year < 1957 AND points < 6 | sql_create_context |
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.PERSON_NM, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE, t_kc21.IDENTITY_CARD FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '39309284337' | css |
CREATE TABLE table_50075 (
"Nat." text,
"Name" text,
"Moving to" text,
"Type" text,
"Transfer window" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the transfer fee for rory loy?
| SELECT "Transfer fee" FROM table_50075 WHERE "Name" = 'rory loy' | wikisql |
CREATE TABLE table_8673 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team for the game with Platense as the away team and attendance under 529?
| SELECT "Home" FROM table_8673 WHERE "Attendance" < '529' AND "Away" = 'platense' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patientheal... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-68180' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... | eicu |
CREATE TABLE document_structures (
document_structure_code text,
parent_document_structure_code text,
document_structure_description text
)
CREATE TABLE document_sections (
section_id number,
document_code text,
section_sequence number,
section_code text,
section_title text
)
CREATE TA... | SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
Ta... | SELECT * FROM Posts WHERE STR_POSITION(Tags, @tag) > 0 AND CreationDate > @startdate | sede |
CREATE TABLE table_55203 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is south melbourne's home side score?
| SELECT "Home team score" FROM table_55203 WHERE "Home team" = 'south melbourne' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLin... | SELECT * FROM ReviewTasks WHERE CreationDate > '2018-01-01' AND DeletionDate >= '2018-01-07' | sede |
CREATE TABLE table_name_37 (
game VARCHAR,
season VARCHAR,
result VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Result of win, and an Opponent of new hampshire, and a Season smaller than 2008?
| SELECT game FROM table_name_37 WHERE result = "win" AND opponent = "new hampshire" AND season < 2008 | sql_create_context |
CREATE TABLE table_name_26 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score on august 1
| SELECT score FROM table_name_26 WHERE date = "august 1" | sql_create_context |
CREATE TABLE table_1992924_3 (
spokesperson VARCHAR,
year_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many spokesperson where in 2004
| SELECT COUNT(spokesperson) FROM table_1992924_3 WHERE year_s_ = 2004 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.formulary_drug_cd = "MYCO500T" | mimicsql_data |
CREATE TABLE table_name_81 (
driver VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the driver when grid is 11?
| SELECT driver FROM table_name_81 WHERE grid = 11 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Acute diastolic heart failure" | mimicsql_data |
CREATE TABLE table_name_4 (
position INTEGER,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest positioned with more than 9 played?
| SELECT MIN(position) FROM table_name_4 WHERE played > 9 | sql_create_context |
CREATE TABLE table_18255 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the district with first elected being 1972
| SELECT "District" FROM table_18255 WHERE "First elected" = '1972' | wikisql |
CREATE TABLE table_name_49 (
total INTEGER,
egyptian_premier_league VARCHAR,
egypt_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest total for players with under 2 Egyptian Premier League goals and 0 Egypt Cup goals?
| SELECT MAX(total) FROM table_name_49 WHERE egyptian_premier_league < 2 AND egypt_cup < 0 | sql_create_context |
CREATE TABLE table_name_70 (
_percentage_2006 INTEGER,
seats_2001 VARCHAR,
_percentage_2001 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When seats for 2001 is greater than 15 and % 2001 is greater than 100, what is the % 2006?
| SELECT AVG(_percentage_2006) FROM table_name_70 WHERE seats_2001 > 15 AND _percentage_2001 > 100 | sql_create_context |
CREATE TABLE table_26896 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least listed owner for pete raymer
| SELECT MIN("#") FROM table_26896 WHERE "Listed Owner(s)" = 'Pete Raymer' | wikisql |
CREATE TABLE Album (
AlbumId integer,
Title varchar(160),
ArtistId integer
)
CREATE TABLE Artist (
ArtistId integer,
Name varchar(120)
)
CREATE TABLE Track (
TrackId integer,
Name varchar(200),
AlbumId integer,
MediaTypeId integer,
GenreId integer,
Composer varchar(220),
... | SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" ORDER BY COUNT(InvoiceDate) | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Estrogens Conjugated" | mimicsql_data |
CREATE TABLE table_name_6 (
format VARCHAR,
single VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the format of the single, I Can't Stay?
| SELECT format FROM table_name_6 WHERE single = "i can't stay" | sql_create_context |
CREATE TABLE table_name_95 (
league VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which League has a Venue of martin luther king, jr. recreation center?
| SELECT league FROM table_name_95 WHERE venue = "martin luther king, jr. recreation center" | sql_create_context |
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 * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf... | css |
CREATE TABLE table_20728138_1 (
_percentage_in_seats_contested VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2003 seat number, when seats contested was at 38.23%
| SELECT MIN(2003 AS _seats) FROM table_20728138_1 WHERE _percentage_in_seats_contested = "38.23%" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,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... | SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'carrier' AND d_item... | mimic_iii |
CREATE TABLE table_name_67 (
winning_score VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Winning score has a Tournament of walt disney world/oldsmobile classic?
| SELECT winning_score FROM table_name_67 WHERE tournament = "walt disney world/oldsmobile classic" | sql_create_context |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End... | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY SUM(Amount_Payment) DESC | nvbench |
CREATE TABLE table_73423 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT("Race Time") FROM table_73423 WHERE "Driver" = 'Cale Yarborough' AND "Average Speed (mph)" = '88.924' | wikisql |
CREATE TABLE table_66012 (
"Ship" text,
"Year" real,
"Dates" text,
"Line" text,
"From" text,
"Distance" text,
"Days, hours, minutes" text,
"Speed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Days, hours, minutes for 21 26 ... | SELECT "Days, hours, minutes" FROM table_66012 WHERE "Dates" = '21 – 26 october' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.