instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Lessons (
lesson_id INTEGER,
customer_id INTEGER,
lesson_status_code VARCHAR(15),
staff_id INTEGER,
vehicle_id INTEGER,
lesson_date DATETIME,
lesson_time VARCHAR(10),
price DOUBLE
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nickname VARCHA... | SELECT date_of_birth, COUNT(date_of_birth) FROM Customers WHERE customer_status_code = 'Good Customer' ORDER BY COUNT(date_of_birth) | nvbench |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
ProfileImage... | SELECT Id AS "post_link", Title FROM Posts WHERE Title LIKE '%:%' AND LEFT(Title, STR_POSITION(Title, ':') - 1) IN (SELECT Tags.TagName FROM PostTags INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE PostTags.PostId = Posts.Id) ORDER BY CreationDate DESC | sede |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions ... | SELECT Country, COUNT(*) FROM climber GROUP BY Country | nvbench |
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 demographic.admission_type, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_52842 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drove the car with a grid of 7?
| SELECT "Driver" FROM table_52842 WHERE "Grid" = '7' | wikisql |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id =... | atis |
CREATE TABLE table_name_32 (
year_s__retired VARCHAR,
serial_numbers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year were the retired serial numbers 27317 27336?
| SELECT year_s__retired FROM table_name_32 WHERE serial_numbers = "27317–27336" | sql_create_context |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program (
program_id int,
name varchar,
... | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND program_course.course_id = course.course_id AND program_course.workload < 3 ORDER BY program_course.workload | advising |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_63871 (
"Contestant" text,
"Starting Weight (kg)" real,
"Final Weight (kg)" real,
"Weight Lost (kg)" real,
"Percentage Lost" text,
"Position (out of Eliminated Contestants)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ... | SELECT "Percentage Lost" FROM table_63871 WHERE "Starting Weight (kg)" > '102' AND "Weight Lost (kg)" = '46.9' | wikisql |
CREATE TABLE table_204_541 (
id number,
"name" text,
"area" text,
"height" text,
"floors" number,
"year" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which building had the least number of floors ?
| SELECT "name" FROM table_204_541 ORDER BY "floors" LIMIT 1 | squall |
CREATE TABLE table_6928 (
"Name" text,
"Overs Bowled" real,
"Maidens" real,
"Runs Conceded" real,
"Wickets" real,
"Extras" real,
"E.R." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Extras for Chamara Kapugedera, with an ... | SELECT MIN("Extras") FROM table_6928 WHERE "Name" = 'chamara kapugedera' AND "E.R." < '4.59' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
U... | SELECT DisplayName FROM Users WHERE LastAccessDate >= DATEDIFF(d, 2, GETDATE()) | sede |
CREATE TABLE table_22355_5 (
rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the minimal rank of a athlete shown in the chart?
| SELECT MIN(rank) FROM table_22355_5 | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480')) AND vitalperiodic.heartrate > 122.0 A... | eicu |
CREATE TABLE table_name_40 (
finalists VARCHAR,
week__number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the finalists for week # less than 2
| SELECT finalists FROM table_name_40 WHERE week__number < 2 | sql_create_context |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrase... | SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Magdalena Balazinska' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_27129 (
"Wind farm" text,
"Installed capacity (MW)" text,
"Turbine Manufacturer" text,
"County" text,
"Date in Service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did this wind farm started service with a capacity of 135 ... | SELECT "Date in Service" FROM table_27129 WHERE "Installed capacity (MW)" = '135' | wikisql |
CREATE TABLE table_61155 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year has a Competition of european championships, and Notes of 66.81 m?
| SELECT SUM("Year") FROM table_61155 WHERE "Competition" = 'european championships' AND "Notes" = '66.81 m' | wikisql |
CREATE TABLE injury_accident (
game_id number,
id number,
player text,
injury text,
number_of_matches text,
source text
)
CREATE TABLE game (
stadium_id number,
id number,
season number,
date text,
home_team text,
away_team text,
score text,
competition text
)
C... | SELECT season, home_team, away_team FROM game | spider |
CREATE TABLE table_1204998_2 (
pinyin VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which pinyin have a population of 374047?
| SELECT pinyin FROM table_1204998_2 WHERE population = 374047 | sql_create_context |
CREATE TABLE table_28714 (
"Monarch" text,
"Heir" text,
"Status" text,
"Relationship to Monarch" text,
"Became heir; reason" text,
"Ceased to be heir; reason" text,
"Next in succession" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was ... | SELECT "Heir" FROM table_28714 WHERE "Monarch" = 'Wareru' | wikisql |
CREATE TABLE table_16284 (
"Rnd" text,
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "Report" FROM table_16284 WHERE "Pole position" = 'Michael Andretti' AND "Winning team" = 'Galles-Kraco Racing' | wikisql |
CREATE TABLE table_47898 (
"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 above.
-- What team... | SELECT "Team" FROM table_47898 WHERE "Manner of departure" = 'end of tenure as caretaker' | wikisql |
CREATE TABLE table_201_25 (
id number,
"party" text,
"leader" text,
"from" text,
"to" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many parties had the same leader in office twice ?
| SELECT COUNT(DISTINCT "party") FROM table_201_25 GROUP BY "leader" HAVING COUNT("leader") = 2 | squall |
CREATE TABLE table_name_48 (
virtues VARCHAR,
psycho_social_crisis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Virtue looks at the intimacy vs. isolation crisis?
| SELECT virtues FROM table_name_48 WHERE psycho_social_crisis = "intimacy vs. isolation" | 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_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '21485538' AND qtb.MED_SER_ORG_NO = '1900114' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '21485538' AND gyb.MED_SER_ORG_NO = '1900... | css |
CREATE TABLE table_name_62 (
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2nd leg with ldu quito as team 1?
| SELECT 2 AS nd_leg FROM table_name_62 WHERE team__number1 = "ldu quito" | sql_create_context |
CREATE TABLE table_2961 (
"Name" text,
"Aperture m" text,
"Aper. in" text,
"Mirror/type" text,
"Nationality/Sponsors" text,
"Site" text,
"Built/Used" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which aperture were built or used between 19... | SELECT "Aper. in" FROM table_2961 WHERE "Built/Used" = '1987-2001' | 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 microlab (
microl... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-85328' AND patient.wardid = 996 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_3248 (
"Party" text,
"January 2010" text,
"February 2010" text,
"March 2010" text,
"April 2010" text,
"May 2010" text,
"June 2010" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the bed 2010 for 6.5%
| SELECT "February 2010" FROM table_3248 WHERE "June 2010" = '6.5%' | 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.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '98195604452' | css |
CREATE TABLE table_name_2 (
team VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team started in grid 11?
| SELECT team FROM table_name_2 WHERE grid = "11" | sql_create_context |
CREATE TABLE table_45078 (
"Number notation" real,
"Power notation" text,
"Short scale" text,
"Long scale" text,
"Indian (or South Asian) English" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For a power notation of 10 12, what is the long scale?
| SELECT "Long scale" FROM table_45078 WHERE "Power notation" = '10 12' | wikisql |
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.short_title = "CV cath plcmt w guidance" | mimicsql_data |
CREATE TABLE table_24628683_2 (
method_of_elimination VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the method of elimination in the chamber with a time of 24:02?
| SELECT method_of_elimination FROM table_24628683_2 WHERE time = "24:02" | sql_create_context |
CREATE TABLE table_18823880_10 (
l2_cache VARCHAR,
release_date VARCHAR,
part_number_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When by80607002529af is the part number and september 2009 is the release date what is the l2 cache?
| SELECT l2_cache FROM table_18823880_10 WHERE release_date = "September 2009" AND part_number_s_ = "BY80607002529AF" | 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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '00768748' AND MED_SER_ORG_NO = '6769443' AND OUT_DIAG_DOC_NM LIKE '马%' | css |
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 transfers (
row_id number,
subject_id number,
hadm_... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '58560026' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2003-02-05') | css |
CREATE TABLE table_name_62 (
record VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was his record when the match went for 3:05?
| SELECT record FROM table_name_62 WHERE time = "3:05" | sql_create_context |
CREATE TABLE table_203_590 (
id number,
"date" text,
"venue" text,
"opponents" text,
"score" text,
"competition" text,
"scotland scorer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- against which opponent did scotland have no scorers ?
| SELECT "opponents" FROM table_203_590 WHERE "score" = 0 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51221" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_60 (
player VARCHAR,
score INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Player that has the Score larger than 67?
| SELECT player FROM table_name_60 WHERE score > 67 | sql_create_context |
CREATE TABLE table_204_945 (
id number,
"episode" number,
"name" text,
"synopsis" text,
"sent home" text,
"highest seller" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last episode with two people sent home ?
| SELECT "name" FROM table_204_945 WHERE "sent home" = 2 ORDER BY "episode" DESC LIMIT 1 | squall |
CREATE TABLE table_15431959_1 (
original_air_date VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of Stargate SG-1 written by Peter Deluise?
| SELECT original_air_date FROM table_15431959_1 WHERE written_by = "Peter DeLuise" | sql_create_context |
CREATE TABLE table_name_42 (
bronze INTEGER,
silver INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the bronze medals of the nation with less than 0 silvers?
| SELECT SUM(bronze) FROM table_name_42 WHERE silver < 0 | 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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSBM = '96274' AND wdmzjzjlb.JZKSRQ BETWEEN '2005-02-09' AND '2015-05-08' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSBM = '96274' AND bdmzjzjlb.JZKSRQ BETWEEN '2005-02-09' AND '2015-05-08' | css |
CREATE TABLE table_71910 (
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the Opponents in the final that played on a carpet (i) Surface?... | SELECT "Opponents in the final" FROM table_71910 WHERE "Surface" = 'carpet (i)' | wikisql |
CREATE TABLE table_name_46 (
pick VARCHAR,
round VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pick has a Round larger than 17, and a Name of gene stewart?
| SELECT COUNT(pick) FROM table_name_46 WHERE round > 17 AND name = "gene stewart" | sql_create_context |
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 equipment_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
val... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ... | mimic_iii |
CREATE TABLE table_12210 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time where the record is 10-1?
| SELECT "Time" FROM table_12210 WHERE "Record" = '10-1' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHIN... | atis |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | WITH Orders AS (SELECT * FROM (VALUES (CAST('2012-01-01 06:10:01' AS DATETIME), 2), ('2012-01-01 08:10:01', 2), ('2012-01-01 10:10:01', 4), ('2012-01-02 08:00:07', 4), ('2012-01-02 10:00:07', 4)) AS Orders(DateReceived, Total)) SELECT CAST(TIME_TO_STR(DATE('datereceived', '-12 hour'), '%Y/%m/%d') AS TEXT(30)) AS "dt_da... | sede |
CREATE TABLE table_name_42 (
time VARCHAR,
rank VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time value for the rider Brian Finch and a rank greater than 3?
| SELECT time FROM table_name_42 WHERE rank > 3 AND rider = "brian finch" | sql_create_context |
CREATE TABLE table_name_7 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team's score at kardinia park?
| SELECT home_team AS score FROM table_name_7 WHERE venue = "kardinia park" | sql_create_context |
CREATE TABLE table_58087 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of week 16?
| SELECT "Result" FROM table_58087 WHERE "Week" = '16' | wikisql |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank | nvbench |
CREATE TABLE table_67195 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is brannon condren with and overall more than 131 drafted?
| SELECT COUNT("Round") FROM table_67195 WHERE "Name" = 'brannon condren' AND "Overall" > '131' | wikisql |
CREATE TABLE table_name_1 (
manufacturer VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Manufacturer for the Rider Colin Edwards?
| SELECT manufacturer FROM table_name_1 WHERE rider = "colin edwards" | sql_create_context |
CREATE TABLE table_name_79 (
block INTEGER,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest block for director Graeme Harper?
| SELECT MIN(block) FROM table_name_79 WHERE director = "graeme harper" | sql_create_context |
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no numbe... | SELECT T1.color FROM grapes AS T1 JOIN wine AS T2 ON T1.grape = T2.grape GROUP BY T2.grape ORDER BY AVG(price) DESC LIMIT 1 | spider |
CREATE TABLE table_name_1 (
capital VARCHAR,
voivodeship_separate_city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the capital with the Voivodeship Separate city of bia ostockie?
| SELECT capital FROM table_name_1 WHERE voivodeship_separate_city = "białostockie" | sql_create_context |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT Time, ID FROM swimmer ORDER BY Time | nvbench |
CREATE TABLE table_name_17 (
round INTEGER,
position VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a Position of qb, and an Overall larger than 6?
| SELECT MAX(round) FROM table_name_17 WHERE position = "qb" AND overall > 6 | sql_create_context |
CREATE TABLE table_11303072_5 (
fielding_team VARCHAR,
runs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fielding team with 155 runs?
| SELECT fielding_team FROM table_11303072_5 WHERE runs = "155" | sql_create_context |
CREATE TABLE table_name_72 (
loss INTEGER,
name VARCHAR,
long VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Loss has a Name of bullock, chris, and a Long smaller than 36?
| SELECT SUM(loss) FROM table_name_72 WHERE name = "bullock, chris" AND long < 36 | sql_create_context |
CREATE TABLE table_16036 (
"Player" text,
"Current singles ranking" text,
"Current doubles ranking" text,
"First year played" real,
"Ties played" real,
"Total W\u2013L" text,
"Singles W\u2013L" text,
"Doubles W\u2013L" text
)
-- Using valid SQLite, answer the following questions for th... | SELECT "Current singles ranking" FROM table_16036 WHERE "Player" = 'Mantas Bugailiškis' | wikisql |
CREATE TABLE table_77766 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time/retired for grid 18?
| SELECT "Time/Retired" FROM table_77766 WHERE "Grid" = '18' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE... | SELECT facid FROM faculty EXCEPT SELECT facid FROM faculty_participates_in | spider |
CREATE TABLE table_name_20 (
entrant VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which entrant had a chassis of March CG891?
| SELECT entrant FROM table_name_20 WHERE chassis = "march cg891" | sql_create_context |
CREATE TABLE table_34601 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team's record on februrary 23?
| SELECT "Record" FROM table_34601 WHERE "February" = '23' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.diagnosis = "SYNCOPE;TELEMETRY" | mimicsql_data |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_MZJZ... | css |
CREATE TABLE table_name_94 (
location VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location of the byron nelson golf classic?
| SELECT location FROM table_name_94 WHERE tournament = "byron nelson golf classic" | sql_create_context |
CREATE TABLE table_25923164_1 (
original_air_date VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of the episode directed by gloria muzio?
| SELECT original_air_date FROM table_25923164_1 WHERE directed_by = "Gloria Muzio" | sql_create_context |
CREATE TABLE table_60740 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the August 20, 2007 match?
| SELECT "Score" FROM table_60740 WHERE "Date" = 'august 20, 2007' | wikisql |
CREATE TABLE table_57290 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year has a total of 0 points and a chassis of Toleman tg181?
| SELECT AVG("Year") FROM table_57290 WHERE "Points" = '0' AND "Chassis" = 'toleman tg181' | wikisql |
CREATE TABLE table_name_51 (
crude_death_rate__per_1000_ INTEGER,
deaths VARCHAR,
crude_birth_rate__per_1000_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Crude death rate (per 1000) has Deaths of 768, and a Crude birth rate (per 1000) smaller th... | SELECT MIN(crude_death_rate__per_1000_) FROM table_name_51 WHERE deaths = "768" AND crude_birth_rate__per_1000_ < 29.7 | sql_create_context |
CREATE TABLE table_26842217_18 (
broadcast VARCHAR,
time VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the broadcast for 7:00pm and mississippi state
| SELECT broadcast FROM table_26842217_18 WHERE time = "7:00pm" AND home_team = "Mississippi State" | sql_create_context |
CREATE TABLE table_38202 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest amount of bronze medals when the rank was larger than 9?
| SELECT MAX("Bronze") FROM table_38202 WHERE "Rank" > '9' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE table_55102 (
"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.
-- In the game where the home team scored 12.14 (86... | SELECT COUNT("Crowd") FROM table_55102 WHERE "Home team score" = '12.14 (86)' | wikisql |
CREATE TABLE table_22462 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT MAX("GEO ID") FROM table_22462 WHERE "County" = 'Logan' | wikisql |
CREATE TABLE table_61370 (
"Number" real,
"Time" real,
"Aircraft" text,
"Opponent" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent with a time higher than 1040, a Spad xiii aircraft in Dun-Sur-Meuse with a lower n... | SELECT "Opponent" FROM table_61370 WHERE "Time" > '1040' AND "Aircraft" = 'spad xiii' AND "Number" < '22' AND "Location" = 'dun-sur-meuse' | wikisql |
CREATE TABLE table_69647 (
"Tournament" text,
"Date" text,
"Surface" text,
"Round" text,
"Opponent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for chris evert opponent and carpet surface
| SELECT "Date" FROM table_69647 WHERE "Opponent" = 'chris evert' AND "Surface" = 'carpet' | wikisql |
CREATE TABLE product (
product VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all the product whose name contains the word 'Scanner'.
| SELECT product FROM product WHERE product LIKE "%Scanner%" | sql_create_context |
CREATE TABLE table_name_56 (
total INTEGER,
nation VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average total of Italy and has a bronze larger than 1?
| SELECT AVG(total) FROM table_name_56 WHERE nation = "italy" AND bronze > 1 | sql_create_context |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.icd9_code = "8968" | mimicsql_data |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "LEFT EYE" | mimicsql_data |
CREATE TABLE table_58981 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date has a Score in the final of 3 6, 2 6, 4 6?
| SELECT "Date" FROM table_58981 WHERE "Score in the final" = '3–6, 2–6, 4–6' | wikisql |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType | nvbench |
CREATE TABLE farm_competition (
Competition_ID int,
Year int,
Theme text,
Host_city_ID int,
Hosts text
)
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE city (
City_ID int,
Official_Name text,
Status text,
Area_km_2 real,
P... | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY Year DESC | nvbench |
CREATE TABLE table_61830 (
"School" text,
"Location" text,
"Nickname(s)" text,
"Colors" text,
"Years Member" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Nickname(s) has a Location of elkville, illinois?
| SELECT "Nickname(s)" FROM table_61830 WHERE "Location" = 'elkville, illinois' | wikisql |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, total, ascites') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 ye... | mimic_iii |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | SELECT Id AS "post_link", CreationDate, Tags FROM Posts WHERE PostTypeId = 1 AND UPPER(Body) = Body ORDER BY CreationDate | sede |
CREATE TABLE table_name_45 (
laps INTEGER,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps were driven in 2:54:23.8?
| SELECT SUM(laps) FROM table_name_45 WHERE time_retired = "2:54:23.8" | sql_create_context |
CREATE TABLE table_name_73 (
high_assists VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the most high assists from Milwaukee?
| SELECT high_assists FROM table_name_73 WHERE team = "milwaukee" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.