instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_50 (
score VARCHAR,
december INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- after december 29 what is the score?
| SELECT score FROM table_name_50 WHERE december > 29 | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '3297791' AND t_kc22.STA_DATE BETWEEN '2015-06-21' AND '2021-03-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_59139 (
"Statistic" text,
"Name" text,
"Total" text,
"School" text,
"Opponent" text,
"Stage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a statistic of most points, what is the stage?
| SELECT "Stage" FROM table_59139 WHERE "Statistic" = 'most points' | 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 COUNT(gwyjzb.IN_DIAG_DIS_CD) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '朱高达' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-07-13' AND '2014-04-10' UNION SELECT COUNT(fgwyjzb.IN_DIAG_DIS_CD) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '朱高达' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-07-13' AND '2014-04-10' | css |
CREATE TABLE table_2361911_2 (
regular_season VARCHAR,
playoffs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the regular season for final playoffs
| SELECT regular_season FROM table_2361911_2 WHERE playoffs = "Final" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'RCIDIV' AND course.number = 351 AND program_course.category LIKE '%ULCS%' | advising |
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 DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
... | SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY DEPT_CODE | nvbench |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
... | SELECT COUNT(Id) FROM Posts WHERE (Tags LIKE '%c%' OR Tags LIKE '%c++%') AND Body LIKE '%<code>%' | sede |
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
)
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Compute ... | SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3267) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'cortisol') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-5... | mimic_iii |
CREATE TABLE county (
County_name VARCHAR,
Population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the names of all counties sorted by population in ascending order.
| SELECT County_name FROM county ORDER BY Population | sql_create_context |
CREATE TABLE table_2764267_2 (
country VARCHAR,
currency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the country for the us dollar
| SELECT country FROM table_2764267_2 WHERE currency = "US dollar" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "GANGRENE" | mimicsql_data |
CREATE TABLE table_26748252_1 (
written_by VARCHAR,
us_viewers__in_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people wrote the episode with 3.40 million U.S viewers?
| SELECT COUNT(written_by) FROM table_26748252_1 WHERE us_viewers__in_millions_ = "3.40" | sql_create_context |
CREATE TABLE film_text (
film_id number,
title text,
description text
)
CREATE TABLE language (
language_id number,
name text,
last_update time
)
CREATE TABLE film_category (
film_id number,
category_id number,
last_update time
)
CREATE TABLE payment (
payment_id number,
c... | SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_19 (
film VARCHAR,
winner_nominee_s_ VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which film was Eddie Murphy nominated for?
| SELECT film FROM table_name_19 WHERE winner_nominee_s_ = "eddie murphy" AND result = "nominated" | sql_create_context |
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 demographic (
subject_id text,
hadm_id t... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= "71" AND demographic.days_stay = "34" | mimicsql_data |
CREATE TABLE table_203_775 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games had at least 10,000 people in attendance ?
| SELECT COUNT(*) FROM table_203_775 WHERE "attendance" >= 10000 | squall |
CREATE TABLE table_49380 (
"Result" text,
"Race" text,
"Distance" text,
"Weight" real,
"Winner or 2nd" text,
"Pos'n" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the winner or 2nd of the race with a 2nd pos'n and a weight lighter than ... | SELECT "Winner or 2nd" FROM table_49380 WHERE "Pos'n" = '2nd' AND "Weight" < '8.1' | wikisql |
CREATE TABLE table_38649 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2010 has a Tournament of australian open?
| SELECT "2010" FROM table_38649 WHERE "Tournament" = 'australian open' | wikisql |
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 T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | nvbench |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "99662" | mimicsql_data |
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 Flag, COUNT(Flag) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain WHERE Rank = 'Midshipman') GROUP BY Flag ORDER BY COUNT(Flag) | nvbench |
CREATE TABLE table_name_41 (
votes VARCHAR,
candidate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Candidate of riikka manner has how many votes?
| SELECT votes FROM table_name_41 WHERE candidate = "riikka manner" | sql_create_context |
CREATE TABLE table_37847 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has boston as the visitor?
| SELECT "Date" FROM table_37847 WHERE "Visitor" = 'boston' | wikisql |
CREATE TABLE table_66278 (
"Date Released" text,
"Polling institute" text,
"Social Democratic" text,
"Socialist" text,
"Green-Communist" text,
"People's Party" text,
"Left Bloc" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "Date Released" FROM table_66278 WHERE "Left Bloc" = '3.2%' | wikisql |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | 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, fare_basis, flight, flight_fare WHERE ((fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.... | atis |
CREATE TABLE table_25708 (
"Date" text,
"Location" text,
"Opponent" text,
"Cardinal Points" real,
"Opp. Points" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the cardinal points for 19-4 record
| SELECT MIN("Cardinal Points") FROM table_25708 WHERE "Record" = '19-4' | wikisql |
CREATE TABLE table_name_8 (
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place had a score of 71-70=141?
| SELECT place FROM table_name_8 WHERE score = 71 - 70 = 141 | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.icd9_code = "3970" | mimicsql_data |
CREATE TABLE table_20332 (
"No." real,
"Name" text,
"Livery" text,
"Locomotive type" text,
"Wheel Arrangement" text,
"Builder" text,
"Year built" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which locomotive type has a s... | SELECT "Locomotive type" FROM table_20332 WHERE "Status" = 'Static display' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
... | SELECT TagName, Count FROM Tags WHERE ExcerptPostId IS NULL AND WikiPostId IS NULL AND Count < 50 ORDER BY Count | sede |
CREATE TABLE table_19833 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT COUNT("Combination classification") FROM table_19833 WHERE "Points classification" = 'Alessandro Petacchi' AND "Winner" = 'Erik Zabel' | wikisql |
CREATE TABLE table_name_87 (
date VARCHAR,
opponent VARCHAR,
venue VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game held at the A venue with a result of 0-1 against the Rangers?
| SELECT date FROM table_name_87 WHERE venue = "a" AND result = "0-1" AND opponent = "rangers" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT * FROM Users JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE CAST(Users.Id AS TEXT) = '##UserId:string##' OR Users.DisplayName = '##UserId##' | sede |
CREATE TABLE payments (
payment_date VARCHAR,
amount_paid VARCHAR,
payment_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check
| SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check' | sql_create_context |
CREATE TABLE table_name_38 (
college_junior_club_team__league_ VARCHAR,
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What League's Round is Sup and Position is Right Wing?
| SELECT college_junior_club_team__league_ FROM table_name_38 WHERE position = "right wing" AND round = "sup" | sql_create_context |
CREATE TABLE table_39607 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tournament has a 2007 of wta premier 5 tournaments?
| SELECT "Tournament" FROM table_39607 WHERE "2007" = 'wta premier 5 tournaments' | wikisql |
CREATE TABLE table_21977704_1 (
constructor VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the constructor for alberto ascari
| SELECT constructor FROM table_21977704_1 WHERE driver = "Alberto Ascari" | sql_create_context |
CREATE TABLE table_1990460_1 (
year VARCHAR,
regular_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the 4th, Midwest season happen?
| SELECT year FROM table_1990460_1 WHERE regular_season = "4th, Midwest" | sql_create_context |
CREATE TABLE table_59411 (
"Date" text,
"Opponent" text,
"Score" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score on April 5?
| SELECT "Score" FROM table_59411 WHERE "Date" = 'april 5' | 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2146" AND lab.label = "MCV" | mimicsql_data |
CREATE TABLE table_name_78 (
year VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years have a Title of Magia Nuda?
| SELECT COUNT(year) FROM table_name_78 WHERE title = "magia nuda" | sql_create_context |
CREATE TABLE table_204_223 (
id number,
"party" text,
"previous council" number,
"staying councillors" number,
"seats up for election" number,
"election result" number,
"new council" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which par... | SELECT "party" FROM table_204_223 ORDER BY "new council" DESC LIMIT 1 | squall |
CREATE TABLE table_name_73 (
points INTEGER,
game VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have a Game smaller than 8, and a Record of 1 0 0?
| SELECT SUM(points) FROM table_name_73 WHERE game < 8 AND record = "1–0–0" | sql_create_context |
CREATE TABLE table_23406 (
"Season" text,
"Player" text,
"Junior college" text,
"State" text,
"Position" text,
"Class" text,
"University" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in which class is the position forward
| SELECT "Class" FROM table_23406 WHERE "Position" = 'Forward' | wikisql |
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 mzjzjlb WHERE JZKSMC = '新生儿外科' AND JZKSRQ BETWEEN '2008-02-20' AND '2017-03-13' | css |
CREATE TABLE table_name_1 (
last_aired INTEGER,
returning VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest aired show that's returning on September 13?
| SELECT MIN(last_aired) FROM table_name_1 WHERE returning = "september 13" | sql_create_context |
CREATE TABLE table_804 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell who... | SELECT "High points" FROM table_804 WHERE "Team" = 'New Jersey' | wikisql |
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 * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_65208 (
"Period" text,
"Team" text,
"Player" text,
"Penalty" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time does Dustin Byfuglien have in 1st period?
| SELECT "Time" FROM table_65208 WHERE "Period" = '1st' AND "Player" = 'dustin byfuglien' | wikisql |
CREATE TABLE table_72714 (
"City/town" text,
"Municipality" text,
"County" text,
"City/town status" real,
"Population" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which municipalities located in the county of Finnmark have populations bigger than... | SELECT "Municipality" FROM table_72714 WHERE "County" = 'Finnmark' AND "Population" > '6187.0' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-47232')) AND lab.labname = 'prolactin' AND DATETIME(lab.labresulttime) >= DATE... | eicu |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE out... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788) AND microbiologyevents.spec_type_desc = 'foot culture' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.chart... | mimic_iii |
CREATE TABLE table_67450 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in week 12?
| SELECT "Opponent" FROM table_67450 WHERE "Week" = '12' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44842')) AND lab.labname = 'total protein' AND DATETIME(lab.labresulttime, 'start of yea... | eicu |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT People_ID, Weight FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_39901 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did they play at Candlestick Park?
| SELECT "Date" FROM table_39901 WHERE "Game Site" = 'candlestick park' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | SELECT p.Id AS "post_link", (SELECT COUNT(1) FROM Votes AS v JOIN VoteTypes AS t ON v.VoteTypeId = t.Id WHERE v.PostId = p.Id AND t.Name = 'UpMod') AS Upvotes, (SELECT COUNT(1) FROM Votes AS v JOIN VoteTypes AS t ON v.VoteTypeId = t.Id WHERE v.PostId = p.Id AND t.Name = 'DownMod') AS Downvotes FROM Posts AS p WHERE p.O... | sede |
CREATE TABLE table_37841 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Played" FROM table_37841 WHERE "Points for" = '247' | wikisql |
CREATE TABLE table_name_90 (
wins INTEGER,
starts VARCHAR,
avg_finish VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in 1990, how many wins had an avg finish of 35 and a start less than 1?
| SELECT MAX(wins) FROM table_name_90 WHERE avg_finish = 35 AND year = 1990 AND starts < 1 | sql_create_context |
CREATE TABLE table_34815 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Liberal ticket" text,
"Independent-Socialist ticket" text,
"Socialist Labor ticket" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Indepen... | SELECT "Independent-Socialist ticket" FROM table_34815 WHERE "Liberal ticket" = 'edward goodell' | wikisql |
CREATE TABLE table_14095 (
"Club" text,
"League/Division" text,
"Home Ground" text,
"Location" text,
"Position in 2012-13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location for a club of telecom?
| SELECT "Location" FROM table_14095 WHERE "Club" = 'telecom' | wikisql |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
ro... | 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, food_service WHERE ((date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.... | atis |
CREATE TABLE table_39861 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Scott Hoch (2) win?
| SELECT "Date" FROM table_39861 WHERE "Winner" = 'scott hoch (2)' | wikisql |
CREATE TABLE table_name_16 (
record VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record of the game where the Rockets were the visiting team?
| SELECT record FROM table_name_16 WHERE visitor = "rockets" | sql_create_context |
CREATE TABLE table_24887326_6 (
away_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the away team for tie no 11?
| SELECT away_team FROM table_24887326_6 WHERE tie_no = 11 | sql_create_context |
CREATE TABLE table_21411 (
"Season" real,
"TV season" text,
"Regular Timeslot (EDT)" text,
"Episode count" real,
"Season premiere" text,
"Season finale" text,
"Rank" text,
"Rating" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ... | SELECT COUNT("TV season") FROM table_21411 WHERE "Season finale" = 'May 23, 1995' | wikisql |
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '91530632' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 4446.07) | css |
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '39193636' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 7889.23) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '39193636' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI... | css |
CREATE TABLE table_49080 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the Final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament did Pemra zgen play against julia kimmelmann in the f... | SELECT "Tournament" FROM table_49080 WHERE "Opponent in the Final" = 'julia kimmelmann' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "SHORT TERM HOSPITAL" | mimicsql_data |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
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 Has_Allergy (
StuID INTEGE... | SELECT Major, COUNT(*) FROM Student GROUP BY Major | nvbench |
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 demographic.age < "36" AND diagnoses.short_title = "Abrasion trunk" | mimicsql_data |
CREATE TABLE staff (
staff_id number,
staff_address_id number,
nickname text,
first_name text,
middle_name text,
last_name text,
date_of_birth time,
date_joined_staff time,
date_left_staff time
)
CREATE TABLE vehicles (
vehicle_id number,
vehicle_details text
)
CREATE TABLE... | SELECT T2.zip_postcode FROM customers AS T1 JOIN addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" | spider |
CREATE TABLE table_75991 (
"Source" text,
"Date" text,
"Goberman" text,
"Loera" text,
"Merkley" text,
"Neville" text,
"Novick" text,
"Obrist" text,
"Other/ Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Neville has a... | SELECT "Neville" FROM table_75991 WHERE "Novick" = '23%' | wikisql |
CREATE TABLE table_74820 (
"Rank" real,
"Name" text,
"Location" text,
"Height Metres / feet" text,
"Floors" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Floors have a Location of ljubljana, and a Name of tr3?
| SELECT "Floors" FROM table_74820 WHERE "Location" = 'ljubljana' AND "Name" = 'tr3' | wikisql |
CREATE TABLE table_name_38 (
school_club_team VARCHAR,
round VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school/club team did the player who was drafted after round 13 with an overall rank of 384 play for?
| SELECT school_club_team FROM table_name_38 WHERE round > 13 AND overall = 384 | sql_create_context |
CREATE TABLE table_203_471 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"site/stadium" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"overall record" text,
"ncaat record" text
)
-- Using valid SQLite, answer the following quest... | SELECT "opponent" FROM table_203_471 WHERE "date" > (SELECT "date" FROM table_203_471 WHERE "date" = 'june 21') ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE table_48153 (
"!Simple Present/Future" text,
"Probable Future" text,
"Simple Past" text,
"Past Habitual" text,
"Injunctive" text,
"Imperative" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the injunctive for the Simple Past... | SELECT "Injunctive" FROM table_48153 WHERE "Simple Past" = 'गरुँला garũlā ''i will (probably) do' | wikisql |
CREATE TABLE table_72123 (
"Region" text,
"Operator" text,
"Licence award date" text,
"On air date" text,
"Closure date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the license award date for North East England?
| SELECT "Licence award date" FROM table_72123 WHERE "Region" = 'North East England' | wikisql |
CREATE TABLE table_250230_2 (
gearbox VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the gearbox when the torque is torque?
| SELECT gearbox FROM table_250230_2 WHERE "torque" = "torque" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
... | SELECT COUNT(*) FROM Users WHERE LastAccessDate >= DATEADD(dd, -30, GETDATE()) | sede |
CREATE TABLE table_19789597_6 (
game INTEGER,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest number of a game where S. Johnson (3) did the most high assists?
| SELECT MIN(game) FROM table_19789597_6 WHERE high_assists = "S. Johnson (3)" | sql_create_context |
CREATE TABLE table_name_94 (
competition_description VARCHAR,
rank_qualifying VARCHAR,
apparatus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition had a Rank-Qualifying of 1st and a ball apparatus?
| SELECT competition_description FROM table_name_94 WHERE rank_qualifying = "1st" AND apparatus = "ball" | sql_create_context |
CREATE TABLE table_73097 (
"District" text,
"Location" text,
"Representative" text,
"Cook PVI" text,
"2012 election results" text,
"Median household income (2011)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location that has the ... | SELECT "Location" FROM table_73097 WHERE "District" = '12th' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_name_42 (
winning_team VARCHAR,
site VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which winning team has Iowa city as the site, and december 3, 2006 as the date?
| SELECT winning_team FROM table_name_42 WHERE site = "iowa city" AND date = "december 3, 2006" | sql_create_context |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | SELECT * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "70" | mimicsql_data |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8058667' AND t_kc21.IN_DIAG_DIS_NM = '非器质性睡眠障碍') | css |
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 hz_info (
KH text,
KLX number... | SELECT * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb... | css |
CREATE TABLE table_80378 (
"Rank" text,
"Goals" text,
"Player" text,
"Club/Clubs" text,
"Career" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has 1299 goals?
| SELECT "Player" FROM table_80378 WHERE "Goals" = '1299' | wikisql |
CREATE TABLE table_2402209_1 (
no_of_barangays VARCHAR,
population__2010_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different counts of tue number of Barangays are there for the municipality with 13824 citizens in 2010?
| SELECT COUNT(no_of_barangays) FROM table_2402209_1 WHERE population__2010_ = 13824 | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | SELECT DATEPART(hour, Posts.CreationDate) AS "daytime", COUNT(Posts.Id) AS "numanswers" FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId WHERE PostTags.TagId = 243 AND Posts.PostTypeId = 1 AND Posts.CreationDate > DATEADD(year, -1, GETDATE()) GROUP BY DATEPART(hour, Posts.CreationDate) | sede |
CREATE TABLE table_38523 (
"Round" text,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a nationality of Czech Republic and a position of right wing?
| SELECT "Player" FROM table_38523 WHERE "Position" = 'right wing' AND "Nationality" = 'czech republic' | wikisql |
CREATE TABLE table_name_23 (
grand_prix VARCHAR,
pole_position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Grand Prix for pole position of kimi r ikk nen
| SELECT grand_prix FROM table_name_23 WHERE pole_position = "kimi räikkönen" | sql_create_context |
CREATE TABLE table_40967 (
"Average population (x 1000)" real,
"Live births" real,
"Deaths" real,
"Natural change" real,
"Crude birth rate (per 1000)" real,
"Crude death rate (per 1000)" real,
"Natural change (per 1000)" real
)
-- Using valid SQLite, answer the following questions for the ... | SELECT MIN("Natural change") FROM table_40967 WHERE "Natural change (per 1000)" = '19.1' AND "Crude birth rate (per 1000)" < '28.3' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.