instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_11111116_6 (
original_air_date VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times did episode 79 originally air?
| SELECT COUNT(original_air_date) FROM table_11111116_6 WHERE no_in_series = 79 | sql_create_context |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry | nvbench |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEG... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code DESC | nvbench |
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_NM = '严虹雨' AND t_kc21.CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_name_64 (
city VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city's IATA is nkg?
| SELECT city FROM table_name_64 WHERE iata = "nkg" | sql_create_context |
CREATE TABLE table_name_60 (
country VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country of the T8 Place Player with a Score of 70-67-71=208?
| SELECT country FROM table_name_60 WHERE place = "t8" AND score = 70 - 67 - 71 = 208 | sql_create_context |
CREATE TABLE table_name_75 (
date VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the game with a Loss of Leneveu (1 0 1)?
| SELECT date FROM table_name_75 WHERE loss = "leneveu (1–0–1)" | 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.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | 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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7271121' AND gwyjzb.IN_DIAG_DIS_CD = 'J45.129' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '7271121' AND fgwyjzb.IN_DIA... | css |
CREATE TABLE table_25085059_3 (
college VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did the player come from whose position is DL?
| SELECT college FROM table_25085059_3 WHERE position = "DL" | 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 (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cabg < 7days' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1) - (SELECT COUNT(DISTINCT... | eicu |
CREATE TABLE table_10841 (
"Year" real,
"Title" text,
"Role" text,
"Leading Lady" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What title has rouben mamoulian directing after 1940 with linda darnell as the leading lady?
| SELECT "Title" FROM table_10841 WHERE "Director" = 'rouben mamoulian' AND "Year" > '1940' AND "Leading Lady" = 'linda darnell' | wikisql |
CREATE TABLE station (
name VARCHAR,
station_id VARCHAR
)
CREATE TABLE train_station (
station_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the station name with at least two trains.
| SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_14245_3 (
population__1931__in_1 VARCHAR,
voivodeship_or_city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the population in 1931 for lubelskie
| SELECT population__1931__in_1, 000 AS s FROM table_14245_3 WHERE voivodeship_or_city = "lubelskie" | sql_create_context |
CREATE TABLE tags (
index number,
id number,
tag text
)
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT T1.tag, T2.groupname FROM torrents AS T2 JOIN tags AS T1 ON T1.id = T2.id | whatcdhiphop |
CREATE TABLE table_40845 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest grid when the time is +8.051 and there were less than 23 laps?
| SELECT MIN("Grid") FROM table_40845 WHERE "Time" = '+8.051' AND "Laps" < '23' | wikisql |
CREATE TABLE table_44516 (
"Year started" real,
"Number of cars" real,
"Current car" text,
"Car #" text,
"Website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Current car has a Number of cars of 1, and a Year started of 1999?
| SELECT "Current car" FROM table_44516 WHERE "Number of cars" = '1' AND "Year started" = '1999' | wikisql |
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
... | SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs ORDER BY date_of_latest_revision | nvbench |
CREATE TABLE table_43506 (
"Tournament" text,
"1978" text,
"1979" text,
"1980" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"Career SR" text
)
-- Usin... | SELECT "1989" FROM table_43506 WHERE "1982" = 'sf' | wikisql |
CREATE TABLE table_name_35 (
preliminary INTEGER,
state VARCHAR,
interview VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the best preliminary for a contestant from New Mexico with interview less than 9.533?
| SELECT MAX(preliminary) FROM table_name_35 WHERE state = "new mexico" AND interview < 9.533 | sql_create_context |
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code text,
total number
)
CREATE TABLE sqlite_sequen... | SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" | spider |
CREATE TABLE table_20548 (
"Season" text,
"1st Place" text,
"2nd Place" text,
"3rd Place" text,
"4th Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What teams finished 3rd when limoges finished 4th?
| SELECT "3rd Place" FROM table_20548 WHERE "4th Place" = 'Limoges' | wikisql |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.diagnosis = "S/P HANGING" | mimicsql_data |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON 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 person_info_hz_info.YLJGDM = hz_inf... | css |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are th... | SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY T2.Name | nvbench |
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 SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411') AND patient.unitdischargetime IS NUL... | eicu |
CREATE TABLE table_name_19 (
year INTEGER,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in what year were 2 points scored?
| SELECT MAX(year) FROM table_name_19 WHERE points = "2" | sql_create_context |
CREATE TABLE table_34920 (
"School" text,
"City" text,
"Mascot" text,
"Enrollment" real,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- County of 46 laporte is what school?
| SELECT "School" FROM table_34920 WHERE "County" = '46 laporte' | wikisql |
CREATE TABLE table_22058 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the game record when the opponent was 'at Los Angeles ... | SELECT "Record" FROM table_22058 WHERE "Opponent" = 'at Los Angeles Raiders' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCAT... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmoun... | SELECT PostId AS "post_link", COUNT(*) AS CommentCount, Score FROM Comments WHERE UserId = @UserId AND Score >= 4 GROUP BY PostId, Score ORDER BY Score DESC | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '76364706' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3367.94) | css |
CREATE TABLE table_name_21 (
visiting_team VARCHAR,
host_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team played on the road against the Buffalo Bills at home ?
| SELECT visiting_team FROM table_name_21 WHERE host_team = "buffalo bills" | sql_create_context |
CREATE TABLE table_name_21 (
base_pairs INTEGER,
species VARCHAR,
genes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowst base pair with a Species of borrelia garinii, and a Genes larger than 832?
| SELECT MIN(base_pairs) FROM table_name_21 WHERE species = "borrelia garinii" AND genes > 832 | sql_create_context |
CREATE TABLE table_75298 (
"Position" text,
"Game 1" text,
"Game 2" text,
"Game 3" text,
"Exhibition*" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What exhibition has greg conescu as game 1?
| SELECT "Exhibition*" FROM table_75298 WHERE "Game 1" = 'greg conescu' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PIT... | atis |
CREATE TABLE table_name_42 (
record VARCHAR,
h_a_n VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Record, when H/A/N is n?
| SELECT record FROM table_name_42 WHERE h_a_n = "n" | sql_create_context |
CREATE TABLE table_148535_2 (
hand VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most 1 credit for three of a kind
| SELECT MAX(1 AS _credit) FROM table_148535_2 WHERE hand = "Three of a Kind" | sql_create_context |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '70820807' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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 COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '9593364' AND t_kc22.SOC_SRT_DIRE_CD = '334225104-r' | css |
CREATE TABLE table_name_37 (
points_for VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is senghenydd rfc's points for?
| SELECT points_for FROM table_name_37 WHERE club = "senghenydd rfc" | sql_create_context |
CREATE TABLE table_name_50 (
direction VARCHAR,
starting_point VARCHAR,
terminus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the direction of the route that stars at downtown transit center and has a terminus point at Pensacola Beach?
| SELECT direction FROM table_name_50 WHERE starting_point = "downtown transit center" AND terminus = "pensacola beach" | sql_create_context |
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_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE table_name_39 (
runners_up VARCHAR,
last_final_lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runners-up did the club with the last final lost in 1985 have?
| SELECT runners_up FROM table_name_39 WHERE last_final_lost = "1985" | sql_create_context |
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code t... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_tim... | atis |
CREATE TABLE table_8721 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player has a +3 To par?
| SELECT "Player" FROM table_8721 WHERE "To par" = '+3' | wikisql |
CREATE TABLE table_204_22 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- whem was illinois ' highest scoring game ?
| SELECT "date" FROM table_204_22 ORDER BY "result" DESC LIMIT 1 | squall |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id ... | SELECT chartevents.valuenum 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 = 23070)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | mimic_iii |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
C... | SELECT q.Id AS "id", q.Score AS "sc", q.AnswerCount AS "ac", CONCAT(q.OwnerDisplayName, u.DisplayName) AS "au", q.Title AS "title", q.Tags AS "tg", q.Body AS "body" FROM Posts AS q LEFT JOIN Users AS u ON q.OwnerUserId = u.Id WHERE q.PostTypeId = 1 AND q.Tags LIKE '%<##Tag##>%' ORDER BY q.Id | sede |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT has_projects FROM course WHERE department = 'EECS' AND number = 554 | advising |
CREATE TABLE table_1181375_1 (
engine VARCHAR,
builder VARCHAR,
withdrawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the engine where builder is gloucester rcw and withdrawn is 1959
| SELECT engine FROM table_1181375_1 WHERE builder = "Gloucester RCW" AND withdrawn = "1959" | sql_create_context |
CREATE TABLE table_204_894 (
id number,
"season" number,
"winner" text,
"score" text,
"runners-up" text,
"venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what number of times was the venue manny ramjohn stadium ?
| SELECT COUNT(*) FROM table_204_894 WHERE "venue" = 'manny ramjohn stadium' | squall |
CREATE TABLE table_31498 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What barony is Ballycunningham in?
| SELECT "Barony" FROM table_31498 WHERE "Townland" = 'Ballycunningham' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '29650849' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
CREATE TABLE table_name_22 (
hometown VARCHAR,
legislatures VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hometown of the representative that served the twenty-sixth legislature?
| SELECT hometown FROM table_name_22 WHERE legislatures = "twenty-sixth" | sql_create_context |
CREATE TABLE table_68806 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the host team at Candlestick Park?
| SELECT "Host Team" FROM table_68806 WHERE "Stadium" = 'candlestick park' | 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 zyjzjlb.MZZYZDZZBM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '37329151718' | css |
CREATE TABLE table_34541 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the runner-up where the winning score is 8 (71-69-67-73=280)?
| SELECT "Runner(s)-up" FROM table_34541 WHERE "Winning score" = '–8 (71-69-67-73=280)' | wikisql |
CREATE TABLE table_26013618_1 (
district___town VARCHAR,
area__ha_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What town has the reserve with an area of 163,62?
| SELECT district___town FROM table_26013618_1 WHERE area__ha_ = "163,62" | sql_create_context |
CREATE TABLE table_78127 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which college is Jordan Phillips playing for?
| SELECT "College" FROM table_78127 WHERE "Player" = 'jordan phillips' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d... | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 85169 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_78278 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest attendace of the game with the Lakers as... | SELECT MAX("Attendance") FROM table_78278 WHERE "Home" = 'lakers' | wikisql |
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.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT" | mimicsql_data |
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | SELECT Home_city, AVG(Age) FROM driver GROUP BY Home_city ORDER BY Home_city DESC | nvbench |
CREATE TABLE table_16478 (
"City of license/Market" text,
"Station" text,
"Channel TV ( DT )" text,
"Year of affiliation" text,
"Owned since" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The station located in Albuquerque has been owned since what... | SELECT "Owned since" FROM table_16478 WHERE "City of license/Market" = 'Albuquerque' | wikisql |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY AllergyType ORDER BY COUNT(AllergyType) | nvbench |
CREATE TABLE table_11692 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of surface was used where the final score was ... | SELECT "Surface" FROM table_11692 WHERE "Score in the final" = '6–2, 6–3' | wikisql |
CREATE TABLE table_25517718_3 (
starter VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many starters are there at right tackle?
| SELECT COUNT(starter) FROM table_25517718_3 WHERE position = "Right tackle" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.... | css |
CREATE TABLE table_19785 (
"English gloss" text,
"Santee-Sisseton" text,
"Yankton-Yanktonai" text,
"Northern Lakota" text,
"Southern Lakota" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the santee sisseton for h ha na
| SELECT COUNT("Santee-Sisseton") FROM table_19785 WHERE "Yankton-Yanktonai" = 'híŋhaŋna' | wikisql |
CREATE TABLE table_name_28 (
record VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record for the game with an attendance of 49,222?
| SELECT record FROM table_name_28 WHERE attendance = "49,222" | sql_create_context |
CREATE TABLE table_name_50 (
year INTEGER,
type VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year had a title of Die Shaolin Affen EP and EP as the type?
| SELECT AVG(year) FROM table_name_50 WHERE type = "ep" AND title = "die shaolin affen ep" | sql_create_context |
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.diagnosis FROM demographic WHERE demographic.name = "Orville Ford" | mimicsql_data |
CREATE TABLE table_name_12 (
attendance INTEGER,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For all games with los angeles as visitor, what is the highest attendance of all?
| SELECT MAX(attendance) FROM table_name_12 WHERE visitor = "los angeles" | sql_create_context |
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2158734' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-03-27' AND '2015-09-07' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 1025.62) AS T | css |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTE... | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Locaton_To) | nvbench |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_... | SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY Position DESC | nvbench |
CREATE TABLE film (
Gross_in_dollar INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average ticket sales gross in dollars of films?
| SELECT AVG(Gross_in_dollar) FROM film | sql_create_context |
CREATE TABLE table_name_41 (
driver VARCHAR,
time_retired VARCHAR,
grid VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the driver when grid is greater than 13 and laps is less than 60 with time/retired of accident
| SELECT driver FROM table_name_41 WHERE grid > 13 AND laps < 60 AND time_retired = "accident" | 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 ReviewTaskResults (
Id number,
ReviewTaskId number,... | SELECT DATEADD(DAY, 0, DATEDIFF(DAY, 0, CreationDate) / @days * @days) AS FullDate, ROUND(CAST(SUM(q.AnswerCount) AS FLOAT) / CAST(COUNT(*) AS FLOAT), 2) AS "Answers per questions" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.AnswerCount >= '##minAnswers##' GROUP BY (DATEDIFF(DAY, 0, CreationDate) / @days * @days) ORDE... | sede |
CREATE TABLE table_69605 (
"Polling Firm" text,
"Date Published" text,
"T. Papadopoulos" text,
"D. Christofias" text,
"I. Kasoulidis" text,
"K. Themistokleous" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the percentage for K. Themist... | SELECT "K. Themistokleous" FROM table_69605 WHERE "I. Kasoulidis" = '30.1%' | wikisql |
CREATE TABLE table_204_450 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year was the first olympics in which lorraine moller competed... | SELECT "year" FROM table_204_450 WHERE "competition" = 'olympic games' ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal bool... | SELECT COUNT(*) FROM Posts AS P, PostTypes AS PT WHERE P.PostTypeId = PT.Id AND PT.Name = 'Question' | sede |
CREATE TABLE table_62082 (
"Companion (in order from star)" text,
"Mass" text,
"Semimajor axis ( AU )" text,
"Orbital period ( s day )" text,
"Eccentricity" text,
"Inclination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Semimajor axis (... | SELECT "Semimajor axis ( AU )" FROM table_62082 WHERE "Companion (in order from star)" = 'g' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '马静慧' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2006-08-11' AND '2020-03-21' | css |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1918 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'ampicillin-sulbactam' | mimic_iii |
CREATE TABLE table_16323766_3 (
evening_gown VARCHAR,
interview VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the evening gown score for the woman who scored 7.600 (9) in her interview?
| SELECT evening_gown FROM table_16323766_3 WHERE interview = "7.600 (9)" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | 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 = 13528)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_name_68 (
variant VARCHAR,
launch_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Variant has a Launch site that is white sands?
| SELECT variant FROM table_name_68 WHERE launch_site = "white sands" | sql_create_context |
CREATE TABLE table_77031 (
"Rank" real,
"Country" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total medals for the united states who had more than 11 silver medals?
| SELECT MIN("Total") FROM table_77031 WHERE "Country" = 'united states' AND "Silver" > '11' | wikisql |
CREATE TABLE table_25016555_5 (
minutes INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When tracy reid is the player what is the highest amount of minutes?
| SELECT MAX(minutes) FROM table_25016555_5 WHERE player = "Tracy Reid" | sql_create_context |
CREATE TABLE table_name_90 (
team VARCHAR,
car__number VARCHAR,
make VARCHAR,
pos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the team of the Chevrolet, and has a position less than 7, for car # 88?
| SELECT team FROM table_name_90 WHERE make = "chevrolet" AND pos < 7 AND car__number = 88 | sql_create_context |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2120" AND lab.label = "Monos" | mimicsql_data |
CREATE TABLE table_204_936 (
id number,
"week" number,
"opponent" text,
"result" text,
"game site" text,
"tv" text,
"time" text,
"attendance" number,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games were attended b... | SELECT COUNT(*) FROM table_204_936 WHERE "attendance" > 70000 | squall |
CREATE TABLE table_name_5 (
television_service VARCHAR,
content VARCHAR,
package_option VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Television Service, when Content is Calcio, and when Package/Option is Option?
| SELECT television_service FROM table_name_5 WHERE content = "calcio" AND package_option = "option" | sql_create_context |
CREATE TABLE table_name_6 (
streak VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the streak for game 2?
| SELECT streak FROM table_name_6 WHERE game = "2" | sql_create_context |
CREATE TABLE table_name_50 (
cuts_made INTEGER,
tournaments_played VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of cuts made when there were more than 2 tournaments played in 2011?
| SELECT AVG(cuts_made) FROM table_name_50 WHERE tournaments_played > 2 AND year = 2011 | sql_create_context |
CREATE TABLE table_name_45 (
pick__number INTEGER,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pick # has a College of concordia?
| SELECT MAX(pick__number) FROM table_name_45 WHERE college = "concordia" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.