instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_7858 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT MAX("Losses") FROM table_7858 WHERE "Wins" > '11' AND "Goal Difference" > '5' AND "Position" = '3' AND "Draws" > '3' | wikisql |
CREATE TABLE table_65133 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's China's heat for Zhang Lin in a lane after 6?
| SELECT SUM("Heat") FROM table_65133 WHERE "Nationality" = 'china' AND "Name" = 'zhang lin' AND "Lane" > '6' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructo... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Restoration Ecology%' OR course.description LIKE '%Restoration Ecology%' OR course.name LIKE '%Restoration Ecology%') AND (area.area LIKE '%Modern Dance%' OR course.desc... | advising |
CREATE TABLE table_16225511_2 (
wins INTEGER,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the largest amount of wins Texas has?
| SELECT MAX(wins) FROM table_16225511_2 WHERE school = "Texas" | sql_create_context |
CREATE TABLE table_10082596_1 (
founded VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many schools are in Bloomington, IN?
| SELECT COUNT(founded) FROM table_10082596_1 WHERE location = "Bloomington, IN" | sql_create_context |
CREATE TABLE table_name_31 (
venue VARCHAR,
founded VARCHAR,
sport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue was fouded before 2000 for basketball?
| SELECT venue FROM table_name_31 WHERE founded < 2000 AND sport = "basketball" | 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'U14.078' | css |
CREATE TABLE gyb (
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_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '18795530' AND qtb.MED_SER_ORG_NO = '0561875' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%分裂%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '18795530' AND gyb.MED_SER_ORG_NO = '0561875' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%分裂%' UNION SELECT zyb.MED_CLINIC_ID F... | css |
CREATE TABLE table_name_87 (
frequency INTEGER,
type VARCHAR,
brand VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Frequency, when Type is 'Norte o', and when Brand is 'La Cotorra'?
| SELECT AVG(frequency) FROM table_name_87 WHERE type = "norteño" AND brand = "la cotorra" | sql_create_context |
CREATE TABLE table_22495 (
"Athlete" text,
"Class" text,
"Event" text,
"Round of 64" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text,
"Semifinals" text,
"Final/ Bronze medal match" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT "Final/ Bronze medal match" FROM table_22495 WHERE "Event" = 'Mixed Quad Singles' | 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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51259" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_51046 (
"Team" text,
"City" text,
"Total Seasons" real,
"Seasons" text,
"Highest League" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest league of the Nova Scotia Clippers with a total season of less than 4?
| SELECT "Highest League" FROM table_51046 WHERE "Total Seasons" < '4' AND "Team" = 'nova scotia clippers' | wikisql |
CREATE TABLE table_name_13 (
year INTEGER,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest year with more than 0 points?
| SELECT MAX(year) FROM table_name_13 WHERE points > 0 | sql_create_context |
CREATE TABLE table_204_433 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who came in last ?
| SELECT "name" FROM table_204_433 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, LastAccessDate FROM Users WHERE LOWER(Location) LIKE '%kolkata%' OR LOWER(Location) LIKE '%india%' ORDER BY Reputation DESC LIMIT 300 | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
... | (SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '76308065306') INTERSECT (SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '53442751434') | css |
CREATE TABLE review (
rid int,
business_id varchar,
user_id varchar,
rating float,
text longtext,
year int,
month varchar
)
CREATE TABLE neighborhood (
id int,
business_id varchar,
neighborhood_name varchar
)
CREATE TABLE user (
uid int,
user_id varchar,
name varcha... | SELECT SUM(tip.likes) FROM business, tip, user WHERE business.name = 'Cafe Zinho' AND tip.business_id = business.business_id AND user.name = 'Niloofar' AND user.user_id = tip.user_id | yelp |
CREATE TABLE table_44301 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the game that resulted in L 30-27?
| SELECT "Date" FROM table_44301 WHERE "Result" = 'l 30-27' | wikisql |
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 Users (
Id number,
Reputation number,
CreationD... | SELECT Id AS "post_link", Score, Tags, CreationDate FROM Posts WHERE Tags LIKE '%<row>%' AND PostTypeId = 1 AND Score > 0 AND CreationDate >= DATEADD(year, -1, GETDATE()) ORDER BY Score DESC | sede |
CREATE TABLE table_name_46 (
country VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country in Kunlong in?
| SELECT country FROM table_name_46 WHERE location = "kunlong" | sql_create_context |
CREATE TABLE table_25557 (
"Engine" text,
"Crankshaft" text,
"Ignition timing" text,
"Graphical" text,
"Example" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When shinya nakano's kawasaki ninja zx-rr is the example what is the graphical?
| SELECT "Graphical" FROM table_25557 WHERE "Example" = 'Shinya Nakano''s Kawasaki Ninja ZX-RR' | wikisql |
CREATE TABLE table_name_65 (
date VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Runner(s)-Up is 'Bo-Mee Lee'?
| SELECT date FROM table_name_65 WHERE runner_s__up = "bo-mee lee" | sql_create_context |
CREATE TABLE table_17071 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT POSITION DOES THE PLAYER FROM SOUTH POINTE HIGH SCHOOL PLAY?
| SELECT "Position" FROM table_17071 WHERE "School" = 'South Pointe High School' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code | nvbench |
CREATE TABLE table_name_1 (
local_networked VARCHAR,
ad_freq VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the local/network with an Ad frequency of 15 minutes?
| SELECT local_networked FROM table_name_1 WHERE ad_freq = "15 minutes" | sql_create_context |
CREATE TABLE table_33147 (
"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 away team when the home team scored... | SELECT "Away team" FROM table_33147 WHERE "Home team score" = '9.8 (62)' | wikisql |
CREATE TABLE table_66362 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Draws has Points smaller ... | SELECT MIN("Draws") FROM table_66362 WHERE "Points" < '15' AND "Conceded" > '10' AND "Position" > '8' AND "Wins" = '1' | wikisql |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY Comptroller | nvbench |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH =... | css |
CREATE TABLE table_46305 (
"Season" text,
"Timeslot" text,
"Premiere" text,
"Finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people tuned in to the finale on May... | SELECT COUNT("Viewers (in millions)") FROM table_46305 WHERE "Finale" = 'may 16, 2007' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE table_242785_3 (
main_legion_base VARCHAR,
date_disband VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the main legion base that disbanded 70 xx?
| SELECT main_legion_base FROM table_242785_3 WHERE date_disband = "70 XX" | 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 COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '4547254' GROUP BY MED_ORG_DEPT_CD HAVING MIN(IN_HOSP_DAYS) > 27) AS T | css |
CREATE TABLE table_25229283_4 (
points_for VARCHAR,
percentage___percentage_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many data are on points for if the percentage is 94.29?
| SELECT COUNT(points_for) FROM table_25229283_4 WHERE percentage___percentage_ = "94.29" | sql_create_context |
CREATE TABLE table_name_47 (
attendance VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game of a.f.c. totton?
| SELECT attendance FROM table_name_47 WHERE home_team = "a.f.c. totton" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.dod_year <= "2112.0" | mimicsql_data |
CREATE TABLE table_153 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Lowest" real,
"Highest" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum capacity of Dundee United's stadium?
| SELECT MIN("Capacity") FROM table_153 WHERE "Team" = 'Dundee United' | wikisql |
CREATE TABLE table_1341930_40 (
result VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result for south carolina 4
| SELECT result FROM table_1341930_40 WHERE district = "South Carolina 4" | sql_create_context |
CREATE TABLE table_69706 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what date was giulia casoni the partner?
| SELECT "Date" FROM table_69706 WHERE "Partner" = 'giulia casoni' | wikisql |
CREATE TABLE table_74134 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least amount of points?
| SELECT MIN("Points") FROM table_74134 | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE restaurant_type (
restypeid number,
restypename text,
restypedescription text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE type_of_restaurant (
resid number,... | SELECT major, COUNT(*) FROM student GROUP BY major ORDER BY COUNT(major) LIMIT 1 | spider |
CREATE TABLE table_68761 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Surface of hardcourt, an Outcome of runner-up, and a Tourname... | SELECT "Opponent" FROM table_68761 WHERE "Surface" = 'hardcourt' AND "Outcome" = 'runner-up' AND "Tournament" = 'honolulu' | wikisql |
CREATE TABLE table_71821 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the game in which the Jacksonville Jaguars were hosts, what was the name of the visiting ... | SELECT "Visiting Team" FROM table_71821 WHERE "Host Team" = 'jacksonville jaguars' | wikisql |
CREATE TABLE table_68100 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year is that has a Entrant of belond equa-flow / calif. muffler?
| SELECT "Year" FROM table_68100 WHERE "Entrant" = 'belond equa-flow / calif. muffler' | wikisql |
CREATE TABLE table_27441210_13 (
year VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years was the country Belgium?
| SELECT COUNT(year) FROM table_27441210_13 WHERE country = "Belgium" | sql_create_context |
CREATE TABLE table_32077 (
"Series #" real,
"Season #" real,
"Title" text,
"Original air date" text,
"Tape date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the highest series # for september 22, 1976
| SELECT MAX("Series #") FROM table_32077 WHERE "Original air date" = 'september 22, 1976' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5532316' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE table_name_9 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record for the game on April 9, 2008?
| SELECT record FROM table_name_9 WHERE date = "april 9, 2008" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
... | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'assault-fi... | mimic_iii |
CREATE TABLE table_name_12 (
gold INTEGER,
silver VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gold have a silver of 1 and a bronze of 0?
| SELECT SUM(gold) FROM table_name_12 WHERE silver = 1 AND bronze < 1 | sql_create_context |
CREATE TABLE table_name_58 (
time VARCHAR,
ground VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time has humber college north as the ground, and toronto downtown dingos as the home?
| SELECT time FROM table_name_58 WHERE ground = "humber college north" AND home = "toronto downtown dingos" | sql_create_context |
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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ac/chr syst/dia hrt fail" AND prescriptions.route = "ID" | mimicsql_data |
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 DISTINCT U.* FROM Users AS U JOIN Posts AS P ON P.OwnerUserId = U.Id JOIN PostTypes AS PT ON PT.Id = P.PostTypeId WHERE UPPER(U.Location) LIKE '%CAPE TOWN%' AND (U.WebsiteUrl != '' OR U.AboutMe != '') AND PT.Name IN ('Question', 'Answer') AND UPPER(P.Tags) LIKE '%NODE%' ORDER BY U.Reputation DESC | sede |
CREATE TABLE ftxmzjzjlb (
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,
MZZYZD... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb... | css |
CREATE TABLE table_204_279 (
id number,
"name of place" text,
"number\nof\ncounties" number,
"principal\ncounty" text,
"zip code\nlower" number,
"zip code\nupper" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the place lis... | SELECT "name of place" FROM table_204_279 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
-- Using valid SQLite, answer the following que... | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY Nominee DESC | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_item... | mimic_iii |
CREATE TABLE table_name_43 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which match had the largest crowd size where the away team was North Melbourne?
| SELECT MAX(crowd) FROM table_name_43 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BALTIMORE' AND flight.departure_time > 1800 AND flight.to_airport = airport_service.airport_code | atis |
CREATE TABLE table_name_43 (
birth_state VARCHAR,
election_year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What state was the president who was elected earlier than 1848 born in?
| SELECT birth_state FROM table_name_43 WHERE election_year < 1848 | sql_create_context |
CREATE TABLE table_name_61 (
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Venue which has a Score of 8 1?
| SELECT venue FROM table_name_61 WHERE score = "8 – 1" | sql_create_context |
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 SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '90720666' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-02-09' AND '2000-05-14' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg... | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_name_46 (
agricultural_panel INTEGER,
industrial_and_commercial_panel INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Agricultural panels that have an Industrial and Commercial Panel smaller than 0?
| SELECT SUM(agricultural_panel) FROM table_name_46 WHERE industrial_and_commercial_panel < 0 | sql_create_context |
CREATE TABLE table_57597 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid with a Toyota constructor and +1:09.718 as time/retired?
| SELECT "Grid" FROM table_57597 WHERE "Constructor" = 'toyota' AND "Time/Retired" = '+1:09.718' | 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 (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8317' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORD... | eicu |
CREATE TABLE table_33384 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"2012 club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2012 club for the Billy Miller Category:Articles with hcards (Name)?
| SELECT "2012 club" FROM table_33384 WHERE "Name" = 'billy miller category:articles with hcards' | wikisql |
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 text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY COUNT(*) | nvbench |
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 procedures.icd9_code FROM procedures WHERE procedures.subject_id = "2560" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '39700520' AND gwyjzb.MED_SER_ORG_NO = '6630727' AND NOT gwyjzb.OUT_DIAG_DIS_NM LIKE '%脑外伤%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '39700520' AND fgwyjzb.MED_SER_ORG_NO = '6630727' AND NOT fgwyjzb.OUT_DIAG_DIS_NM LIKE '... | css |
CREATE TABLE table_67494 (
"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 of the draw in the 2005 FIFA Confederations Cup?
| SELECT "Score" FROM table_67494 WHERE "Competition" = '2005 fifa confederations cup' AND "Result" = 'draw' | wikisql |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_20009 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"For" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games ... | SELECT MAX("Won") FROM table_20009 WHERE "Team" = 'Palmeiras' | wikisql |
CREATE TABLE table_35177 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the game before week 15 with the result of bye?
| SELECT "Date" FROM table_35177 WHERE "Week" < '15' AND "Result" = 'bye' | wikisql |
CREATE TABLE table_5830 (
"Week" text,
"Song choice" text,
"Theme" text,
"Performance Order" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the theme for week 3?
| SELECT "Theme" FROM table_5830 WHERE "Week" = 'week 3' | wikisql |
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 zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '33793765856' | css |
CREATE TABLE table_45531 (
"Rank" real,
"City" text,
"Province" text,
"Date of Official Foundation of Municipality" real,
"2006" real,
"1996" real,
"1986" real,
"1976" real,
"1966" real,
"1956" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT COUNT("2006") FROM table_45531 WHERE "Date of Official Foundation of Municipality" = '1918' | wikisql |
CREATE TABLE table_35075 (
"Player" text,
"Played" real,
"Sets Won" real,
"Sets Lost" real,
"Legs Won" real,
"Legs Lost" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" real
)
-- Using valid SQLite, answer the following questions for the ... | SELECT MAX("Sets Won") FROM table_35075 WHERE "Legs Won" < '1' | wikisql |
CREATE TABLE table_73690 (
"Series #" real,
"Season #" text,
"Episode" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the amount of viewer... | SELECT "Viewers (in millions)" FROM table_73690 WHERE "Series #" = '14' | wikisql |
CREATE TABLE table_name_14 (
score VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score of Game #4?
| SELECT score FROM table_name_14 WHERE game = 4 | sql_create_context |
CREATE TABLE table_name_41 (
proto_germanic VARCHAR,
german VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Proto Germanic when then German is /s/ or /ts/?
| SELECT proto_germanic FROM table_name_41 WHERE german = "/s/ or /ts/" | sql_create_context |
CREATE TABLE table_name_40 (
gold INTEGER,
rank VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most gold when the rank is 7 and bronze is less than 0?
| SELECT MAX(gold) FROM table_name_40 WHERE rank = "7" AND bronze < 0 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT demographic.age, demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_68050 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years does Kakahi school, with a decile of 3, have?
| SELECT "Years" FROM table_68050 WHERE "Decile" = '3' AND "Name" = 'kakahi school' | wikisql |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE author (
authorid int,
authorname... | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset, venue WHERE dataset.datasetname = 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'cvpr' | scholar |
CREATE TABLE table_38061 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which FCC info has a ERP W smaller than 222, and a Call sign of k297... | SELECT "FCC info" FROM table_38061 WHERE "ERP W" < '222' AND "Call sign" = 'k297ai' | wikisql |
CREATE TABLE table_33909 (
"Tournament" text,
"2002" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "2005" FROM table_33909 WHERE "Tournament" = 'grand slam tournaments' | wikisql |
CREATE TABLE table_name_89 (
tongan VARCHAR,
north_marquesan VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Tongan has a North Marquesan of /ha e/?
| SELECT tongan FROM table_name_89 WHERE north_marquesan = "/haʔe/" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_name_87 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did Rich Manning play?
| SELECT position FROM table_name_87 WHERE player = "rich manning" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
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 transfers (
row_id n... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ins spinal fusion device') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-4 year') | mimic_iii |
CREATE TABLE table_name_61 (
react INTEGER,
mark VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest React, when Mark is 46.26 sb, and when Lane is greater than 6?
| SELECT MIN(react) FROM table_name_61 WHERE mark = "46.26 sb" AND lane > 6 | sql_create_context |
CREATE TABLE table_42314 (
"Country" text,
"Automobile Name" text,
"Manufacturer" text,
"Engine Make/Capacity" text,
"Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the car that was made in the years 1956-1958?
| SELECT "Automobile Name" FROM table_42314 WHERE "Year" = '1956-1958' | 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 prescriptions (
subject_id text,
hadm_id... | SELECT demographic.gender, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "32418" | mimicsql_data |
CREATE TABLE table_name_76 (
game INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Score of 3 4?
| SELECT MIN(game) FROM table_name_76 WHERE score = "3–4" | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_1924975_1 (
q1_pos INTEGER,
q1_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the q1 time is 1:16.218 what is the highest q1 pos?
| SELECT MAX(q1_pos) FROM table_1924975_1 WHERE q1_time = "1:16.218" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'encephalopathy - metabolic' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patien... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.