instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_17360840_4 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give the date of games against minnesota wild
| SELECT date FROM table_17360840_4 WHERE opponent = "Minnesota Wild" | sql_create_context |
CREATE TABLE table_24798489_1 (
challenge_winner VARCHAR,
original_airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the challenge winner in the episode that originally aired on January 28, 2009?
| SELECT challenge_winner FROM table_24798489_1 WHERE original_airdate = "January 28, 2009" | sql_create_context |
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2130" AND diagnoses.short_title = "Pressure ulcer, stage IV" | mimicsql_data |
CREATE TABLE table_71285 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position of the team that used an oldsmobile engine and DNQ?
| SELECT "Finish" FROM table_71285 WHERE "Engine" = 'oldsmobile' AND "Start" = 'dnq' | wikisql |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_SEX = '沈文乐' AND t_kc22.STA_DATE BETWEEN '2004-10-30' AND '2012-03-27' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeou... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')... | eicu |
CREATE TABLE table_201_1 (
id number,
"from" number,
"to" number,
"name" text,
"party" text,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which mayor of airan also held the position of first secretary for the minister of finance ?
| SELECT "name" FROM table_201_1 WHERE "position" = 'first secretary for the minister of finance' | squall |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE enroll (
class_code text,
stu_n... | SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE table_name_65 (
club VARCHAR,
try_bonus VARCHAR,
drawn VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club had 1, draw, 11 lost, and a try bonus of 7?
| SELECT club FROM table_name_65 WHERE drawn = "1" AND lost = "11" AND try_bonus = "7" | sql_create_context |
CREATE TABLE table_62117 (
"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 was the score of the Championship match played in... | SELECT "Score in the final" FROM table_62117 WHERE "Championship" = 'estoril, portugal' | wikisql |
CREATE TABLE table_name_20 (
first_elected VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of first elected for dranesville
| SELECT COUNT(first_elected) FROM table_name_20 WHERE district = "dranesville" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_31 (
director VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director of Little Beau Porky?
| SELECT director FROM table_name_31 WHERE title = "little beau porky" | sql_create_context |
CREATE TABLE table_name_60 (
opponents VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponents, when Partner is Vitalia Diatchenko?
| SELECT opponents FROM table_name_60 WHERE partner = "vitalia diatchenko" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE" | mimicsql_data |
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARC... | SELECT student_id, monthly_rental FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_14 (
melbourne VARCHAR,
auckland VARCHAR,
gold_coast VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Melbourne has an Auckland of no, and a Gold Coast of no?
| SELECT melbourne FROM table_name_14 WHERE auckland = "no" AND gold_coast = "no" | sql_create_context |
CREATE TABLE table_2562572_44 (
largest_ethnic_group__2002_ VARCHAR,
population__2011_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest ethnic group in the settlement with a 2011 population of 5082?
| SELECT COUNT(largest_ethnic_group__2002_) FROM table_2562572_44 WHERE population__2011_ = 5082 | sql_create_context |
CREATE TABLE table_56825 (
"Chemical class" text,
"Group" text,
"Formula" text,
"Prefix" text,
"Suffix" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which suffix has the prefix of isothiocyanato- (-ncs)?
| SELECT "Suffix" FROM table_56825 WHERE "Prefix" = 'isothiocyanato- (-ncs)' | wikisql |
CREATE TABLE table_name_36 (
resolution VARCHAR,
dish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the resolution for dish of 5270
| SELECT resolution FROM table_name_36 WHERE dish = "5270" | sql_create_context |
CREATE TABLE table_name_13 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 992 has a 1 2 of 1989 ?
| SELECT 1992 FROM table_name_13 WHERE 1989 = "1–2" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ye... | mimic_iii |
CREATE TABLE table_dev_52 (
"id" int,
"anemia" bool,
"gender" string,
"prediabetes" bool,
"systolic_blood_pressure_sbp" int,
"metabolic_syndrome" bool,
"hemoglobin_a1c_hba1c" float,
"dyslipidemia" bool,
"dsp" int,
"renal_disease" bool,
"hepatic_disease" bool,
"elevated_tr... | SELECT * FROM table_dev_52 WHERE anemia = 1 OR (hemoglobin_a1c_hba1c < 12 AND gender = 'male') OR (hemoglobin_a1c_hba1c < 11 AND gender = 'female') OR chronic_hematology_disorders = 1 | criteria2sql |
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Drug detoxification" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_45881 (
"Version" text,
"Length" text,
"Album" text,
"Remixed by" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the album when the year is later than 2008?
| SELECT "Album" FROM table_45881 WHERE "Year" > '2008' | wikisql |
CREATE TABLE table_name_29 (
crowd VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the size of the crowd when the home team is Fitzroy?
| SELECT COUNT(crowd) FROM table_name_29 WHERE home_team = "fitzroy" | sql_create_context |
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 Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_name_23 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attandance figure on October 7, 1990?
| SELECT attendance FROM table_name_23 WHERE date = "october 7, 1990" | sql_create_context |
CREATE TABLE table_name_45 (
streak VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which streak had an attendance of 33,013?
| SELECT streak FROM table_name_45 WHERE attendance = "33,013" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_name_89 (
rank INTEGER,
goals VARCHAR,
matches VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Des Dickson's lowest rank for matches smaller than 285 and less than 219 goals?
| SELECT MIN(rank) FROM table_name_89 WHERE matches < 285 AND name = "des dickson" AND goals < 219 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" | mimicsql_data |
CREATE TABLE table_10835 (
"Country" text,
"City" text,
"Festival name" text,
"Year(s)" text,
"Type" text,
"BIE recognised" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the year(s) when the city is kunming?
| SELECT "Year(s)" FROM table_10835 WHERE "City" = 'kunming' | wikisql |
CREATE TABLE table_15592941_1 (
college VARCHAR,
player_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did jeremy zuttah attend?
| SELECT college FROM table_15592941_1 WHERE player_name = "Jeremy Zuttah" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2165.0" AND prescriptions.drug = "Levofloxacin" | mimicsql_data |
CREATE TABLE table_204_29 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who performed better , goddard or francis ?
| SELECT "name" FROM table_204_29 WHERE "name" IN ('james goddard', 'charles francis') ORDER BY id LIMIT 1 | squall |
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 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 Id AS "post_link", ViewCount, FavoriteCount, CAST(FavoriteCount AS FLOAT) / CAST(ViewCount AS FLOAT) AS ScorePerView FROM Posts WHERE PostTypeId = 1 ORDER BY ScorePerView DESC LIMIT 100 | sede |
CREATE TABLE table_39095 (
"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,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Club" FROM table_39095 WHERE "Tries against" = '75' | wikisql |
CREATE TABLE table_25324 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Cowboys points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many opponents are there when cowboy points were 10?
| SELECT "Opponents" FROM table_25324 WHERE "Cowboys points" = '10' | wikisql |
CREATE TABLE table_name_79 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the away team when the home team was south melbourne?
| SELECT away_team AS score FROM table_name_79 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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_MZJZJLB WHERE hz_info.person_info_XM = '陈振海' AND jybgb.BGRQ BETWEEN '2003-09-30' AND '... | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_name_43 (
location VARCHAR,
round VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What location shows round was 1, and against Ricky Shivers?
| SELECT location FROM table_name_43 WHERE round = 1 AND opponent = "ricky shivers" | sql_create_context |
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,
Join_Year int,
Team text
)
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel... | SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE table_44713 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the racer with a first-qualifying time of 58.991?
| SELECT "Name" FROM table_44713 WHERE "Qual 1" = '58.991' | wikisql |
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 CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE, EMP_FNAME ORDER BY EMP_FNAME | nvbench |
CREATE TABLE table_name_46 (
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Place, when Player is 'Justin Leonard'?
| SELECT place FROM table_name_46 WHERE player = "justin leonard" | sql_create_context |
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 txmzjzjlb.YLJGDM FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '65424109' UNION SELECT ftxmzjzjlb.YLJGDM FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz_info.KH = ftxmzjzjlb.KH AND hz_i... | css |
CREATE TABLE table_28633 (
"Channel" real,
"Channel name" text,
"Callsign" text,
"Signal power" text,
"Broadcast area" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many channels are there in the Greater Tokyo area?
| SELECT COUNT("Channel") FROM table_28633 WHERE "Broadcast area" = 'Greater Tokyo' | wikisql |
CREATE TABLE table_70851 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Margin of victory on aug 11, 2002?
| SELECT "Margin of victory" FROM table_70851 WHERE "Date" = 'aug 11, 2002' | wikisql |
CREATE TABLE table_25228 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Team classification" text,
"Combativity award" text
)
-- Using valid SQLite, answer the following qu... | SELECT COUNT("Winner") FROM table_25228 WHERE "Team classification" = 'Kelme-Costa Blanca' AND "Combativity award" = 'Jacky Durand' | wikisql |
CREATE TABLE table_name_87 (
name VARCHAR,
replacement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the manager who was replaced by michael skibbe?
| SELECT name FROM table_name_87 WHERE replacement = "michael skibbe" | sql_create_context |
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Ag... | SELECT Name, Age FROM driver | nvbench |
CREATE TABLE PlaylistTrack (
PlaylistId integer,
TrackId integer
)
CREATE TABLE Artist (
ArtistId integer,
Name varchar(120)
)
CREATE TABLE Employee (
EmployeeId integer,
LastName varchar(20),
FirstName varchar(20),
Title varchar(30),
ReportsTo integer,
BirthDate datetime,
... | SELECT T1.FirstName, T1.SupportRepId FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId ORDER BY T1.FirstName | nvbench |
CREATE TABLE table_54012 (
"Round" text,
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pick for West Virginia college?
| SELECT "Pick" FROM table_54012 WHERE "College" = 'west virginia' | wikisql |
CREATE TABLE table_11309 (
"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 was the score for the away team that played... | SELECT "Away team score" FROM table_11309 WHERE "Venue" = 'glenferrie oval' | wikisql |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Draw a bar chart for what i... | SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age) | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug = "NEO*IV*Gentamicin" | mimicsql_data |
CREATE TABLE table_name_57 (
total VARCHAR,
gold VARCHAR,
silver VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of totals that have silvers under 2, bronzes over 0, and golds over 1?
| SELECT COUNT(total) FROM table_name_57 WHERE silver < 2 AND bronze > 0 AND gold > 1 | sql_create_context |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE statements (
statement... | SELECT COUNT(*) FROM ref_budget_codes | spider |
CREATE TABLE table_28926 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the candidates in the district where the incumbent was Nathanie... | SELECT "Candidates" FROM table_28926 WHERE "Incumbent" = 'Nathaniel Macon' | 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 MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8562)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... | mimic_iii |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT TIME_TO_STR(CreationDate, '%W') AS "week", COUNT(*) AS "total_questions", ROUND(100.0 * COUNT(CASE WHEN Score < 0 THEN 1 END) / COUNT(*), 2) AS "%_score<0", ROUND(100.0 * COUNT(CASE WHEN Score > 0 THEN 1 END) / COUNT(*), 2) AS "%_score>0" FROM Posts WHERE PostTypeId = 1 GROUP BY TIME_TO_STR(CreationDate, '%W') O... | sede |
CREATE TABLE table_name_91 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team score with Fitzroy as away team?
| SELECT home_team AS score FROM table_name_91 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_6569 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the sum for a top-10 U.S. open that had a top-25 bigger ... | SELECT SUM("Top-10") FROM table_6569 WHERE "Tournament" = 'u.s. open' AND "Top-25" > '0' | wikisql |
CREATE TABLE table_29747178_3 (
title VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the episode with a production code of FL209?
| SELECT title FROM table_29747178_3 WHERE production_code = "FL209" | sql_create_context |
CREATE TABLE table_11607 (
"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.
-- How many were in the crowd when North Melbourne ... | SELECT "Crowd" FROM table_11607 WHERE "Home team" = 'north melbourne' | wikisql |
CREATE TABLE table_16407 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the cfl team that has a position of ol?
| SELECT "CFL Team" FROM table_16407 WHERE "Position" = 'OL' | wikisql |
CREATE TABLE table_64412 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is ranked number 4?
| SELECT "Country" FROM table_64412 WHERE "Rank" = '4' | wikisql |
CREATE TABLE table_37694 (
"Rank" text,
"Urban sub-area" text,
"Population" text,
"Status" text,
"Council area" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population of the East Kilbride urban sub-area?
| SELECT "Population" FROM table_37694 WHERE "Urban sub-area" = 'east kilbride' | wikisql |
CREATE TABLE table_4426 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the date for dinah pfizenmaier anna zaja and winner
| SELECT "Date" FROM table_4426 WHERE "Outcome" = 'winner' AND "Opponents" = 'dinah pfizenmaier anna zaja' | wikisql |
CREATE TABLE table_52358 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which label had a CD format and a date of June 25, 2002?
| SELECT "Label" FROM table_52358 WHERE "Format" = 'cd' AND "Date" = 'june 25, 2002' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | SELECT Score, COUNT(Id) FROM (SELECT Users.Id AS "Id", AVG(Posts.Score) AS "Score" FROM Users, Posts WHERE Users.Id = Posts.OwnerUserId AND Posts.PostTypeId = 1 GROUP BY Users.Id HAVING COUNT(Posts.Id) = 1) AS P GROUP BY Score | sede |
CREATE TABLE table_74697 (
"Player" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many conversions had 0 pens and 0 tries?
| SELECT "Conv" FROM table_74697 WHERE "Pens" = '0' AND "Tries" = '0' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
insuranc... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30671) AND prescriptions.drug = 'potassium chl 20 meq / 1000 ml d5ns' AND STRFTIME('%y', prescriptions.startdate) <= '2104' | mimic_iii |
CREATE TABLE table_74123 (
"Program" text,
"Exercise" text,
"Week" text,
"Muscles Worked" text,
"Type" text,
"Ab Ripper X" text,
"Length" text,
"Equipment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the exercise when the equi... | SELECT "Exercise" FROM table_74123 WHERE "Equipment" = 'Heart rate monitor, water and towel' | wikisql |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
-- Using valid SQLite, answer... | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_2161859_1 (
artist VARCHAR,
strip_numbers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the artist for strip numbers 3932-4031a?
| SELECT artist FROM table_2161859_1 WHERE strip_numbers = "3932-4031A" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid num... | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY intakeoutput.celllabel) AS ... | eicu |
CREATE TABLE table_2521 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Race Time" FROM table_2521 WHERE "Driver" = 'Jeff Gordon' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.long_title = "Below knee amputation status" | mimicsql_data |
CREATE TABLE table_name_33 (
match INTEGER,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which average match has points less than 6?
| SELECT AVG(match) FROM table_name_33 WHERE points < 6 | sql_create_context |
CREATE TABLE table_1180228_1 (
aspect_ratio VARCHAR,
released VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the aspect ratio of the DVD released on 12/10/2009?
| SELECT aspect_ratio FROM table_1180228_1 WHERE released = "12/10/2009" | sql_create_context |
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other... | SELECT Investor_details, COUNT(Investor_details) FROM Investors GROUP BY Investor_details ORDER BY COUNT(Investor_details) | nvbench |
CREATE TABLE table_22151 (
"Year to April" real,
"Revenue (US $million)" text,
"EBIT (US $m)" text,
"Net profit (US $m)" text,
"Earnings per share (\u00a2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many dollars is the revenue when the net ... | SELECT "Revenue (US $million)" FROM table_22151 WHERE "Net profit (US $m)" = '55.4' | wikisql |
CREATE TABLE table_name_59 (
round VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE ROUND NUMBER OF NICHOLAS TREMBLAY?
| SELECT COUNT(round) FROM table_name_59 WHERE player = "nicholas tremblay" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescription... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11826 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'aminocaproic acid' ORDER BY prescriptions.sta... | mimic_iii |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX n... | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '0598399' AND zyjzjlb.RYDJSJ BETWEEN '2007-02-14' AND '2021-02-04' AND zyjzjlb.WDBZ > 0 | css |
CREATE TABLE table_dev_58 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"intra_aortic_balloon_pump_iabp" bool,
"systemic_arterial_po2" int,
"creatinine_clearance_cl" float,
"supplemental_oxygen" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the foll... | SELECT * FROM table_dev_58 WHERE (gender = 'male' OR gender = 'female') AND (age >= 18 AND age <= 80) | criteria2sql |
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 mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '57... | css |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
C... | SELECT Posts.Id, FH.Id AS "before_first_hour", AFH.Id AS "after_first_hour" FROM Posts LEFT JOIN Votes AS FH ON Posts.Id = FH.PostId LEFT JOIN Votes AS AFH ON Posts.Id = AFH.PostId WHERE Posts.Score < 0 AND Posts.PostTypeId = @postType AND FH.VoteTypeId = @voteType AND AFH.VoteTypeId = @voteType AND FH.CreationDate <= ... | sede |
CREATE TABLE table_57180 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average grid for damon hill with over 74 laps?
| SELECT AVG("Grid") FROM table_57180 WHERE "Laps" > '74' AND "Driver" = 'damon hill' | wikisql |
CREATE TABLE table_name_53 (
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Competition had a game on October 31, 1979?
| SELECT competition FROM table_name_53 WHERE date = "october 31, 1979" | sql_create_context |
CREATE TABLE services (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many services are there?
| SELECT COUNT(*) FROM services | sql_create_context |
CREATE TABLE table_75403 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Result of 86-87 (2-4) involves what home team?
| SELECT "Home Team" FROM table_75403 WHERE "Result" = '86-87 (2-4)' | wikisql |
CREATE TABLE table_name_28 (
population INTEGER,
municipality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest population within the municipality of Porsgrunn?
| SELECT MAX(population) FROM table_name_28 WHERE municipality = "porsgrunn" | sql_create_context |
CREATE TABLE table_14668 (
"Team" text,
"Manager" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team is the kit manufacturer Umbro, and the captain Gary Mabbutt?
| SELECT "Team" FROM table_14668 WHERE "Kit manufacturer" = 'umbro' AND "Captain" = 'gary mabbutt' | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Chlorothiazide" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.