instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE order_items (
order_id VARCHAR,
order_quantity INTEGER
)
CREATE TABLE customer_orders (
customer_id VARCHAR,
order_id VARCHAR
)
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_53153 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the lelast decile for roll of 428
| SELECT MIN("Decile") FROM table_53153 WHERE "Roll" = '428' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(mzjzjlb.ZZYSGH) 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 '2016-04-26' AND '2019-12-28' | css |
CREATE TABLE table_name_26 (
points INTEGER,
score VARCHAR,
january VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points is the lowest one that has a Score of 1 4, and a January smaller than 18?
| SELECT MIN(points) FROM table_name_26 WHERE score = "1–4" AND january < 18 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT prescriptions.drug, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Colton Andrade" | mimicsql_data |
CREATE TABLE table_11187 (
"State" text,
"Population" real,
"GDP per cap. (PPP)" real,
"Currency" text,
"Gini" real,
"Council votes" real,
"EP seats" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has less than 4 votes?
| SELECT "State" FROM table_11187 WHERE "Council votes" < '4' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT mzjzjlb.JZLSH 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 NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2020-11-21') | css |
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 AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'osteomyelitis - extremity' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1 | eicu |
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'AOSS' AND COURSE_1.number = ... | advising |
CREATE TABLE table_name_95 (
analogue_terrestrial_channel VARCHAR,
internet VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the analogue terrestrial channel when the internet shows channel4.com?
| SELECT analogue_terrestrial_channel FROM table_name_95 WHERE internet = "channel4.com" | sql_create_context |
CREATE TABLE table_21795846_1 (
position VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If there is 16 points, what was the position?
| SELECT position FROM table_21795846_1 WHERE points = 16 | sql_create_context |
CREATE TABLE table_76790 (
"Pick" real,
"Pos." text,
"Nationality" text,
"Team" text,
"Previous team" text,
"NBA years [a ]" text,
"Career with the franchise [b ]" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team of the player... | SELECT "Team" FROM table_76790 WHERE "Previous team" = 'indiana pacers' | wikisql |
CREATE TABLE table_name_62 (
place VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place for roger pontare?
| SELECT place FROM table_name_62 WHERE artist = "roger pontare" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921) AND prescriptions.drug = 'lidocaine jelly 2% (urojet)' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1... | mimic_iii |
CREATE TABLE table_name_83 (
round INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has an Opponent of jorge magalhaes?
| SELECT AVG(round) FROM table_name_83 WHERE opponent = "jorge magalhaes" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26313) AND prescriptions.drug = 'rifaximin' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTI... | mimic_iii |
CREATE TABLE table_64000 (
"Hampden FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Draws have Losses larger than 8, and a Hampden FL of terang-mortlake?
| SELECT "Draws" FROM table_64000 WHERE "Losses" > '8' AND "Hampden FL" = 'terang-mortlake' | wikisql |
CREATE TABLE table_2417345_3 (
successor VARCHAR,
date_of_successors_formal_installation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the successors when the date the successors were installed was February 23, 1870?
| SELECT successor FROM table_2417345_3 WHERE date_of_successors_formal_installation = "February 23, 1870" | sql_create_context |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Student... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) | nvbench |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80' | atis |
CREATE TABLE table_2562572_54 (
population__2011_ INTEGER,
settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest population in 2011 for the settlement of ortanovci?
| SELECT MIN(population__2011_) FROM table_2562572_54 WHERE settlement = "Čortanovci" | sql_create_context |
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 patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '025-60396' AND patient.hospitaladmitsource = 'floor' AND STRFTIME('%y', patient.hospitaladmittime) = '2104' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_62 (
fa_cup INTEGER,
player VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which FA Cup has a Player of khairan ezuan razali, and a Total smaller than 0?
| SELECT AVG(fa_cup) FROM table_name_62 WHERE player = "khairan ezuan razali" AND total < 0 | sql_create_context |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Dates_active | nvbench |
CREATE TABLE table_73981 (
"Episode" real,
"First broadcast Denmark ( DR1 )" text,
"Official TNS Gallup ratings" real,
"First broadcast UK ( BBC Four )" text,
"Official BARB ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the episod... | SELECT "First broadcast Denmark ( DR1 )" FROM table_73981 WHERE "Official BARB ratings" = '1,036,000' | wikisql |
CREATE TABLE table_35913 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest attendance that has oakland raiders as the op... | SELECT MAX("Attendance") FROM table_35913 WHERE "Opponent" = 'oakland raiders' AND "Week" > '9' | wikisql |
CREATE TABLE table_204_853 (
id number,
"pos" number,
"grid" number,
"no." number,
"driver" text,
"team" text,
"manufacturer" text,
"laps" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which driver scored the most... | SELECT "driver" FROM table_204_853 ORDER BY "points" DESC LIMIT 1 | squall |
CREATE TABLE table_54556 (
"Environment" text,
"Realization" text,
"Example" text,
"Pronunciation" text,
"Gloss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the gloss for [ d m]
| SELECT "Gloss" FROM table_54556 WHERE "Pronunciation" = '[χdəm]' | wikisql |
CREATE TABLE table_name_37 (
country VARCHAR,
pinnacle_height VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country has a Pinnacle height of metres (ft) and a Name of azeri tv tower?
| SELECT country FROM table_name_37 WHERE pinnacle_height = "metres (ft)" AND name = "azeri tv tower" | sql_create_context |
CREATE TABLE table_29809 (
"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 ha... | SELECT "High assists" FROM table_29809 WHERE "Score" = 'W 107–95 (OT)' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9009373' GROUP BY t_kc21.MED_ORG_DEPT_NM | css |
CREATE TABLE table_203_711 (
id number,
"name" text,
"age" number,
"hometown" text,
"occupation" text,
"culinary p.o.v." text,
"eliminated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many competitors were under the age of 30 ?
| SELECT COUNT("name") FROM table_203_711 WHERE "age" < 30 | squall |
CREATE TABLE table_14312471_4 (
crowd INTEGER,
ground VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the maximum crowd when scg is the ground?
| SELECT MAX(crowd) FROM table_14312471_4 WHERE ground = "SCG" | sql_create_context |
CREATE TABLE table_name_94 (
matches VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Matches have a Rank of 2?
| SELECT COUNT(matches) FROM table_name_94 WHERE rank = 2 | sql_create_context |
CREATE TABLE table_203_313 (
id number,
"name" text,
"pennant" text,
"builder" text,
"launched" text,
"original name" text,
"fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what date was the first ship launched ?
| SELECT "launched" FROM table_203_313 ORDER BY "launched" LIMIT 1 | squall |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%wellington, new zealand' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE table_name_12 (
nation___athlete_s_ VARCHAR,
sport VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Nation - athlete(s), when the Sport is luge - men's singles, and when the Record is, 'track'?
| SELECT nation___athlete_s_ FROM table_name_12 WHERE sport = "luge - men's singles" AND record = "track" | sql_create_context |
CREATE TABLE table_24866 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed when the production code is 1.02?
| SELECT "Directed by" FROM table_24866 WHERE "Production code" = '1.02' | wikisql |
CREATE TABLE table_name_26 (
streak VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the streak when the opponent was @ new jersey nets?
| SELECT streak FROM table_name_26 WHERE opponent = "@ new jersey nets" | sql_create_context |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Cardiac tamponade" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
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_ID = '16747082' AND MED_SER_ORG_NO = '7283689' AND IN_DIAG_DIS_NM LIKE '%失眠%' | css |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | WITH superclosures AS (SELECT ph.Id, ph.PostId AS "post_link", u.DisplayName AS CloseUser, crt.Name AS CloseReasonType, COUNT(v.value) AS VoterCount FROM PostHistory AS ph JOIN Posts AS p ON p.Id = ph.PostId JOIN Users AS u ON u.Id = ph.UserId JOIN CloseReasonTypes AS crt ON crt.Id = ph.Comment JOIN LATERAL OPENJSON(ph... | sede |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE writes (
paperid int,
authori... | SELECT DISTINCT paper.paperid FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' | scholar |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT COUNT(t_kc21.MED_SER_ORG_NO) FROM t_kc21 WHERE t_kc21.PERSON_ID = '95900132' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-01-04' AND '2014-09-24' | css |
CREATE TABLE table_2847477_2 (
density INTEGER,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the density of the place with an area of 1512?
| SELECT MAX(density) FROM table_2847477_2 WHERE area = 1512 | sql_create_context |
CREATE TABLE table_203_455 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the only player to be picked in round nine ?
| SELECT "player" FROM table_203_455 WHERE "round" = 9 | squall |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'goalie' | spider |
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Timed_Status_of_Things (
thing_id INTEGER,
Date_and_Date DATETIME,
Status_of_Thing_Code CHAR(15)
)
CREATE TABLE Timed_Locations_of_Things (
... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in) DESC | nvbench |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Date_of_Birth, Height FROM people ORDER BY Height | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'drug overdose- general - with respiratory depression') | eicu |
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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC | nvbench |
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, flight WHERE ((flight.arrival_time <= 1230 AND flight.arrival_time >= 1130) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND CITY_1.... | atis |
CREATE TABLE table_51188 (
"Player" text,
"Position" text,
"First-Team Appearances" text,
"First-Team Goals" text,
"Current Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the player who has ongoing first-team goals and ... | SELECT "Position" FROM table_51188 WHERE "First-Team Goals" = 'ongoing' AND "Current Club" = 'aston villa' | wikisql |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2089" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_11036 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which region in Saint-Simon-Les-Mines has ... | SELECT MAX("Region") FROM table_11036 WHERE "Name" = 'saint-simon-les-mines' AND "Population" < '458' | 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 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Bleed esoph var oth dis" | mimicsql_data |
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 MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'fibrinogen')) AND STRFTIME('%y', cost.chargetime) >= '2102' GROUP BY... | eicu |
CREATE TABLE table_58333 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the NBA Draft for the School Bishop O'Connell High School?
| SELECT "NBA Draft" FROM table_58333 WHERE "School" = 'bishop o''connell high school' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC te... | SELECT zyjzjlb.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '15486646572' | css |
CREATE TABLE table_name_35 (
starts INTEGER,
points VARCHAR,
podiums VARCHAR,
stage_wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average starts when the podiums is more than 0, stage wins is more than 39 and points is more than 456... | SELECT AVG(starts) FROM table_name_35 WHERE podiums > 0 AND stage_wins > 39 AND points > 456 | sql_create_context |
CREATE TABLE table_58101 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many year was the venue in stockholm, sweden used?
| SELECT COUNT("Year") FROM table_58101 WHERE "Venue" = 'stockholm, sweden' | wikisql |
CREATE TABLE table_1427998_1 (
playoffs VARCHAR,
team_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the playoff result for the team name of bay area seals
| SELECT playoffs FROM table_1427998_1 WHERE team_name = "Bay Area Seals" | sql_create_context |
CREATE TABLE table_8197 (
"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 total Attendance in weeks previous of 5, playing the Seattle Seahawks?
| SELECT COUNT("Attendance") FROM table_8197 WHERE "Week" < '5' AND "Opponent" = 'seattle seahawks' | wikisql |
CREATE TABLE table_14016079_1 (
rd VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of rounds on the Hidden Valley Raceway?
| SELECT COUNT(rd) FROM table_14016079_1 WHERE circuit = "Hidden Valley Raceway" | sql_create_context |
CREATE TABLE Catalogs (
catalog_id INTEGER,
catalog_name VARCHAR(50),
catalog_publisher VARCHAR(80),
date_of_publication DATETIME,
date_of_latest_revision DATETIME
)
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
... | SELECT attribute_name, COUNT(attribute_name) FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 GROUP BY attribute_name | nvbench |
CREATE TABLE table_name_96 (
death VARCHAR,
birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE DEATH WHEN BIRTH DATE IS 2 AUGUST 1424?
| SELECT death FROM table_name_96 WHERE birth = "2 august 1424" | sql_create_context |
CREATE TABLE table_26250155_1 (
song_choice VARCHAR,
original_artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of song choices where the original artist was Bright Eyes?
| SELECT COUNT(song_choice) FROM table_26250155_1 WHERE original_artist = "Bright Eyes" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id numbe... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'heparin flush (100 units/ml)' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') | mimic_iii |
CREATE TABLE table_name_30 (
fac___lc_g INTEGER,
UEfa_yc VARCHAR,
cl_g VARCHAR,
total_apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the FAC/LC G with a CL G less than 2, less than 5 total apps, and a UEFA YC greater than 0?
| SELECT SUM(fac___lc_g) FROM table_name_30 WHERE cl_g < 2 AND total_apps < 5 AND UEfa_yc > 0 | sql_create_context |
CREATE TABLE table_name_30 (
time VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Loris Capirossi's time?
| SELECT time FROM table_name_30 WHERE rider = "loris capirossi" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSDM = '87709' AND wdmzjzjlb.RYDJSJ BETWEEN '2006-12-25' AND '2007-07-04' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSDM = '87709' AND bdmzjzjlb.RYDJSJ BETWEEN '2006-12-25' AND '2007-07-04' | css |
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Docume... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*) | nvbench |
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 name, number FROM course WHERE department = 'CCS' AND credits = 3 | advising |
CREATE TABLE table_69038 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of the ERP W with a call sign of w242ak?
| SELECT COUNT("ERP W") FROM table_69038 WHERE "Call sign" = 'w242ak' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid... | SELECT Sex, MAX(Age) FROM Student GROUP BY Sex | nvbench |
CREATE TABLE table_31799 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks have an attendance of 64,116?
| SELECT COUNT("Week") FROM table_31799 WHERE "Attendance" = '64,116' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '45492720' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-07-14' AND '2010-01-25' | css |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "76" AND procedures.icd9_code = "3961" | mimicsql_data |
CREATE TABLE table_name_32 (
award VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the award before 2001?
| SELECT award FROM table_name_32 WHERE year < 2001 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "NonSquamous Epithelial Cell" | mimicsql_data |
CREATE TABLE table_71421 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is was the Chassis in 1967?
| SELECT "Chassis" FROM table_71421 WHERE "Year" = '1967' | wikisql |
CREATE TABLE table_66727 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Result of 1st, and a Venue of melbourne , australia, and a Extra of 100 m happened in which year?
| SELECT "Year" FROM table_66727 WHERE "Result" = '1st' AND "Venue" = 'melbourne , australia' AND "Extra" = '100 m' | wikisql |
CREATE TABLE table_52389 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game when the Avalanche had a record of 8 3 1?
| SELECT "Date" FROM table_52389 WHERE "Record" = '8–3–1' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... | eicu |
CREATE TABLE college (
college_id TEXT,
name_full TEXT,
city TEXT,
state TEXT,
country TEXT
)
CREATE TABLE fielding (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
pos TEXT,
g INTEGER,
gs NUMERIC,
inn_outs NUMERIC,
po NUMERIC,
... | SELECT year, SUM(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' | nvbench |
CREATE TABLE table_name_87 (
fleet_size INTEGER,
type VARCHAR,
introduced VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest fleet size with a type of shunter introduced in 1953?
| SELECT MIN(fleet_size) FROM table_name_87 WHERE type = "shunter" AND introduced = "1953" | sql_create_context |
CREATE TABLE table_name_98 (
year INTEGER,
manager VARCHAR,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least year for gene hassell manager and 6th finish
| SELECT MIN(year) FROM table_name_98 WHERE manager = "gene hassell" AND finish = "6th" | sql_create_context |
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_Name, Team_ID FROM basketball_match ORDER BY Team_ID | nvbench |
CREATE TABLE table_24611 (
"Season" text,
"Timeslot Times listed are Eastern time" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" real,
"Viewers (in millions of households)" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT COUNT("TV season") FROM table_24611 WHERE "Viewers (in millions of households)" = '10.2' | wikisql |
CREATE TABLE table_3818 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Title" FROM table_3818 WHERE "Production code" = '231' | wikisql |
CREATE TABLE table_7487 (
"Name" text,
"Start of Reign" real,
"End of Reign" text,
"Birth Name" text,
"Title" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Metodija Gogov's Start of Reign?
| SELECT COUNT("Start of Reign") FROM table_7487 WHERE "Birth Name" = 'metodija gogov' | wikisql |
CREATE TABLE table_9305 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total attendance of games against the New York Giants after week 13?
| SELECT COUNT("Attendance") FROM table_9305 WHERE "Week" > '13' AND "Opponent" = 'new york giants' | wikisql |
CREATE TABLE table_61762 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
)
-- Using valid SQLite, answer t... | SELECT "3:00 pm" FROM table_61762 WHERE "1:00 pm" = 'days of our lives' | wikisql |
CREATE TABLE table_10680 (
"Line" text,
"Colour" text,
"Route" text,
"Length" text,
"Stations" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which route has 21 stations?
| SELECT "Route" FROM table_10680 WHERE "Stations" = '21' | wikisql |
CREATE TABLE table_204_975 (
id number,
"year" number,
"competition" text,
"location" text,
"event" text,
"final-rank" text,
"final-score" number,
"qualifying rank" number,
"qualifying score" number
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "competition" FROM table_204_975 WHERE "year" = 2008 AND "event" = 'team' | squall |
CREATE TABLE table_name_45 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record for April 15?
| SELECT record FROM table_name_45 WHERE date = "april 15" | sql_create_context |
CREATE TABLE temperature (
city_id number,
jan number,
feb number,
mar number,
apr number,
jun number,
jul number,
aug number,
sep number,
oct number,
nov number,
dec number
)
CREATE TABLE hosting_city (
year number,
match_id number,
host_city text
)
CREATE ... | SELECT host_city FROM hosting_city ORDER BY year DESC LIMIT 1 | spider |
CREATE TABLE table_name_76 (
overall VARCHAR,
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Overall has a Position of ot, and a Round larger than 5?
| SELECT COUNT(overall) FROM table_name_76 WHERE position = "ot" AND round > 5 | sql_create_context |
CREATE TABLE table_47486 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Method, when Opponent is 'Thiago Alves'?
| SELECT "Method" FROM table_47486 WHERE "Opponent" = 'thiago alves' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.