instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_49625 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest point total that placed 3rd and has a draw larger than 5?
| SELECT MAX("Points") FROM table_49625 WHERE "Place" = '3rd' AND "Draw" > '5' | wikisql |
CREATE TABLE table_8025 (
"World Record" text,
"Press" text,
"92.5" text,
"Hans W\u00f6lpert" text,
"Mannheim ( GER )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the 92.5 with the press 282.5?
| SELECT "92.5" FROM table_8025 WHERE "Press" = '282.5' | wikisql |
CREATE TABLE table_74648 (
"Rank" text,
"County" text,
"Population (1960)" real,
"Population (2000)" real,
"Population (2040)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the population of a county in 1960 that had a population of 467,05... | SELECT AVG("Population (1960)") FROM table_74648 WHERE "Population (2000)" > '467,052' AND "Population (2040)" = '78,812' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'physi... | eicu |
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 HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | 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 demographic.insurance, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "21796" | mimicsql_data |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(15),
order_date DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_content VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_... | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' ORDER BY COUNT(active_from_date) | nvbench |
CREATE TABLE table_70128 (
"Interferon beta-1a" text,
"Betaseron (beta-1b)" text,
"Copaxone" text,
"Mitoxantrone" text,
"Tysabri" text,
"Fingolimod (Gylenya)" text,
"Teriflunomide" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the copa... | SELECT "Copaxone" FROM table_70128 WHERE "Mitoxantrone" = 'no' AND "Betaseron (beta-1b)" = 'no' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547' AND patient.hospitaldischargetime IS NULL)) | eicu |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3125) AND icustays.outtime IS NULL) ... | mimic_iii |
CREATE TABLE table_name_64 (
opponent VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the opponent with round 17?
| SELECT opponent FROM table_name_64 WHERE round = "17" | sql_create_context |
CREATE TABLE table_name_92 (
home_runs INTEGER,
team VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the highest home runs for cleveland indians years before 1931
| SELECT MAX(home_runs) FROM table_name_92 WHERE team = "cleveland indians" AND year < 1931 | sql_create_context |
CREATE TABLE table_57491 (
"Actor" text,
"Character" text,
"Duration" text,
"No. of series" text,
"Episodes" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What character is in over 22 episodes?
| SELECT "Character" FROM table_57491 WHERE "Episodes" > '22' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
P... | SELECT ROW_NUMBER() OVER (ORDER BY Views DESC) AS Rank, Id AS "user_link", Views, Reputation, ROUND(1.0 * Views / Reputation, 2) AS "viewsperrep" FROM Users WHERE Reputation >= '##MinimumReputation:int?200##' ORDER BY ViewsPerRep DESC, Views DESC LIMIT 100 | sede |
CREATE TABLE Customers_cards (
customer_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the customer id with most number of cards, and how many does he have?
| SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_22588 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Chrome" text,
"Safari" text,
"Opera" text,
"Other Mozilla" text,
"Mobile" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For period September 2009, what... | SELECT COUNT("Other Mozilla") FROM table_22588 WHERE "Period" = 'September 2009' | 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 Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Price) DESC | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2203" AND lab.label = "Carboxyhemoglobin" | mimicsql_data |
CREATE TABLE table_12834315_4 (
barrel_twist VARCHAR,
colt_model_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the barrel twist for colt model mt6400
| SELECT barrel_twist FROM table_12834315_4 WHERE colt_model_no = "MT6400" | sql_create_context |
CREATE TABLE table_name_24 (
date VARCHAR,
scored VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did Sigurd Rushfeldt score less than 2 points in the UEFA Euro 2004 qualifying competition?
| SELECT date FROM table_name_24 WHERE scored < 2 AND competition = "uefa euro 2004 qualifying" | sql_create_context |
CREATE TABLE table_name_63 (
goals INTEGER,
position VARCHAR,
league VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Goals that has a Position of 14th of 24, and a League of football conference has what sum?
| SELECT SUM(goals) FROM table_name_63 WHERE position = "14th of 24" AND league = "football conference" | sql_create_context |
CREATE TABLE table_29708 (
"Conference" text,
"Old membership total" real,
"New membership total" real,
"Net change" text,
"Members added" real,
"Members lost" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number for old me... | SELECT MIN("Old membership total") FROM table_29708 | wikisql |
CREATE TABLE apartment_buildings (
building_id number,
building_short_name text,
building_full_name text,
building_description text,
building_address text,
building_manager text,
building_phone text
)
CREATE TABLE view_unit_status (
apt_id number,
apt_booking_id number,
status_d... | SELECT booking_status_code, COUNT(*) FROM apartment_bookings GROUP BY booking_status_code | spider |
CREATE TABLE table_name_22 (
height__m_ INTEGER,
island VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Height (m) on the island of Burray?
| SELECT MIN(height__m_) FROM table_name_22 WHERE island = "burray" | sql_create_context |
CREATE TABLE table_name_5 (
races INTEGER,
wins VARCHAR,
podiums VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest number of races when there are less than 6 podiums, the series is the formula renault 2.0 eurocup, and... | SELECT MAX(races) FROM table_name_5 WHERE podiums < 6 AND series = "formula renault 2.0 eurocup" AND wins > 0 | 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 * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '50999365' AND hz_info.YLJGDM = '7538695' AND NOT mzjzjlb.JZZDSM LIKE '%过敏症%' | css |
CREATE TABLE table_name_9 (
winner VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Winner in the Year of 2000?
| SELECT winner FROM table_name_9 WHERE year = "2000" | sql_create_context |
CREATE TABLE table_name_3 (
day_4 VARCHAR,
day_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is day 4 when day 2 is PAAQ?
| SELECT day_4 FROM table_name_3 WHERE day_2 = "paaq" | sql_create_context |
CREATE TABLE table_name_40 (
size__cents_ INTEGER,
just_ratio VARCHAR,
just__cents_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ratio of 15:14, and a just (cents) larger than 119.44 is what average size (cents)?
| SELECT AVG(size__cents_) FROM table_name_40 WHERE just_ratio = "15:14" AND just__cents_ > 119.44 | sql_create_context |
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 hz_info (
KH text,
KLX number... | SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '褚芳芳' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2013-05-1... | css |
CREATE TABLE table_203_293 (
id number,
"years of appearance" text,
"title" text,
"network" text,
"character name" text,
"actor" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last show aired by abc ?
| SELECT "title" FROM table_203_293 WHERE "network" = 'abc' ORDER BY "years of appearance" DESC LIMIT 1 | squall |
CREATE TABLE table_59164 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team played against Stoke City?
| SELECT "Home team" FROM table_59164 WHERE "Away team" = 'stoke city' | wikisql |
CREATE TABLE table_25730326_2 (
touchdowns INTEGER,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many touchdowns did the player with 10 points have?
| SELECT MIN(touchdowns) FROM table_25730326_2 WHERE points = 10 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | 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 = '022-127262' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospita... | eicu |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT Id AS "user_link" FROM Users WHERE AboutMe LIKE '%' + '##search:string?senior##' + '%' ORDER BY DisplayName | sede |
CREATE TABLE table_23346303_5 (
points VARCHAR,
assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the points total number if the assists is 7?
| SELECT COUNT(points) FROM table_23346303_5 WHERE assists = 7 | sql_create_context |
CREATE TABLE table_35846 (
"Game #" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in game 81?
| SELECT "Score" FROM table_35846 WHERE "Game #" = '81' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT demographic.diagnosis, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_58725 (
"Club" text,
"City" text,
"Stadium" text,
"Capacity" real,
"2007\u201308 season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the name of the stadium when the club was F.C. Igea Virtus Barcellona?
| SELECT "Stadium" FROM table_58725 WHERE "Club" = 'f.c. igea virtus barcellona' | wikisql |
CREATE TABLE table_59925 (
"Nat." text,
"Name" text,
"Moving to" text,
"Type" text,
"Transfer window" text,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player is associated with soenderjyske.dk?
| SELECT "Name" FROM table_59925 WHERE "Source" = 'soenderjyske.dk' | wikisql |
CREATE TABLE table_6145 (
"Call sign" text,
"Frequency" text,
"City of license" text,
"Watts" real,
"Class" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Frequency that is smaller than 100,000 Watts in guymon, oklahoma?
| SELECT "Frequency" FROM table_6145 WHERE "Watts" < '100,000' AND "City of license" = 'guymon, oklahoma' | wikisql |
CREATE TABLE table_name_95 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was Patty Fendick an opponent?
| SELECT date FROM table_name_95 WHERE opponent = "patty fendick" | sql_create_context |
CREATE TABLE journal (
date VARCHAR,
theme VARCHAR,
sales VARCHAR
)
CREATE TABLE journal_committee (
journal_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the date, theme and sales of the journal which did not have any of the listed editors... | SELECT date, theme, sales FROM journal EXCEPT SELECT T1.date, T1.theme, T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID | sql_create_context |
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 DisplayName, Location, Reputation FROM Users WHERE Reputation < 9001 ORDER BY Reputation DESC LIMIT 10 | sede |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
... | SELECT c.UserId AS "user_link", c.CreationDate, c.Id AS "comment_link", c.PostId AS "post_link", c.Text FROM (Comments AS c JOIN Posts AS p ON c.PostId = p.Id) WHERE (p.PostTypeId = 1) AND (p.Tags LIKE '%<##tagName?gn.general-topology##>%') ORDER BY CreationDate DESC LIMIT 500 | sede |
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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.short_title = "Intracerebral hemorrhage" | mimicsql_data |
CREATE TABLE table_11281 (
"Season Number" text,
"Premiere Date" text,
"Winner" text,
"Runner Up" text,
"2nd Runner-up" text,
"3rd Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2nd runner-up for yuming lai ( )
| SELECT "2nd Runner-up" FROM table_11281 WHERE "Winner" = 'yuming lai (賴銘偉)' | wikisql |
CREATE TABLE table_26986076_3 (
rank INTEGER,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Paul Coward 492cc nourish Weslake's lowest rank?
| SELECT MIN(rank) FROM table_26986076_3 WHERE rider = "Paul Coward 492cc Nourish Weslake" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '965' AND IN_HOSP_DATE BETWEEN '2008-12-24' AND '2011-06-04' AND IN_DIAG_DIS_CD = 'U57.745' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '58152656' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2017-04-13') | css |
CREATE TABLE table_66243 (
"Debut year" real,
"Player" text,
"Games" real,
"Goals" real,
"Years at club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Years at club have Games smaller than 7, and Goals larger than 2, and a Player of john fraz... | SELECT "Years at club" FROM table_66243 WHERE "Games" < '7' AND "Goals" > '2' AND "Player" = 'john frazer' | wikisql |
CREATE TABLE table_name_80 (
game VARCHAR,
streak VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Streak of loss 1, and a Score of 110 111?
| SELECT game FROM table_name_80 WHERE streak = "loss 1" AND score = "110–111" | sql_create_context |
CREATE TABLE table_14929 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name of the racer with a heat higher than 2 and a lane less than 5, with a time of 1:01.53?
| SELECT "Name" FROM table_14929 WHERE "Heat" > '2' AND "Lane" < '5' AND "Time" = '1:01.53' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE furniture_manufacte (
manufacturer_id number,
furniture_id number,
price_in_dollar number
)
CREATE TABLE manufacturer (
manufacturer_id number,
open_year number,
name text,
num_of_factories number,
num_of_shops number
)
CREATE TABLE furniture (
furniture_id number,
... | SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1 | spider |
CREATE TABLE table_68609 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the chassis when the entrant was Lavazza March, and the year was 1975?
| SELECT "Chassis" FROM table_68609 WHERE "Entrant" = 'lavazza march' AND "Year" = '1975' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '021-111547' | eicu |
CREATE TABLE table_name_70 (
city VARCHAR,
province VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city is in Saskatchewan?
| SELECT city FROM table_name_70 WHERE province = "saskatchewan" | sql_create_context |
CREATE TABLE table_20345624_2 (
writer VARCHAR,
original_airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of writers for airdate of 15 july 1967
| SELECT COUNT(writer) FROM table_20345624_2 WHERE original_airdate = "15 July 1967" | sql_create_context |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREA... | SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details DESC | nvbench |
CREATE TABLE table_17288869_5 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record on November 7?
| SELECT COUNT(record) FROM table_17288869_5 WHERE date = "November 7" | sql_create_context |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Participates_in (
stuid IN... | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex | nvbench |
CREATE TABLE table_2890 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "Directed by" FROM table_2890 WHERE "Production code" = '414' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '56692747' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
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_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '0296260' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-01-26' AND '2017-06-26' UNION SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.ME... | css |
CREATE TABLE table_66917 (
"Colt model no." text,
"Name" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Case deflector" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
... | SELECT "Bayonet Lug" FROM table_66917 WHERE "Name" = 'ar-15 lightweight' | wikisql |
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
)
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
-- Using valid SQLite, answer the ... | SELECT Party, COUNT(*) FROM representative GROUP BY Party | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | SELECT MIN(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 = '006-251537')) AND lab.labname = 'ionized calcium' AND STRFTIME('%y-%m', lab.labres... | eicu |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE table_22542179_3 (
l_g VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the l g for rubio
| SELECT l_g FROM table_22542179_3 WHERE player = "Rubio" | sql_create_context |
CREATE TABLE table_75517 (
"Rank" real,
"# of Titles" real,
"School" text,
"City" text,
"Sport" text,
"First" real,
"Last" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city is the school that had less than 17 titles in boys basketball... | SELECT "City" FROM table_75517 WHERE "# of Titles" < '17' AND "Last" > '2005' AND "Sport" = 'boys basketball' | wikisql |
CREATE TABLE table_name_8 (
team_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score of the 1st leg when Water Corporation was Team 1?
| SELECT 1 AS st_leg FROM table_name_8 WHERE team_1 = "water corporation" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | SELECT U.Id AS "user_link", U.Location, T.TagName, SUM(A.Score) AS TagScore FROM Users AS U INNER JOIN Posts AS A ON A.OwnerUserId = U.Id AND A.PostTypeId = 2 INNER JOIN Posts AS Q ON Q.Id = A.ParentId AND Q.PostTypeId = 1 INNER JOIN PostTags AS PT ON PT.PostId = Q.Id INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE U.Loc... | sede |
CREATE TABLE table_16712 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the to... | SELECT COUNT("Race Winner") FROM table_16712 WHERE "Rnd" = '10' | 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 All_Road, Team_ID FROM basketball_match | nvbench |
CREATE TABLE workshop (
workshop_id number,
date text,
venue text,
name text
)
CREATE TABLE submission (
submission_id number,
scores number,
author text,
college text
)
CREATE TABLE acceptance (
submission_id number,
workshop_id number,
result text
)
-- Using valid SQLit... | SELECT college, COUNT(*) FROM submission GROUP BY college | spider |
CREATE TABLE table_203_239 (
id number,
"year" number,
"title" text,
"chinese title" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many films in 1995 did athen chu act in ?
| SELECT COUNT("title") FROM table_203_239 WHERE "year" = 1995 | squall |
CREATE TABLE table_name_81 (
team VARCHAR,
rank VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's Matts Nilsson's team that's ranked better than 7?
| SELECT team FROM table_name_81 WHERE rank < 7 AND rider = "matts nilsson" | sql_create_context |
CREATE TABLE table_8309 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the player that has a To par of 1?
| SELECT "Player" FROM table_8309 WHERE "To par" = '–1' | wikisql |
CREATE TABLE table_56303 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the Mariners game that had a score of 1-12?
| SELECT "Date" FROM table_56303 WHERE "Score" = '1-12' | wikisql |
CREATE TABLE table_5617 (
"Crop" text,
"Area" text,
"Output (2007)" text,
"% of national" text,
"Main location(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed for the Main Location(s) that has a % of National of 2.05%?
| SELECT "Main location(s)" FROM table_5617 WHERE "% of national" = '2.05%' | wikisql |
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_... | SELECT COUNT(*), dept_code FROM class AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code | spider |
CREATE TABLE table_21722 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is part 1 of the verb in class 7b
| SELECT "Part 1" FROM table_21722 WHERE "Class" = '7b' | wikisql |
CREATE TABLE table_13514348_7 (
venue VARCHAR,
captain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue did Luke Blackwell serve as captain?
| SELECT venue FROM table_13514348_7 WHERE captain = "Luke Blackwell" | sql_create_context |
CREATE TABLE table_30875 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many nationalities does Alex Nikolic come from?
| SELECT COUNT("Nationality") FROM table_30875 WHERE "Player" = 'Alex Nikolic' | wikisql |
CREATE TABLE table_name_61 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who went to Geelong to play?
| SELECT away_team FROM table_name_61 WHERE home_team = "geelong" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.itemid = "50935" | mimicsql_data |
CREATE TABLE table_51519 (
"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.
-- When the home team was hawthorn, what was the da... | SELECT "Date" FROM table_51519 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_15187735_12 (
segment_b VARCHAR,
series_ep VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Segment B for series episode 12-08?
| SELECT segment_b FROM table_15187735_12 WHERE series_ep = "12-08" | sql_create_context |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_I... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE... | 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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_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 (((CITY_1.... | atis |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB ... | css |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '80740257' AND MED_SER_ORG_NO = '2849878' AND NOT IN_DIAG_DIS_NM LIKE '%合并%' | css |
CREATE TABLE table_name_70 (
record VARCHAR,
points VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record with 23 points and a visitor of Chicago?
| SELECT record FROM table_name_70 WHERE points = 23 AND visitor = "chicago" | sql_create_context |
CREATE TABLE table_69773 (
"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.
-- For the player finishing at +8, what is his nationality?
| SELECT "Country" FROM table_69773 WHERE "To par" = '+8' | wikisql |
CREATE TABLE table_train_99 (
"id" int,
"mini_mental_state_examination_mmse" int,
"language" string,
"renal_disease" bool,
"hepatic_disease" bool,
"allergy_to_formoterol" bool,
"geriatric_depression_scale_gds" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions f... | SELECT * FROM table_train_99 WHERE language = 'english' OR language = 'spanish' | criteria2sql |
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 mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND per... | css |
CREATE TABLE table_24257833_4 (
operating_system VARCHAR,
webkit_version VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all OS's with a webkit version of 525.29.1.
| SELECT operating_system FROM table_24257833_4 WHERE webkit_version = "525.29.1" | sql_create_context |
CREATE TABLE table_name_9 (
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game where St Kilda is the home team?
| SELECT date FROM table_name_9 WHERE home_team = "st kilda" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.