instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_15161 (
"Year" text,
"League" text,
"Position" text,
"Leading Scorer" text,
"Goals" real
)
-- 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_15161 WHERE "Position" = '14th of 24' AND "League" = 'football conference' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_ID, School_ID FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE table_name_23 (
location VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location when the name is telmatosaurus?
| SELECT location FROM table_name_23 WHERE name = "telmatosaurus" | sql_create_context |
CREATE TABLE table_25049 (
"Rank Subcontinent" real,
"Rank Asia" real,
"Rank World" real,
"Country" text,
"2011 GDP (PPP) billions of USD" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least rank subcontinent for bangladesh
| SELECT MIN("Rank Subcontinent") FROM table_25049 WHERE "Country" = 'Bangladesh' | wikisql |
CREATE TABLE table_name_89 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the home team when Preston North End is the away team?
| SELECT home_team FROM table_name_89 WHERE away_team = "preston north end" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, COUNT(T2.Name) 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 table_65612 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Byes have Wins smaller than 11, and a Wimmera FL of minyip murtoa, and Losses ... | SELECT COUNT("Byes") FROM table_65612 WHERE "Wins" < '11' AND "Wimmera FL" = 'minyip murtoa' AND "Losses" < '6' | wikisql |
CREATE TABLE table_2518850_4 (
year_of_previous_participation VARCHAR,
prefecture VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the year of previous participation for the school in the Kagoshima prefecture?
| SELECT year_of_previous_participation FROM table_2518850_4 WHERE prefecture = "Kagoshima" | sql_create_context |
CREATE TABLE table_16617025_1 (
written_by VARCHAR,
season__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote Season 8?
| SELECT written_by FROM table_16617025_1 WHERE season__number = 8 | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 ti... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'b-complex defic nec') AND STRFTIME('%y', diagnoses_icd.charttime) = '2101'... | mimic_iii |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in... | css |
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '柏和玉' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 1924.14) | css |
CREATE TABLE table_55148 (
"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.
-- Which team has an away score of 18.14 (122)?
| SELECT "Home team" FROM table_55148 WHERE "Away team score" = '18.14 (122)' | wikisql |
CREATE TABLE table_204_188 (
id number,
"rank" number,
"player" text,
"points" number,
"points defending" number,
"points won" number,
"new points" number,
"withdrew due to" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the high... | SELECT "player" FROM table_204_188 ORDER BY "rank" LIMIT 1 | squall |
CREATE TABLE table_27298240_26 (
aorist VARCHAR,
present VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What aorist has bude in present tense?
| SELECT aorist FROM table_27298240_26 WHERE present = "bude" | sql_create_context |
CREATE TABLE table_name_90 (
date_aired VARCHAR,
network VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date was the show aired on the RTL Televizija network?
| SELECT date_aired FROM table_name_90 WHERE network = "rtl televizija" | sql_create_context |
CREATE TABLE table_61581 (
"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.
-- Which country won in 1988?
| SELECT "Country" FROM table_61581 WHERE "Year(s) won" = '1988' | wikisql |
CREATE TABLE table_27871460_2 (
network VARCHAR,
state_or_territory VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network was located in Illinois?
| SELECT network FROM table_27871460_2 WHERE state_or_territory = "Illinois" | sql_create_context |
CREATE TABLE medicine_enzyme_interaction (
medicine_id VARCHAR
)
CREATE TABLE medicine (
id VARCHAR,
Name VARCHAR,
FDA_approved VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the ids, names and FDA approval status of medicines in descending... | SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC | sql_create_context |
CREATE TABLE table_18681 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the last year that someone is first elected?
| SELECT MAX("First elected") FROM table_18681 | wikisql |
CREATE TABLE table_24648 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT COUNT("Wins") FROM table_24648 WHERE "Avg. Start" = '29.0' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 20) | css |
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.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_23703 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least... | SELECT MIN("Podiums") FROM table_23703 WHERE "Wins" = '0' AND "Season" = '2005' AND "Points" = '321' | wikisql |
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 jybgb.BGRQ FROM jybgb WHERE jybgb.BGDH = '04251278145' | css |
CREATE TABLE table_31198 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest overall am... | SELECT MIN("W") FROM table_31198 | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | SELECT a.Id AS "post_link", a.Body FROM Posts AS a INNER JOIN Posts AS b ON a.ParentId = b.Id WHERE a.OwnerUserId = '##UserId##' AND LOWER(b.Title) LIKE '%##Keyword##%' ORDER BY a.Id DESC | sede |
CREATE TABLE table_34231 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"Long" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Darrius Heyward-Bey's average with more than 20 yards and less than 80 long?
| SELECT COUNT("Avg.") FROM table_34231 WHERE "Yards" > '20' AND "Player" = 'darrius heyward-bey' AND "Long" < '80' | wikisql |
CREATE TABLE table_name_64 (
score VARCHAR,
to_par VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the player from the United states that was +1 to par?
| SELECT score FROM table_name_64 WHERE to_par = "+1" AND country = "united states" | sql_create_context |
CREATE TABLE table_204_200 (
id number,
"iso/iec standard" text,
"title" text,
"status" text,
"description" text,
"wg" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in the year published between iso/iec 15288 and iso/ic... | SELECT ABS((SELECT "status" FROM table_204_200 WHERE "iso/iec standard" = 'iso/iec 15288') - (SELECT "status" FROM table_204_200 WHERE "iso/iec standard" = 'iso/iec 20000-1')) | squall |
CREATE TABLE table_name_96 (
winner VARCHAR,
general_classification VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winner for nick nuyens for general classification and stage of 2
| SELECT winner FROM table_name_96 WHERE general_classification = "nick nuyens" AND stage = "2" | sql_create_context |
CREATE TABLE table_name_69 (
bronze INTEGER,
gold VARCHAR,
total VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze has a Total smaller than 2, and a Silver larger than 0, and a Gold smaller than 0?
| SELECT SUM(bronze) FROM table_name_69 WHERE total < 2 AND silver > 0 AND gold < 0 | sql_create_context |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code v... | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n... | atis |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "DMII oth uncntrld" | mimicsql_data |
CREATE TABLE table_60429 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue of the Friendly Competition with a Score of 1 4?
| SELECT "Venue" FROM table_60429 WHERE "Competition" = 'friendly' AND "Score" = '1–4' | 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 Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name | nvbench |
CREATE TABLE table_12199 (
"Preferences" text,
"1. vs 2." real,
"1. vs 3." real,
"2. vs 3." real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 1 vs 2 when total is more than 28 and 2 vs 3 is 8?
| SELECT "1. vs 2." FROM table_12199 WHERE "Total" > '28' AND "2. vs 3." = '8' | wikisql |
CREATE TABLE table_name_99 (
best VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Justin Wilson has what has his best time?
| SELECT best FROM table_name_99 WHERE name = "justin wilson" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | SELECT COUNT(Id) FROM Posts WHERE Tags LIKE '%<php>%' AND CreationDate > '2012-06-01' AND CreationDate < '2012-06-03' | sede |
CREATE TABLE table_name_40 (
total INTEGER,
gold VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who scored the lowest with 8 gold medals and less than 4 silver medals?
| SELECT MIN(total) FROM table_name_40 WHERE gold = 8 AND silver < 4 | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '昌阳辉' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-01-10' AND '2008-08-12' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_name_41 (
score VARCHAR,
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score on December 1 when Philadelphia visited?
| SELECT score FROM table_name_41 WHERE visitor = "philadelphia" AND date = "december 1" | sql_create_context |
CREATE TABLE table_name_14 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many were in Attendance on December 11, 1954?
| SELECT COUNT(attendance) FROM table_name_14 WHERE date = "december 11, 1954" | 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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '潘天蓝' AND MED_SER_ORG_NO = '0395177' AND OUT_DIAG_DOC_NM LIKE '柳%' | css |
CREATE TABLE table_name_46 (
broadcast_date VARCHAR,
viewers__in_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the broadcast date with 7.0 million viewers?
| SELECT broadcast_date FROM table_name_46 WHERE viewers__in_millions_ = "7.0" | sql_create_context |
CREATE TABLE table_18118221_1 (
annual_interchanges__millions__2011_12 VARCHAR,
annual_entry_exit__millions__2011_12 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many annual interchanges in the millions occurred in 2011-12 when the number of annual ent... | SELECT annual_interchanges__millions__2011_12 FROM table_18118221_1 WHERE annual_entry_exit__millions__2011_12 = "36.609" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '004-7984' AND STRFTIME('%y', patient.hospitaladmittime) <= '2102' | eicu |
CREATE TABLE table_204_445 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- at which world indoor championships did peter widen achieve a higher position : 1989... | SELECT "year" FROM table_204_445 WHERE "year" IN (1989, 1991) ORDER BY "position" LIMIT 1 | squall |
CREATE TABLE staff (
staff_id number,
gender text,
first_name text,
last_name text,
email_address text,
phone_number text
)
CREATE TABLE products (
product_id number,
parent_product_id number,
product_category_code text,
date_product_first_available time,
date_product_discon... | SELECT last_name FROM staff WHERE email_address LIKE "%wrau%" | spider |
CREATE TABLE table_55950 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away score when they played at Brun... | SELECT "Away team score" FROM table_55950 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE table_11545282_6 (
years_for_jazz VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During which years did Jim Farmer play for Jazz?
| SELECT years_for_jazz FROM table_11545282_6 WHERE player = "Jim Farmer" | sql_create_context |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB 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 COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '1211179' AND zyjzjlb.RYDJSJ > '2012-01-28' | css |
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE affected_region (
region_id number,
storm_id nu... | SELECT AVG(damage_millions_usd), MAX(damage_millions_usd) FROM storm WHERE max_speed > 1000 | spider |
CREATE TABLE table_39859 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Purse ($) total for Iowa?
| SELECT COUNT("Purse( $ )") FROM table_39859 WHERE "Location" = 'iowa' | wikisql |
CREATE TABLE table_name_38 (
date_of_appointment VARCHAR,
team VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of appointment for Christos Kassianos who belonged to AEK?
| SELECT date_of_appointment FROM table_name_38 WHERE team = "aek" AND replaced_by = "christos kassianos" | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, flight, flight_fare, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAK... | atis |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | 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 = '025-19271')) AND microlab.culturesite = 'urine, voided specimen' AND STRFTIME('%y'... | eicu |
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
)
-- Using valid SQLite, answer the... | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_24 (
home VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team at the Nuggets game that had a score of 116 105?
| SELECT home FROM table_name_24 WHERE score = "116–105" | sql_create_context |
CREATE TABLE table_12691 (
"Matches" real,
"Wins" real,
"Draw" real,
"Losses" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Losses, when Wins is '1', and when Matches is less than 2?
| SELECT MAX("Losses") FROM table_12691 WHERE "Wins" = '1' AND "Matches" < '2' | wikisql |
CREATE TABLE table_79049 (
"Team" text,
"1982" text,
"1983" text,
"1984" real,
"Total points" real,
"Seasons" real,
"Points average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for 1984 for the team with 100 points total... | SELECT SUM("1984") FROM table_79049 WHERE "Total points" = '100' AND "Seasons" > '3' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | 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-3355')) AND microlab.culturesite = 'other' AND STRFTIME('%y-%m', microlab.cult... | eicu |
CREATE TABLE table_11440 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Constellation has a 20h56m40s Right Ascension (J200... | SELECT "Constellation" FROM table_11440 WHERE "Right ascension ( J2000 )" = '20h56m40s' | wikisql |
CREATE TABLE table_75246 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Record of 38 20 12 2?
| SELECT "Opponent" FROM table_75246 WHERE "Record" = '38–20–12–2' | wikisql |
CREATE TABLE table_name_10 (
english_translation VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the english translation when the artist is ann christine?
| SELECT english_translation FROM table_name_10 WHERE artist = "ann christine" | sql_create_context |
CREATE TABLE table_12715053_1 (
molecular_target VARCHAR,
compound_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the molecular target listed under the compounded name of hemiasterlin (e7974)
| SELECT molecular_target FROM table_12715053_1 WHERE compound_name = "Hemiasterlin (E7974)" | sql_create_context |
CREATE TABLE table_name_96 (
productions VARCHAR,
herbie VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which production had Rex Robbins as Herbie?
| SELECT productions FROM table_name_96 WHERE herbie = "rex robbins" | sql_create_context |
CREATE TABLE table_17675 (
"Character" text,
"Portrayed by" text,
"Main cast seasons" text,
"Recurring cast seasons" text,
"# of episodes" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Kevin lucas appears in which seasons?
| SELECT "Recurring cast seasons" FROM table_17675 WHERE "Character" = 'Kevin Lucas' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pressure ulcer,stage nos') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year'... | mimic_iii |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "31" AND diagnoses.icd9_code = "2809" | mimicsql_data |
CREATE TABLE table_name_99 (
total VARCHAR,
fa_trophy VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Total that has a FA Trophy of 0 and a Player of charlie butler?
| SELECT COUNT(total) FROM table_name_99 WHERE fa_trophy = 0 AND player = "charlie butler" | sql_create_context |
CREATE TABLE table_48035 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is the crowd attending at colonial sta... | SELECT "Crowd" FROM table_48035 WHERE "Ground" = 'colonial stadium' AND "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_78 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away score at VFL Park?
| SELECT away_team AS score FROM table_name_78 WHERE venue = "vfl park" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... | mimic_iii |
CREATE TABLE table_36235 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Website" text,
"Webcast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The KTRH.com website includes which type of webcast?
| SELECT "Webcast" FROM table_36235 WHERE "Website" = 'ktrh.com' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 662 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2019 | advising |
CREATE TABLE table_65708 (
"Score" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 2011 has 12.7% as the 2010?
| SELECT "2011" FROM table_65708 WHERE "2010" = '12.7%' | 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 MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2002-06-01' AND '2003-03-27' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 30 | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5433552' AND qtb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5433552' AND gyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '5433552' AND zyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM mzb WHERE mzb.MED_SER_ORG_NO = '... | css |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREA... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary) | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE table_name_77 (
gain VARCHAR,
long VARCHAR,
avg_g VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Gain has a Long of 29, and an Avg/G smaller than 33.7?
| SELECT COUNT(gain) FROM table_name_77 WHERE long = 29 AND avg_g < 33.7 | sql_create_context |
CREATE TABLE table_19328 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is shown for the 2nd (m) of 220.5?
| SELECT "Name" FROM table_19328 WHERE "2nd (m)" = '220.5' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId nu... | SELECT COUNT(ClosedDate) AS NowClosed, COUNT(*) AS ClosedOnce FROM Posts WHERE Id IN (SELECT DISTINCT PostId FROM PostHistory WHERE PostHistoryTypeId = 10) | sede |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | SELECT p.Id, p.CreationDate, DATEADD(ww, -1, GETDATE()), DATEADD(ww, 0, GETDATE()) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'lens' | sede |
CREATE TABLE table_16835 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country is the player that went to Oregon?
| SELECT "Nationality" FROM table_16835 WHERE "School/Club Team" = 'Oregon' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
... | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'necator americanus' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'necator americanus' | mimic_iii |
CREATE TABLE table_name_40 (
cardinalatial_title VARCHAR,
elector VARCHAR,
elevated VARCHAR,
place_of_birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Cardinalatial Title has the Elevated of December 18, 1182, the Place of birth of Luc... | SELECT cardinalatial_title FROM table_name_40 WHERE elevated = "december 18, 1182" AND place_of_birth = "lucca" AND elector = "pandolfo" | sql_create_context |
CREATE TABLE table_name_10 (
tag_team VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Tag Team with a Time of 03:34?
| SELECT tag_team FROM table_name_10 WHERE time = "03:34" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195541')) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-104 month') | eicu |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNot... | SELECT Id AS "post_link", Score, AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = '<##Tag##>' AND ClosedDate IS NULL ORDER BY CreationDate DESC | sede |
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 chartevents (
row_id number,
subject_id number,
had... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'prim central sleep apnea') AND STRFTIME('%y', diagnoses_icd.charttime) <= ... | mimic_iii |
CREATE TABLE table_12244 (
"7:00 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" text,
"6:30 pm" ... | SELECT "1:30 pm" FROM table_12244 WHERE "2:00 pm" = 'one life to live' | wikisql |
CREATE TABLE table_name_39 (
opponent VARCHAR,
save VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent with a save of ||33,453||36 27?
| SELECT opponent FROM table_name_39 WHERE save = "||33,453||36–27" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.icd9_code = "3019" | mimicsql_data |
CREATE TABLE table_51427 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the player that went to st. benedict's prep?
| SELECT "Player" FROM table_51427 WHERE "School" = 'st. benedict''s prep' | wikisql |
CREATE TABLE table_name_64 (
pick VARCHAR,
round VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Pick has a Round smaller than 13, and a Position of fullback?
| SELECT COUNT(pick) FROM table_name_64 WHERE round < 13 AND position = "fullback" | sql_create_context |
CREATE TABLE table_20451 (
"Country" text,
"Name" text,
"Host" text,
"Channel" text,
"First Premiere" text,
"Regular Judge" text,
"Seasons" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of regular judge when host is bernie c... | SELECT COUNT("Regular Judge") FROM table_20451 WHERE "Host" = 'Bernie Chan' | wikisql |
CREATE TABLE table_60911 (
"Season" real,
"Years" text,
"Final Standing" real,
"Points" real,
"Top Goal Scorer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the final standing in 1981 82?
| SELECT "Final Standing" FROM table_60911 WHERE "Years" = '1981–82' | wikisql |
CREATE TABLE table_name_83 (
ground VARCHAR,
competition VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ground of the tim trophy competition, which had a time of 23:00 cet?
| SELECT ground FROM table_name_83 WHERE competition = "tim trophy" AND time = "23:00 cet" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.