instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 wdmzjzjlb.RZBQDM, wdmzjzjlb.RZBQMC, wdmzjzjlb.RYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '49376399892' UNION SELECT bdmzjzjlb.RZBQDM, bdmzjzjlb.RZBQMC, bdmzjzjlb.RYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '49376399892' | css |
CREATE TABLE table_name_47 (
bronze INTEGER,
rank VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Bronze when the rank is more than 11 and gold is less than 0?
| SELECT SUM(bronze) FROM table_name_47 WHERE rank > 11 AND gold < 0 | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | SELECT DATE(CreationDate), COUNT(PostId) FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Tags.TagName = '##TagName:string##' GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) | sede |
CREATE TABLE table_name_51 (
laps VARCHAR,
grid VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Laps have Grid larger than 14, and a Rider of sylvain guintoli?
| SELECT COUNT(laps) FROM table_name_51 WHERE grid > 14 AND rider = "sylvain guintoli" | sql_create_context |
CREATE TABLE table_4042 (
"School" text,
"Gender" text,
"Age Range" text,
"Religious Affiliation" text,
"Location" text,
"School website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has a website of http://www.sjfisher.herts.sch.... | SELECT "School" FROM table_4042 WHERE "School website" = 'http://www.sjfisher.herts.sch.uk/' | 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 COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE IN_DIAG_DIS_NM = '癫痫' | css |
CREATE TABLE table_8321 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance when they played the New Orleans Saints?
| SELECT "Attendance" FROM table_8321 WHERE "Opponent" = 'new orleans saints' | wikisql |
CREATE TABLE table_30991 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the results of those matches where the championshi... | SELECT "Score" FROM table_30991 WHERE "Championship" = 'French Open' | wikisql |
CREATE TABLE table_46705 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real,
"Name origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the year when the diameter was 729 km?
| SELECT "Year named" FROM table_46705 WHERE "Diameter (km)" = '729' | wikisql |
CREATE TABLE procedures (
code number,
name text,
cost number
)
CREATE TABLE affiliated_with (
physician number,
department number,
primaryaffiliation boolean
)
CREATE TABLE room (
roomnumber number,
roomtype text,
blockfloor number,
blockcode number,
unavailable boolean
)
... | SELECT name, cost FROM procedures ORDER BY cost DESC | spider |
CREATE TABLE table_name_97 (
samurai VARCHAR,
stampede VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the samurai for stampede of t. mask
| SELECT samurai FROM table_name_97 WHERE stampede = "t. mask" | sql_create_context |
CREATE TABLE table_12687 (
"Season" text,
"GP/MP" text,
"Kills" real,
"K/Game" real,
"Errors" real,
"Total Attempts" real,
"Percentage" real,
"Assists" real,
"Service Aces" real,
"Digs" real,
"Solo Blocks" real,
"Block Assists" real,
"Total Blocks" real
)
-- Using v... | SELECT MAX("Assists") FROM table_12687 WHERE "Percentage" < '0.34900000000000003' AND "Solo Blocks" > '13' AND "Total Attempts" < '4713' | wikisql |
CREATE TABLE table_1405704_1 (
team VARCHAR,
race_name VARCHAR,
engine VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team raced with a Foyt engine in the Texas Grand Prix?
| SELECT team FROM table_1405704_1 WHERE race_name = "Texas Grand Prix" AND engine = "Foyt" | sql_create_context |
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
)
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
... | SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY Party | nvbench |
CREATE TABLE table_name_80 (
score VARCHAR,
player VARCHAR,
country VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the United States in place T1 for David Duval?
| SELECT score FROM table_name_80 WHERE country = "united states" AND place = "t1" AND player = "david duval" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_item... | mimic_iii |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "CIPROBASE" | mimicsql_data |
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Radical neck dissection, unilateral" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_name_20 (
result VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result when the score is 0-2?
| SELECT result FROM table_name_20 WHERE score = "0-2" | sql_create_context |
CREATE TABLE table_10812403_4 (
position VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people were pick #30?
| SELECT COUNT(position) FROM table_10812403_4 WHERE pick__number = 30 | sql_create_context |
CREATE TABLE table_2732 (
"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 was... | SELECT "Team" FROM table_2732 WHERE "Date" = 'February 4' | wikisql |
CREATE TABLE table_47146 (
"Company" text,
"Type" text,
"Principal activities" text,
"Incorporated in" text,
"Group's Equity Shareholding" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Type has an Incorporated in of netherlands, a Principal a... | SELECT "Type" FROM table_47146 WHERE "Incorporated in" = 'netherlands' AND "Principal activities" = 'airline' AND "Company" = 'transavia.com' | wikisql |
CREATE TABLE table_name_22 (
lane VARCHAR,
heat VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What lane number was Hungary and had a heat of 4?
| SELECT COUNT(lane) FROM table_name_22 WHERE heat = 4 AND nationality = "hungary" | sql_create_context |
CREATE TABLE table_62007 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of the Winning driver has a Circuit of saint-rapha l?
| SELECT "Winning driver" FROM table_62007 WHERE "Circuit" = 'saint-raphaël' | wikisql |
CREATE TABLE table_1566850_8 (
centerfold_model VARCHAR,
pictorials VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the centerfold model when a pictorial was done on marilyn monroe?
| SELECT centerfold_model FROM table_1566850_8 WHERE pictorials = "Marilyn Monroe" | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_co... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1800 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... | atis |
CREATE TABLE table_26678 (
"Region/Country" text,
"Local name" text,
"Main presenter" text,
"Network" text,
"Year premiered" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is every main presenter for the year 2011?
| SELECT "Main presenter" FROM table_26678 WHERE "Year premiered" = '2011' | wikisql |
CREATE TABLE table_name_26 (
opponent_in_the_final VARCHAR,
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which final opponent's surface was hard (i) and participated on October 9, 2005?
| SELECT opponent_in_the_final FROM table_name_26 WHERE surface = "hard (i)" AND date = "october 9, 2005" | sql_create_context |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'E00.628' AND jyjgzbb.JCZBMC = '免疫球蛋白A(标准)' UNION SELECT jyjgzbb.... | css |
CREATE TABLE table_58151 (
"Runs" text,
"Player" text,
"Opponent" text,
"Venue" text,
"Season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During runs 332, what was the venue?
| SELECT "Venue" FROM table_58151 WHERE "Runs" = '332' | wikisql |
CREATE TABLE table_28190534_1 (
engine VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the engine for ecurie lutetia
| SELECT engine FROM table_28190534_1 WHERE entrant = "Ecurie Lutetia" | sql_create_context |
CREATE TABLE table_33591 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was home team Essendon's opponents score?
| SELECT "Away team score" FROM table_33591 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11914 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_4 (
location_attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location/ attendance for a 35-28 record?
| SELECT location_attendance FROM table_name_4 WHERE record = "35-28" | sql_create_context |
CREATE TABLE table_3255 (
"Information" text,
"James E. Holmes" text,
"Reidsville" text,
"Rockingham County" text,
"Western Rockingham Middle School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the james e. holmes for erselle young
| SELECT "James E. Holmes" FROM table_3255 WHERE "Reidsville" = 'Erselle Young' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name var... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO... | atis |
CREATE TABLE Documents (
document_name VARCHAR,
document_id VARCHAR,
document_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find names and ids of all documents with document type code BK.
| SELECT document_name, document_id FROM Documents WHERE document_type_code = "BK" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE p... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 443 | advising |
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 jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_... | css |
CREATE TABLE table_56376 (
"State" text,
"Swimsuit" real,
"Evening gown" real,
"Interview" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which state had an average of less than 8.67, a swimsuit score of 8.27, an evening gown score o... | SELECT "State" FROM table_56376 WHERE "Average" < '8.67' AND "Swimsuit" = '8.27' AND "Evening gown" = '8.78' AND "Interview" = '8.52' | wikisql |
CREATE TABLE table_63979 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when the competition is 1996 tiger cup and the result is drew?
| SELECT "Date" FROM table_63979 WHERE "Competition" = '1996 tiger cup' AND "Result" = 'drew' | wikisql |
CREATE TABLE orders (
order_id number,
customer_id number,
order_status text,
date_order_placed time,
order_details text
)
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE customers (
customer_id number,
customer_name text,
customer_details ... | SELECT order_item_id FROM order_items WHERE product_id = 11 | spider |
CREATE TABLE table_name_52 (
class VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class had a rank of 2nd?
| SELECT class FROM table_name_52 WHERE rank = "2nd" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
journalid int,
jo... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'character recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year < 2010 | scholar |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
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,
... | SELECT Sex, MAX(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_name_44 (
game VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opponent of @ atlanta flames had what game?
| SELECT game FROM table_name_44 WHERE opponent = "@ atlanta flames" | sql_create_context |
CREATE TABLE table_36896 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue #" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Country is Catalogue # ASW 50248 (724385024825) from?
| SELECT "Country" FROM table_36896 WHERE "Catalogue #" = 'asw 50248 (724385024825)' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
... | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22204) AND NOT transfers.careunit IS NULL AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_84 (
money___ INTEGER,
player VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the sum of Money ($) that has the Score of 69-72-67-71=279, and the Player of loren roberts?
| SELECT SUM(money___) AS $__ FROM table_name_84 WHERE score = 69 - 72 - 67 - 71 = 279 AND player = "loren roberts" | sql_create_context |
CREATE TABLE table_26336739_1 (
elected INTEGER,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the district incumbent Saxby Chambliss elected?
| SELECT MAX(elected) FROM table_26336739_1 WHERE incumbent = "Saxby Chambliss" | sql_create_context |
CREATE TABLE staff (
staff_id number,
gender text,
first_name text,
last_name text,
email_address text,
phone_number text
)
CREATE TABLE complaints (
complaint_id number,
product_id number,
customer_id number,
complaint_outcome_code text,
complaint_status_code text,
comp... | SELECT address_line_1, address_line_2 FROM customers WHERE email_address = "vbogisich@example.org" | spider |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '46237741' AND t_kc22.STA_DATE BETWEEN '2011-01-06' AND '2012-11-24' 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.PERSON_ID = '4... | css |
CREATE TABLE table_2668416_7 (
district VARCHAR,
party VARCHAR,
candidates VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the district for the party federalist and the candidates are william craik (f) 51.0% benjamin edwards 49.0%?
| SELECT district FROM table_2668416_7 WHERE party = "Federalist" AND candidates = "William Craik (F) 51.0% Benjamin Edwards 49.0%" | sql_create_context |
CREATE TABLE table_204_127 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"opponent" text,
"score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which surface was played on the least ?
| SELECT "surface" FROM table_204_127 GROUP BY "surface" ORDER BY COUNT(*) LIMIT 1 | squall |
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '8772585' AND wdmzjzjlb.JZKSRQ BETWEEN '2015-03-20' AND '2021-04-24' AND wdmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '8772585' AND bdmzjzjlb.JZKSRQ BETWEEN '2015-03-20' AND '2021-04-24' AND bdmzjzjlb.ZZBZ > 0 | css |
CREATE TABLE table_68903 (
"Rank" real,
"Country/Region" text,
"Population" real,
"Area (km 2 )" real,
"Density (Pop. per km 2 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest area of the region with a population less than 22,955... | SELECT MIN("Area (km 2 )") FROM table_68903 WHERE "Population" < '22,955,395' AND "Country/Region" = 'bangladesh' AND "Density (Pop. per km 2 )" < '1034' | wikisql |
CREATE TABLE table_68530 (
"Venue" text,
"City" text,
"Tickets Sold / Available" text,
"Gross Revenue (1979)" text,
"Gross Revenue (2012)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue has Tickets Sold/ Available with a Gross Revenue (1... | SELECT "Tickets Sold / Available" FROM table_68530 WHERE "Gross Revenue (1979)" = '$665,232' | wikisql |
CREATE TABLE table_2523 (
"Rank" real,
"School" text,
"Basic Elements" real,
"Tumbling" real,
"Stunts" text,
"Pyramids" text,
"Tosses" text,
"Deductions" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every tota... | SELECT "Total" FROM table_2523 WHERE "School" = 'University of the Cordilleras UC Dance Squad' | wikisql |
CREATE TABLE table_77191 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when the round is sf?
| SELECT "Date" FROM table_77191 WHERE "Round" = 'sf' | wikisql |
CREATE TABLE table_13625792_1 (
total__number VARCHAR,
bush__percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the county where Bush won 77.76%, how many total votes were cast?
| SELECT total__number FROM table_13625792_1 WHERE bush__percentage = "77.76%" | sql_create_context |
CREATE TABLE table_18824 (
"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.
-- How ma... | SELECT COUNT("Record") FROM table_18824 WHERE "Date" = 'April 12' | wikisql |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local... | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) | nvbench |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
even... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'streptococcus unspecf') AND STRFTIME('%y', diagnoses_icd.charttime) >= '21... | mimic_iii |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTask... | SELECT RANK() OVER (ORDER BY u.Reputation DESC) AS Rank, u.Id AS "user_link", u.Reputation, COUNT(b.Id) AS "count" FROM Badges AS b INNER JOIN Users AS u ON b.UserId = u.Id WHERE (b.Name = '##name?Famous Question##') GROUP BY u.Id, u.Reputation ORDER BY u.Reputation DESC LIMIT 500 | sede |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airp... | 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, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'FIRST' AND far... | atis |
CREATE TABLE table_74942 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Lost" FROM table_74942 WHERE "Played" = 'played' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1833407' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-07-26' AND '2011-07-21' | css |
CREATE TABLE table_20856 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race time" text,
"Average speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Driver" FROM table_20856 WHERE "Race time" = '2:34:21' | wikisql |
CREATE TABLE table_12473 (
"State" text,
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What state is Ding and has a royal house of Ji?
| SELECT "State" FROM table_12473 WHERE "Royal house" = 'ji' AND "Name" = 'ding' | wikisql |
CREATE TABLE table_72449 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Tries against" FROM table_72449 WHERE "Tries for" = '62' | wikisql |
CREATE TABLE table_43805 (
"Release date" text,
"Album title" text,
"Record label" text,
"Disc number" text,
"Track number" text,
"Title" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Track number has a Album title of , and a Title of ?
| SELECT "Track number" FROM table_43805 WHERE "Album title" = '文武双全升级版' AND "Title" = '老爸你别装酷' | wikisql |
CREATE TABLE table_12985 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Election has a 2nd Member of reform act 1867 : constituency abolished?
| SELECT "Election" FROM table_12985 WHERE "2nd Member" = 'reform act 1867 : constituency abolished' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT BGRQ FROM jybgb WHERE BGDH = '45430196189' | css |
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(*) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '苗乐池' AND mzjzjlb.JZKSRQ BETWEEN '2005-05-11' AND '2021-10-27' AND mzjzjlb.YLJGDM = '4321914' | css |
CREATE TABLE orders (
order_id number,
customer_id number,
order_status text,
date_order_placed time,
order_details text
)
CREATE TABLE shipments (
shipment_id number,
order_id number,
invoice_number number,
shipment_tracking_number text,
shipment_date time,
other_shipment_d... | SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2 | spider |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cholecystitis - acute' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102') AS t1 JOIN (SELECT patient.uni... | eicu |
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.admission_type = "URGENT" AND lab.itemid = "50980" | mimicsql_data |
CREATE TABLE table_name_21 (
site_stadium VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On March 23, what is the site/stadium?
| SELECT site_stadium FROM table_name_21 WHERE date = "march 23" | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "4432" | mimicsql_data |
CREATE TABLE table_64311 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When against is 797 and wins is more than 10, what is the sum of draws?
| SELECT COUNT("Draws") FROM table_64311 WHERE "Against" = '797' AND "Wins" > '10' | wikisql |
CREATE TABLE table_name_21 (
no_result VARCHAR,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total No Results are recorded for less than 6 wins?
| SELECT COUNT(no_result) FROM table_name_21 WHERE wins < 6 | sql_create_context |
CREATE TABLE documents_mailed (
document_id number,
mailed_to_address_id number,
mailing_date time
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_description text
)
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
... | SELECT document_status_description FROM ref_document_status WHERE document_status_code = "working" | spider |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE table_38834 (
"Distance" text,
"Time" text,
"Date" text,
"Location" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the date when the location is Berlin?
| SELECT "Date" FROM table_38834 WHERE "Location" = 'berlin' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 (
... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "GELCLAIR" | mimicsql_data |
CREATE TABLE table_7725 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the transfer fee for the player ending in 2011 a... | SELECT "Transfer fee" FROM table_7725 WHERE "Ends" = '2011' AND "Moving from" = 'thrasyvoulos' | wikisql |
CREATE TABLE table_66377 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance in a week earlier than 4, and result is w 31-20?
| SELECT AVG("Attendance") FROM table_66377 WHERE "Week" < '4' AND "Result" = 'w 31-20' | wikisql |
CREATE TABLE table_name_49 (
genre VARCHAR,
developer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what genre did Microvision develop a game?
| SELECT genre FROM table_name_49 WHERE developer = "microvision" | sql_create_context |
CREATE TABLE table_50446 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" 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 with a transfer window in summer, an un... | SELECT "Name" FROM table_50446 WHERE "Transfer window" = 'summer' AND "Transfer fee" = 'undisclosed' AND "Moving from" = 'brussels' | wikisql |
CREATE TABLE table_31778 (
"Year" real,
"Date" text,
"Event" text,
"Days" text,
"Stages" text,
"Acts" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the events for 106 bands
| SELECT "Event" FROM table_31778 WHERE "Acts" = '106 bands' | wikisql |
CREATE TABLE table_name_97 (
name VARCHAR,
qual_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What name has a qual 2 of 1:43.374?
| SELECT name FROM table_name_97 WHERE qual_2 = "1:43.374" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... | atis |
CREATE TABLE table_name_92 (
place INTEGER,
year VARCHAR,
clean_and_jerk VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest place result in 2010 with a Clean and Jerk weight of 224kg?
| SELECT MAX(place) FROM table_name_92 WHERE year = 2010 AND clean_and_jerk = "224kg" | sql_create_context |
CREATE TABLE table_28027307_1 (
us_viewers__millions_ VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many millions of U.S. viewers watched the episode with the production code of 6AKY07?
| SELECT us_viewers__millions_ FROM table_28027307_1 WHERE production_code = "6AKY07" | sql_create_context |
CREATE TABLE table_name_57 (
origin VARCHAR,
in_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the vessel with a listed In service of 1, what is the origin given?
| SELECT origin FROM table_name_57 WHERE in_service = 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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Hematocrit, Other Fluid" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '奚心思' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLI... | css |
CREATE TABLE table_16748 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the r... | SELECT "Report" FROM table_16748 WHERE "Location" = 'Kyalami' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.