instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3252243' AND gwyjzb.MED_ORG_DEPT_NM = '小儿头颈肿瘤科' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3252243' AND fgwyjzb.MED_ORG_DEPT_NM = '小儿头颈肿瘤科')... | css |
CREATE TABLE table_58281 (
"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 the lowest crowd with home team richmond... | SELECT MIN("Crowd") FROM table_58281 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE table_59371 (
"Station" text,
"Distance from Wellington" text,
"Height above sea level (m)" text,
"Opened" real,
"Closed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opened prior to 1877 only 2.44km from Wellington, when did this sta... | SELECT "Closed" FROM table_59371 WHERE "Opened" < '1877' AND "Distance from Wellington" = '2.44km' | wikisql |
CREATE TABLE results (
resultid number,
raceid number,
driverid number,
constructorid number,
number number,
grid number,
position number,
positiontext text,
positionorder number,
points number,
laps number,
time text,
milliseconds number,
fastestlap number,
r... | SELECT DISTINCT name FROM races WHERE year BETWEEN 2014 AND 2017 | spider |
CREATE TABLE table_name_80 (
percentage INTEGER,
points_for VARCHAR,
losses VARCHAR,
wins VARCHAR,
points_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Percentage when there are more than 0 wins, Points Against is mor... | SELECT AVG(percentage) FROM table_name_80 WHERE wins > 0 AND points_against > 481 AND losses = 8 AND points_for > 826 | 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.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '云曼冬' AND t_kc21.MED_SER_ORG_NO = '7485822' AND t_kc21.IN_DIAG_DIS_NM LIKE '%楔状缺损%' | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Alveolar-arterial Gradient" | mimicsql_data |
CREATE TABLE table_23197088_4 (
score_in_final VARCHAR,
championship VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- such as are entire the rating of closing where championship is moscow
| SELECT score_in_final FROM table_23197088_4 WHERE championship = "Moscow" | sql_create_context |
CREATE TABLE table_name_53 (
player VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has a score of 79?
| SELECT player FROM table_name_53 WHERE score = "79" | sql_create_context |
CREATE TABLE table_11230937_2 (
us_viewers__millions_ VARCHAR,
no_in_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many millions of viewers watched episode 15?
| SELECT us_viewers__millions_ FROM table_11230937_2 WHERE no_in_season = 15 | sql_create_context |
CREATE TABLE table_9648 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Round(s), when Time is 'n/a', and when Loc... | SELECT COUNT("Round") FROM table_9648 WHERE "Time" = 'n/a' AND "Location" = 'canton, ohio, usa' | wikisql |
CREATE TABLE table_8648 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Call sign of the Frequency 106.9 the X?
| SELECT "Call sign" FROM table_8648 WHERE "Branding" = '106.9 the x' | wikisql |
CREATE TABLE table_24302700_6 (
name VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are all the players from the united states?
| SELECT name FROM table_24302700_6 WHERE nationality = "United States" | sql_create_context |
CREATE TABLE table_7056 (
"Rank" text,
"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 largest gold number when the total is less than 3, the rank is 5, and the silver ... | SELECT MAX("Gold") FROM table_7056 WHERE "Total" < '3' AND "Rank" = '5' AND "Silver" > '1' | wikisql |
CREATE TABLE player (
player_id TEXT,
birth_year NUMERIC,
birth_month NUMERIC,
birth_day NUMERIC,
birth_country TEXT,
birth_state TEXT,
birth_city TEXT,
death_year NUMERIC,
death_month NUMERIC,
death_day NUMERIC,
death_country TEXT,
death_state TEXT,
death_city TEXT,
... | SELECT year, SUM(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC | nvbench |
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 mzjzjlb.JZZTDM, mzjzjlb.JZZTMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '43796484911' | css |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC | nvbench |
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '1577129' AND IN_HOSP_DATE BETWEEN '2001-12-14' AND '2004-04-11' AND INSU_TYPE = '儿童' | css |
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
surname TEXT,
dob TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE results (
resultId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
... | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY name | nvbench |
CREATE TABLE table_19178 (
"Home (1st leg)" text,
"Home (2nd leg)" text,
"1st Leg" text,
"2nd leg" text,
"Aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When temperley is the home (2nd leg) what is the home (1st leg)?
| SELECT "Home (1st leg)" FROM table_19178 WHERE "Home (2nd leg)" = 'Temperley' | wikisql |
CREATE TABLE table_40721 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the overall score when set 1 was 23 25?
| SELECT "Score" FROM table_40721 WHERE "Set 1" = '23–25' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac posthemorrhag anemia') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5364) AND DATETIME(diagnoses_... | mimic_iii |
CREATE TABLE table_18461635_1 (
captain VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the captain of the team in Southampton?
| SELECT captain FROM table_18461635_1 WHERE location = "Southampton" | sql_create_context |
CREATE TABLE table_19324 (
"Episode no." real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original Air Date (ATV)" text,
"Production no." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director of the episode originally aired ... | SELECT "Director" FROM table_19324 WHERE "Original Air Date (ATV)" = '26 October 1969' | wikisql |
CREATE TABLE table_name_20 (
laps INTEGER,
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the low lap total for henri pescarolo with a grad larger than 6?
| SELECT MIN(laps) FROM table_name_20 WHERE grid > 6 AND driver = "henri pescarolo" | sql_create_context |
CREATE TABLE table_21197 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT "Record" FROM table_21197 WHERE "High rebounds" = 'Gerald Wallace (14)' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
... | SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'DANCE' AND course.number = 335 AND program_course.course_id = course.course_id AND program_course.workload > 3 | advising |
CREATE TABLE table_24924 (
"Name" text,
"Position" text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Home Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the weight is the name is Stuart Craig?
| SELECT "Weight" FROM table_24924 WHERE "Name" = 'Stuart Craig' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_3 (
result VARCHAR,
film_title_used_in_nomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE RESULT WITH A FILM TITLE FIREDANCER?
| SELECT result FROM table_name_3 WHERE film_title_used_in_nomination = "firedancer" | sql_create_context |
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 MIN(demographic.age) FROM demographic WHERE demographic.language = "RUSS" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE table_44557 (
"School" text,
"Bask" text,
"Golf" text,
"Soccer" text,
"Soft" text,
"Swimming" text,
"Tennis" text,
"Indoor track" text,
"Volleyball" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Does Detroit have a socc... | SELECT "Soccer" FROM table_44557 WHERE "School" = 'detroit' | wikisql |
CREATE TABLE table_name_54 (
name VARCHAR,
town_city VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name of the Multiple Type museum in Anchorage?
| SELECT name FROM table_name_54 WHERE town_city = "anchorage" AND type = "multiple" | sql_create_context |
CREATE TABLE table_204_784 (
id number,
"player" text,
"league" number,
"cup" number,
"europa league" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many goals did ismail isa score this season ?
| SELECT "total" FROM table_204_784 WHERE "player" = 'ismail isa' | squall |
CREATE TABLE table_5918 (
"Character" text,
"French voice actor" text,
"Italian voice actor" text,
"German voice actor" text,
"Spanish voice actor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What character does Italian voice actor Emanuela Damas... | SELECT "Character" FROM table_5918 WHERE "Italian voice actor" = 'emanuela damasio' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17669')) AND vitalperiodic.heartrate < 116.0 AND NOT vitalperiod... | eicu |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17950' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE table_59235 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many t... | SELECT "Tries against" FROM table_59235 WHERE "Tries for" = '67' | wikisql |
CREATE TABLE table_name_13 (
company_name VARCHAR,
accreditation_level VARCHAR,
accreditation_status VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Company Name, when the Accreditation Level is Joyn Hot Fixes, and when the Accreditation Statu... | SELECT company_name FROM table_name_13 WHERE accreditation_level = "joyn hot fixes" AND accreditation_status = "approved (awarded 17.05.13)" | sql_create_context |
CREATE TABLE table_name_27 (
country_of_origin VARCHAR,
year_of_intro VARCHAR,
primary_cartridge VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Country of Origin, when Year of Intro is greater than 1985, and when Primary Cartridge is 125mm?
| SELECT country_of_origin FROM table_name_27 WHERE year_of_intro > 1985 AND primary_cartridge = "125mm" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT demographic.gender, demographic.admission_location FROM demographic WHERE demographic.name = "Jane Dillard" | mimicsql_data |
CREATE TABLE table_204_130 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date above 19 october 2013 ?
| SELECT "date" FROM table_204_130 WHERE id = (SELECT id FROM table_204_130 WHERE "date" = '19 october 2013') - 1 | squall |
CREATE TABLE table_2361788_1 (
regular_season VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of regular season for 2007
| SELECT COUNT(regular_season) FROM table_2361788_1 WHERE year = 2007 | sql_create_context |
CREATE TABLE table_name_31 (
rank INTEGER,
date VARCHAR,
mark VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rank of the record on 2007-06-21 with a mark less than 91.29?
| SELECT AVG(rank) FROM table_name_31 WHERE date = "2007-06-21" AND mark < 91.29 | sql_create_context |
CREATE TABLE table_10432351_1 (
mass__m___ INTEGER,
radius__r___ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If a radius is 10, what is the lowest possible mass?
| SELECT MIN(mass__m___) FROM table_10432351_1 WHERE radius__r___ = 10 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
h... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE table_33984 (
"Tournament" text,
"2006" text,
"2007" text,
"2008-12" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2006 has a 2007 of A?
| SELECT "2006" FROM table_33984 WHERE "2007" = 'a' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31229') | eicu |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... | SELECT Users.AccountId AS Id, Users.Reputation AS rep, COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId GROUP BY Users.AccountId, Users.Reputation ORDER BY 'reputation' DESC LIMIT 38000 | sede |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_203_676 (
id number,
"pick #" number,
"cfl team" text,
"player" text,
"position" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the last pick in round four ?
| SELECT "player" FROM table_203_676 ORDER BY "pick #" DESC LIMIT 1 | squall |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | SELECT q.Id AS Id, q.Score AS Score, q.Id AS "post_link" FROM Posts AS q INNER JOIN PostHistory AS h ON q.Id = h.PostId WHERE h.PostHistoryTypeId = 10 AND h.Comment = '102' AND NOT q.ClosedDate IS NULL ORDER BY q.ViewCount DESC | sede |
CREATE TABLE table_20457 (
"S No" real,
"Team (A)" text,
"Team (B)" text,
"Winner" text,
"Margin" text,
"Match Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winner for date of nov 5, 1987
| SELECT "Winner" FROM table_20457 WHERE "Match Date" = 'Nov 5, 1987' | wikisql |
CREATE TABLE table_75775 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has an against more than 8, lost of 7... | SELECT "Team" FROM table_75775 WHERE "Against" > '8' AND "Lost" = '7' AND "Position" = '5' | wikisql |
CREATE TABLE table_name_74 (
driver VARCHAR,
constructor VARCHAR,
grid VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a grid smaller than 24, less than 61 laps, and a ferrari constructor?
| SELECT driver FROM table_name_74 WHERE grid < 24 AND laps < 61 AND constructor = "ferrari" | sql_create_context |
CREATE TABLE table_8660 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total attendance for Candlestick Park?
| SELECT COUNT("Attendance") FROM table_8660 WHERE "Game site" = 'candlestick park' | wikisql |
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 gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6735951' GROUP BY gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6735951' GROUP BY fgwyjzb.IN_DIAG_DIS_CD | css |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "48" AND lab.itemid = "51438" | mimicsql_data |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'Y80.928' | css |
CREATE TABLE table_60243 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is born on 1982-01-29?
| SELECT "Name" FROM table_60243 WHERE "Date of Birth" = '1982-01-29' | wikisql |
CREATE TABLE table_name_23 (
date VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the tournament held in Indonesia?
| SELECT date FROM table_name_23 WHERE country = "indonesia" | sql_create_context |
CREATE TABLE table_18468 (
"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.
-- Which candidates were in the election where Frank W. Boykin was an incum... | SELECT "Candidates" FROM table_18468 WHERE "Incumbent" = 'Frank W. Boykin' | wikisql |
CREATE TABLE table_name_36 (
position INTEGER,
played VARCHAR,
goal_difference VARCHAR,
drawn VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the positions for the player who had less than 25 losses, a goal differe... | SELECT SUM(position) FROM table_name_36 WHERE drawn = 10 AND lost < 25 AND goal_difference = "+20" AND played < 42 | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '95072739' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 8153.6) | 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.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '14360011' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-02-17' AND '2013-01-19' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID... | css |
CREATE TABLE table_71293 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT COUNT("Losses") FROM table_71293 WHERE "Goal Difference" = '5' AND "Draws" > '10' AND "Goals against" = '43' | wikisql |
CREATE TABLE table_58174 (
"Heir" text,
"Status" text,
"Relationship to Monarch" text,
"Became heir" text,
"Reason" text,
"Ceased to be heir" text,
"Monarch" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Status when Henry I is t... | SELECT "Status" FROM table_58174 WHERE "Monarch" = 'henry i' AND "Reason" = 'succession unclear 1100-1103' | wikisql |
CREATE TABLE table_name_80 (
until INTEGER,
titles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total Until when the Titles was 5?
| SELECT SUM(until) FROM table_name_80 WHERE titles = "5" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT chartevents.charttime 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 = 2498)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatu... | mimic_iii |
CREATE TABLE table_name_61 (
pick VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- College of boston college has what pick?
| SELECT pick FROM table_name_61 WHERE college = "boston college" | sql_create_context |
CREATE TABLE table_16064 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Vikings points" real,
"Opponents" real,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The record of 7-3 had the largest at... | SELECT MAX("Attendance") FROM table_16064 WHERE "Record" = '7-3' | wikisql |
CREATE TABLE table_name_71 (
player VARCHAR,
country VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player placed t6 for the United States with a score of 67-69=136?
| SELECT player FROM table_name_71 WHERE country = "united states" AND place = "t6" AND score = 67 - 69 = 136 | sql_create_context |
CREATE TABLE table_67781 (
"Type" text,
"Fleet numbers" text,
"Quantity made" real,
"Manufacturer" text,
"Date made" text,
"Date withdrawn" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date made that has an associated fleet number ... | SELECT "Date made" FROM table_67781 WHERE "Fleet numbers" = '4' | wikisql |
CREATE TABLE table_1939405_2 (
latin_americans_2001 INTEGER,
_percentage_2001 VARCHAR,
_percentage_2011 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Latin Americans were there in 2001 in the province with 0.0% 2001 and 0.2% 2011?
| SELECT MAX(latin_americans_2001) FROM table_1939405_2 WHERE _percentage_2001 = "0.0%" AND _percentage_2011 = "0.2%" | sql_create_context |
CREATE TABLE table_197446_1 (
branch VARCHAR,
term_began VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What branch was involved when the term began in January 3, 1985?
| SELECT branch FROM table_197446_1 WHERE term_began = "January 3, 1985" | sql_create_context |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'DUTCH' AND number = 339 | advising |
CREATE TABLE table_name_52 (
time VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total time that it took for the driver to finish 14 laps?
| SELECT time FROM table_name_52 WHERE laps = 14 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '褚雨伯' AND t_kc22.STA_DATE BETWEEN '2010-11-02' AND '2016-08-24' AND t_kc22.SOC_SRT_DIRE_CD = '477789-7' | css |
CREATE TABLE table_41425 (
"Tournament" text,
"2003" text,
"2004" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What results in 2012 also has 2013 results of 2r and the tournament was Wimbledon?
| SELECT "2012" FROM table_41425 WHERE "2013" = '2r' AND "Tournament" = 'wimbledon' | wikisql |
CREATE TABLE table_name_12 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on April 6, 2008?
| SELECT score FROM table_name_12 WHERE date = "april 6, 2008" | sql_create_context |
CREATE TABLE table_61443 (
"S.no." real,
"Power Plant" text,
"State" text,
"Total Capacity (MW)" real,
"Completion Schedule" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the completion schedule for himachal pradesh state with a total capac... | SELECT "Completion Schedule" FROM table_61443 WHERE "State" = 'himachal pradesh' AND "Total Capacity (MW)" = '800' | wikisql |
CREATE TABLE table_name_51 (
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the nationality for rudolf vercik
| SELECT nationality FROM table_name_51 WHERE player = "rudolf vercik" | sql_create_context |
CREATE TABLE table_32538 (
"Pool" text,
"Age Group" text,
"Time" text,
"Event" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What age group has a time of 6:37.73 at the 200m breaststroke?
| SELECT "Age Group" FROM table_32538 WHERE "Event" = '200m breaststroke' AND "Time" = '6:37.73' | wikisql |
CREATE TABLE table_name_17 (
nationality VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Nationality has a Round of 4?
| SELECT nationality FROM table_name_17 WHERE round = 4 | sql_create_context |
CREATE TABLE table_55045 (
"Tournament" text,
"1980" text,
"1981" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text... | SELECT "1981" FROM table_55045 WHERE "Tournament" = 'wimbledon' | wikisql |
CREATE TABLE table_name_99 (
constructor VARCHAR,
location VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What company constructed the vehicle in the location not held in 1933?
| SELECT constructor FROM table_name_99 WHERE location = "not held" AND year = "1933" | sql_create_context |
CREATE TABLE table_name_33 (
date_of_appointment VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE APPOINTMENT DATE FOR AC HORSENS?
| SELECT date_of_appointment FROM table_name_33 WHERE team = "ac horsens" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.itemid = "50976" | mimicsql_data |
CREATE TABLE table_name_58 (
game INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Game, when Date is 'December 23'?
| SELECT AVG(game) FROM table_name_58 WHERE date = "december 23" | sql_create_context |
CREATE TABLE table_name_17 (
top_25 INTEGER,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest number of top-25s for events with more than 0 wins?
| SELECT MIN(top_25) FROM table_name_17 WHERE wins > 0 | sql_create_context |
CREATE TABLE Products (
product_id INTEGER,
product_type_code VARCHAR(15),
product_name VARCHAR(80),
product_price DOUBLE
)
CREATE TABLE Customer_Address_History (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Customers (
customer_id I... | SELECT product_name, COUNT(product_name) FROM Products WHERE product_price > 1000 OR product_price < 500 GROUP BY product_name | nvbench |
CREATE TABLE table_21098 (
"Rank" real,
"Team" text,
"Round1" real,
"Round2" real,
"Round3" real,
"Round4" real,
"Round5" real,
"Total Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest score for round 2?
| SELECT MAX("Round2") FROM table_21098 | wikisql |
CREATE TABLE table_204_79 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- after the 1990/91 season , which place was earned in the next season ?
| SELECT "place" FROM table_204_79 WHERE "season" > '1990/91' ORDER BY "season" LIMIT 1 | squall |
CREATE TABLE table_52445 (
"Year" real,
"Network" text,
"Lap-by-lap" text,
"Color commentator(s)" text,
"Pit reporters" text,
"Host" text,
"Ratings" text,
"Viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the ratings for... | SELECT "Ratings" FROM table_52445 WHERE "Host" = 'chris economaki' AND "Viewers" = '12.3 million' | wikisql |
CREATE TABLE table_34096 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what week was the attendance 25,000?
| SELECT "Week" FROM table_34096 WHERE "Attendance" = '25,000' | wikisql |
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_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '2412028' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-01-31' AND '2009-06-09' | css |
CREATE TABLE table_name_51 (
points INTEGER,
touchdowns INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points is the lowest one that has Touchdowns smaller than 1?
| SELECT MAX(points) FROM table_name_51 WHERE touchdowns < 1 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.