instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_8 (
terry_mcauliffe VARCHAR,
dates_administered VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Terry McAuliffe is it that has a Dates Administered on June 6 7?
| SELECT terry_mcauliffe FROM table_name_8 WHERE dates_administered = "june 6–7" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '孙欣艳' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 532.62) | css |
CREATE TABLE table_name_66 (
seasons VARCHAR,
poles VARCHAR,
entries VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Seasons have a Poles larger than 29, and Entries larger than 191?
| SELECT seasons FROM table_name_66 WHERE poles > 29 AND entries > 191 | sql_create_context |
CREATE TABLE table_2637317_1 (
change_in_population_since_1993 VARCHAR,
_percentage_of_countrys_population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the change in population since 1993 in the region where the % of country's population was 4.2?
| SELECT COUNT(change_in_population_since_1993) FROM table_2637317_1 WHERE _percentage_of_countrys_population = "4.2" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26793)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... | mimic_iii |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_re... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'TACOMA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE table_name_90 (
december VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Decembers have calgary flames as the opponent?
| SELECT COUNT(december) FROM table_name_90 WHERE opponent = "calgary flames" | sql_create_context |
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working... | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality | nvbench |
CREATE TABLE table_name_58 (
opponent VARCHAR,
save VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in the game with save ||33,389||87 62?
| SELECT opponent FROM table_name_58 WHERE save = "||33,389||87–62" | sql_create_context |
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 intakeoutput (
in... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-24135' AND patient.hospitaldischargetime IS NULL)) | eicu |
CREATE TABLE table_5999 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT "Mountains classification" FROM table_5999 WHERE "Team classification" = 'quick step' | wikisql |
CREATE TABLE table_name_25 (
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in week 13?
| SELECT opponent FROM table_name_25 WHERE week = 13 | sql_create_context |
CREATE TABLE Ref_calendar (
day_Number VARCHAR,
calendar_date VARCHAR
)
CREATE TABLE All_documents (
Date_Stored VARCHAR,
date_stored VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the day Number and date of all the documents?
| SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.Date_Stored = T2.calendar_date | sql_create_context |
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
address_type VARCHAR(15),
date_address_to DATETIME
)
CREATE TABLE Order_Items (
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(15)
)
CREATE TABLE Products (
product_... | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' | nvbench |
CREATE TABLE table_39344 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mean pick number for the cornerback position when the overall is less than... | SELECT AVG("Pick #") FROM table_39344 WHERE "Position" = 'cornerback' AND "Overall" < '134' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2065')) AND NOT vitalperiodic.respiration IS N... | eicu |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank i... | SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_67840 (
"Rank" real,
"Team" text,
"Wins" real,
"Losses" real,
"Runs Allowed" real,
"Run Ratio" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of losses the United States, ranked higher than 3 with mor... | SELECT MIN("Losses") FROM table_67840 WHERE "Rank" < '3' AND "Team" = 'united states' AND "Wins" > '6' | wikisql |
CREATE TABLE table_name_54 (
game VARCHAR,
pov_character VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game does the quentyn martell have?
| SELECT game FROM table_name_54 WHERE pov_character = "quentyn martell" | sql_create_context |
CREATE TABLE table_name_45 (
first_elected VARCHAR,
result VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was first elected as the result of a retired republican gain in the district of ohio 21?
| SELECT first_elected FROM table_name_45 WHERE result = "retired republican gain" AND district = "ohio 21" | sql_create_context |
CREATE TABLE table_name_48 (
loss VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the losing score on September 1?
| SELECT loss FROM table_name_48 WHERE date = "september 1" | sql_create_context |
CREATE TABLE table_16929 (
"Venue" text,
"Hosted" real,
"Average" real,
"Highest" real,
"Lowest" real,
"Total" real,
"Last Year" text,
"Up/Down" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the up/down at the venue that hosted ... | SELECT "Up/Down" FROM table_16929 WHERE "Hosted" = '7' | wikisql |
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 pie on what is min... | SELECT job, MIN(age) FROM Person GROUP BY job | nvbench |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | SELECT COUNT(c.Id) AS TotalNoComments, p.Id AS Posts_id FROM Posts AS p INNER JOIN Comments AS c ON (p.Id = c.Id) GROUP BY p.Id ORDER BY TotalNoComments DESC | sede |
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_4 (
diameter__km_ INTEGER,
name VARCHAR,
year_named VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Diameter (km) has a Name of alma-merghen planitia, and a Year named smaller than 1997?
| SELECT MAX(diameter__km_) FROM table_name_4 WHERE name = "alma-merghen planitia" AND year_named < 1997 | sql_create_context |
CREATE TABLE table_203_608 (
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 countries have at least one gold medal ?
| SELECT COUNT("nation") FROM table_203_608 WHERE "gold" >= 1 | squall |
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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder | nvbench |
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 bdmzjzjlb (
HXPLC number,
HZX... | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '3982610' AND wdmzjzjlb.JZKSRQ BETWEEN '2016-01-19' AND '2018-02-22' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '3982610' AND bdmzjzjlb.JZKSRQ BETWEEN '2016-01-19' AND '2018-02-22' AND bdmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season | nvbench |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '8883529' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 22 | css |
CREATE TABLE table_18894744_6 (
high_rebounds VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the high rebounds in the game with a 19-6 record?
| SELECT high_rebounds FROM table_18894744_6 WHERE record = "19-6" | sql_create_context |
CREATE TABLE table_67712 (
"Status" text,
"Name" text,
"First Performance" text,
"Last Performance" text,
"Style" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the First Performance when the status is past and the style was ballet, tap?
| SELECT "First Performance" FROM table_67712 WHERE "Status" = 'past' AND "Style" = 'ballet, tap' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ye... | mimic_iii |
CREATE TABLE table_name_27 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the Kings game when they had a record of 8 11 1?
| SELECT score FROM table_name_27 WHERE record = "8–11–1" | sql_create_context |
CREATE TABLE table_29190 (
"Rank" real,
"Rider" text,
"Sat 21 Aug" text,
"Mon 23 Aug" text,
"Tues 24 Aug" text,
"Wed 25 Aug" text,
"Thurs 26 Aug" text,
"Fri 27 Aug" text,
"Sat 29 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Mon 23 Aug" FROM table_29190 WHERE "Tues 24 Aug" = '21'' 18.87 106.209mph' | wikisql |
CREATE TABLE table_40086 (
"Name" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is the Jiufotang Formation located in?
| SELECT "Location" FROM table_40086 WHERE "Unit" = 'jiufotang formation' | wikisql |
CREATE TABLE table_25920798_2 (
leader_battle VARCHAR,
vote VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the leader battle for 4-3 vote
| SELECT leader_battle FROM table_25920798_2 WHERE vote = "4-3" | sql_create_context |
CREATE TABLE claims_processing (
claim_processing_id number,
claim_id number,
claim_outcome_code text,
claim_stage_id number,
staff_id number
)
CREATE TABLE claims_documents (
claim_id number,
document_type_code text,
created_by_staff_id number,
created_date number
)
CREATE TABLE c... | SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" | spider |
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 Name, COUNT(Name) FROM Products GROUP BY Name | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Private" | mimicsql_data |
CREATE TABLE table_57363 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed By" text,
"Written By" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Julie gets Validated originally air?
| SELECT "Original air date" FROM table_57363 WHERE "Title" = 'julie gets validated' | wikisql |
CREATE TABLE table_17350255_1 (
film_title_used_in_nomination VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title used in nomination in the original B b i Zhu ngsh ( )?
| SELECT film_title_used_in_nomination FROM table_17350255_1 WHERE original_title = "Bābǎi zhuàngshì (八百壯士)" | sql_create_context |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE food_service (
meal_code text,
meal_nu... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'Z80.670' AND jyjgzbb.JCZBDM = '849746' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
... | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'stochastic optimization' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpap... | scholar |
CREATE TABLE table_name_38 (
goals VARCHAR,
name VARCHAR,
since VARCHAR,
nat VARCHAR,
transfer_fee VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals was by Rix from Eng who started before 2005 in the youth system?
| SELECT COUNT(goals) FROM table_name_38 WHERE nat = "eng" AND transfer_fee = "youth system" AND since < 2005 AND name = "rix" | sql_create_context |
CREATE TABLE table_48133 (
"Event" text,
"Year" real,
"Category" text,
"Work" text,
"Outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What category was the winner in?
| SELECT "Category" FROM table_48133 WHERE "Outcome" = 'winner' | wikisql |
CREATE TABLE table_477 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Intergiro classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Intergiro classification" FROM table_477 WHERE "Winner" = 'Alexander Gontchenkov' | wikisql |
CREATE TABLE table_name_2 (
grid INTEGER,
manufacturer VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average grid for vehicles manufactured by Aprilia and having run more than 16 laps?
| SELECT AVG(grid) FROM table_name_2 WHERE manufacturer = "aprilia" AND laps > 16 | sql_create_context |
CREATE TABLE table_66057 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" 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 Enrollment of 908?
| SELECT "School" FROM table_66057 WHERE "Enrollment" = '908' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-47306')) AND medication.drugname IN ('pneumococcal vac polyvalent 25 m... | eicu |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'ITALIAN' AND semester.semester = 'Fall' | advising |
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Ref_Transaction_Types (
transact... | SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY AVG(share_count) DESC | nvbench |
CREATE TABLE table_26637 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What state had william bigler (d) as a successor)
| SELECT "State (class)" FROM table_26637 WHERE "Successor" = 'William Bigler (D)' | wikisql |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "7761" | mimicsql_data |
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 COUNT(txmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '戚俊晤' AND txmzjzjlb.JZKSRQ BETWEEN '2006-06-17' AND '2011-04-28' UNION SELECT COUNT(ft... | css |
CREATE TABLE table_name_82 (
time VARCHAR,
nfl_recap VARCHAR,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time of the game at Arrowhead Stadium with an NFL Recap of recap?
| SELECT time FROM table_name_82 WHERE nfl_recap = "recap" AND game_site = "arrowhead stadium" | sql_create_context |
CREATE TABLE table_24971 (
"#" text,
"Spacecraft" text,
"Spacewalkers" text,
"Start ( UTC )" text,
"End (UTC)" text,
"Duration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who walked in space from STS-101 Eva 1?
| SELECT "Spacewalkers" FROM table_24971 WHERE "Spacecraft" = 'STS-101 EVA 1' | wikisql |
CREATE TABLE Vehicles (
vehicle_details VARCHAR,
vehicle_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the detail of vehicle with id 1.
| SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1 | sql_create_context |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "769" | mimicsql_data |
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
-- Using valid SQLite... | SELECT fname, lname FROM student | spider |
CREATE TABLE table_76939 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the To par of the Player with a Score of 70-71=141?
| SELECT AVG("To par") FROM table_76939 WHERE "Score" = '70-71=141' | wikisql |
CREATE TABLE table_5139 (
"Season" text,
"Series" text,
"Races" real,
"Poles" real,
"Wins" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins are associated with 20 points and ove... | SELECT SUM("Wins") FROM table_5139 WHERE "Points" = '20' AND "Podiums" > '1' | wikisql |
CREATE TABLE table_32387 (
"Player" text,
"Home Town" text,
"College/Prior" text,
"Drafting Team" text,
"Graduated" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drafted the player from Michigan after 2010?
| SELECT "Drafting Team" FROM table_32387 WHERE "Graduated" > '2010' AND "College/Prior" = 'michigan' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLO... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_203_444 (
id number,
"week" number,
"start date" text,
"type" text,
"tournament" text,
"surface" text,
"town" text,
"country" text,
"continent" text,
"prize money" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "tournament" FROM table_203_444 WHERE id = (SELECT id FROM table_203_444 WHERE "tournament" = 'bnp paribas open') - 1 | squall |
CREATE TABLE table_20959 (
"Country" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends F/A" text,
"Stolen Ends For" real,
"Stolen Ends Against" real,
"Shot %" real
)
-- Using valid SQLite, answer the following qu... | SELECT "Skip" FROM table_20959 WHERE "Stolen Ends Against" = '13' | wikisql |
CREATE TABLE table_26986076_5 (
mon_23_aug VARCHAR,
tues_24_aug VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 21' 18.87 106.209mph is Tuesday August 24th what is Monday August 23rd?
| SELECT mon_23_aug FROM table_26986076_5 WHERE tues_24_aug = "21' 18.87 106.209mph" | sql_create_context |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For e... | SELECT stars, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director | nvbench |
CREATE TABLE table_15314901_1 (
coordinate_velocity_v_dx_dt_in_units_of_c VARCHAR,
condition_parameter VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the the condition/parameter is rapidity of 2 hyperbolic radians, what is the coordinate velocity v dx/dt ... | SELECT coordinate_velocity_v_dx_dt_in_units_of_c FROM table_15314901_1 WHERE condition_parameter = "Rapidity of 2 hyperbolic radians" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '任秀竹' AND t_kc22.STA_DATE BETWEEN '2000-08-26' AND '2011-03-02' AND t_kc22.t_kc21_MED_SER_ORG_NO = '2367774' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_11656578_2 (
voivodeship VARCHAR,
population__1980_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different voivodenship have 747 900 citizes?
| SELECT COUNT(voivodeship) FROM table_11656578_2 WHERE population__1980_ = "747 900" | sql_create_context |
CREATE TABLE table_66805 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score for september 25
| SELECT "Score" FROM table_66805 WHERE "Date" = 'september 25' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'dementia' AND DATETIME(diagnosis.diagnosistime) <=... | eicu |
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 DISTINCT Name FROM Badges AS b | sede |
CREATE TABLE table_26198 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What CFL team was the player playing on SB position drafted for?
| SELECT "CFL Team" FROM table_26198 WHERE "Position" = 'SB' | wikisql |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_fare AS FLIGHT_FARE, flight_fare ... | atis |
CREATE TABLE table_61711 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Usin... | SELECT MAX("League Cup Goals") FROM table_61711 WHERE "FA Cup Apps" = '0' AND "Position" = 'mf' AND "League Apps" = '1' AND "Total Goals" < '0' | wikisql |
CREATE TABLE table_name_63 (
date VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the match at Lake Oval take place?
| SELECT date FROM table_name_63 WHERE venue = "lake oval" | sql_create_context |
CREATE TABLE table_name_26 (
episode_title VARCHAR,
countries_visited VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode title featured a visit to the country of Cuba?
| SELECT episode_title FROM table_name_26 WHERE countries_visited = "cuba" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
CREATE TABLE table_23949 (
"City (Utility)" text,
"Residential Monthly usage: 1000 kWh" text,
"Small power Power demand: 40 kW; Consumption 10,000 kWh, load factor: 35%." text,
"Medium power Power demand: 1,000 kW; Consumption: 400,000 kWh, load factor: 56 %." text,
"Large power Power demand: 50,000... | SELECT "Large power Power demand: 50,000 kW; Consumption: 30,600,000 kWh, load factor: 85%." FROM table_23949 WHERE "Small power Power demand: 40 kW; Consumption 10,000 kWh, load factor: 35%." = '13.41' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '姜新蕾' AND hz_info.YLJGDM = '4680590' AND wdmzjzjlb.CYKSMC LIKE '%免疫病%' UNION SELECT * FROM person_info JOIN ... | css |
CREATE TABLE table_30633 (
"Category" text,
"Player" text,
"Team" text,
"Games played" real,
"Totals" text,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the team when the category is field goal percentage?
| SELECT "Team" FROM table_30633 WHERE "Category" = 'Field goal percentage' | wikisql |
CREATE TABLE table_11220799_2 (
episode_titles VARCHAR,
first_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes had their first air date on March 6, 2008?
| SELECT COUNT(episode_titles) FROM table_11220799_2 WHERE first_air_date = "March 6, 2008" | sql_create_context |
CREATE TABLE technician (
technician_id number,
name text,
team text,
starting_year number,
age number
)
CREATE TABLE machine (
machine_id number,
making_year number,
class text,
team text,
machine_series text,
value_points number,
quality_rank number
)
CREATE TABLE rep... | SELECT name FROM technician ORDER BY age | spider |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13920') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ... | eicu |
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.dod_year <= "2132.0" AND diagnoses.icd9_code = "7098" | mimicsql_data |
CREATE TABLE invoices (
customer_id VARCHAR
)
CREATE TABLE customers (
id VARCHAR,
first_name VARCHAR,
last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many orders does Lucas Mancini has?
| SELECT COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini" | sql_create_context |
CREATE TABLE table_name_94 (
losses VARCHAR,
wins VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of losses with less than 6 wins and less than 0 draws?
| SELECT COUNT(losses) FROM table_name_94 WHERE wins < 6 AND draws < 0 | sql_create_context |
CREATE TABLE table_name_63 (
overall VARCHAR,
name VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the name Derek Smith when the round is higher than 3?
| SELECT COUNT(overall) FROM table_name_63 WHERE name = "derek smith" AND round > 3 | sql_create_context |
CREATE TABLE table_name_32 (
enrollment INTEGER,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- COunt the average Enrollment in hope?
| SELECT AVG(enrollment) FROM table_name_32 WHERE location = "hope" | 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 Apartment_Facilities (
apt_id I... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_name_17 (
school VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is School, when Event is '100 Backstroke'?
| SELECT school FROM table_name_17 WHERE event = "100 backstroke" | sql_create_context |
CREATE TABLE table_18214 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Status" text,
"Opponent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many republican incumbents first elected in 1974?
| SELECT COUNT("Incumbent") FROM table_18214 WHERE "Party" = 'Republican' AND "First elected" = '1974' | wikisql |
CREATE TABLE table_name_82 (
score VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Tie No is '30'?
| SELECT score FROM table_name_82 WHERE tie_no = "30" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_67126 (
"Year" real,
"Event" text,
"Venue" text,
"Driver" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the BRDC International Trophy with driver Emerson Fittipaldi held?
| SELECT "Venue" FROM table_67126 WHERE "Driver" = 'emerson fittipaldi' AND "Event" = 'brdc international trophy' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.