instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_36591 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score did the Green Bay Packers get as visitor?
| SELECT "Score" FROM table_36591 WHERE "Visitor" = 'green bay packers' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_6283 (
"Rank" text,
"Institution" text,
"Gold" real,
"Silver" real,
"Bronze" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of Silvers for rank 7 teams with 1 gold and under 1 bronze?
| SELECT MAX("Silver") FROM table_6283 WHERE "Bronze" < '1' AND "Gold" = '1' AND "Rank" = '7' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... | eicu |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Course_Authors_and_... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) | nvbench |
CREATE TABLE Benefits_Overpayments (
council_tax_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Parking_Fines (
council_tax_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Electoral_Register (
electoral_register_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Business_Rates (
... | SELECT council_tax_id, cmi_cross_ref_id FROM Parking_Fines | nvbench |
CREATE TABLE table_70059 (
"Rank" real,
"Circuit" text,
"Headquarters" text,
"Screens" real,
"Sites" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the rank of the cinema when the number of sites is more than 62 and the circuit is cineplex e... | SELECT SUM("Rank") FROM table_70059 WHERE "Sites" > '62' AND "Circuit" = 'cineplex entertainment' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND prescriptions.drug = 'sucralfate' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER ... | mimic_iii |
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.language = "PTUN" AND demographic.dod_year <= "2138.0" | mimicsql_data |
CREATE TABLE table_31137 (
"Year" real,
"Network" text,
"Play-by-play announcer" text,
"Color commentator" text,
"s Field reporter" text,
"Pregame hosts" text,
"Pregame analysts" text,
"Trophy presentation" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT "Pregame analysts" FROM table_31137 WHERE "Trophy presentation" = 'Chris Rose' | wikisql |
CREATE TABLE table_25839957_5 (
cvt_hd VARCHAR,
market VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What mobile markets have cvt hd?
| SELECT cvt_hd FROM table_25839957_5 WHERE market = "Mobile" | sql_create_context |
CREATE TABLE table_64397 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What F/Laps li... | SELECT "F/Laps" FROM table_64397 WHERE "Points" = 'n/a' AND "Poles" = '1' AND "Wins" = '0' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT DATE(CreationDate) AS date, COUNT(*) AS q_cnt, SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS answered_cnt, SUM(ViewCount) AS vw_cnt FROM Posts WHERE PostTypeId = 1 GROUP BY DATE(CreationDate) ORDER BY date | sede |
CREATE TABLE table_28877 (
"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.
-- What party did the incumbent Thomas P. Moore belong to?
| SELECT "Party" FROM table_28877 WHERE "Incumbent" = 'Thomas P. Moore' | wikisql |
CREATE TABLE projects (
project_id number,
organisation_id number,
project_details text
)
CREATE TABLE research_staff (
staff_id number,
employer_organisation_id number,
staff_details text
)
CREATE TABLE document_types (
document_type_code text,
document_description text
)
CREATE TABL... | SELECT T1.grant_amount FROM grants AS T1 JOIN documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16' | spider |
CREATE TABLE table_27014 (
"Vehicle" text,
"Operating mode" text,
"EPA rated All-electric range" text,
"EPA rated combined fuel economy" text,
"Clean electric grid California (San Francisco)" text,
"U.S. national average electric mix" text,
"Dirty electric grid Rocky Mountains (Denver)" text... | SELECT COUNT("Operating mode") FROM table_27014 WHERE "EPA rated combined fuel economy" = '87 mpg-e (39kW-hrs/100mi)' | wikisql |
CREATE TABLE table_name_45 (
year VARCHAR,
nominee VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years was Denis Lawson nominated for an award?
| SELECT COUNT(year) FROM table_name_45 WHERE nominee = "denis lawson" | sql_create_context |
CREATE TABLE table_name_76 (
country_region VARCHAR,
languages VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country speaks Vietnamese?
| SELECT country_region FROM table_name_76 WHERE languages = "vietnamese" | sql_create_context |
CREATE TABLE table_name_14 (
division VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Division does the City being jacksonville, florida belong to?
| SELECT division FROM table_name_14 WHERE city = "jacksonville, florida" | sql_create_context |
CREATE TABLE table_8711 (
"Developer(s)" text,
"Release date" text,
"Required OS" text,
"Payment" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Release date has a Developer(s) of microsoft research?
| SELECT "Release date" FROM table_8711 WHERE "Developer(s)" = 'microsoft research' | wikisql |
CREATE TABLE table_name_7 (
elevated VARCHAR,
elevator VARCHAR,
cardinalatial_order_and_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of elevation for the Cardinal elevated by Nicholas III to the title of Cardinal-Deacon of S. Eus... | SELECT elevated FROM table_name_7 WHERE elevator = "nicholas iii" AND cardinalatial_order_and_title = "cardinal-deacon of s. eustachio" | sql_create_context |
CREATE TABLE table_204_10 (
id number,
"ecclesiastical jurisdictions" text,
"latin name" text,
"type" text,
"rite" text,
"ecclesiastical province" text,
"established" text,
"area (km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- wh... | SELECT "type" FROM table_204_10 GROUP BY "type" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_12973 (
"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 "Points for" FROM table_12973 WHERE "Losing bonus" = '2' AND "Lost" = '8' AND "Club" = 'rhyl and district rfc' | wikisql |
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE ... | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | nvbench |
CREATE TABLE table_59079 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the event in a year before 1989?
| SELECT "Event" FROM table_59079 WHERE "Year" < '1989' | wikisql |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age... | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition_result (
... | SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY Position | nvbench |
CREATE TABLE table_21248 (
"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.
-- Who di... | SELECT "High points" FROM table_21248 WHERE "Date" = 'April 12' | wikisql |
CREATE TABLE table_34287 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the game that had an end result of 5-2?
| SELECT "Score" FROM table_34287 WHERE "Result" = '5-2' | wikisql |
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 All_Road, School_ID FROM basketball_match ORDER BY School_ID DESC | nvbench |
CREATE TABLE table_70238 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Intergiro classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the followin... | SELECT "Intergiro classification" FROM table_70238 WHERE "Trofeo Fast Team" = 'gb-mg maglificio' | wikisql |
CREATE TABLE table_name_76 (
draws VARCHAR,
against VARCHAR,
byes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of draws when there are 1465 against matches and less than 2 byes?
| SELECT COUNT(draws) FROM table_name_76 WHERE against = 1465 AND byes < 2 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "49" AND demographic.admityear < "2163" | mimicsql_data |
CREATE TABLE table_54729 (
"Club" text,
"Wins" real,
"Runners-up" real,
"Years won" text,
"Years runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years runner-up is Birmingham city, with over 1 runners-up?
| SELECT "Years runner-up" FROM table_54729 WHERE "Runners-up" > '1' AND "Club" = 'birmingham city' | wikisql |
CREATE TABLE table_204_100 (
id number,
"date" text,
"name of ship" text,
"nationality" text,
"tonnage" number,
"fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what ship is recorded as sunk before the ss eros ?
| SELECT "name of ship" FROM table_204_100 WHERE id = (SELECT id FROM table_204_100 WHERE "name of ship" = 'ss eros') - 1 | squall |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_ca... | SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY AVG(Age) | nvbench |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY COUNT(Type) | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
med... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8066' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... | eicu |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | 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 = '004-29334')) AND treatment.treatmentname = 'surgery consultation'... | eicu |
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 zyjybgb.BGDH FROM zyjybgb WHERE zyjybgb.JZLSH = '98858427489' AND NOT zyjybgb.KSMC LIKE '%其它%' UNION SELECT mzjybgb.BGDH FROM mzjybgb WHERE mzjybgb.JZLSH = '98858427489' AND NOT mzjybgb.KSMC LIKE '%其它%' | css |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韦文心' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-05-29') | css |
CREATE TABLE table_204_58 (
id number,
"year" number,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was their position the year after the year they withdrew due to rebel attacks ?
| SELECT "position" FROM table_204_58 WHERE "year" > (SELECT "year" FROM table_204_58 WHERE "position" = 'withdrew due to rebel attack') ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '1314915' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DI... | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patient... | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-14220')) AND lab.labname = 'creatinine' AND STRFTIME('%y-%m', lab.labresulttime) >=... | eicu |
CREATE TABLE table_name_34 (
rank INTEGER,
name VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rank for Viktors Dobrecovs with less than 325 Matches?
| SELECT AVG(rank) FROM table_name_34 WHERE name = "viktors dobrecovs" AND matches < 325 | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '鲁建修' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 4854.45) | css |
CREATE TABLE table_name_38 (
score VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Bolton Wanderers were the away team?
| SELECT score FROM table_name_38 WHERE away_team = "bolton wanderers" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
... | SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester... | advising |
CREATE TABLE table_74334 (
"Team" text,
"Stadium" text,
"Home Games" real,
"Average Attendance" real,
"Total Attendance" real,
"Capacity Percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many teams had a 99.3% capacity rating?
| SELECT COUNT("Team") FROM table_74334 WHERE "Capacity Percentage" = '99.3%' | wikisql |
CREATE TABLE table_41349 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the visitor with the 14-10 record?
| SELECT "Visitor" FROM table_41349 WHERE "Record" = '14-10' | wikisql |
CREATE TABLE table_204_861 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games were replays ?
| SELECT COUNT(*) FROM table_204_861 WHERE "tie no" = 'replay' | squall |
CREATE TABLE table_name_41 (
position VARCHAR,
player VARCHAR,
club_province VARCHAR,
caps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does ceri sweeney with under 87 caps of the newport gwent dragons play?
| SELECT position FROM table_name_41 WHERE club_province = "newport gwent dragons" AND caps < 87 AND player = "ceri sweeney" | sql_create_context |
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | SELECT Location, COUNT(Location) FROM party GROUP BY Location ORDER BY Location DESC | nvbench |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Price DESC | nvbench |
CREATE TABLE table_203_667 (
id number,
"year" number,
"driver" text,
"co-driver" text,
"car" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which driver won after ponsiano lwakataka ?
| SELECT "driver" FROM table_203_667 WHERE "year" > (SELECT "year" FROM table_203_667 WHERE "driver" = 'ponsiano lwakataka') ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '012-37411' AND patient.unitdischargetime IS NULL | eicu |
CREATE TABLE table_79450 (
"Year" real,
"Program" text,
"Role" text,
"Episode" text,
"First aired" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode was first aired in 1976?
| SELECT "Episode" FROM table_79450 WHERE "First aired" = '1976' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-141335' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hos... | eicu |
CREATE TABLE phone_market (
Num_of_stock INTEGER,
Phone_ID VARCHAR
)
CREATE TABLE phone (
Name VARCHAR,
Phone_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each phone, show its names and total number of stocks.
| SELECT T2.Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name | sql_create_context |
CREATE TABLE table_name_74 (
cuts_made VARCHAR,
events VARCHAR,
top_5 VARCHAR,
top_10 VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cuts made when the Top-10 is larger than 1, and the wins greater than 0, and a Top-5 great... | SELECT COUNT(cuts_made) FROM table_name_74 WHERE top_10 > 1 AND wins > 0 AND top_5 > 2 AND events > 18 | 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 t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5333311' GROUP BY t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE table_203_296 (
id number,
"country" text,
"total gdp (nominal)\n(billion us$)" text,
"gdp per capita\n(us$, ppp)" text,
"gdp growth,\n2007-2011\n(in %)" number,
"hdi" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what country had ... | SELECT "country" FROM table_203_296 ORDER BY "gdp growth,\n2007-2011\n(in %)" LIMIT 1 | squall |
CREATE TABLE problem_log (
problem_log_id VARCHAR,
log_entry_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the id of the problem log that is created most recently?
| SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_72 (
record VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Record that has the Game of 19?
| SELECT record FROM table_name_72 WHERE game = 19 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '褚芳芳' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2013-05-1... | css |
CREATE TABLE table_60996 (
"Semi-closed initial unstressed vowels" text,
"17th c." text,
"American" text,
"Australian" text,
"Examples" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the American sound that has a 17th century equivalent of ?... | SELECT "American" FROM table_60996 WHERE "17th c." = 'ɔ' | wikisql |
CREATE TABLE table_name_33 (
frequency VARCHAR,
origin VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the frequency of number 3 with a bus station origin?
| SELECT frequency FROM table_name_33 WHERE origin = "bus station" AND number = 3 | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Ar... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category | nvbench |
CREATE TABLE table_17622423_12 (
date VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for series 2-2
| SELECT date FROM table_17622423_12 WHERE series = "2-2" | sql_create_context |
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 Badges (
Id number,
UserId number,
Name text,
... | SELECT COUNT(DISTINCT ParentId) FROM Posts WHERE Posts.PostTypeId = 2 AND Posts.ParentId IN (SELECT Posts.Id FROM Posts WHERE Posts.OwnerUserId IN (SELECT Users.Id FROM Users WHERE Users.Reputation < '##reputation1##' AND Reputation >= '##reputation2##' AND Users.CreationDate < DATEADD(month, -6, GETDATE())) AND Posts.... | sede |
CREATE TABLE table_204_665 (
id number,
"rank" number,
"name" text,
"notability" text,
"birthplace" text,
"advocate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what name is previous to wayne gretzky on the list ?
| SELECT "name" FROM table_204_665 WHERE "rank" = (SELECT "rank" FROM table_204_665 WHERE "name" = 'wayne gretzky') - 1 | squall |
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 MIN(t_kc24.MED_AMOUT), MAX(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 = '7379867' AND gwyjzb.IN_DIAG_DIS_CD = 'T83.572' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '7379867' AND fgwyjzb.IN_DIA... | css |
CREATE TABLE table_name_96 (
venue VARCHAR,
against VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the venue for the game played on 16/01/1954, when the against was more than 3?
| SELECT venue FROM table_name_96 WHERE against > 3 AND date = "16/01/1954" | sql_create_context |
CREATE TABLE table_name_7 (
score_final INTEGER,
score_qualifying VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was her lowest final score with a qualifying score of 74.075?
| SELECT MIN(score_final) FROM table_name_7 WHERE score_qualifying = 74.075 | sql_create_context |
CREATE TABLE table_62701 (
"Season" real,
"Winners" text,
"Runners-up" text,
"Third-place" text,
"fourth-placed" text,
"Number of clubs" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was in third place when the Winner was Dalian Shide, Chon... | SELECT "Third-place" FROM table_62701 WHERE "Number of clubs" = '14' AND "Winners" = 'dalian shide' AND "fourth-placed" = 'chongqing longxin' | wikisql |
CREATE TABLE table_name_14 (
event VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event was on 26 August 2005?
| SELECT event FROM table_name_14 WHERE date = "26 august 2005" | sql_create_context |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,... | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements GROUP BY Date_Claim_Settled | nvbench |
CREATE TABLE table_name_45 (
established INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the venue named nassau veterans memorial coliseum established??
| SELECT MAX(established) FROM table_name_45 WHERE venue = "nassau veterans memorial coliseum" | sql_create_context |
CREATE TABLE table_64692 (
"Term Abroad" text,
"2000/01" real,
"2001/02" real,
"2002/03" real,
"2003/04" real,
"2004/05" real,
"2005/06" real,
"2006/07" real,
"2007/08" real,
"2008/09" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT AVG("2007/08") FROM table_64692 WHERE "2002/03" > '3.8' AND "2003/04" > '8.9' AND "2001/02" < '34.4' | wikisql |
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCHAR(255),
other_company_details VARCHAR(255)
)
C... | SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name | nvbench |
CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID ... | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio DESC | nvbench |
CREATE TABLE table_53657 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"First elected" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which member has Cook as the electorate?
| SELECT "Member" FROM table_53657 WHERE "Electorate" = 'cook' | wikisql |
CREATE TABLE table_204_15 (
id number,
"year" number,
"date" text,
"venue" text,
"city" text,
"country" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- is canada at least on the chart 3 times ?
| SELECT (SELECT COUNT(*) FROM table_204_15 WHERE "country" = 'canada') > 3 | squall |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE table_47433 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date was the match with a Score of 6-2, 6-4?
| SELECT "Date" FROM table_47433 WHERE "Score" = '6-2, 6-4' | wikisql |
CREATE TABLE table_5107 (
"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.
-- Which Played is the highest one that has a Lost ... | SELECT MAX("Played") FROM table_5107 WHERE "Lost" < '1' AND "Difference" = '6' AND "Against" > '2' | 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 prescription... | 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.short_title = "Aortic valve disorder" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_19577 (
"Year" real,
"Enrollment" real,
"Black (%)" text,
"White (%)" text,
"Hispanic (%)" text,
"Asian (%)" text,
"Free/reduced lunch (%)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of Asians are there... | SELECT "Asian (%)" FROM table_19577 WHERE "Year" = '2009' | wikisql |
CREATE TABLE table_30597 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the smallest... | SELECT MIN("No. in season") FROM table_30597 | wikisql |
CREATE TABLE table_35232 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Location/attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest game with Oakland Seals opponent and a record of 27-30-6 ... | SELECT MAX("Game") FROM table_35232 WHERE "Opponent" = 'oakland seals' AND "Record" = '27-30-6' AND "Date" > '7' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-144847' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospita... | eicu |
CREATE TABLE table_79762 (
"Tournament" text,
"Wins" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cuts did he make in the tournament with 3 top 25s and under 13 events?
| SELECT MAX("Cuts made") FROM table_79762 WHERE "Top-25" = '3' AND "Events" < '13' | wikisql |
CREATE TABLE discount_coupons (
coupon_id number,
date_issued time,
coupon_amount number
)
CREATE TABLE customers (
customer_id number,
coupon_id number,
good_or_bad_customer text,
first_name text,
last_name text,
gender_mf text,
date_became_customer time,
date_last_hire tim... | SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76 | spider |
CREATE TABLE table_15055594_6 (
fall_09 INTEGER,
fall_06 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest number of students in Fall 09 in the state that had 3821 in Fall 06?
| SELECT MAX(fall_09) FROM table_15055594_6 WHERE fall_06 = 3821 | sql_create_context |
CREATE TABLE table_30087032_5 (
high_points VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different high points results are there for the game on May 15?
| SELECT COUNT(high_points) FROM table_30087032_5 WHERE date = "May 15" | sql_create_context |
CREATE TABLE table_name_60 (
plural VARCHAR,
singular VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the plural if the singular is awu?
| SELECT plural FROM table_name_60 WHERE singular = "awu" | sql_create_context |
CREATE TABLE table_train_151 (
"id" int,
"gender" string,
"renal_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"fasting_c_peptide" float,
"stenosis_of_coronary" int,
"serum_creatinine" float,
"esrd" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, ans... | SELECT * FROM table_train_151 WHERE estimated_glomerular_filtration_rate_egfr < 15 OR (renal_disease = 1 OR esrd = 1) | criteria2sql |
CREATE TABLE table_56654 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the leading scorer for april 12, 2008
| SELECT "Leading scorer" FROM table_56654 WHERE "Date" = 'april 12, 2008' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.