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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE table_name_57 (
school_club_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the school that hosts jim goodman
| SELECT school_club_team FROM table_name_57 WHERE player = "jim goodman" | sql_create_context |
CREATE TABLE table_24445 (
"Class" text,
"Weapon" text,
"Caliber" text,
"Type" text,
"Weight (g)" text,
"Range (m)" text,
"Velocity (m/s)" text,
"Impact Energy" text,
"Shots" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Type FJ/RN/... | SELECT "Class" FROM table_24445 WHERE "Type" = 'FJ/RN/SC' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE requirement (... | SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'EHS' AND course.number = 500 AND program_course.course_id = course.course_id AND program_course.workload > 3 | advising |
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '苗飞章' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-03-03' AND '2015-09-01' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PER... | css |
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_34 (
player VARCHAR,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player had a total less than 277?
| SELECT player FROM table_name_34 WHERE total < 277 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABL... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MODGREEK' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sp... | advising |
CREATE TABLE table_2076490_1 (
founded INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest founding date?
| SELECT MAX(founded) FROM table_2076490_1 | sql_create_context |
CREATE TABLE table_34080 (
"Nation" text,
"Finalists" real,
"Winners" real,
"Runners-up" real,
"% won" real,
"Years won" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many finalists were there when the years won was 2008 and the won % was g... | SELECT SUM("Finalists") FROM table_34080 WHERE "Years won" = '2008' AND "% won" > '33' | wikisql |
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex t... | SELECT T2.fname, T2.lname FROM course AS T1 JOIN faculty AS T2 ON T1.instructor = T2.facid WHERE T1.cname = "COMPUTER LITERACY" | spider |
CREATE TABLE table_204_834 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the last finisher from the us ?
| SELECT "name" FROM table_204_834 WHERE "nationality" = 'united states' ORDER BY "time" DESC LIMIT 1 | squall |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52604 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) | mimic_iii |
CREATE TABLE table_24431264_17 (
points VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the total number of defense points for caroline wozniacki.
| SELECT points AS defending FROM table_24431264_17 WHERE player = "Caroline Wozniacki" | sql_create_context |
CREATE TABLE table_74104 (
"Status" text,
"2001 number (,000)" real,
"2001 %" text,
"2011 number (,000)" real,
"2011 %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2011 number (,000) when the status is separated?
| SELECT "2011 number (,000)" FROM table_74104 WHERE "Status" = 'Separated' | wikisql |
CREATE TABLE table_204_22 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what 's the number of people who attended the ok... | SELECT "attendance" FROM table_204_22 WHERE "date" = '11/29/1985' | squall |
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 * FROM jybgb WHERE jybgb.JZLSH = '91187445953' | css |
CREATE TABLE table_203_7 (
id number,
"pos." number,
"artist" text,
"single" text,
"year" number,
"sales" number,
"peak" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what were the total sales of eiffel 65 's blue -lrb- da ba dee -rrb- ?
| SELECT "sales" FROM table_203_7 WHERE "single" = '"blue (da ba dee)"' AND "artist" = 'eiffel 65' | squall |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEG... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY COUNT(date_of_transaction) DESC | nvbench |
CREATE TABLE table_202_240 (
id number,
"year" number,
"single" text,
"chart" text,
"position" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many singles from dosage appeared on the modern rock tracks charts ?
| SELECT COUNT("single") FROM table_202_240 WHERE "chart" = 'modern rock tracks' | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mannitol - bolus .25-.5 gms/kg' AND STRF... | eicu |
CREATE TABLE table_10192 (
"Name" text,
"Service" text,
"Rank" text,
"Place of action" text,
"Unit" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the place of action for sergeant rank and 5th company, 2nd marines unit
| SELECT "Place of action" FROM table_10192 WHERE "Rank" = 'sergeant' AND "Unit" = '5th company, 2nd marines' | wikisql |
CREATE TABLE table_63758 (
"Title" text,
"Series" text,
"Director" text,
"Production Num." text,
"Release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director of Little Beau Porky?
| SELECT "Director" FROM table_63758 WHERE "Title" = 'little beau porky' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Posts (
... | SELECT Id AS "user_link", DisplayName, WebsiteUrl, Location FROM Users WHERE Location LIKE 'Victoria,BC%' ORDER BY age DESC LIMIT 100 | sede |
CREATE TABLE table_49937 (
"Method of administration[ citation needed ]" text,
"Category 1" real,
"Category 2" real,
"Category 3" text,
"Category 4" text,
"Category 5" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If category 1 is 0.05, what is... | SELECT "Category 3" FROM table_49937 WHERE "Category 1" = '0.05' | wikisql |
CREATE TABLE products (
product_name VARCHAR,
product_id VARCHAR
)
CREATE TABLE complaints (
product_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the name of all products along with the number of complaints that they have received.
| SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-86236')) AND NOT vitalperiodic.heartrate IS NULL... | eicu |
CREATE TABLE table_name_13 (
runs VARCHAR,
opponent VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runs did they get against new south wales in 2002/03?
| SELECT runs FROM table_name_13 WHERE opponent = "new south wales" AND season = "2002/03" | sql_create_context |
CREATE TABLE table_204_621 (
id number,
"no." number,
"date" text,
"tournament" text,
"winning score" text,
"margin\nof victory" text,
"runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did don january win by at lea... | SELECT COUNT(*) FROM table_204_621 WHERE "margin\nof victory" >= 10 | squall |
CREATE TABLE table_name_87 (
total INTEGER,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many medals did China receive?
| SELECT MIN(total) FROM table_name_87 WHERE nation = "china" | sql_create_context |
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 Posts.Id, Posts.Id AS "post_link", Posts.Title, Posts.OwnerUserId, Users.DisplayName, Posts.Body, Posts.CreationDate, Posts.LastActivityDate, Posts.LastEditDate, Posts.DeletionDate, Posts.ClosedDate, Posts.ViewCount, Posts.FavoriteCount, Posts.CommentCount, Posts.AnswerCount, Posts.AcceptedAnswerId FROM Posts JO... | sede |
CREATE TABLE table_62166 (
"Party" text,
"Name in English" text,
"City" text,
"Province" text,
"Date of registration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which province is Pamplona located in?
| SELECT "Province" FROM table_62166 WHERE "City" = 'pamplona' | wikisql |
CREATE TABLE table_name_26 (
league VARCHAR,
established VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the league established before 1930 with the rayo vallecano club?
| SELECT league FROM table_name_26 WHERE established < 1930 AND club = "rayo vallecano" | 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 WHERE demographic.gender = "F" AND demographic.diagnosis = "RASH" | mimicsql_data |
CREATE TABLE table_76974 (
"Result" text,
"Race" text,
"Distance" text,
"Weight" real,
"Winner or 2nd" text,
"Pos'n" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the the name of the winner or 2nd with a weight more than 7.3, and the re... | SELECT "Winner or 2nd" FROM table_76974 WHERE "Weight" > '7.3' AND "Result" = '–' | wikisql |
CREATE TABLE table_name_76 (
not_outs INTEGER,
innings INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of Not Outs when there were more than 25 innings?
| SELECT MIN(not_outs) FROM table_name_76 WHERE innings > 25 | sql_create_context |
CREATE TABLE table_29683 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (millions)" text,
"Original U.S. air date" text,
"Prod. code" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT COUNT("Directed by") FROM table_29683 WHERE "Title" = 'Magic Unmasked' | wikisql |
CREATE TABLE table_14345690_2 (
finished VARCHAR,
celebrity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did Tara Palmer-Tomkinson finish?
| SELECT finished FROM table_14345690_2 WHERE celebrity = "Tara Palmer-Tomkinson" | sql_create_context |
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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '62495309' AND gwyjzb.MED_SER_ORG_NO = '2963519' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%人格%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '62495309' AND fgwyjzb.MED_SER_ORG_NO = '2963519' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%人格%' | css |
CREATE TABLE table_39326 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Surface during the match with Partner Debbie Gra... | SELECT "Surface" FROM table_39326 WHERE "Partner" = 'debbie graham' | wikisql |
CREATE TABLE table_name_51 (
extra INTEGER,
meeting VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest extra total before 2003 at the Meeting of all africa games?
| SELECT MAX(extra) FROM table_name_51 WHERE meeting = "all africa games" AND year < 2003 | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74624 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'catheter tip-iv' AND NOT... | mimic_iii |
CREATE TABLE table_5459 (
"s Car plate (starting 1937)" text,
"Voivodeship or city" text,
"Capital" text,
"Area (1930) in 1,000skm 2" text,
"Population (1931) in 1,000s" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Capital of brze nad bugiem has w... | SELECT "Population (1931) in 1,000s" FROM table_5459 WHERE "Capital" = 'brześć nad bugiem' | wikisql |
CREATE TABLE table_75452 (
"Track" text,
"Song title" text,
"Length" text,
"Composer(s)" text,
"Performance location(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the composer of the song with a length of 6:24?
| SELECT "Composer(s)" FROM table_75452 WHERE "Length" = '6:24' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "DMI neuro nt st uncntrld" | mimicsql_data |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT KH, KLX FROM zyjzjlb WHERE JZLSH = '02981540665' | css |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate ti... | SELECT a.Id AS "post_link", a.Score, a.CreationDate, CASE WHEN a.Score < 1 THEN 'Score too low' WHEN e.CreationDate IS NULL THEN 'No edit within 12 hours' ELSE 'Question closed' END AS "Why no Illuminator" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id AND a.CreationDate < q.ClosedDate LEFT JOIN LATERAL (SE... | sede |
CREATE TABLE table_name_46 (
surface VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what surface was the score 6 2, 6 1?
| SELECT surface FROM table_name_46 WHERE score = "6–2, 6–1" | sql_create_context |
CREATE TABLE table_58826 (
"Year" real,
"Artist" text,
"Title" text,
"Format" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the artist before 2010 with a Promotional 7' as a format?
| SELECT "Artist" FROM table_58826 WHERE "Year" < '2010' AND "Format" = 'promotional 7' | wikisql |
CREATE TABLE table_10153 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings( $ )" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the united states has 22 wins and a rank greater than 2, what is the total earnings?
| SELECT SUM("Earnings( $ )") FROM table_10153 WHERE "Country" = 'united states' AND "Wins" = '22' AND "Rank" > '2' | wikisql |
CREATE TABLE table_name_32 (
date VARCHAR,
home VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game with pittsburgh as the home team and boston as the visitor team?
| SELECT date FROM table_name_32 WHERE home = "pittsburgh" AND visitor = "boston" | sql_create_context |
CREATE TABLE table_204_49 (
id number,
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text,
"commenced" number,
"ended" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the next airport listed after darwin interna... | SELECT "airport" FROM table_204_49 WHERE id = (SELECT id FROM table_204_49 WHERE "airport" = 'darwin international airport') + 1 | squall |
CREATE TABLE table_name_44 (
college VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which college is Kellen Davis from?
| SELECT college FROM table_name_44 WHERE player = "kellen davis" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65484 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_66995 (
"Player" text,
"Height" real,
"Position" text,
"Year born" real,
"Current Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Born in 1982, this guard has what listed as a height?
| SELECT "Height" FROM table_66995 WHERE "Position" = 'guard' AND "Year born" = '1982' | wikisql |
CREATE TABLE table_name_14 (
away_team VARCHAR,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team was hosted at Adelaide Oval?
| SELECT away_team FROM table_name_14 WHERE stadium = "adelaide oval" | 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 ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ST. LOUIS' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_10079 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silver medals did the team that had 5 bronze and less than 16 gold have?
| SELECT SUM("Silver") FROM table_10079 WHERE "Bronze" > '5' AND "Gold" < '16' | wikisql |
CREATE TABLE table_24430894_20 (
mutya_ng_pilipinas_asia_pacific VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won 3rd place when the mutya ng pilipinas winner was was rochelle romero ong?
| SELECT 2 AS nd_runner_up FROM table_24430894_20 WHERE mutya_ng_pilipinas_asia_pacific = "Rochelle Romero Ong" | sql_create_context |
CREATE TABLE fgwyjzb (
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '02779654722' UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.MED_ORG_DEPT_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '02779654722' | css |
CREATE TABLE table_3975 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the cfl team for patrice denis
| SELECT "CFL Team" FROM table_3975 WHERE "Player" = 'Patrice Denis' | wikisql |
CREATE TABLE table_23579 (
"Title" text,
"Author" text,
"Reader" text,
"Format" text,
"Company" text,
"Release Date" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the reader of the audiobook authored by cole, stephen st... | SELECT "Reader" FROM table_23579 WHERE "Author" = 'Cole, Stephen Stephen Cole' AND "Release Date" = '2008-11-13 13 November 2008' | 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 Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT Id AS Post_Link, Score FROM Posts AS p WHERE PostTypeId = 2 AND Score = (SELECT MAX(Score) FROM Posts WHERE PostTypeId = 2 AND p.ParentId = ParentId) AND OwnerUserId = '##userID##' AND Score > 0 ORDER BY Score DESC | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE ftxmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
... | SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_204_966 (
id number,
"region" text,
"date" text,
"label" text,
"format" text,
"catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what region is above australia ?
| SELECT "region" FROM table_204_966 WHERE id = (SELECT id FROM table_204_966 WHERE "region" = 'australia') - 1 | squall |
CREATE TABLE table_32039 (
"Manager" text,
"Ukraine career" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Win %" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total win % of manager viktor prokopenko, when he lost fewer than 2?
| SELECT COUNT("Win %") FROM table_32039 WHERE "Manager" = 'viktor prokopenko' AND "Lost" < '2' | wikisql |
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year ... | SELECT Country, COUNT(*) FROM people GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE d_icd_procedures (
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 admissions (
ro... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_36562 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Round of joe patterson?
| SELECT MIN("Round") FROM table_36562 WHERE "Player" = 'joe patterson' | wikisql |
CREATE TABLE table_dev_47 (
"id" int,
"gender" string,
"gestational_diabetes" bool,
"systolic_blood_pressure_sbp" int,
"leukopenia" int,
"hemoglobin_a1c_hba1c" float,
"cd4_count" int,
"platelets" int,
"diabetic" string,
"elevated_blood_pressure" bool,
"diastolic_blood_pressur... | SELECT * FROM table_dev_47 WHERE (serum_creatinine > 1.3 AND gender = 'female') OR (serum_creatinine > 1.5 AND gender = 'male') | criteria2sql |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text... | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) DESC | nvbench |
CREATE TABLE table_204_790 (
id number,
"year" number,
"nw rank" number,
"venue" text,
"opp rank" number,
"opponent" text,
"score" text,
"w/l" text,
"round" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who scored ... | SELECT "opponent" FROM table_204_790 WHERE "round" = 'quarterfinal' ORDER BY "score" DESC LIMIT 1 | squall |
CREATE TABLE table_55161 (
"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.
-- On the game where the home team scored 9.9 (63) ... | SELECT "Date" FROM table_55161 WHERE "Crowd" > '14,589' AND "Home team score" = '9.9 (63)' | wikisql |
CREATE TABLE table_name_16 (
christ_madeking VARCHAR,
great_tribulation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Christ made king date with a great tribulation in 1925?
| SELECT christ_madeking FROM table_name_16 WHERE great_tribulation = "1925" | sql_create_context |
CREATE TABLE fgwyjzb (
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8274481' AND gwyjzb.OUT_DIAG_DIS_CD = 'S71.183' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8274481' AND fgwyjzb.OUT_D... | css |
CREATE TABLE table_name_98 (
gold INTEGER,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Gold medals did the Soviet Union receive?
| SELECT AVG(gold) FROM table_name_98 WHERE nation = "soviet union" | sql_create_context |
CREATE TABLE table_name_48 (
cpc_blend_kazakhstan INTEGER,
barrow_island_australia INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest CPC blend Kazakhstan number when Barrow Island Australia is smaller than 12?
| SELECT MAX(cpc_blend_kazakhstan) FROM table_name_48 WHERE barrow_island_australia < 12 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.icd9_code = "E8786" | mimicsql_data |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8313730' AND gwyjzb.IN_HOSP_DATE BETWEEN '2019-08-10' AND '2021-08-28' | css |
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE station_company (
station_id number,
company_id number,
ran... | SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company) | spider |
CREATE TABLE table_name_8 (
player VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player with a Place of T10 had a Score of 80-70-72-72=294?
| SELECT player FROM table_name_8 WHERE place = "t10" AND score = 80 - 70 - 72 - 72 = 294 | 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 Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_2905 (
"Episode" text,
"First broadcast" text,
"Davids team" text,
"Lees team" text,
"Scores" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the davids team for 8 august 2008
| SELECT "Davids team" FROM table_2905 WHERE "First broadcast" = '8 August 2008' | wikisql |
CREATE TABLE table_203_809 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did november 11 or november 25 hav... | SELECT "date" FROM table_203_809 WHERE "date" IN ('november 11', 'november 25') ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_18438494_3 (
time VARCHAR,
wrestler VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the time for the match with Cena?
| SELECT time FROM table_18438494_3 WHERE wrestler = "Cena" | sql_create_context |
CREATE TABLE table_1359212_2 (
artist VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the artist performing at heineken music hall?
| SELECT artist FROM table_1359212_2 WHERE venue = "Heineken Music Hall" | sql_create_context |
CREATE TABLE table_name_34 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze has a Total of 4, and a Gold smaller than 1?
| SELECT MIN(bronze) FROM table_name_34 WHERE total = 4 AND gold < 1 | sql_create_context |
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 compartment, meal_code, meal_number FROM food_service | atis |
CREATE TABLE table_78321 (
"Date" text,
"Opponent" text,
"Bulls." real,
"Opp." real,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total number for the Bulls when they were at Old Trafford?
| SELECT COUNT("Bulls.") FROM table_78321 WHERE "Venue" = 'old trafford' | wikisql |
CREATE TABLE table_6219 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has a Date of 7 june 2000?
| SELECT "Result" FROM table_6219 WHERE "Date" = '7 june 2000' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '003-43270' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-2 year') | eicu |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
... | 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 ((fare_basis.class_type = 'COACH' AND fare.fare_basis_code = fare_basis.fare_basis_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.... | atis |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date DESC | nvbench |
CREATE TABLE table_204_56 (
id number,
"year" number,
"song" text,
"us r&b" number,
"us rap" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year had the most singles ?
| SELECT "year" FROM table_204_56 GROUP BY "year" ORDER BY COUNT("song") DESC LIMIT 1 | squall |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport_service (... | SELECT DISTINCT CITY_0.city_code FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DALLAS' AND flight.dep... | atis |
CREATE TABLE table_name_85 (
score VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the game with arsenal win 4-2 on penalties in the attendance field?
| SELECT score FROM table_name_85 WHERE attendance = "arsenal win 4-2 on penalties" | sql_create_context |
CREATE TABLE table_44449 (
"Designation" text,
"Name" text,
"Launch date" text,
"ISS docking date" text,
"Deorbit date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the ATV that launched on 9 March 2008, deorbit?
| SELECT "Deorbit date" FROM table_44449 WHERE "Launch date" = '9 march 2008' | wikisql |
CREATE TABLE table_73892 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The episode with original ... | SELECT "Written by" FROM table_73892 WHERE "Original air date" = 'January 13, 1999' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Metabolic encephalopathy" AND prescriptions.route = "ID" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.