instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 patient.age FROM patient WHERE patient.uniquepid = '028-22327' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_name_67 (
inflation_index__2000 INTEGER,
per_capita_income__as__percentage_of_usa_ VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Inflation Index (2000=100) has a Per Capita Income (as % of USA) of 10.65, and a Year... | SELECT MAX(inflation_index__2000) = 100 AS _ FROM table_name_67 WHERE per_capita_income__as__percentage_of_usa_ = 10.65 AND year < 1990 | sql_create_context |
CREATE TABLE table_62243 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real,
"League position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result F-A of the game on 6 march 1993?
| SELECT "Result F \u2013 A" FROM table_62243 WHERE "Date" = '6 march 1993' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
sc... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '19:00' AND course.course_id = course_offering.course_id AND course.department = 'SW' AND course.number = 425 AND semester.semester = 'WN' AND se... | advising |
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_kc21.MED_CLINIC_ID 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 '2004-08-16' AND '2006-12-03' | css |
CREATE TABLE table_11964047_5 (
home VARCHAR,
streak VARCHAR,
leading_scorer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the home team where streak is l3 and leading scorer is roy : 23
| SELECT home FROM table_11964047_5 WHERE streak = "L3" AND leading_scorer = "Roy : 23" | sql_create_context |
CREATE TABLE table_17644 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power (kW)" text,
"Station Type" text,
"Coverage (Transmitter site)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the coverage for relay tv-37?
| SELECT "Coverage (Transmitter site)" FROM table_17644 WHERE "Station Type" = 'Relay' AND "Ch. #" = 'TV-37' | wikisql |
CREATE TABLE table_204_34 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many silver medals were earned by egypt ?
| SELECT "silver" FROM table_204_34 WHERE "nation" = 'egypt' | squall |
CREATE TABLE table_name_88 (
played INTEGER,
losses VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Played, when Losses is '13', and when Position is greater than 11?
| SELECT SUM(played) FROM table_name_88 WHERE losses = 13 AND position > 11 | sql_create_context |
CREATE TABLE table_13890 (
"Date" text,
"Name" text,
"Nationality" text,
"Tonnage (GRT)" real,
"Fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tonnage of the Eldena?
| SELECT "Tonnage (GRT)" FROM table_13890 WHERE "Name" = 'eldena' | wikisql |
CREATE TABLE table_35730 (
"Year" real,
"Record" text,
"Seed" text,
"Region" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest Year with the Region of Southeast?
| SELECT MAX("Year") FROM table_35730 WHERE "Region" = 'southeast' | wikisql |
CREATE TABLE table_51591 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICAO for Antalya Airport?
| SELECT "ICAO" FROM table_51591 WHERE "Airport" = 'antalya airport' | wikisql |
CREATE TABLE table_73187 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number picks were the players who went to Calgary?
| SELECT "Pick #" FROM table_73187 WHERE "College" = 'Calgary' | wikisql |
CREATE TABLE table_69552 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did helle nielsen marie r pke play women... | SELECT "Year" FROM table_69552 WHERE "Women's doubles" = 'helle nielsen marie røpke' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "7756" | mimicsql_data |
CREATE TABLE table_22771048_3 (
projected_opening INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least projected opening
| SELECT MIN(projected_opening) FROM table_22771048_3 | sql_create_context |
CREATE TABLE table_name_33 (
chassis VARCHAR,
entrant VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What chassis type does a scuderia ferrari with more than 1 point have?
| SELECT chassis FROM table_name_33 WHERE entrant = "scuderia ferrari" AND points > 1 | sql_create_context |
CREATE TABLE table_name_70 (
artist VARCHAR,
language VARCHAR,
draw VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Artist has a Draw smaller than 14, and Points less than 73, and a Language of turkish?
| SELECT artist FROM table_name_70 WHERE draw < 14 AND points < 73 AND language = "turkish" | sql_create_context |
CREATE TABLE table_name_45 (
bronze VARCHAR,
nation VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of bronze medals the U.S. Virgin Islands, which has less than 0 golds, has?
| SELECT COUNT(bronze) FROM table_name_45 WHERE nation = "u.s. virgin islands" AND gold < 0 | sql_create_context |
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1)... | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY Date_in_Locaton_To | nvbench |
CREATE TABLE table_24912693_4 (
player VARCHAR,
blocks VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has 17 blocks?
| SELECT player FROM table_24912693_4 WHERE blocks = 17 | sql_create_context |
CREATE TABLE table_55285 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the player from NGA?
| SELECT "Name" FROM table_55285 WHERE "Country" = 'nga' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Portal hypertension" | mimicsql_data |
CREATE TABLE table_203_9 (
id number,
"state" text,
"last execution date" text,
"name" text,
"crime" text,
"method" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many states have never used capital punishment ?
| SELECT COUNT("state") FROM table_203_9 WHERE "last execution date" = 'never used' | squall |
CREATE TABLE table_46879 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Total, when Year(s) Won is '1948 , 1950 , 1951 , 1953'?
| SELECT MIN("Total") FROM table_46879 WHERE "Year(s) won" = '1948 , 1950 , 1951 , 1953' | wikisql |
CREATE TABLE table_21545 (
"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 "High rebounds" FROM table_21545 WHERE "Date" = 'November 26' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 65582 AND admissions.admission_location = 'emergency room admit' AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_... | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'SAN FRANCISCO' AND date_day.day_number = 1 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days... | atis |
CREATE TABLE table_45471 (
"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 THE TO PAR WITH T5 PLACE, AND PLAYER MARK MCCUMBER?
| SELECT "To par" FROM table_45471 WHERE "Place" = 't5' AND "Player" = 'mark mccumber' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'OMS' AND number = 548 | advising |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid... | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM Has_amenity AS T3 JOIN Dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') GROUP BY Fname ORDER BY COUNT(Fname) | nvbench |
CREATE TABLE table_1408397_3 (
telugu_తెలుగు VARCHAR,
mongolian VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Telugu word for in Mongolian?
| SELECT telugu_తెలుగు FROM table_1408397_3 WHERE mongolian = "Хонгорцог" | sql_create_context |
CREATE TABLE table_2603017_2 (
b___bishop VARCHAR,
ab___angry_boar VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is b - bishop where ab - angry boar is vw - vertical wolf?
| SELECT b___bishop FROM table_2603017_2 WHERE ab___angry_boar = "VW - Vertical Wolf" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body t... | SELECT * FROM Users WHERE DisplayName LIKE 'Nirav D' | sede |
CREATE TABLE table_31869 (
"Year" real,
"Tournaments played" real,
"Cuts made*" real,
"Wins" real,
"Top 10s" real,
"Best finish" text,
"Earnings ($)" real,
"Money list rank" text,
"Scoring average" real,
"Scoring rank" text
)
-- Using valid SQLite, answer the following question... | SELECT COUNT("Scoring average") FROM table_31869 WHERE "Earnings ($)" > '117,682' AND "Best finish" = 't24' | wikisql |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
oth... | SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY lot_details | nvbench |
CREATE TABLE table_name_15 (
tournament VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tournament has a Winning score of e (72-69-71-68=280)?
| SELECT tournament FROM table_name_15 WHERE winning_score = E(72 - 69 - 71 - 68 = 280) | sql_create_context |
CREATE TABLE table_name_28 (
pick INTEGER,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average pick of Florida State?
| SELECT AVG(pick) FROM table_name_28 WHERE college = "florida state" | sql_create_context |
CREATE TABLE table_51859 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the transfer fee for transfer status for fra
| SELECT "Transfer fee" FROM table_51859 WHERE "Status" = 'transfer' AND "Country" = 'fra' | wikisql |
CREATE TABLE table_18249 (
"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.
-- In what district would you find the candidates listed as jim cooper (d) ... | SELECT "District" FROM table_18249 WHERE "Candidates" = 'Jim Cooper (D) Unopposed' | 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 * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '22973171' AND jyjgzbb.JCZBJGDL < jyjgzbb.CKZFWXX OR jyjgzbb... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'acute copd exacerbation - with baseline hypercarbia'... | eicu |
CREATE TABLE table_64420 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has a mascot of the Panthers?
| SELECT "School" FROM table_64420 WHERE "Mascot" = 'panthers' | wikisql |
CREATE TABLE table_42406 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Team" text,
"Primary Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What public team was founded prior to 1883?
| SELECT "Team" FROM table_42406 WHERE "Founded" < '1883' AND "Type" = 'public' | 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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '口齿病(龋齿病)' AND jyjgzbb.JCZBDM = ... | css |
CREATE TABLE table_name_21 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT WAS COLLINGWOOD'S LOWEST CROWD NUMBER WHEN PLAYING AS THE AWAY TEAM?
| SELECT MIN(crowd) FROM table_name_21 WHERE away_team = "collingwood" | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Contr cerebr arteriogram" | mimicsql_data |
CREATE TABLE table_62423 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the republican Incumbent for Pennsylvania 9?
| SELECT "Incumbent" FROM table_62423 WHERE "Party" = 'republican' AND "District" = 'pennsylvania 9' | wikisql |
CREATE TABLE table_name_67 (
week VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of week for w 35 7
| SELECT COUNT(week) FROM table_name_67 WHERE result = "w 35–7" | sql_create_context |
CREATE TABLE table_73901 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in 1833, how many institutions were created?
| SELECT COUNT("Institution") FROM table_73901 WHERE "Founded" = '1833' | 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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '76277364103' AND OVE_SELF_AMO > 353.22 | css |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airli... | 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DA... | atis |
CREATE TABLE table_name_98 (
rank INTEGER,
total VARCHAR,
gold VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank a country with less than 3 gold, more than 2 silver, and less than 5 total medals has?
| SELECT MAX(rank) FROM table_name_98 WHERE gold < 3 AND silver > 2 AND total < 5 | sql_create_context |
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(10),
customer_code... | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY MAX(product_price) | nvbench |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return a bar chart on how o... | SELECT job, MIN(age) FROM Person GROUP BY job | nvbench |
CREATE TABLE table_204_68 (
id number,
"name" text,
"profession" text,
"hometown" text,
"term expires" number,
"office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many of the current state regents will be in office until at least 2016 ?
| SELECT COUNT("name") FROM table_204_68 WHERE "term expires" >= 2016 | squall |
CREATE TABLE table_27401 (
"Language" text,
"Sorata Municipality" text,
"Guanay Municipality" text,
"Tacacoma Municipality" text,
"Quiabaya Municipality" text,
"Combaya Municipality" text,
"Tipuani Municipality" text,
"Mapiri Municipality" text,
"Teoponte Municipality" text
)
-- Us... | SELECT "Guanay Municipality" FROM table_27401 WHERE "Tacacoma Municipality" = '4.321' | wikisql |
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_ID INTEGER,
Order_Item_ID INTEGER,
Product_ID INTEGER,
Order_Quantity INTEGER,
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Addresses (
Address_ID VARCHAR(100),
Line_1 VARCHAR(255),
Line_2 VARCHAR(... | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY Store_Name DESC | nvbench |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'N83.862' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE table_name_27 (
tyre VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Tyre for the German Grand Prix?
| SELECT tyre FROM table_name_27 WHERE race = "german grand prix" | sql_create_context |
CREATE TABLE table_32604 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest crowd at corio oval?
| SELECT MIN("Crowd") FROM table_32604 WHERE "Venue" = 'corio oval' | wikisql |
CREATE TABLE table_74449 (
"Rank" real,
"Rider" text,
"Sat 20 Aug" text,
"Mon 22 Aug" text,
"Tues 23 Aug" text,
"Wed 24 Aug" text,
"Thurs 25 Aug" text,
"Fri 26 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value on Th... | SELECT "Thurs 25 Aug" FROM table_74449 WHERE "Rank" = '3' | wikisql |
CREATE TABLE table_53499 (
"Year" real,
"Ceremony" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was there a category of Best Supporting Actress?
| SELECT SUM("Year") FROM table_53499 WHERE "Category" = 'best supporting actress' | wikisql |
CREATE TABLE table_66179 (
"Title" text,
"Series" text,
"Director" text,
"Release date" text,
"reissue?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the release date of Rabbit Romeo?
| SELECT "Release date" FROM table_66179 WHERE "Title" = 'rabbit romeo' | wikisql |
CREATE TABLE table_name_22 (
date VARCHAR,
home VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Home of pittsburgh, and a Record of 3 6 5?
| SELECT date FROM table_name_22 WHERE home = "pittsburgh" AND record = "3–6–5" | sql_create_context |
CREATE TABLE table_name_6 (
coach VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the coach of the team from Port Pirie?
| SELECT coach FROM table_name_6 WHERE location = "port pirie" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT fp.OwnerUserId AS "user_link", p1.Id AS "post_link", SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 WHEN v.VoteTypeId = 3 THEN -1 ELSE 0 END) AS ScoreThen FROM (SELECT p.OwnerUserId, MIN(p.CreationDate) AS dateFirstPost FROM Posts AS p WHERE p.PostTypeId = '##Choose1forQ2forA##' GROUP BY p.OwnerUserId) AS fp INNER JOIN P... | sede |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 zzmzjzjlb.JZZDSM = '急性支气管炎' GROUP BY person_info.JGDM UNION SELECT ... | css |
CREATE TABLE table_35108 (
"Callsign" text,
"Area served" text,
"Frequency" text,
"Band" text,
"Freq currently" text,
"Purpose" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which band has a current freq of 8tab (hpon)?
| SELECT "Band" FROM table_35108 WHERE "Freq currently" = '8tab (hpon)' | wikisql |
CREATE TABLE table_38317 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent did they play against on April 16?
| SELECT "Opponent" FROM table_38317 WHERE "Date" = 'april 16' | wikisql |
CREATE TABLE table_name_87 (
instrumental VARCHAR,
adverbial VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What instrumental has chven-s as the adverbial?
| SELECT instrumental FROM table_name_87 WHERE adverbial = "chven-s" | sql_create_context |
CREATE TABLE movie (
mid int,
title text,
release_year int,
title_aka text,
budget text
)
CREATE TABLE actor (
aid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CREATE TABLE p... | SELECT genre.genre FROM classification, genre, movie WHERE genre.gid = classification.gid AND movie.mid = classification.msid AND movie.title = 'Jurassic Park' | imdb |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id num... | SELECT Comments.CreationDate, Comments.Id AS "comment_link" FROM Comments WHERE Text LIKE '%sino-5000.com%' | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.admityear < "2139" | mimicsql_data |
CREATE TABLE table_15919 (
"Country ( exonym )" text,
"Capital ( exonym )" text,
"Country ( endonym )" text,
"Capital ( endonym )" text,
"Official or native language(s) (alphabet/script)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many count... | SELECT COUNT("Country ( endonym )") FROM table_15919 WHERE "Capital ( endonym )" = 'Jakarta' | wikisql |
CREATE TABLE table_test_23 (
"id" int,
"previous_mi" bool,
"anemia" bool,
"left_ventricular_ejection_fraction_lvef" int,
"tolerate_gadolinium_contrast_media" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"tolerate_magnet... | SELECT * FROM table_test_23 WHERE renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 30 | criteria2sql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
... | SELECT DATE(CreationDate), SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) >= '##Date##' GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) DESC | sede |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88180) AND microbiologyevents.spec_type_desc = 'tissue' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = DATET... | mimic_iii |
CREATE TABLE table_name_44 (
game INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Record of 20 4 involved what highest game?
| SELECT MAX(game) FROM table_name_44 WHERE record = "20–4" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Arlene Saxonhouse%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor... | advising |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score num... | SELECT (CAST(COUNT(a.Id) AS FLOAT) / (SELECT COUNT(*) FROM Posts AS q WHERE OwnerUserId = @UserId AND PostTypeId = 2 AND q.Score >= @Score) * 100) AS AcceptedPercentage FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2 AND a.Score >= @Score | sede |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'ionized calcium') | eicu |
CREATE TABLE table_name_78 (
built VARCHAR,
location VARCHAR,
county VARCHAR,
listed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which year did Blount County build a bridge in Cleveland that was listed on 1981-08-20?
| SELECT built FROM table_name_78 WHERE county = "blount" AND listed = "1981-08-20" AND location = "cleveland" | 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 = '5878641' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-10-14' AND '2015-11-15' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 1815.95) AS T | css |
CREATE TABLE table_70694 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has the format of cd?
| SELECT "Date" FROM table_70694 WHERE "Format" = 'cd' | wikisql |
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 T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_name_33 (
gross VARCHAR,
territory VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the gross in the United Kingdom?
| SELECT gross FROM table_name_33 WHERE territory = "united kingdom" | sql_create_context |
CREATE TABLE table_8657 (
"Name" text,
"Pre-Season" real,
"A-League" text,
"Finals" real,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pre-Season has a A-League of 0 1, and a Finals larger than 0?
| SELECT MIN("Pre-Season") FROM table_8657 WHERE "A-League" = '0 1' AND "Finals" > '0' | wikisql |
CREATE TABLE table_name_51 (
surface VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what surface was the game played that had a score of 4 6, 6 4, [8 10]?
| SELECT surface FROM table_name_51 WHERE score = "4–6, 6–4, [8–10]" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | SELECT p.Id AS "post_link", p.Score, p.ClosedDate, c.Text FROM Comments AS c INNER JOIN Posts AS p ON p.Id = c.PostId WHERE c.UserId = 2 AND p.PostTypeId = 1 AND p.Score >= 0 AND p.AnswerCount = 0 AND c.Text LIKE '%answer%' ORDER BY p.Score DESC | sede |
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 CloseAsO... | SELECT ((SELECT CAST(COUNT(*) AS FLOAT) FROM Posts AS q JOIN Posts AS a ON a.Id = q.AcceptedAnswerId) / (SELECT CAST(COUNT(*) AS FLOAT) FROM Posts WHERE PostTypeId = 1)) AS accept_answer_ratio | sede |
CREATE TABLE table_62124 (
"Team" text,
"1983" text,
"1984" text,
"1985-1986" real,
"Total points" real,
"Seasons" real,
"Points average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total for 1985-1986 when the total po... | SELECT MIN("1985-1986") FROM table_62124 WHERE "Total points" = '124' | wikisql |
CREATE TABLE table_204_429 (
id number,
"battle" text,
"location" text,
"date(s)" text,
"engagement remarks" text,
"victor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of texan victories ?
| SELECT COUNT(*) FROM table_204_429 WHERE "victor" = 't' | squall |
CREATE TABLE table_39102 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest Attendance for a Week of 2?
| SELECT MIN("Attendance") FROM table_39102 WHERE "Week" = '2' | wikisql |
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | SELECT p.Id, p.Title, COUNT(answers.Id) AS answerCount, p.Score, COUNT(answers.Id) - p.Score AS subtraction FROM Posts AS p INNER JOIN Posts AS answers ON p.Id = answers.ParentId INNER JOIN (SELECT PostId, COUNT(v.Id) AS votes FROM Posts AS p INNER JOIN Posts AS answers ON p.Id = answers.ParentId INNER JOIN Votes AS v ... | sede |
CREATE TABLE table_51898 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has a Hometown of phoenix, az?
| SELECT "School" FROM table_51898 WHERE "Hometown" = 'phoenix, az' | wikisql |
CREATE TABLE table_13050003_2 (
rebounds VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rebounds were there in 2008?
| SELECT COUNT(rebounds) FROM table_13050003_2 WHERE year = 2008 | sql_create_context |
CREATE TABLE table_20275 (
"Name" text,
"Overs Bowled" text,
"Maidens" real,
"Runs Conceded" real,
"Wickets" real,
"Extras" real,
"E.R." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the wickets when overs bowled is 9
| SELECT "Wickets" FROM table_20275 WHERE "Overs Bowled" = '9' | wikisql |
CREATE TABLE table_45830 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date had an attendance of 76,518?
| SELECT "Date" FROM table_45830 WHERE "Attendance" = '76,518' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.