instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_27329061_2 (
version VARCHAR,
compatible_repository VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the version when the compatible reposityory is xubuntu 10.04
| SELECT version FROM table_27329061_2 WHERE compatible_repository = "Xubuntu 10.04" | sql_create_context |
CREATE TABLE table_name_53 (
engine VARCHAR,
chassis_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Engine does the w123.026 chassis have?
| SELECT engine FROM table_name_53 WHERE chassis_code = "w123.026" | sql_create_context |
CREATE TABLE table_name_17 (
points VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points does driver kosuke matsuura have?
| SELECT points FROM table_name_17 WHERE driver = "kosuke matsuura" | sql_create_context |
CREATE TABLE table_name_70 (
borough VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the percentage in 1980 in Brooklyn?
| SELECT MIN(1980) FROM table_name_70 WHERE borough = "brooklyn" | sql_create_context |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid int,
a... | SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, writes WHERE author.authorname = 'torlak' AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2010 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
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_gpa number,... | SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num | spider |
CREATE TABLE table_name_80 (
stage VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the stage when the winner is charly mottet?
| SELECT stage FROM table_name_80 WHERE winner = "charly mottet" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19059) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND DATETIME(labevents.charttime, 'start of year') = DATE... | mimic_iii |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | SELECT SUM(beds) FROM rooms WHERE bedtype = 'King' | spider |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9519124' AND t_kc21.MED_ORG_DEPT_NM = '小儿青光眼科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-04-02' AND '2017-09-13' | css |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE > 13) | css |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TAB... | SELECT t.Id, t.TagName, t.Count FROM Tags AS t WHERE t.TagName IN ('c#', 'java') | sede |
CREATE TABLE table_name_62 (
win_percentage VARCHAR,
lost VARCHAR,
drew VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Win percentage where there were 5 lost and 0 is drew?
| SELECT win_percentage FROM table_name_62 WHERE lost = 5 AND drew = 0 | sql_create_context |
CREATE TABLE table_name_82 (
winning_driver VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Winning Driver has an Event of 200 miles of norisring?
| SELECT winning_driver FROM table_name_82 WHERE event = "200 miles of norisring" | sql_create_context |
CREATE TABLE table_55605 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What... | SELECT SUM("Podiums") FROM table_55605 WHERE "Final Placing" = '14th' AND "Season" > '2008' AND "Races" < '1' | wikisql |
CREATE TABLE table_name_82 (
length VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the length of the 6 Hours of Talladega?
| SELECT length FROM table_name_82 WHERE race = "6 hours of talladega" | sql_create_context |
CREATE TABLE table_2720 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team for arif asadov
| SELECT "Team" FROM table_2720 WHERE "Replaced by" = 'Arif Asadov' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Benign neo pituitary" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TA... | 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_time... | atis |
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, School_ID FROM basketball_match GROUP BY All_Games | nvbench |
CREATE TABLE table_10184 (
"Year" real,
"Title" text,
"Genre" text,
"Role" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What role does she play before 1942 with dorothy arzner directing?
| SELECT "Role" FROM table_10184 WHERE "Year" < '1942' AND "Director" = 'dorothy arzner' | wikisql |
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 (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '5860255' AND jybgb.BGRQ BETWEEN '2007-07-16' AND '2020-08-01' GROUP BY jybgb.KSBM HAVING COUNT(*) < 19) AS T | css |
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
type text,
built_year int,
notes text
)
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location t... | SELECT built_year, COUNT(built_year) FROM mill WHERE type = 'Grondzeiler' ORDER BY built_year | nvbench |
CREATE TABLE table_68352 (
"Name" text,
"Park" text,
"Country" text,
"Inversions" real,
"Opened" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the status for six flags new england
| SELECT "Status" FROM table_68352 WHERE "Park" = 'six flags new england' | wikisql |
CREATE TABLE table_16892 (
"Year" real,
"Starts" real,
"Cuts made" text,
"Wins (Majors)" text,
"2nd" real,
"3rd" real,
"Top 10" real,
"Top 25" real,
"Earnings ($)" real,
"Money list rank" real,
"Adjusted scoring average (rank)" text
)
-- Using valid SQLite, answer the follo... | SELECT MAX("2nd") FROM table_16892 WHERE "Cuts made" = '11' | wikisql |
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_name_25 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the Tournament of SR get in 1951?
| SELECT 1951 FROM table_name_25 WHERE tournament = "sr" | sql_create_context |
CREATE TABLE table_name_54 (
money___ INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average money ($) that Tom Weiskopf made?
| SELECT AVG(money___) AS $__ FROM table_name_54 WHERE player = "tom weiskopf" | sql_create_context |
CREATE TABLE table_68558 (
"Season" text,
"Competition" text,
"Round" text,
"Opponents" text,
"Home leg" text,
"Away leg" text,
"Aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the competition for motherwell opponents
| SELECT "Competition" FROM table_68558 WHERE "Opponents" = 'motherwell' | wikisql |
CREATE TABLE Contacts (
contact_id INTEGER,
customer_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(50),
contact_phone VARCHAR(80)
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(15),
customer_number VARCHAR(20),
customer_nam... | SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id ORDER BY COUNT(date_to) DESC | nvbench |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT OwnerUserId AS "user_link", OwnerDisplayName, COUNT(Id) FROM Posts WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL GROUP BY OwnerUserId, OwnerDisplayName ORDER BY COUNT(Id) DESC LIMIT 100 | sede |
CREATE TABLE table_11722 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- After 1979, where was the European Indoor Championships held?
| SELECT "Venue" FROM table_11722 WHERE "Competition" = 'european indoor championships' AND "Year" > '1979' | wikisql |
CREATE TABLE table_28884858_2 (
capacity_percentage VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the capacity for the Denver Broncos?
| SELECT capacity_percentage FROM table_28884858_2 WHERE team = "Denver Broncos" | sql_create_context |
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
product_characteristic_value VARCHAR(50)
)
CREATE TABLE Characteristics (
characteristic_id INTEGER,
characteristic_type_code VARCHAR(15),
characteristic_data_type VARCHAR(10),
characteristic_name VARCHAR(... | 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 COUNT(product_category_description) DESC | nvbench |
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 outputevents (
row_id number,
subject_id number,
ha... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 18677 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
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 gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6247162' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-03-18' AND '2019-06-20' AND gwyjzb.IN_DIAG_DIS_CD <> gwyjzb.OUT_DIAG_DIS_CD UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6247162' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2008-03-18' AND '2019-06-20'... | css |
CREATE TABLE table_1342198_17 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many results for incumbent Noble Jones Gregory?
| SELECT COUNT(district) FROM table_1342198_17 WHERE incumbent = "Noble Jones Gregory" | sql_create_context |
CREATE TABLE table_722 (
"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.
-- how many times was the candidates dan mica (d) 55.3% bill james (r) 44.7%?... | SELECT COUNT("Incumbent") FROM table_722 WHERE "Candidates" = 'Dan Mica (D) 55.3% Bill James (R) 44.7%' | wikisql |
CREATE TABLE table_61132 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Place, when Player is 'Steve Pate'?
| SELECT "Place" FROM table_61132 WHERE "Player" = 'steve pate' | wikisql |
CREATE TABLE table_name_77 (
money___$__ VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the money for trevor immelman?
| SELECT money___$__ FROM table_name_77 WHERE player = "trevor immelman" | sql_create_context |
CREATE TABLE table_name_77 (
year INTEGER,
date VARCHAR,
type VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Year with a Type of informal, and a Location with justus lipsius building, brussels, and a Date with 23 ... | SELECT SUM(year) FROM table_name_77 WHERE type = "informal" AND location = "justus lipsius building, brussels" AND date = "23 may" | sql_create_context |
CREATE TABLE table_name_38 (
school_club_team VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is School/Club Team, when Pick is 9 (via Hamilton)?
| SELECT school_club_team FROM table_name_38 WHERE pick = "9 (via hamilton)" | sql_create_context |
CREATE TABLE table_name_81 (
call_sign VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which call sign has a frequency of FM 105.3?
| SELECT call_sign FROM table_name_81 WHERE frequency = "fm 105.3" | sql_create_context |
CREATE TABLE table_name_6 (
erp_w INTEGER,
frequency_mhz INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ERP W number where the frequency is smaller than 91.1?
| SELECT MAX(erp_w) FROM table_name_6 WHERE frequency_mhz < 91.1 | sql_create_context |
CREATE TABLE table_27086613_5 (
fa_cup_goals INTEGER,
fa_cup_apps VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least fa cup goals with fa cup apps being 2 and fw
| SELECT MIN(fa_cup_goals) FROM table_27086613_5 WHERE fa_cup_apps = 2 AND position = "FW" | sql_create_context |
CREATE TABLE table_1447085_1 (
county VARCHAR,
median_house__hold_income VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which county has a median household income of $98,090?
| SELECT county FROM table_1447085_1 WHERE median_house__hold_income = "$98,090" | 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 SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '葛星光' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-04-05' AND '2020-07-04' | css |
CREATE TABLE table_18788823_5 (
position_in_table VARCHAR,
date_of_vacancy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which vacancy occurred on 16 February 2009?
| SELECT position_in_table FROM table_18788823_5 WHERE date_of_vacancy = "16 February 2009" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chr syst/diastl hrt fail" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
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 qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '41231928309' UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.MED_ORG_DEPT_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '41231928309' UNION SELECT zyb.MED_ORG_DEPT_CD, zyb.MED_ORG_DEPT_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '41231928309' UNION SELECT mzb.... | css |
CREATE TABLE table_name_2 (
to_par INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average to par for a score of 78-67-73=218?
| SELECT AVG(to_par) FROM table_name_2 WHERE score = 78 - 67 - 73 = 218 | sql_create_context |
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.PERSON_ID = '46217483' AND t_kc22.STA_DATE BETWEEN '2002-01-13' AND '2018-10-07' AND t_kc21.MED_SER_ORG_NO = '4175604' AND t_kc22.MED_INV... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT lab.label FROM lab WHERE lab.subject_id = "19187" | mimicsql_data |
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_dat... | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY booking_status_code DESC | nvbench |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%south carolina%' ORDER BY Reputation DESC | sede |
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdes... | SELECT clubname FROM club | spider |
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 jybgb (
BBCJBW text,
BBDM tex... | SELECT COUNT(zzmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '柏梦竹' AND zzmzjzjlb.JZKSRQ BETWEEN '2004-08-14' AND '2017-05-20' UNION SELECT COUNT(fz... | css |
CREATE TABLE table_52032 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date for the Away team University?
| SELECT "Date" FROM table_52032 WHERE "Away team" = 'university' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts ... | SELECT MAX(q.Id) AS "post_link", MAX(q.Score) AS "q_score", MAX(a.Score) AS "max_a_score", MIN(a.Score) AS "min_a_score", COUNT(*) AS "answer_count", MAX(q.ClosedDate) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND ('##excludeClosed:int?1##' = 0 OR q.ClosedDat... | sede |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND lab.label = "Methemoglobin" | mimicsql_data |
CREATE TABLE table_69069 (
"Season" text,
"Team" text,
"Country" text,
"Division" text,
"Apps" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Apps of indonesia with Goals smaller than 1000?
| SELECT AVG("Apps") FROM table_69069 WHERE "Country" = 'indonesia' AND "Goals" < '1000' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_AMOUT FROM t_kc21 WHERE MED_CLINIC_ID = '80157522521' | css |
CREATE TABLE list (
classroom VARCHAR,
grade VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each classroom, report the classroom number and the number of grades using it.
| SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom | sql_create_context |
CREATE TABLE table_26587 (
"#" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Winnings ($)" real,
"After" real,
"Before" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all before numbers when Geoff Ogilvy was pla... | SELECT "Before" FROM table_26587 WHERE "Player" = 'Geoff Ogilvy' | wikisql |
CREATE TABLE table_64411 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game against Oxford United?
| SELECT "Date" FROM table_64411 WHERE "Opposing Team" = 'oxford united' | wikisql |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage) DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2184" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_55751 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of laps with a grid larger than 24?
| SELECT MIN("Laps") FROM table_55751 WHERE "Grid" > '24' | wikisql |
CREATE TABLE table_name_83 (
team VARCHAR,
points_diff VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has +119 Points diff?
| SELECT team FROM table_name_83 WHERE points_diff = "+119" | sql_create_context |
CREATE TABLE table_46574 (
"Rank" 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 amount of bronze medals for teams with 9 silvers and less than 27 points?
| SELECT MIN("Bronze") FROM table_46574 WHERE "Silver" = '9' AND "Total" < '27' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cerebral subdural hematoma - secondary t... | eicu |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT AnswerCount, ViewCount, Title AS "post_title" FROM Posts LIMIT 20 | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '3364170' AND jybgb.BGRQ BETWEEN '2010-04-09' AND '2016-11-21' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 7) AS T | css |
CREATE TABLE table_51232 (
"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 home team has home team score of 12.12 (84... | SELECT "Home team" FROM table_51232 WHERE "Home team score" = '12.12 (84)' | wikisql |
CREATE TABLE table_1341598_11 (
district VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district shows a first elected of 1980?
| SELECT district FROM table_1341598_11 WHERE first_elected = 1980 | sql_create_context |
CREATE TABLE personfriend (
name text,
friend text,
year number
)
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the male friend of Alice whose job is a docto... | SELECT T2.friend FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor' | spider |
CREATE TABLE table_53029 (
"Name" text,
"Real Name" text,
"Birthdate" text,
"Costume Role" text,
"Defining characteristics" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the member with the costume Role of 'the girl'?
| SELECT "Real Name" FROM table_53029 WHERE "Costume Role" = 'the girl' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-20295')) AND diagnosis.diagnosisname = 'seizures - new onset' AND DATETI... | eicu |
CREATE TABLE table_name_62 (
total VARCHAR,
set_5 VARCHAR,
set_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Total, when Set 5 is NA, and when Set 2 is 25-13?
| SELECT total FROM table_name_62 WHERE set_5 = "na" AND set_2 = "25-13" | sql_create_context |
CREATE TABLE Courses (
course_name VARCHAR,
author_id VARCHAR
)
CREATE TABLE Course_Authors_and_Tutors (
author_id VARCHAR,
personal_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of courses taught by the tutor who has personal n... | SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = "Julio" | sql_create_context |
CREATE TABLE table_20971444_3 (
first_air_date VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the first air date for 9 episode
| SELECT first_air_date FROM table_20971444_3 WHERE episode = 9 | sql_create_context |
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE plays... | SELECT gname FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid JOIN student AS T3 ON T3.stuid = T1.stuid WHERE T3.lname = "Smith" AND T3.fname = "Linda" | spider |
CREATE TABLE table_16236 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the minimum pick # where position is defensive tackle
| SELECT MIN("Pick #") FROM table_16236 WHERE "Position" = 'Defensive Tackle' | wikisql |
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 CIVIL_SUBSIDY FROM t_kc24 WHERE MED_CLINIC_ID = '10244235592' | css |
CREATE TABLE table_58520 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has a title of calder?
| SELECT "Team" FROM table_58520 WHERE "Race Title" = 'calder' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p maze procedure') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.d... | eicu |
CREATE TABLE table_22941863_19 (
winner VARCHAR,
sprints_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the winner when the sprints classification is no award?
| SELECT winner FROM table_22941863_19 WHERE sprints_classification = "no award" | sql_create_context |
CREATE TABLE table_12966 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the amount of money with a score of 67-71-70-71=279?
| SELECT COUNT("Money ( $ )") FROM table_12966 WHERE "Score" = '67-71-70-71=279' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TA... | SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 497 | advising |
CREATE TABLE table_78509 (
"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 team that played at Princes Pa... | SELECT "Away team" FROM table_78509 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE table_61836 (
"Air Date" text,
"Rating" text,
"18-49" text,
"Viewers" text,
"Weekly Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Weekly Winner, when Air Date is 'July 4, 2008'?
| SELECT "Weekly Winner" FROM table_61836 WHERE "Air Date" = 'july 4, 2008' | wikisql |
CREATE TABLE table_30786 (
"Player" text,
"Matches" real,
"Innings" real,
"Runs" real,
"Average" text,
"Highest Score" text,
"100s" real,
"50s" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the innings when the highest score is ... | SELECT MAX("Innings") FROM table_30786 WHERE "Highest Score" = '72' | wikisql |
CREATE TABLE table_name_38 (
competition VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Competition had a Score of 2 0?
| SELECT competition FROM table_name_38 WHERE score = "2–0" | sql_create_context |
CREATE TABLE table_203_89 (
id number,
"#" number,
"name\n(birth-death)" text,
"took office" text,
"left office" text,
"monarch" text,
"prime minister" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total years did sir patrick dunca... | SELECT "left office" - "took office" FROM table_203_89 WHERE "name\n(birth-death)" = 'sir patrick duncan' | squall |
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
... | SELECT destination, COUNT(*) FROM flight GROUP BY destination | spider |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE fare (
fare_id 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND date_day.day_number = 24 AND date_day.month_number = 5 AND d... | atis |
CREATE TABLE table_67954 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the melbourne for adelaide of no with auckland of yes and gold coast of ... | SELECT "Melbourne" FROM table_67954 WHERE "Adelaide" = 'no' AND "Auckland" = 'yes' AND "Gold Coast" = 'no' | wikisql |
CREATE TABLE table_1341423_36 (
results VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the results for the district oklahoma 3?
| SELECT results FROM table_1341423_36 WHERE district = "Oklahoma 3" | sql_create_context |
CREATE TABLE table_203_405 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games did the eagles win after december 1 , 1968 ?
| SELECT COUNT(*) FROM table_203_405 WHERE "result" = 'w' AND "date" >= 12 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.