instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id | advising |
CREATE TABLE table_42127 (
"Year" real,
"Country" text,
"Team" text,
"Individual" text,
"Location" text,
"Runners-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years was the individual winner from the United States was Tiger Woods?... | SELECT COUNT("Year") FROM table_42127 WHERE "Country" = 'united states' AND "Individual" = 'tiger woods' | wikisql |
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 COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.ZZYSGH = '21581460' AND txmzjzjlb.JZKSRQ BETWEEN '2002-10-01' AND '2016-07-05' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZZYSGH = '21581460' AND ftxmzjzjlb.JZKSRQ BETWEEN '2002-10-01' AND '2016-07-05' | css |
CREATE TABLE table_66330 (
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text,
"Home team/s" text,
"Closed (as a RL stadium)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest closed year in the country of france?
| SELECT MIN("Closed (as a RL stadium)") FROM table_66330 WHERE "Country" = 'france' | wikisql |
CREATE TABLE table_27872 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the larg... | SELECT "Largest ethnic group (2002)" FROM table_27872 WHERE "Population (2011)" = '200' | wikisql |
CREATE TABLE table_46731 (
"Model" text,
"Memory ( RAM )" text,
"Storage ( flash )" text,
"Operating system version" text,
"Memory card" text,
"Weight, dimensions" text,
"Retail availability" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Weight, dimensions" FROM table_46731 WHERE "Model" = 'n800' | wikisql |
CREATE TABLE table_name_88 (
attendance INTEGER,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest attendance recorded for week 15?
| SELECT MIN(attendance) FROM table_name_88 WHERE week = 15 | sql_create_context |
CREATE TABLE table_69771 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the finish of the winner of the 2000 Masters?
| SELECT "Finish" FROM table_69771 WHERE "Year(s) won" = '2000' | wikisql |
CREATE TABLE table_13503 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the London Marathon held?
| SELECT "Venue" FROM table_13503 WHERE "Event" = 'marathon' AND "Competition" = 'london marathon' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE building (
name VARCHAR,
building_id VARCHAR
)
CREATE TABLE institution (
building_id VARCHAR,
founded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names of buildings except for those having an institution founded in 2003.
| SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003 | sql_create_context |
CREATE TABLE table_name_76 (
thumb_stick VARCHAR,
wrist_pad VARCHAR,
supplier VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Thumb stick has a Wrist pad of no, and a Supplier of sharkoon?
| SELECT thumb_stick FROM table_name_76 WHERE wrist_pad = "no" AND supplier = "sharkoon" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '25164587531' | css |
CREATE TABLE table_42844 (
"Sunshine (hrs/year)" text,
"Rain (mm/year)" text,
"Snow (days/year)" real,
"Storms (days/year)" real,
"Fog (days/year)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the number of storms where fog is lower than ... | SELECT COUNT("Storms (days/year)") FROM table_42844 WHERE "Fog (days/year)" < '74' AND "Sunshine (hrs/year)" = '2 668' | wikisql |
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE savings (
custid number,
balance number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the balance of the checking account ... | SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%' | spider |
CREATE TABLE table_name_85 (
text VARCHAR,
wade_giles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which text has Wade-Giles translation of ai-ma hsin-y an?
| SELECT text FROM table_name_85 WHERE wade_giles = "ai-ma … hsin-yüan" | sql_create_context |
CREATE TABLE table_name_57 (
written_by VARCHAR,
code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Written by has a Code of 1.2 1.3?
| SELECT written_by FROM table_name_57 WHERE code = "1.2 1.3" | sql_create_context |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Rev... | SELECT OwnerUserId AS "user_link", Id AS "post_link", LENGTH(Body) AS "length_of_post" FROM Posts WHERE NOT ParentId IS NULL AND OwnerUserId = '##UserId##' ORDER BY 'length_of_post' | sede |
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 (SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2016-11-23' AND '2018-06-23' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 1) - (SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2016-11-23' AND '2018-06-23' AND t_kc22.MED_INV_ITEM_TYPE = '... | css |
CREATE TABLE table_14884 (
"Rider" text,
"Years active" text,
"Races" real,
"Wins" real,
"2nd pl." real,
"3rd pl." real,
"Titles." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of 2nd place finishes for riders activ... | SELECT SUM("2nd pl.") FROM table_14884 WHERE "Years active" = '2009-2010' AND "Wins" > '0' | wikisql |
CREATE TABLE table_77986 (
"Line" text,
"Began operation" real,
"Stations" real,
"Length (km)" text,
"Terminals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average operation beginning with a length of ampang and over 27 stations?
| SELECT AVG("Began operation") FROM table_77986 WHERE "Length (km)" = 'ampang' AND "Stations" > '27' | wikisql |
CREATE TABLE table_10564 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When they were playing the detroit lio... | SELECT "Result" FROM table_10564 WHERE "Game site" = 'tampa stadium' AND "Opponent" = 'detroit lions' | wikisql |
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
... | SELECT T3.dept_name FROM course AS T1 JOIN class AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY SUM(T1.crs_credit) DESC LIMIT 1 | spider |
CREATE TABLE table_43570 (
"landsv\u00e6\u00f0i" text,
"(English)" text,
"Population 2011-01-01" text,
"Area (km\u00b2)" text,
"Pop./ km\u00b2" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the area for a population of 0.58 km?
| SELECT "Area (km\u00b2)" FROM table_43570 WHERE "Pop./ km\u00b2" = '0.58' | wikisql |
CREATE TABLE table_53972 (
"Peak" text,
"metres" real,
"feet" real,
"Latitude (N)" text,
"Longitude (E)" text,
"Prominence (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average feet that has a Latitude (N) of 35 48 35 , and und... | SELECT AVG("feet") FROM table_53972 WHERE "Latitude (N)" = '35°48′35″' AND "metres" < '8,047' | wikisql |
CREATE TABLE table_59463 (
"Year" text,
"Champion" text,
"Runner-up" text,
"Score" text,
"Name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score in 1990?
| SELECT "Score" FROM table_59463 WHERE "Year" = '1990' | wikisql |
CREATE TABLE table_name_89 (
result VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what number of people went to the tiger stadium
| SELECT result FROM table_name_89 WHERE venue = "tiger stadium" | sql_create_context |
CREATE TABLE table_25519 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- David James Elliott directed which episode number with... | SELECT "No. in series" FROM table_25519 WHERE "Directed by" = 'David James Elliott' | wikisql |
CREATE TABLE table_20650 (
"Province" text,
"Map #" real,
"ISO 3166-2:AF" text,
"Centers" text,
"Population" real,
"Area (km\u00b2)" real,
"Language" text,
"Notes" text,
"U.N. Region" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Na... | SELECT "Area (km\u00b2)" FROM table_20650 WHERE "Map #" = '24' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-119251')) AND medication.drugname = 'nss infusion' AND DATETIME(medication... | eicu |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX n... | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON 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 = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGD... | css |
CREATE TABLE table_52991 (
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tyres for Didier pironi?
| SELECT "Tyres" FROM table_52991 WHERE "Driver" = 'didier pironi' | wikisql |
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working... | SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type | nvbench |
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 jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labev... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS... | mimic_iii |
CREATE TABLE table_12927 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has a to par larger than 5 and a player John Mahaffey?
| SELECT "Country" FROM table_12927 WHERE "To par" > '5' AND "Player" = 'john mahaffey' | wikisql |
CREATE TABLE table_23840 (
"Type" text,
"Beam height (mm)" real,
"Flange width (mm)" real,
"Web thickness (mm)" text,
"Flange thickness (mm)" text,
"Weight (kg/m)" text,
"Cross-section area (cm 2 )" text,
"Moment of inertia in torsion (J) (cm 4 )" text
)
-- Using valid SQLite, answer t... | SELECT "Flange thickness (mm)" FROM table_23840 WHERE "Weight (kg/m)" = '10.4' | 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT u.Id, u.DisplayName, u.Reputation, v.weekno, COUNT(v.Id) AS downvotes, MIN(v.CreationDate) AS fromdate, MAX(v.CreationDate) AS todate FROM Users AS u, Posts AS p, (SELECT Id, DATEDIFF(week, '2019-01-01', creationdate) AS weekno, CreationDate, PostId FROM Votes WHERE CreationDate >= '2019-01-01' AND VoteTypeId = ... | sede |
CREATE TABLE table_name_64 (
apps INTEGER,
player VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Apps did Player Gilberto with more than 1 Goals have?
| SELECT AVG(apps) FROM table_name_64 WHERE player = "gilberto" AND goals > 1 | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT COUNT(*) FROM Posts AS question INNER JOIN PostTags AS pt ON pt.PostId = question.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('visual-studio', 'visual-studio-2013', 'visual-studio-2012') AND YEAR(question.CreationDate) = 2014 | sede |
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 medication (
medi... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'urine, voided specimen' AND DATETIME(micr... | eicu |
CREATE TABLE table_name_94 (
game VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the playoffs Game number on April 26?
| SELECT game FROM table_name_94 WHERE date = "april 26" | 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
CREATE TABLE table_39512 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Language (s)" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original title of the Gypsy Magic film title use... | SELECT "Original title" FROM table_39512 WHERE "Film title used in nomination" = 'gypsy magic' | wikisql |
CREATE TABLE table_5788 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When has a Score of 6 3, 6 4?
| SELECT "Date" FROM table_5788 WHERE "Score" = '6–3, 6–4' | wikisql |
CREATE TABLE table_78269 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the retired time on someone who had 43 laps on a grip of 18?
| SELECT "Time/Retired" FROM table_78269 WHERE "Laps" = '43' AND "Grid" = '18' | wikisql |
CREATE TABLE table_203_501 (
id number,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"premiere date" text,
"place, theatre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many number of 1 acts were there ?
| SELECT COUNT(*) FROM table_203_501 WHERE "sub\u00addivisions" = '1 act' | squall |
CREATE TABLE table_20936 (
"Ethnicity" text,
"Islam" text,
"Christianity" text,
"Judaism" text,
"Buddhism" text,
"Other" text,
"Atheism" text,
"n/a" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When tajik is the ethnicity what is islam... | SELECT "Islam" FROM table_20936 WHERE "Ethnicity" = 'Tajik' | wikisql |
CREATE TABLE table_203_54 (
id number,
"selected\nlatin american\ncountries" text,
"internl.\ntourism\narrivals\n2010\n(x 1000)" number,
"internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number,
"average\nreceipt\nper visitor\n2009\n(usd/turista)" number,
"tourist\narrivals\nper\n1000 inhab\n(... | SELECT "tourism\nincome\n%\ngdp\n2003" FROM table_203_54 ORDER BY "tourism\nincome\n%\ngdp\n2003" DESC LIMIT 1 | squall |
CREATE TABLE product_characteristics (
product_id number,
characteristic_id number,
product_characteristic_value text
)
CREATE TABLE ref_product_categories (
product_category_code text,
product_category_description text,
unit_of_measure text
)
CREATE TABLE ref_characteristic_types (
charac... | SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "cumin" | spider |
CREATE TABLE table_1570003_2 (
playoffs VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the playoff advancement during the year 1998?
| SELECT playoffs FROM table_1570003_2 WHERE year = 1998 | sql_create_context |
CREATE TABLE table_41680 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What CFL team did Kelly Bates play for?
| SELECT "CFL Team" FROM table_41680 WHERE "Player" = 'kelly bates' | wikisql |
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 ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_name_96 (
gold VARCHAR,
total VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of gold where the total is less than 23 and the rank is over 10?
| SELECT COUNT(gold) FROM table_name_96 WHERE total < 23 AND rank > 10 | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT wdmzjzjlb.JZKSBM, wdmzjzjlb.JZKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '74199194476' UNION SELECT bdmzjzjlb.JZKSBM, bdmzjzjlb.JZKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '74199194476' | css |
CREATE TABLE table_65189 (
"Class" text,
"Railway number(s)" text,
"DRG number(s)" text,
"Quantity" real,
"Year(s) of manufacture" text,
"Axle arrangement" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year(s) of manufacture has an Axle a... | SELECT "Year(s) of manufacture" FROM table_65189 WHERE "Axle arrangement" = '2′b n2' | wikisql |
CREATE TABLE table_30638 (
"Rank" real,
"Country" text,
"Miss Universe" text,
"1st Runner-up" real,
"2nd Runner-up" real,
"3rd Runner-up" real,
"4th Runner-up" real,
"Semifinalists" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Country" FROM table_30638 WHERE "Miss Universe" = '6' | wikisql |
CREATE TABLE table_63491 (
"Rank" real,
"Peak" text,
"Country" text,
"Island" text,
"Elevation (m)" real,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the elevation of Vanuatu, when the rank is smaller than 3?
| SELECT AVG("Elevation (m)") FROM table_63491 WHERE "Country" = 'vanuatu' AND "Rank" < '3' | wikisql |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_... | atis |
CREATE TABLE table_31213 (
"Episode" text,
"Theme / Date" text,
"Song title" text,
"Original performer" text,
"Result (Placement)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the original performer when the episode is casting?
| SELECT "Original performer" FROM table_31213 WHERE "Episode" = 'Casting' | wikisql |
CREATE TABLE table_name_75 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the game with a Score of L 115 118 (OT)?
| SELECT date FROM table_name_75 WHERE score = "l 115–118 (ot)" | sql_create_context |
CREATE TABLE table_71663 (
"Year" text,
"Title" text,
"Production Company" text,
"Role" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the role that has a Title of Olvidarte Jamas?
| SELECT "Role" FROM table_71663 WHERE "Title" = 'olvidarte jamas' | 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 * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
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 demographic.days_stay FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_41439 (
"Season" text,
"Conference" text,
"Division" text,
"Finish" text,
"Wins" real,
"Losses" real,
"Win%" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest win percentage when there were 23 losses?
| SELECT MAX("Win%") FROM table_41439 WHERE "Losses" = '23' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.insurance = "Private" | mimicsql_data |
CREATE TABLE table_47181 (
"Player" text,
"Club" text,
"Games" real,
"Goals" real,
"Assists" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest amount of Games recorded that have more than 10 assists?
| SELECT MAX("Games") FROM table_47181 WHERE "Assists" > '10' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE equipment_... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | atis |
CREATE TABLE table_77384 (
"Tournament" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text... | SELECT "1992" FROM table_77384 WHERE "2001" = '1r' AND "1994" = '1r' AND "2002" = 'qf' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CRE... | SELECT * FROM Posts WHERE Tags LIKE '%git%' ORDER BY Score DESC | sede |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CRE... | SELECT RANK() OVER (ORDER BY Answers.Score DESC) AS "rank", Answers.Score, Users.Id AS "user_link", Users.Reputation, Answers.Id AS "post_link", Answers.CreationDate AS "date", Question.Tags FROM Posts AS Answers INNER JOIN Posts AS Question ON Question.Id = Answers.ParentId INNER JOIN Users ON Users.Id = Answers.Owner... | sede |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'change in mental status' AND STRFTIME('%y', diagno... | eicu |
CREATE TABLE table_20467 (
"Cartridge" text,
"Bullet weight" text,
"Muzzle velocity" text,
"Muzzle energy" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of cartridge is used by a Weatherby?
| SELECT "Cartridge" FROM table_20467 WHERE "Source" = 'Weatherby' | wikisql |
CREATE TABLE table_5634 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has 1 for the game?
| SELECT "Date" FROM table_5634 WHERE "Game" = '1' | wikisql |
CREATE TABLE table_47914 (
"Game" real,
"Date" text,
"Opponent" text,
"Score/Time" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Arena/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Date" FROM table_47914 WHERE "Game" = '21' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'percu abdom... | mimic_iii |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DAYS_0.day_name = 'MONDAY' AND DAYS_1.day_name = 'MO... | atis |
CREATE TABLE table_14070062_4 (
losing_bonus VARCHAR,
tries_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the extra score when the overall score was 52
| SELECT losing_bonus FROM table_14070062_4 WHERE tries_for = "52" | sql_create_context |
CREATE TABLE table_27529608_21 (
semi_final__week_ VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many semi-final weeks are there for acts from Pittsburgh, Pennsylvania?
| SELECT COUNT(semi_final__week_) FROM table_27529608_21 WHERE hometown = "Pittsburgh, Pennsylvania" | sql_create_context |
CREATE TABLE table_54610 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What class is after 1973 with 41 points?
| SELECT "Class" FROM table_54610 WHERE "Year" > '1973' AND "Points" = '41' | wikisql |
CREATE TABLE table_203_139 (
id number,
"name" text,
"abbr." text,
"leader" text,
"ideology" text,
"political position" text,
"mps" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what party has the highest number of mps ?
| SELECT "name" FROM table_203_139 ORDER BY "mps" DESC LIMIT 1 | squall |
CREATE TABLE table_38327 (
"Event" text,
"Round" text,
"Result" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Result of win, and a Score of 33-22 involved what event?
| SELECT "Event" FROM table_38327 WHERE "Result" = 'win' AND "Score" = '33-22' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
... | SELECT COUNT(*) AS N, Reputation FROM Users WHERE Reputation < 2100 GROUP BY Reputation ORDER BY Reputation | sede |
CREATE TABLE table_name_90 (
dam_type VARCHAR,
year_completed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which dam type was completed in 1961?
| SELECT dam_type FROM table_name_90 WHERE year_completed = 1961 | sql_create_context |
CREATE TABLE table_12894 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has an Opponent of @ washington wizards?
| SELECT "Game" FROM table_12894 WHERE "Opponent" = '@ washington wizards' | wikisql |
CREATE TABLE table_name_49 (
region VARCHAR,
format VARCHAR,
label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the region of the Catalog that is in cd format and has a label a&m/canyon?
| SELECT region FROM table_name_49 WHERE format = "cd" AND label = "a&m/canyon" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insulin -... | eicu |
CREATE TABLE table_42993 (
"Pos." text,
"Player" text,
"Team" text,
"Height" text,
"Weight" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does Brian Butch play?
| SELECT "Pos." FROM table_42993 WHERE "Player" = 'brian butch' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE equipment_sequence (
aircr... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((date_day.day_number = 2 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_17340355_7 (
high_assists VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the high assist total on january 2?
| SELECT high_assists FROM table_17340355_7 WHERE date = "January 2" | sql_create_context |
CREATE TABLE table_name_4 (
score VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the game in which the Edmonton Oilers were visitors?
| SELECT score FROM table_name_4 WHERE visitor = "edmonton oilers" | sql_create_context |
CREATE TABLE table_59690 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team of the game with an attendance of 117?
| SELECT "Away team" FROM table_59690 WHERE "Attendance" = '117' | wikisql |
CREATE TABLE table_34123 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Bulls score" real,
"Opponent score" real,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Streak of lost 1,... | SELECT "Opponent" FROM table_34123 WHERE "Streak" = 'lost 1' AND "Date" = 'april 30' | wikisql |
CREATE TABLE table_76877 (
"Date" text,
"Round" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Scorers" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance number in the final round?
| SELECT SUM("Attendance") FROM table_76877 WHERE "Round" = 'final' | wikisql |
CREATE TABLE table_name_98 (
date VARCHAR,
opponent VARCHAR,
surface VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for chris evert opponent and carpet surface
| SELECT date FROM table_name_98 WHERE opponent = "chris evert" AND surface = "carpet" | sql_create_context |
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,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | (SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 jyb... | css |
CREATE TABLE table_78312 (
"Team" text,
"Outgoing manager" text,
"Date of departure" text,
"Replaced by" text,
"Date of Appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the appointment date for VFL Wolfsburg?
| SELECT "Date of Appointment" FROM table_78312 WHERE "Team" = 'vfl wolfsburg' | wikisql |
CREATE TABLE table_14118 (
"Title" text,
"Series" text,
"Director" text,
"Production Number" text,
"Release date" text,
"reissue?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production number that has no reissue with a series of ... | SELECT "Production Number" FROM table_14118 WHERE "reissue?" = 'no' AND "Series" = 'lt' AND "Director" = 'robert mckimson' AND "Title" = 'the up-standing sitter' | wikisql |
CREATE TABLE table_68412 (
"Club" text,
"League" text,
"Sport" text,
"Venue" text,
"Established" real,
"Championships" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average established for championships less than 1 and club of erie sea... | SELECT AVG("Established") FROM table_68412 WHERE "Championships" < '1' AND "Club" = 'erie seawolves' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.