instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_10195 (
"Goal" real,
"Date" text,
"Venue" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day is miami the venue with 38 goals?
| SELECT "Date" FROM table_10195 WHERE "Venue" = 'miami' AND "Goal" = '38' | wikisql |
CREATE TABLE table_name_79 (
province VARCHAR,
party VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Ken Wright of the National Party was from which province?
| SELECT province FROM table_name_79 WHERE party = "national" AND name = "ken wright" | sql_create_context |
CREATE TABLE table_62372 (
"1999/ 00" text,
"2000/ 01" text,
"2001/ 02" text,
"2002/ 03" text,
"2003/ 04" text,
"2004/ 05" text,
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
... | SELECT "2008/ 09" FROM table_62372 WHERE "1999/ 00" = 'non-ranking tournaments' | wikisql |
CREATE TABLE table_12120 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the 2nd leg when Belasica is team 2?
| SELECT "2nd leg" FROM table_12120 WHERE "Team 2" = 'belasica' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "OU" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "V4581" | mimicsql_data |
CREATE TABLE table_1308 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title when there... | SELECT "Title" FROM table_1308 WHERE "U.S. viewers (millions)" = '14.39' | wikisql |
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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
di... | SELECT name, salary FROM employee WHERE eid = 242518965 | spider |
CREATE TABLE table_27383390_4 (
team VARCHAR,
date_of_vacancy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team with the date of vacancy 8 dec 2010?
| SELECT team FROM table_27383390_4 WHERE date_of_vacancy = "8 Dec 2010" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Automatic implantable cardioverter/defibrillator (AICD) check" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id n... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1014) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '... | mimic_iii |
CREATE TABLE table_name_6 (
game INTEGER,
high_rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Game(s), when High Rebounds is 'Pierson (6)'?
| SELECT SUM(game) FROM table_name_6 WHERE high_rebounds = "pierson (6)" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2261260' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) > 9 | css |
CREATE TABLE table_37649 (
"Commune" text,
"Area (km 2 )" real,
"2002 population" real,
"Density (km 2 )" real,
"Government website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the density that has an area smaller than 2,200.2 and a popul... | SELECT COUNT("Density (km 2 )") FROM table_37649 WHERE "Area (km 2 )" < '2,200.2' AND "2002 population" > '2,599' | wikisql |
CREATE TABLE table_name_40 (
Box VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the box score for the game where the away team was the sydney spirit?
| SELECT Box AS score FROM table_name_40 WHERE away_team = "sydney spirit" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uniquepi... | eicu |
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 WHERE demographic.dob_year < "2182" | mimicsql_data |
CREATE TABLE table_56818 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine \u2020" text,
"Tyre" text,
"Driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine did David Coulthard have in his mp4-13 chass... | SELECT "Engine \u2020" FROM table_56818 WHERE "Chassis" = 'mp4-13' AND "Driver" = 'david coulthard' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.short_title = "Other phototherapy" | mimicsql_data |
CREATE TABLE table_name_45 (
identifier VARCHAR,
power VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the identifier that has 50,000 watts of power?
| SELECT identifier FROM table_name_45 WHERE power = "50,000 watts" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.long_title = "Observation for suspected genetic or metabolic condition" | mimicsql_data |
CREATE TABLE table_64220 (
"Event" text,
"Date" text,
"Location" text,
"Winning skip" text,
"Runner-up skip" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event did Patti Lank have the winning skip?
| SELECT "Event" FROM table_64220 WHERE "Winning skip" = 'patti lank' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "30" | mimicsql_data |
CREATE TABLE table_name_62 (
transfer_fee VARCHAR,
type VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT TRANSFER FEE HAS A TYPE OF TRANSFER FOR DOS SANTOS?
| SELECT transfer_fee FROM table_name_62 WHERE type = "transfer" AND name = "dos santos" | sql_create_context |
CREATE TABLE table_35591 (
"Year" text,
"Winners" text,
"Score" text,
"Runner-up" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the match with a score of 33-22?
| SELECT "Venue" FROM table_35591 WHERE "Score" = '33-22' | wikisql |
CREATE TABLE table_name_7 (
team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team did they play on March 11?
| SELECT team FROM table_name_7 WHERE date = "march 11" | sql_create_context |
CREATE TABLE table_38195 (
"Rank" real,
"Name" text,
"Height m (ft)" text,
"Floors" real,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest floors with rank greater than 1 in Conrad Dubai?
| SELECT MAX("Floors") FROM table_38195 WHERE "Rank" > '1' AND "Name" = 'conrad dubai' | wikisql |
CREATE TABLE table_62528 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place of the Player with a To par of 6?
| SELECT "Place" FROM table_62528 WHERE "To par" = '–6' | wikisql |
CREATE TABLE table_name_87 (
d_48_√ VARCHAR,
d_46_√ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the D 48 with a D 46 with r 33 o?
| SELECT d_48_√ FROM table_name_87 WHERE d_46_√ = "r 33 o" | sql_create_context |
CREATE TABLE fgwyjzb (
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 SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '65322845' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-12-30' AND '2010-10-25' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg... | css |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Guests (
gue... | SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE buildings (
id int,
name text,
City text,
Height int,
Stories int,
Status text
)
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_... | SELECT name, Assets_billion FROM Companies ORDER BY name | nvbench |
CREATE TABLE table_name_35 (
score VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the away team Chelsea?
| SELECT score FROM table_name_35 WHERE away_team = "chelsea" | sql_create_context |
CREATE TABLE table_47952 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Format is Vinyl, and when Label is Mercury?
| SELECT "Date" FROM table_47952 WHERE "Format" = 'vinyl' AND "Label" = 'mercury' | 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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '花正阳' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2018-09-29') | css |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
... | SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'image understanding' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC | scholar |
CREATE TABLE table_name_35 (
example_code__huc_ INTEGER,
level VARCHAR,
example_name VARCHAR,
digits VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mean huc example code when the example name's lower snake, there are 6 digits, and less th... | SELECT AVG(example_code__huc_) FROM table_name_35 WHERE example_name = "lower snake" AND digits = 6 AND level < 3 | sql_create_context |
CREATE TABLE table_32738 (
"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 away team played when the home team scoreed... | SELECT "Away team" FROM table_32738 WHERE "Home team score" = '5.7 (37)' | wikisql |
CREATE TABLE gwyjzb (
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 AVG(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9033547' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-11-19' AND '2017-02-07' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHE... | css |
CREATE TABLE table_24921 (
"School" text,
"Location" text,
"Team Name" text,
"Colors" text,
"Varsity Teams" real,
"NJCAA Championships" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum possible NJCAA championships?
| SELECT MIN("NJCAA Championships") FROM table_24921 | wikisql |
CREATE TABLE table_name_65 (
moving_to VARCHAR,
date_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the player loaned out on 27 november 2008 move to ?
| SELECT moving_to FROM table_name_65 WHERE date_from = "27 november 2008" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE table_name_39 (
points_jury VARCHAR,
dance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Points Jury for Dance pop?
| SELECT points_jury FROM table_name_39 WHERE dance = "pop" | sql_create_context |
CREATE TABLE table_name_37 (
final_rank VARCHAR,
rank_in_fs VARCHAR,
rank_in_sp VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many skaters have a Rank in FS of 3, and a Rank in SP larger than 4?
| SELECT COUNT(final_rank) FROM table_name_37 WHERE rank_in_fs = 3 AND rank_in_sp > 4 | sql_create_context |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE savings (
custid number,
balance number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of accounts with a saving... | SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings) | spider |
CREATE TABLE table_name_54 (
pick__number INTEGER,
overall VARCHAR,
position VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Pick Number when the position was wide receiver, the college was Southern Miss with an overall l... | SELECT AVG(pick__number) FROM table_name_54 WHERE position = "wide receiver" AND college = "southern miss" AND overall < 186 | sql_create_context |
CREATE TABLE table_19934 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of episode for phyllo dough
| SELECT COUNT("Episode") FROM table_19934 WHERE "Segment C" = 'Phyllo Dough' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "4589" | mimicsql_data |
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG... | css |
CREATE TABLE table_203_186 (
id number,
"painter" text,
"composition" number,
"drawing" number,
"color" number,
"expression" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which artists scored at least 16 for composition ?
| SELECT "painter" FROM table_203_186 WHERE "composition" >= 16 | squall |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Fo... | SELECT Took_office, COUNT(Took_office) FROM party ORDER BY COUNT(Took_office) | nvbench |
CREATE TABLE table_25486 (
"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 "High points" FROM table_25486 WHERE "High rebounds" = 'Terrence Williams (8)' | wikisql |
CREATE TABLE table_21584646_10 (
champion VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many champions are shown for the runner-up of stefan edberg?
| SELECT COUNT(champion) FROM table_21584646_10 WHERE runner_up = "Stefan Edberg" | sql_create_context |
CREATE TABLE table_name_20 (
visitor VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which visitor has a Los Angeles home?
| SELECT visitor FROM table_name_20 WHERE home = "los angeles" | sql_create_context |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Visua... | SELECT title, SUM(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY SUM(stars) | nvbench |
CREATE TABLE table_76789 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which College has a Position of ol, and a Pick # smaller than 32?
| SELECT "College" FROM table_76789 WHERE "Position" = 'ol' AND "Pick #" < '32' | wikisql |
CREATE TABLE table_name_33 (
competition VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the competition when the score was 3-0?
| SELECT competition FROM table_name_33 WHERE score = "3-0" | sql_create_context |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "30400" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_43562 (
"1946 Nos" text,
"1947 Nos" text,
"Date" real,
"Built at" text,
"LMS Nos" text,
"BR Nos" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1947 Nos has a BR Nos of 48730-9?
| SELECT "1947 Nos" FROM table_43562 WHERE "BR Nos" = '48730-9' | wikisql |
CREATE TABLE table_name_31 (
imed_avicenna_listed VARCHAR,
established VARCHAR,
degree VARCHAR,
regional_offshore VARCHAR,
country_territory VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the imed/avicenna listed for a medical school offs... | SELECT imed_avicenna_listed FROM table_name_31 WHERE regional_offshore = "offshore" AND country_territory = "saint kitts and nevis" AND degree = "md" AND established < 2000 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_75989 (
"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 Loera has a S... | SELECT "Loera" FROM table_75989 WHERE "Source" = 'surveyusa' AND "Date" = 'may 16–may 18, 2008' | wikisql |
CREATE TABLE table_19102 (
"Club" text,
"Played" text,
"Won" 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 follo... | SELECT "Points for" FROM table_19102 WHERE "Lost" = '7' | wikisql |
CREATE TABLE table_name_86 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game when the record was 70-74?
| SELECT date FROM table_name_86 WHERE record = "70-74" | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_name_35 (
yonguk VARCHAR,
halang VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Yonguk has a Halang of ran ?
| SELECT yonguk FROM table_name_35 WHERE halang = "ran¹" | sql_create_context |
CREATE TABLE table_15755 (
"Player" text,
"League" real,
"Scottish Cup" real,
"League Cup" real,
"Challenge Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Total with a League Cup greater than 0, Player Gary... | SELECT MAX("Total") FROM table_15755 WHERE "League Cup" > '0' AND "Player" = 'gary harkins' AND "Scottish Cup" > '0' | wikisql |
CREATE TABLE table_56228 (
"D 50" text,
"D 49" text,
"D 48" text,
"D 47" text,
"D 46" text,
"D 45" text,
"D 44" text,
"D 43" text,
"D 42" text,
"D 41" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the D 42 when the D 50 ... | SELECT "D 42" FROM table_56228 WHERE "D 50" = 'd 31' | wikisql |
CREATE TABLE table_58447 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of Competition of 2008 africa cup of nations?
| SELECT "Date" FROM table_58447 WHERE "Competition" = '2008 africa cup of nations' | wikisql |
CREATE TABLE table_796 (
"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 of South Carolina 5?
| SELECT "Candidates" FROM table_796 WHERE "District" = 'South Carolina 5' | wikisql |
CREATE TABLE zyb (
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 qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0798538' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_... | css |
CREATE TABLE table_name_76 (
name VARCHAR,
species_authority VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name for the species Authority of sigmodon hispidus say & ord, 1825?
| SELECT name FROM table_name_76 WHERE species_authority = "sigmodon hispidus say & ord, 1825" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Regular_Season, School_ID FROM basketball_match | nvbench |
CREATE TABLE table_13012165_1 (
maryland VARCHAR,
pennsylvania VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played in Maryland the same year that Deep Run Valley LL Hilltown played in Pennsylvania?
| SELECT maryland FROM table_13012165_1 WHERE pennsylvania = "Deep Run Valley LL Hilltown" | sql_create_context |
CREATE TABLE table_76772 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Gain has a Long of 29, and an Avg/G smaller than 33.7?
| SELECT COUNT("Gain") FROM table_76772 WHERE "Long" = '29' AND "Avg/G" < '33.7' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "29961" | mimicsql_data |
CREATE TABLE table_46431 (
"Club" text,
"Location" text,
"Current manager" text,
"Team captain" text,
"Stadium" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the team captain of the Guldensporen Stadion with a stadium ca... | SELECT "Team captain" FROM table_46431 WHERE "Capacity" > '12,919' AND "Stadium" = 'guldensporen stadion' | wikisql |
CREATE TABLE table_79744 (
"Name" text,
"Birth year and age" text,
"Net worth US$ (billions)" real,
"Citizenship" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the source of wealth of the person worth $17 billion?
| SELECT "Source" FROM table_79744 WHERE "Net worth US$ (billions)" = '17' | 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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ... | css |
CREATE TABLE table_27712702_11 (
game INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the game number where the record was 46 24?
| SELECT MIN(game) FROM table_27712702_11 WHERE record = "46–24" | sql_create_context |
CREATE TABLE table_25446 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the surface when the us open is the championship in... | SELECT "Surface" FROM table_25446 WHERE "Championship" = 'US Open' AND "Year" = '1979' | wikisql |
CREATE TABLE table_name_62 (
silver INTEGER,
nation VARCHAR,
gold VARCHAR,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the most silver when bronze is more than 0, total is more than 1, gold is more than 0 and the ... | SELECT MAX(silver) FROM table_name_62 WHERE bronze > 0 AND total > 1 AND gold > 0 AND nation = "china (chn)" | sql_create_context |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '继发龋' AND jyjgzbb.JCZBMC = '妊娠相关... | css |
CREATE TABLE table_46927 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the player is Corey Pavin when he had a To par of over 7, what was the sum of h... | SELECT SUM("Total") FROM table_46927 WHERE "To par" > '7' AND "Player" = 'corey pavin' | wikisql |
CREATE TABLE table_name_29 (
release_date VARCHAR,
sspec_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the release date for the processor spec number SLBEQ(d0)?
| SELECT release_date FROM table_name_29 WHERE sspec_number = "slbeq(d0)" | sql_create_context |
CREATE TABLE Students (
first_name VARCHAR,
student_id VARCHAR
)
CREATE TABLE Student_Addresses (
student_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the id and first name of the student whose addresses have the highest average monthly re... | SELECT T1.student_id, T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_201_39 (
id number,
"no" number,
"title" text,
"directed by" text,
"released" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last title that sid marcus directed ?
| SELECT "title" FROM table_201_39 WHERE "directed by" = 'sid marcus' ORDER BY "no" DESC LIMIT 1 | squall |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '俞玉宸' AND hz_info.YLJGDM = '4840688' AND NOT zyjzjlb.JZKSMC LIKE '%乳腺%' | css |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Other radiotherapeutic procedure" | mimicsql_data |
CREATE TABLE table_name_32 (
pick VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE TOTAL PICK FOR BOSTON COLLEGE?
| SELECT COUNT(pick) FROM table_name_32 WHERE college = "boston college" | sql_create_context |
CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
date_first_rental DATETIME,
date_left_university DATETIME,
other_student_details VARC... | SELECT student_id, address_id FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_75321 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Consort" text,
"Coronation" text,
"Ceased to be Consort" text,
"Death" text,
"Spouse" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did James II... | SELECT "Became Consort" FROM table_75321 WHERE "Spouse" = 'james ii' | wikisql |
CREATE TABLE table_name_12 (
date VARCHAR,
set_1 VARCHAR,
set_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the set 1 25 23, and a Set 3 of 25 14?
| SELECT date FROM table_name_12 WHERE set_1 = "25–23" AND set_3 = "25–14" | sql_create_context |
CREATE TABLE table_31404 (
"Name" text,
"#" real,
"Position" text,
"Height" text,
"Weight ( lb. )" real,
"Year" text,
"Hometown" text,
"Previous School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was player number 10?
| SELECT "Year" FROM table_31404 WHERE "#" = '10' | wikisql |
CREATE TABLE table_67242 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What entrant had a Maserati 250F chassis and fewer than 6 points before 1957?
| SELECT "Entrant" FROM table_67242 WHERE "Chassis" = 'maserati 250f' AND "Year" < '1957' AND "Points" < '6' | wikisql |
CREATE TABLE table_64388 (
"Rank" real,
"Heat" real,
"Athlete" text,
"Country" text,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the heat when the athlete is anita pistone?
| SELECT SUM("Heat") FROM table_64388 WHERE "Athlete" = 'anita pistone' | wikisql |
CREATE TABLE table_73084 (
"Episode title" text,
"Subject" text,
"Music by" text,
"Lyrics by" text,
"Performed by" text,
"First aired" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When zachary sanders is the performer how many first aired are ... | SELECT COUNT("First aired") FROM table_73084 WHERE "Performed by" = 'Zachary Sanders' | wikisql |
CREATE TABLE table_2818164_5 (
production_code INTEGER,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code for episode 96 in the series?
| SELECT MIN(production_code) FROM table_2818164_5 WHERE no_in_series = "96" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.