instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_7 (
district VARCHAR,
first_elected VARCHAR,
towns_represented VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district had first elected earlier than 2006 for representation of Broken Arrow, Tulsa?
| SELECT district FROM table_name_7 WHERE first_elected < 2006 AND towns_represented = "broken arrow, tulsa" | sql_create_context |
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '7743304' AND wdmzjzjlb.RYDJSJ > '2007-08-11' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '7743304' AND bdmzjzjlb.RYDJSJ > '2007-08-11' | css |
CREATE TABLE Ref_Colors (
color_code VARCHAR(15),
color_description VARCHAR(80)
)
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
... | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'systemic antibiotics - quinolone' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year')) | eicu |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_79006 (
"Player" text,
"Team" text,
"Round 1" real,
"Round 2" text,
"Subtotal" real,
"Finals" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has a subtotal of more than 3 and more than 8 in round... | SELECT "Player" FROM table_79006 WHERE "Subtotal" > '3' AND "Round 1" > '8' | wikisql |
CREATE TABLE table_name_65 (
socialist_ticket VARCHAR,
american_labor_ticket VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Socialist candidate ran against American Labor candidate Caroline O'Day?
| SELECT socialist_ticket FROM table_name_65 WHERE american_labor_ticket = "caroline o'day" | sql_create_context |
CREATE TABLE table_6390 (
"Year" real,
"Film" text,
"Role" text,
"Language" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which film has a role named Taylor?
| SELECT "Film" FROM table_6390 WHERE "Role" = 'taylor' | wikisql |
CREATE TABLE table_56348 (
"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.
-- Who held pole position at the... | SELECT "Pole Position" FROM table_56348 WHERE "Fastest Lap" = 'gilles villeneuve' AND "Constructor" = 'ferrari' AND "Race Winner" = 'gilles villeneuve' | wikisql |
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
-- Using valid SQLite, answer the foll... | SELECT type, nationality FROM ship | spider |
CREATE TABLE table_24872 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the ep... | SELECT "Title" FROM table_24872 WHERE "Original air date" = 'March 2, 1997' | wikisql |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) DESC | nvbench |
CREATE TABLE table_62458 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which play is from Ireland?
| SELECT "Player" FROM table_62458 WHERE "Country" = 'ireland' | wikisql |
CREATE TABLE table_66769 (
"Team" text,
"City" text,
"State" text,
"Home venue" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the state of the team who plays in Mumbai?
| SELECT "State" FROM table_66769 WHERE "Team" = 'mumbai' | wikisql |
CREATE TABLE table_32861 (
"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 is the size of the crowd for the game with ... | SELECT AVG("Crowd") FROM table_32861 WHERE "Home team" = 'footscray' | wikisql |
CREATE TABLE table_49705 (
"Exit Date" text,
"Pos." text,
"Player" text,
"To club" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Ashley Grimes had what to club?
| SELECT "To club" FROM table_49705 WHERE "Player" = 'ashley grimes' | wikisql |
CREATE TABLE table_name_14 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest bronze medal count for Italy with fewer than 6 gold medals and greater than 10 total medals?
| SELECT MIN(bronze) FROM table_name_14 WHERE gold < 6 AND nation = "italy" AND total > 10 | sql_create_context |
CREATE TABLE table_42819 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game that was played on 29,30 31 May 1902?
| SELECT "Result" FROM table_42819 WHERE "Date" = '29,30–31 may 1902' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Users.DisplayName, Posts.CreationDate FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, ... | sede |
CREATE TABLE table_36063 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has 48 rebounds?
| SELECT "Team" FROM table_36063 WHERE "Rebounds" = '48' | wikisql |
CREATE TABLE table_56104 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many bronzes for nations ranked above 7, under 3 golds, and under 10 total medals?
| SELECT COUNT("Bronze") FROM table_56104 WHERE "Rank" < '7' AND "Gold" < '3' AND "Total" < '10' | wikisql |
CREATE TABLE table_name_31 (
percent_of_slovenes_1951 VARCHAR,
village__german_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of Slovenes lived in the village of Roach in 1951?
| SELECT percent_of_slovenes_1951 FROM table_name_31 WHERE village__german_ = "roach" | sql_create_context |
CREATE TABLE table_73869 (
"Constituency" text,
"Candidate" text,
"Affiliation" text,
"Result - votes" real,
"Result - %" text,
"Loss/gain" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many values for constituency for the vote result of 16... | SELECT COUNT("Constituency") FROM table_73869 WHERE "Result - votes" = '162' | wikisql |
CREATE TABLE table_2840500_3 (
pick VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the overall number of chosen ideas where the person is scott parker
| SELECT COUNT(pick) FROM table_2840500_3 WHERE player = "Scott Parker" | sql_create_context |
CREATE TABLE table_29447 (
"Club" text,
"Chairman" text,
"Current manager" text,
"Team captain" text,
"Kitmaker" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the club when the chairman is roger lambrecht?
| SELECT "Club" FROM table_29447 WHERE "Chairman" = 'Roger Lambrecht' | wikisql |
CREATE TABLE table_10188 (
"Rank" real,
"Gymnast" text,
"Floor Exercise" real,
"Pommel Horse" real,
"Rings" real,
"Vault" real,
"Parallel Bars" real,
"Horizontal Bar" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name ... | SELECT COUNT("Pommel Horse") FROM table_10188 WHERE "Rank" > '16' AND "Vault" = '9.475' | wikisql |
CREATE TABLE table_65340 (
"Draw" real,
"Entrant" text,
"Brand" text,
"Order" text,
"Eliminated by" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Mark Henry's brand?
| SELECT "Brand" FROM table_65340 WHERE "Entrant" = 'mark henry' | wikisql |
CREATE TABLE table_name_54 (
profits__billion_ INTEGER,
sales__billion_$_ VARCHAR,
headquarters VARCHAR,
industry VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many profits is the company that is headquartered in the USA, in the banking industry... | SELECT SUM(profits__billion_) AS $_ FROM table_name_54 WHERE headquarters = "usa" AND industry = "banking" AND sales__billion_$_ < 98.64 | sql_create_context |
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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer | nvbench |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Co... | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC | nvbench |
CREATE TABLE table_name_66 (
starts VARCHAR,
earnings__$_ VARCHAR,
cuts_made VARCHAR,
top_25 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Starts that have Cuts made of 2, Top 25 larger than 0, and Earnings ($) smaller than 338,067?
| SELECT COUNT(starts) FROM table_name_66 WHERE cuts_made = 2 AND top_25 > 0 AND earnings__$_ < 338 OFFSET 067 | sql_create_context |
CREATE TABLE table_name_95 (
game INTEGER,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of the game that was played in the time of 2:38?
| SELECT MAX(game) FROM table_name_95 WHERE time = "2:38" | sql_create_context |
CREATE TABLE table_203_581 (
id number,
"club" text,
"chinese" text,
"city" text,
"home stadium" text,
"capacity" number,
"average attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total clubs are listed ?
| SELECT COUNT("club") FROM table_203_581 | squall |
CREATE TABLE table_name_33 (
notes VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Notes of the Frequency with Call sign CFUN-FM-1?
| SELECT notes FROM table_name_33 WHERE call_sign = "cfun-fm-1" | sql_create_context |
CREATE TABLE table_name_10 (
player VARCHAR,
club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player Club Team is Indiana Ice (ushl)?
| SELECT player FROM table_name_10 WHERE club_team = "indiana ice (ushl)" | sql_create_context |
CREATE TABLE table_34249 (
"Kanji" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Kanji for the Ayanami dd-45?
| SELECT "Kanji" FROM table_34249 WHERE "Name" = 'ayanami dd-45' | wikisql |
CREATE TABLE table_2679061_9 (
nationality VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the nationality of player picked no. 179?
| SELECT nationality FROM table_2679061_9 WHERE pick__number = 179 | sql_create_context |
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gp... | SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1 | spider |
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 COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '窦碧玉' AND mzjzjlb.JZKSRQ BETWEEN '2001-08-28' AND '2006-01-01' AND mzjzjlb.YLJGDM = '9175260' | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136) ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '褚学义' | css |
CREATE TABLE table_train_232 (
"id" int,
"metastatic_cancer" bool,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"short_life_expectancy" bool,
"body_mass_index_bmi" float,
"a1c" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT * FROM table_train_232 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 38 AND diabetic = 'ii' | criteria2sql |
CREATE TABLE table_1820752_1 (
constellation VARCHAR,
spectral_type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the spectral type is g1v, what is the constellation?
| SELECT constellation FROM table_1820752_1 WHERE spectral_type = "G1V" | sql_create_context |
CREATE TABLE table_name_46 (
points INTEGER,
player VARCHAR,
tries VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of points scored by Joe Vagana when making fewer than 2 tries?
| SELECT AVG(points) FROM table_name_46 WHERE player = "joe vagana" AND tries < 2 | sql_create_context |
CREATE TABLE table_204_211 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the only country to win only golds ?
| SELECT "nation" FROM table_204_211 WHERE "silver" = 0 AND "bronze" = 0 | squall |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '慢性支气管炎' AND jyjgzbb.JCZBDM = ... | css |
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 KH, KLX FROM zyjzjlb WHERE JZLSH = '02981540665' | css |
CREATE TABLE table_name_25 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the away team score for geelong away team
| SELECT away_team AS score FROM table_name_25 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number... | SELECT P.Id AS "post_link", P.Score, P.ViewCount FROM Posts AS P WHERE P.ClosedDate IS NULL AND P.PostTypeId = 1 AND P.AnswerCount >= 1 AND P.Id NOT IN (SELECT A.ParentId FROM Posts AS A WHERE A.PostTypeId = 2 AND A.Score >= 2 AND A.Body LIKE '%imgur%') ORDER BY P.ViewCount DESC | sede |
CREATE TABLE table_name_12 (
date VARCHAR,
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Score of 24-7, and a Record of 4-10?
| SELECT date FROM table_name_12 WHERE score = "24-7" AND record = "4-10" | sql_create_context |
CREATE TABLE table_28600 (
"Year" real,
"Under-11" text,
"Under-13" text,
"Under-15" text,
"Under-17" text,
"Under-19" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the year 2009 who was the under-13?
| SELECT "Under-13" FROM table_28600 WHERE "Year" = '2009' | wikisql |
CREATE TABLE table_name_23 (
crowd INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the Home team of geelong played, what was their lowest Crowd number?
| SELECT MIN(crowd) FROM table_name_23 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_name_47 (
pick INTEGER,
round VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many picks had a round smaller than 6 and an overall bigger than 153?
| SELECT SUM(pick) FROM table_name_47 WHERE round < 6 AND overall > 153 | sql_create_context |
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 DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '012-169' | eicu |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE In... | SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id | nvbench |
CREATE TABLE table_name_73 (
player VARCHAR,
country VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Player who has a Country of united states, and a To par of 5?
| SELECT player FROM table_name_73 WHERE country = "united states" AND to_par = "–5" | sql_create_context |
CREATE TABLE table_40286 (
"Week of" text,
"Tier" text,
"Winner" text,
"Runner-up" text,
"Semi finalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Semi finalists when the Runner-up was katrina adams zina garrison-jackson?
| SELECT "Semi finalists" FROM table_40286 WHERE "Runner-up" = 'katrina adams zina garrison-jackson' | wikisql |
CREATE TABLE table_name_29 (
size_difference VARCHAR,
prefix VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the size difference for exa?
| SELECT size_difference FROM table_name_29 WHERE prefix = "exa" | sql_create_context |
CREATE TABLE table_11982 (
"Date" text,
"Venue" text,
"Opponent" text,
"Result" text,
"Tournament" text,
"Scored" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game with the result of 22-20 played?
| SELECT "Venue" FROM table_11982 WHERE "Result" = '22-20' | wikisql |
CREATE TABLE table_70597 (
"Poll source" text,
"Date(s) administered" text,
"Tom Campbell*" text,
"Meg Whitman" text,
"Steve Poizner" text,
"Peter Foy*" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What poll had Steve Poizner at 37%?
| SELECT "Poll source" FROM table_70597 WHERE "Steve Poizner" = '37%' | wikisql |
CREATE TABLE table_name_79 (
type VARCHAR,
cancelable VARCHAR,
attribute VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the type with cancelable of no and attribute of ondragend
| SELECT type FROM table_name_79 WHERE cancelable = "no" AND attribute = "ondragend" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(mzjzjlb.ZZYSGH) 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 = '78228979' AND mzjzjlb.JZKSRQ BETWEEN '2002-10-08' AND '2016-07-03' | css |
CREATE TABLE table_14823 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date, when the Opponent is Gisela Dulko?
| SELECT "Date" FROM table_14823 WHERE "Opponent" = 'gisela dulko' | wikisql |
CREATE TABLE table_66868 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14
| SELECT "Rider" FROM table_66868 WHERE "Laps" > '23' AND "Manufacturer" = 'aprilia' AND "Grid" = '14' | wikisql |
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE budget ... | SELECT County, SUM(Enrollment) FROM School GROUP BY County | nvbench |
CREATE TABLE schedule (
cinema_id number,
film_id number,
date text,
show_times_per_day number,
price number
)
CREATE TABLE film (
film_id number,
rank_in_series number,
number_in_season number,
title text,
directed_by text,
original_air_date text,
production_code text
)... | SELECT name, openning_year FROM cinema ORDER BY openning_year DESC | spider |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.age < "41" | mimicsql_data |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_name_7 (
score_in_the_final VARCHAR,
championship VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the French Open?
| SELECT score_in_the_final FROM table_name_7 WHERE championship = "french open" | sql_create_context |
CREATE TABLE table_6251 (
"Year" real,
"Class" text,
"Team" text,
"Chassis" text,
"Tyre" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total of Year that's got a Team of Porsche Kremer Racing?
| SELECT SUM("Year") FROM table_6251 WHERE "Team" = 'porsche kremer racing' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '7280779' AND IN_DIAG_DIS_NM = '持续的躯体形式的疼痛障碍') | css |
CREATE TABLE table_name_33 (
score VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of Game 48?
| SELECT score FROM table_name_33 WHERE game = 48 | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | 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, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST... | atis |
CREATE TABLE table_train_271 (
"id" int,
"renal_disease" bool,
"hepatic_disease" bool,
"smoking" bool,
"coronary_artery_disease_cad" bool,
"serum_creatinine" float,
"body_mass_index_bmi" float,
"myocardial_infarction" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the followin... | SELECT * FROM table_train_271 WHERE body_mass_index_bmi > 30 | criteria2sql |
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 Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
... | SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY COUNT(*) DESC | nvbench |
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '6526650' AND t_kc22.SOC_SRT_DIRE_NM = '蒲地蓝消炎口服液' | css |
CREATE TABLE table_204_729 (
id number,
"year" text,
"show" text,
"role" text,
"channel" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was this actor 's first television role ?
| SELECT "role" FROM table_204_729 ORDER BY "year" LIMIT 1 | squall |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "14" | mimicsql_data |
CREATE TABLE table_25016824_2 (
vote VARCHAR,
air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the vote when the air date is 4 october 1997?
| SELECT vote FROM table_25016824_2 WHERE air_date = "4 October 1997" | 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(DISTINCT Id) AS responses, AVG(CAST((JULIANDAY(ClosedDate) - JULIANDAY(CreationDate)) * 24.0 AS INT)) AS average_response_time_in_hours FROM Posts WHERE CreationDate >= '2020-09-2' AND ClosedDate <= '2020-09-28' | sede |
CREATE TABLE table_37347 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day is their record 13-15?
| SELECT "Date" FROM table_37347 WHERE "Record" = '13-15' | wikisql |
CREATE TABLE table_26033 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the writer for th... | SELECT "Written by" FROM table_26033 WHERE "Title" = 'And the Rocky Goes To...' | wikisql |
CREATE TABLE table_10023387_1 (
doubles_w_l VARCHAR,
years_played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the doubles w-l with years played value of 1 (1968)
| SELECT doubles_w_l FROM table_10023387_1 WHERE years_played = "1 (1968)" | sql_create_context |
CREATE TABLE table_3763 (
"Artist" text,
"Country" text,
"Number-one single(s)" text,
"Year" real,
"Weeks at #1" real,
"Straight to #1 ?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the straight to number 1 for tribal king
| SELECT "Straight to #1 ?" FROM table_3763 WHERE "Artist" = 'Tribal King' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Pressure ulcer, stage I" | mimicsql_data |
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '苗乐池' AND mzjzjlb.JZKSRQ BETWEEN '2005-05-11' AND '2021-10-27' AND mzjzjlb.YLJGDM = '4321914' | css |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id 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 ... | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz... | css |
CREATE TABLE table_41520 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the 20 Questions section aimed at when Centerfold Model was Rachel J... | SELECT "20 Questions" FROM table_41520 WHERE "Centerfold model" = 'rachel jeán marteen' | wikisql |
CREATE TABLE table_57703 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Grid has a Time/Retired of clutch?
| SELECT SUM("Grid") FROM table_57703 WHERE "Time/Retired" = 'clutch' | wikisql |
CREATE TABLE table_name_58 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Bornor Regis Town was the opponent?
| SELECT score FROM table_name_58 WHERE opponent = "bornor regis town" | sql_create_context |
CREATE TABLE table_70082 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the oldest model Porsche v12 that has points less than or equal to 0.
| SELECT MIN("Year") FROM table_70082 WHERE "Engine" = 'porsche v12' AND "Pts." < '0' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) >= '2101' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_74392 (
"#" text,
"Title" text,
"Author" text,
"Doctor" text,
"Featuring companion" text,
"Published" text,
"ISBN" text,
"Audiobook narrator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of book num... | SELECT "Title" FROM table_74392 WHERE "#" = '7' | wikisql |
CREATE TABLE table_name_26 (
wins INTEGER,
matches VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the greatest Wins with Matches smaller than 5, and a Year of 1994?
| SELECT MAX(wins) FROM table_name_26 WHERE matches < 5 AND year = 1994 | sql_create_context |
CREATE TABLE table_21164557_1 (
original_air_date VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many original air dates were there for episodes with a production code of 4398016?
| SELECT COUNT(original_air_date) FROM table_21164557_1 WHERE production_code = 4398016 | sql_create_context |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | SELECT Year, COUNT(Year) FROM wine WHERE Price > 100 | nvbench |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId ... | SELECT COUNT(*) FROM (SELECT (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId LEFT JOIN Users AS u ON u.Id = d.OwnerUserId WHERE d.PostTypeId = 1 AND u.Reputation > 999 AND u.Reputation < 10000) AS ... | sede |
CREATE TABLE table_33800 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event in the 2008 Beijing Games had a bronze medal?
| SELECT "Event" FROM table_33800 WHERE "Games" = '2008 beijing' AND "Medal" = 'bronze' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.