instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_79 (
attendance VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Attendance, when Opponent is 'At Syracuse'?
| SELECT attendance FROM table_name_79 WHERE opponent = "at syracuse" | sql_create_context |
CREATE TABLE table_21494 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ma... | SELECT "High assists" FROM table_21494 WHERE "High rebounds" = 'Al Horford (17)' | wikisql |
CREATE TABLE table_name_67 (
title VARCHAR,
track VARCHAR,
translation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title has tracks smaller than 7 with translation of an island?
| SELECT title FROM table_name_67 WHERE track < 7 AND translation = "an island" | sql_create_context |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREA... | SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code ORDER BY Participant_Type_Code | nvbench |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "62" | mimicsql_data |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "17" | mimicsql_data |
CREATE TABLE table_name_75 (
location VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the 200m backstroke?
| SELECT location FROM table_name_75 WHERE event = "200m backstroke" | sql_create_context |
CREATE TABLE table_72629 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 1987 who was the mens singles
| SELECT "Mens singles" FROM table_72629 WHERE "Year" = '1987' | 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 WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Pleural effusion NOS" | mimicsql_data |
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE <= 20) | css |
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.long_title = "Intestinal infection due to Clostridium difficile" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
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, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '2061785' GROUP BY IN_DIAG_DIS_CD | css |
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 SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '25376993' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '25376993' AND fgwyjzb.CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_name_46 (
wins INTEGER,
winning_span VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Wins have a Winning span of 2000 2010?
| SELECT SUM(wins) FROM table_name_46 WHERE winning_span = "2000–2010" | sql_create_context |
CREATE TABLE table_name_81 (
week INTEGER,
result VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest week with a w 21-17 result, and more than 45,254 in attendance?
| SELECT MAX(week) FROM table_name_81 WHERE result = "w 21-17" AND attendance > 45 OFFSET 254 | sql_create_context |
CREATE TABLE table_name_97 (
score VARCHAR,
save VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the match with a save postponed rescheduled for June 24?
| SELECT score FROM table_name_97 WHERE save = "postponed rescheduled for june 24" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "ASIAN" AND procedures.long_title = "Open and other replacement of aortic valve with tissue graft" | mimicsql_data |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id numbe... | SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" | spider |
CREATE TABLE table_1173 (
"School Board" text,
"Type" text,
"Language" text,
"Headquarters" text,
"Census Division(s) Served" text,
"Number of Elementary Schools" real,
"Number of Secondary Schools" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Type" FROM table_1173 WHERE "School Board" = 'Rainbow District School Board' | wikisql |
CREATE TABLE table_71004 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the percentage with number of 1 343
| SELECT "percentage (%)" FROM table_71004 WHERE "Number" = '1 343' | wikisql |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
store_id number,
order_date time,
planned_delivery_date time,
actual_delivery_date time,
other_order_details text
)
CREATE TABLE drama_workshop_groups (
workshop_group_id number,
address_id number,
currency_code... | SELECT T2.store_email_address FROM addresses AS T1 JOIN drama_workshop_groups AS T2 ON T1.address_id = T2.address_id WHERE T1.state_county = "Alaska" | spider |
CREATE TABLE table_20469 (
"Cartridge" text,
"Bullet weight" text,
"Muzzle velocity" text,
"Muzzle energy" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the weight of the bullet used in a Weatherby?
| SELECT "Bullet weight" FROM table_20469 WHERE "Source" = 'Weatherby' | 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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT FIRST_NAME, MANAGER_ID FROM employees | nvbench |
CREATE TABLE table_59532 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Venue, when Status is '2007 Rugby World Cup', when Against is less than 22, and when Date is... | SELECT "Venue" FROM table_59532 WHERE "Status" = '2007 rugby world cup' AND "Against" < '22' AND "Date" = '08/09/2007' | wikisql |
CREATE TABLE table_27987623_3 (
episode VARCHAR,
order VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode was #1 in the order?
| SELECT episode FROM table_27987623_3 WHERE order = 1 | sql_create_context |
CREATE TABLE table_name_28 (
position VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the player from the denver broncos?
| SELECT position FROM table_name_28 WHERE team = "denver broncos" | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "49" AND prescriptions.formulary_drug_cd = "MORP0.5-4" | mimicsql_data |
CREATE TABLE table_204_722 (
id number,
"season" text,
"series" text,
"team" text,
"races" number,
"wins" number,
"poles" number,
"f/lap" number,
"podiums" number,
"points" number,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT "team" FROM table_204_722 ORDER BY "points" DESC LIMIT 1 | squall |
CREATE TABLE table_name_76 (
Took VARCHAR,
location VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the executive office in Dover take office?
| SELECT Took AS office FROM table_name_76 WHERE location = "dover" AND type = "executive" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
pa... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
... | SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE table_name_98 (
point INTEGER,
lost_point VARCHAR,
league_point VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the highest point with lost point being 33 and league point less than 52
| SELECT MAX(point) FROM table_name_98 WHERE lost_point = 33 AND league_point < 52 | sql_create_context |
CREATE TABLE table_61205 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"10: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,
"5:00 pm" text,
"6:30 pm"... | SELECT "3:00 pm" FROM table_61205 WHERE "noon" = 'local programs' | 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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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_MZJZ... | css |
CREATE TABLE table_34093 (
"Version" text,
"Length" text,
"Album" text,
"Remixed by" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which album is the royal g's club mix version, which is remixed by royal garden sound, from?
| SELECT "Album" FROM table_34093 WHERE "Remixed by" = 'royal garden sound' AND "Version" = 'royal g''s club mix' | wikisql |
CREATE TABLE table_32082 (
"All Children ('000s)" real,
"Economically Active Children ('000s)" real,
"Economically Active Children (%)" real,
"Child Labour ('000s)" real,
"Child Labour (%)" real,
"Children In Hazardous Work ('000s)" real,
"Children In Hazardous Work (%)" real
)
-- Using va... | SELECT MIN("All Children ('000s)") FROM table_32082 WHERE "Child Labour (%)" > '15.2' AND "Economically Active Children (%)" < '23.4' AND "Economically Active Children ('000s)" = '210,800' | wikisql |
CREATE TABLE table_204_684 (
id number,
"wrestler:" text,
"times:" number,
"date:" text,
"location:" text,
"notes:" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many different men held the wsl title before horshu won his first wsl title ?
| SELECT COUNT(DISTINCT "wrestler:") FROM table_204_684 WHERE "date:" < (SELECT "date:" FROM table_204_684 WHERE "wrestler:" = 'horshu') | squall |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Accid in resident instit" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostsWit... | SELECT COUNT(PostId) AS Rate FROM Tags, PostTags, Posts WHERE (TagName = 'grpc' OR TagName = 'grpc-java') AND Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2019-07-01' AND Posts.CreationDate > '2018-07-01' | sede |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Encephalopathy NOS" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_60969 (
"Title" text,
"Developer" text,
"Category" text,
"Release date" text,
"Version" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Title has a Version of 1.0.0.3?
| SELECT "Title" FROM table_60969 WHERE "Version" = '1.0.0.3' | wikisql |
CREATE TABLE table_name_44 (
team_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Fulham as Team 1 has the 2nd leg score of what?
| SELECT 2 AS nd_leg FROM table_name_44 WHERE team_1 = "fulham" | sql_create_context |
CREATE TABLE table_29778 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT "Record" FROM table_29778 WHERE "Location Attendance" = 'American Airlines Arena 19,825' | wikisql |
CREATE TABLE table_68792 (
"Institution" text,
"Team" text,
"City" text,
"Province" text,
"First season" real,
"Head coach" text,
"Enrollment" real,
"Football stadium" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT "Institution" FROM table_68792 WHERE "Enrollment" > '37,591' AND "Football stadium" = 'concordia stadium' | wikisql |
CREATE TABLE table_74825 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in London, England in a round ... | SELECT "Opponent" FROM table_74825 WHERE "Location" = 'london, england' AND "Round" < '2' | wikisql |
CREATE TABLE table_79688 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the erp w of the k222al call sign?
| SELECT SUM("ERP W") FROM table_79688 WHERE "Call sign" = 'k222al' | wikisql |
CREATE TABLE table_name_73 (
games VARCHAR,
points VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of games that had more than 34 points and exactly 3 losses?
| SELECT COUNT(games) FROM table_name_73 WHERE points = 34 AND losses = 3 | sql_create_context |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
U... | SELECT COUNT(a.Id) AS accepted, (SELECT COUNT(*) FROM Posts WHERE OwnerUserId = @UserId AND PostTypeId = 2) AS total FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2 | sede |
CREATE TABLE table_name_87 (
year INTEGER,
result VARCHAR,
film VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the year of Bridget Jones: The Edge of Reason that was nominated?
| SELECT MIN(year) FROM table_name_87 WHERE result = "nominated" AND film = "bridget jones: the edge of reason" | sql_create_context |
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE countries (
country_id text,
country... | SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500 | spider |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kerala%' OR UPPER(Location) LIKE '%Kerala' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_name_67 (
bronze INTEGER,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the bronze medals won by south korea?
| SELECT SUM(bronze) FROM table_name_67 WHERE nation = "south korea" | sql_create_context |
CREATE TABLE table_59363 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What bronze has tatiana ryabkina as the silver, anne margrethe hausken as the gold?
| SELECT "Bronze" FROM table_59363 WHERE "Silver" = 'tatiana ryabkina' AND "Gold" = 'anne margrethe hausken' | 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_203_137 (
id number,
"title" text,
"album details" text,
"peak chart positions\nus" number,
"peak chart positions\nus r&b" number,
"certifications" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which was the last album to be ... | SELECT "title" FROM table_203_137 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_65961 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Owner of Frequency 00 99.3?
| SELECT "Owner" FROM table_65961 WHERE "Frequency" = '00 99.3' | wikisql |
CREATE TABLE table_name_60 (
date VARCHAR,
opponent VARCHAR,
result VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Result of win, and a Round smaller than 2, and an Opponent of myron greenberg?
| SELECT date FROM table_name_60 WHERE result = "win" AND round < 2 AND opponent = "myron greenberg" | sql_create_context |
CREATE TABLE gyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6786102' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐胶囊' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '6786102' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐胶囊... | css |
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 p.Id AS "post_link", Score, DisplayName, Reputation FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND AnswerCount != 0 AND Tags LIKE '%identification-%' | sede |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VE... | atis |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%gurgaon%' OR UPPER(Location) LIKE '%Gurgaon%' OR Location LIKE '%Gurgaon%' ORDER BY Reputation DESC LIMIT 1420 | sede |
CREATE TABLE table_name_33 (
prr_class VARCHAR,
wheel_arrangement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What PRR class has a Wheel arrangement of a1a-a1a?
| SELECT prr_class FROM table_name_33 WHERE wheel_arrangement = "a1a-a1a" | sql_create_context |
CREATE TABLE table_name_49 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2013 with a 2r in 2010 and a qf in 2011?
| SELECT 2013 FROM table_name_49 WHERE 2010 = "2r" AND 2011 = "qf" | sql_create_context |
CREATE TABLE table_36739 (
"Date" text,
"Episode" real,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Episode of 16 involves which performer 1?
| SELECT "Performer 1" FROM table_36739 WHERE "Episode" = '16' | wikisql |
CREATE TABLE table_28005100_1 (
no VARCHAR,
lyricist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which number was the lyricist ahmed metwally?
| SELECT no FROM table_28005100_1 WHERE lyricist = "Ahmed Metwally" | sql_create_context |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int... | SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_CODE ORDER BY DEPT_CODE | nvbench |
CREATE TABLE table_name_31 (
artist VARCHAR,
year VARCHAR,
composer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What artist shows 2007 and composer of Hayko?
| SELECT artist FROM table_name_31 WHERE year = 2007 AND composer = "hayko" | sql_create_context |
CREATE TABLE table_1008653_9 (
country___endonym__ VARCHAR,
capital___endonym__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many countries (endonym) has the capital (endonym) of Jakarta?
| SELECT COUNT(country___endonym__) FROM table_1008653_9 WHERE capital___endonym__ = "Jakarta" | sql_create_context |
CREATE TABLE table_76445 (
"Date" text,
"Event" text,
"City" text,
"Oil Pattern" text,
"Winner (Title #)" text,
"Runner-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Event which has a Score of 209-197?
| SELECT "Event" FROM table_76445 WHERE "Score" = '209-197' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE T... | SELECT COUNT(Id) AS "COUNT_ID" FROM Posts WHERE YEAR(CreationDate) = 2017 GROUP BY Tags ORDER BY COUNT_ID DESC | sede |
CREATE TABLE table_17058116_6 (
date VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did the team play charlotte?
| SELECT date FROM table_17058116_6 WHERE team = "Charlotte" | sql_create_context |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE T... | SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'richard anderson' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC | scholar |
CREATE TABLE nurse (
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of all distinct nurses ordered by alphabetical order?
| SELECT DISTINCT name FROM nurse ORDER BY name | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205')) AND STRFTIME('%y-%m', medication.drugstarttime) >=... | eicu |
CREATE TABLE table_8281 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week was the tournament of paris?
| SELECT "Week" FROM table_8281 WHERE "Tournament" = 'paris' | wikisql |
CREATE TABLE table_name_93 (
attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which attendance has the 25 17 5 record?
| SELECT attendance FROM table_name_93 WHERE record = "25–17–5" | sql_create_context |
CREATE TABLE table_23050 (
"Series #" real,
"Episode #" real,
"Title" text,
"Written by" text,
"Directed by" text,
"Viewers" real,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest episode number with the t... | SELECT MAX("Episode #") FROM table_23050 WHERE "Title" = 'Jerusalem' | wikisql |
CREATE TABLE table_20745759_1 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the record for january 18, 1997
| SELECT record FROM table_20745759_1 WHERE date = "January 18, 1997" | sql_create_context |
CREATE TABLE table_2699 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party is the winner K. Anbazhagan from?
| SELECT "Party a" FROM table_2699 WHERE "Winner" = 'K. Anbazhagan' | wikisql |
CREATE TABLE table_name_67 (
location VARCHAR,
date VARCHAR,
competition VARCHAR,
lineup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Location has a Competition of Group Stage, a Lineup of Start and a Date of 2000-09-17?
| SELECT location FROM table_name_67 WHERE competition = "group stage" AND lineup = "start" AND date = "2000-09-17" | sql_create_context |
CREATE TABLE table_55384 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Distance/Duration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year does robin buck go 44 laps?
| SELECT "Year" FROM table_55384 WHERE "Distance/Duration" = '44 laps' AND "Driver" = 'robin buck' | wikisql |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
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, 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 = 'BO... | atis |
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, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC | nvbench |
CREATE TABLE table_12094609_1 (
evening_gown VARCHAR,
preliminaries VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the evening gown where preliminaries is 8.977
| SELECT evening_gown FROM table_12094609_1 WHERE preliminaries = "8.977" | sql_create_context |
CREATE TABLE table_24620 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score of the game played on July 10?
| SELECT "Final Score" FROM table_24620 WHERE "Date" = 'July 10' | wikisql |
CREATE TABLE table_74528 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Time" text,
"Grade" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won under Gary Simms?
| SELECT "Winner" FROM table_74528 WHERE "Trainer" = 'gary simms' | wikisql |
CREATE TABLE table_22494 (
"Athlete" text,
"Class" text,
"Event" text,
"Round of 64" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text,
"Semifinals" text,
"Final/ Bronze medal match" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT "Event" FROM table_22494 WHERE "Final/ Bronze medal match" = 'Scheffers ( NED ) L 3-6, 1-6' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.long_title = "Enteral infusion of concentrated nutritional substances" | mimicsql_data |
CREATE TABLE table_1046170_5 (
playoffs VARCHAR,
us_open_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the playoffs for u.s. open cup in 1st round
| SELECT playoffs FROM table_1046170_5 WHERE us_open_cup = "1st Round" | sql_create_context |
CREATE TABLE table_name_35 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does adam rachel play?
| SELECT position FROM table_name_35 WHERE player = "adam rachel" | sql_create_context |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Guests (
guest_id INTEGER,
... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_61663 (
"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 result of the match on December 9, 1962?
| SELECT "Result" FROM table_61663 WHERE "Date" = 'december 9, 1962' | wikisql |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | 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 = "Chronic liver dis NEC" AND prescriptions.route = "TD" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2126.0" AND lab.itemid = "51363" | mimicsql_data |
CREATE TABLE table_72822 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" text,
"Profits (billion $)" text,
"Assets (billion $)" text,
"Market Value (billion $)" text
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT "Market Value (billion $)" FROM table_72822 WHERE "Sales (billion $)" = '172.7' | wikisql |
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
... | SELECT Season, COUNT(Season) FROM game GROUP BY Season ORDER BY Season DESC | nvbench |
CREATE TABLE table_28550 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the original air date for series number 15
| SELECT "Original air date" FROM table_28550 WHERE "Series #" = '15' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay 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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_name_98 (
draws INTEGER,
against INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest draw against 2161?
| SELECT MAX(draws) FROM table_name_98 WHERE against > 2161 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.