instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND prescriptions.route = "NU" | mimicsql_data |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CR... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BALTIMORE' AND flight.departure_time BETWEEN 1800 AND 2200 AND flight.to_airport = airport_service.airport_code | atis |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY Date_of_Birth | nvbench |
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 demographic.marital_status, demographic.religion FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '孙丹红' AND hz_info.YLJGDM = '9381500' AND zzmzjzjlb.JZKSMC LIKE '%产%' UNION SELECT fzzmzjzjlb.J... | css |
CREATE TABLE table_23284271_11 (
high_assists VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the high assists for 1-2 series
| SELECT high_assists FROM table_23284271_11 WHERE series = "1-2" | sql_create_context |
CREATE TABLE table_8053 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the player in round 1?
| SELECT "Player" FROM table_8053 WHERE "Round" = '1' | wikisql |
CREATE TABLE table_76040 (
"Year" real,
"Championship" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What margin was in after 1981, and was Roberto De Vicenzo runner-up?
| SELECT "Margin" FROM table_76040 WHERE "Year" > '1981' AND "Runner(s)-up" = 'roberto de vicenzo' | wikisql |
CREATE TABLE table_23910822_1 (
frequency VARCHAR,
callsign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which frequency is DYMY?
| SELECT frequency FROM table_23910822_1 WHERE callsign = "DYMY" | sql_create_context |
CREATE TABLE table_name_71 (
cdt___5_utc_ VARCHAR,
edt___4_utc_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time is CDT when EDT is 4:55 a.m.?
| SELECT cdt___5_utc_ FROM table_name_71 WHERE edt___4_utc_ = "4:55 a.m." | 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 lab.value_unit, lab.label FROM lab WHERE lab.subject_id = "19420" | mimicsql_data |
CREATE TABLE table_name_72 (
accreditation_type VARCHAR,
accreditation_level VARCHAR,
hardware_model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Accreditation Type, when the Accreditation Level is Joyn, and when the Hardware Model is Nokia... | SELECT accreditation_type FROM table_name_72 WHERE accreditation_level = "joyn" AND hardware_model = "nokia 700" | sql_create_context |
CREATE TABLE table_43058 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Cover Model was featured on 8-03?
| SELECT "Cover model" FROM table_43058 WHERE "Date" = '8-03' | wikisql |
CREATE TABLE table_name_57 (
team VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much 1991-1992 has a Team of gimnasia de la plata, and more than 113 points?
| SELECT COUNT(1991 AS _1992) FROM table_name_57 WHERE team = "gimnasia de la plata" AND points > 113 | sql_create_context |
CREATE TABLE table_name_77 (
almalı__qax_ VARCHAR,
süskən VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Almali village with the S sk n village z rn ?
| SELECT almalı__qax_ FROM table_name_77 WHERE süskən = "zərnə" | sql_create_context |
CREATE TABLE table_16253 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which series with 62 points?
| SELECT "Series" FROM table_16253 WHERE "Points" = '62' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-33597') AND NOT patient.unitdischargetime IS NULL ORDER ... | eicu |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY... | atis |
CREATE TABLE table_name_32 (
date VARCHAR,
result VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date that had a Result of draw, with Oval as a venue?
| SELECT date FROM table_name_32 WHERE result = "draw" AND venue = "oval" | sql_create_context |
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 int
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age ... | SELECT Country, COUNT(*) FROM people GROUP BY Country | nvbench |
CREATE TABLE table_50349 (
"World Record" text,
"Press" text,
"103.5" text,
"Roger Fran\u00e7ois" text,
"Paris ( FRA )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total amount of world records for Roger Francois?
| SELECT "Roger Fran\u00e7ois" FROM table_50349 WHERE "World Record" = 'total' | wikisql |
CREATE TABLE table_name_58 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2012 for 2011 being qf
| SELECT 2012 FROM table_name_58 WHERE 2011 = "qf" | 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 prescriptions... | SELECT diagnoses.short_title, prescriptions.drug_type FROM diagnoses INNER JOIN prescriptions ON diagnoses.hadm_id = prescriptions.hadm_id WHERE diagnoses.subject_id = "74032" | mimicsql_data |
CREATE TABLE table_name_19 (
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is Rob Nicholson?
| SELECT nationality FROM table_name_19 WHERE player = "rob nicholson" | sql_create_context |
CREATE TABLE table_train_65 (
"id" int,
"intention_to_arterial_catheter" bool,
"steroid_therapy" bool,
"intention_to_central_venous_catheter" bool,
"central_venous_pressure_cvp" int,
"receiving_vasopressor" bool,
"pulmonary_artery_occlusive_pressure_paop" int,
"septic_shock" bool,
"a... | SELECT * FROM table_train_65 WHERE receiving_vasopressor = 1 | criteria2sql |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 4 AND date_day.month_number = 6 AND dat... | atis |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT PostId AS "post_link", * FROM Comments WHERE UserId = '##UserId##' AND Text LIKE '%##Text##%' ORDER BY CreationDate | sede |
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 WHERE demographic.diagnosis = "OVERDOSE" AND demographic.age < "64" | mimicsql_data |
CREATE TABLE table_11621747_1 (
tournament VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tournament on Jul 11?
| SELECT tournament FROM table_11621747_1 WHERE date = "Jul 11" | sql_create_context |
CREATE TABLE table_12159115_3 (
us_viewers__millions_ VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many U.S Viewers, in millions, were for series # 26?
| SELECT us_viewers__millions_ FROM table_12159115_3 WHERE series__number = 26 | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | SELECT COUNT(Id) FROM Posts WHERE CreationDate BETWEEN '2015-01-01 00:00:00' AND '2015-01-02 00:00:00' | sede |
CREATE TABLE table_203_165 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many nations won no silver medals at all ?
| SELECT COUNT("nation") FROM table_203_165 WHERE "silver" = 0 | squall |
CREATE TABLE table_name_91 (
winning_driver VARCHAR,
winning_constructor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Winning driver of mercedes on 22 august?
| SELECT winning_driver FROM table_name_91 WHERE winning_constructor = "mercedes" AND date = "22 august" | 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14211)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst... | mimic_iii |
CREATE TABLE table_name_43 (
tournament_location VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament location has south korea as the country?
| SELECT tournament_location FROM table_name_43 WHERE country = "south korea" | sql_create_context |
CREATE TABLE table_name_30 (
year INTEGER,
points VARCHAR,
wins VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year that has a win less than 1, yamaha as the team, with points greater than 2?
| SELECT AVG(year) FROM table_name_30 WHERE wins < 1 AND team = "yamaha" AND points > 2 | sql_create_context |
CREATE TABLE table_17514 (
"Chapter" real,
"Chinese" text,
"Pinyin" text,
"Translation" text,
"Subject" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pinyin for explaining beasts?
| SELECT "Pinyin" FROM table_17514 WHERE "Translation" = 'Explaining Beasts' | wikisql |
CREATE TABLE table_54126 (
"Date of Issue" text,
"Denomination" text,
"Design" text,
"Paper Type" text,
"First Day Cover Cancellation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's listed as the First Day Cover Cancellation with a Date of Is... | SELECT "First Day Cover Cancellation" FROM table_54126 WHERE "Date of Issue" = '13 june 2005' | wikisql |
CREATE TABLE table_name_97 (
lead VARCHAR,
third VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who holds the lead role when Aanders Brorson is third?
| SELECT lead FROM table_name_97 WHERE third = "aanders brorson" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'ketorolac 30 mg/ml 1ml sdv inj' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-2 year')) | eicu |
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 * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i... | css |
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 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 hz_info.YLJGDM = '3861685' AND mzjzjlb.JZKSMC LIKE '%正骨科%' | css |
CREATE TABLE table_204_373 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- number of mocho cota matches held in mexico city in 1983 or 1984
| SELECT COUNT(*) FROM table_204_373 WHERE "location" = 'mexico city' AND "date" IN (1983, 1984) | squall |
CREATE TABLE table_name_96 (
game INTEGER,
february VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game is the highest one that has a February of 25?
| SELECT MAX(game) FROM table_name_96 WHERE february = 25 | sql_create_context |
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_ID INTEGE... | SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings | nvbench |
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 CloseReasonTypes (
Id number,
Name text,
Description... | SELECT Id AS "post_link", CreationDate AS Date, AnswerCount FROM Posts WHERE CreationDate < '2011-12-31' AND PostTypeId = 1 AND ClosedDate IS NULL AND AnswerCount = 0 AND CommunityOwnedDate IS NULL ORDER BY CreationDate | sede |
CREATE TABLE stock (
Shop_ID int,
Device_ID int,
Quantity int
)
CREATE TABLE shop (
Shop_ID int,
Shop_Name text,
Location text,
Open_Date text,
Open_Year int
)
CREATE TABLE device (
Device_ID int,
Device text,
Carrier text,
Package_Version text,
Applications text,
... | SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform ORDER BY Software_Platform | nvbench |
CREATE TABLE table_203_393 (
id number,
"year" number,
"film" text,
"director" text,
"cast" text,
"details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- prema katha won more than how many awards compared to aaha ?
| SELECT (SELECT "details" FROM table_203_393 WHERE "film" = 'prema katha') - (SELECT "details" FROM table_203_393 WHERE "film" = 'aaha') | squall |
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.religion = "CHRISTIAN SCIENTIST" AND lab.label = "Immunoglobulin G" | mimicsql_data |
CREATE TABLE table_41413 (
"Club" text,
"Position in 2013" text,
"First season" real,
"First season of current spell" real,
"Number of seasons in Superettan" real,
"Number of seasons in second tier" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "Number of seasons in second tier" FROM table_41413 WHERE "First season" = '2000' AND "First season of current spell" = '2014' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT Answers.Id AS "post_link", Question.ViewCount FROM Posts AS Answers, Posts AS Question WHERE Answers.PostTypeId = 2 AND Answers.OwnerUserId = '##UserId##' AND Question.AcceptedAnswerId = Answers.Id ORDER BY Question.ViewCount DESC | sede |
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE store (
Store_ID int,
Store_Name text,
Type text,
Area_size real,
Number_of_product_category real,
Ranking int
)
CREATE TABLE product (
product_id int,
product text,
dimensions text,
dpi real,
... | SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_38101 (
"Version" text,
"Length" text,
"Album" text,
"Remixed by" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Version before 2001 with a Length of 7:42?
| SELECT "Version" FROM table_38101 WHERE "Year" < '2001' AND "Length" = '7:42' | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j... | css |
CREATE TABLE table_12163387_1 (
mens_doubles VARCHAR,
womens_singles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the mens doubles the year Alison Humby won the womens singles?
| SELECT mens_doubles FROM table_12163387_1 WHERE womens_singles = "Alison Humby" | sql_create_context |
CREATE TABLE table_204_17 (
id number,
"region" text,
"date" text,
"format" text,
"version(s)" text,
"label" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which country had a release with the same label as germany ?
| SELECT "region" FROM table_204_17 WHERE "region" <> 'germany' AND "label" = (SELECT "label" FROM table_204_17 WHERE "region" = 'germany') | squall |
CREATE TABLE table_name_5 (
score_composer VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the score composer of the film released in 1967?
| SELECT score_composer FROM table_name_5 WHERE year = 1967 | sql_create_context |
CREATE TABLE table_56774 (
"Date" text,
"Opponents" text,
"Score" text,
"Competition" text,
"Match Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the competition with opponents of Sv Werder Bremen and a score of 1-2?
| SELECT "Competition" FROM table_56774 WHERE "Opponents" = 'sv werder bremen' AND "Score" = '1-2' | wikisql |
CREATE TABLE table_970 (
"Season" text,
"Oberliga Bayern" text,
"Oberliga Hessen" text,
"Oberliga Baden-W\u00fcrttemberg" text,
"Oberliga S\u00fcdwest" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the oberliga bayern for sv sandhausen for 198... | SELECT "Oberliga Bayern" FROM table_970 WHERE "Oberliga Baden-W\u00fcrttemberg" = 'SV Sandhausen' AND "Season" = '1986-87' | wikisql |
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 diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "32418" | mimicsql_data |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_31529 (
"Player" text,
"Current singles ranking" text,
"Current doubles ranking" text,
"First year played" real,
"Ties played" real,
"Total W\u2013L" text,
"Singles W\u2013L" text,
"Doubles W\u2013L" text
)
-- Using valid SQLite, answer the following questions for th... | SELECT "Doubles W\u2013L" FROM table_31529 WHERE "Player" = 'laurynas grigelis' | wikisql |
CREATE TABLE table_68537 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Loss when the Record was 50-54?
| SELECT "Loss" FROM table_68537 WHERE "Record" = '50-54' | wikisql |
CREATE TABLE table_name_82 (
rank INTEGER,
album VARCHAR,
peak_position VARCHAR,
certification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest rank when the peak position is 2, certification is platinum and the album is my december?... | SELECT MIN(rank) FROM table_name_82 WHERE peak_position = "2" AND certification = "platinum" AND album = "my december" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '18:15' AND course.course_id = course_offering.course_id AND course.department = 'RUSSIAN' AND course.number = 483 AND semester.semester = 'WN' A... | advising |
CREATE TABLE table_name_26 (
foreign_population INTEGER,
population__2004_ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Foreign population has a Population (2004) larger than 234733?
| SELECT AVG(foreign_population) FROM table_name_26 WHERE population__2004_ > 234733 | 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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32329 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l... | mimic_iii |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_lo... | SELECT DISTINCT flight.flight_id 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.cit... | atis |
CREATE TABLE table_44632 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is To Par, when Money ( $ ) is Playoff, and when Score is 68-73-77-65=283?
| SELECT "To par" FROM table_44632 WHERE "Money ( $ )" = 'playoff' AND "Score" = '68-73-77-65=283' | wikisql |
CREATE TABLE table_71208 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st leg score when US Mbila Nzambi is team 1?
| SELECT "1st leg" FROM table_71208 WHERE "Team 1" = 'us mbila nzambi' | wikisql |
CREATE TABLE table_3032 (
"Series No." real,
"Episode No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"UK Ratings (BBC2 Rank)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least series num... | SELECT MIN("Series No.") FROM table_3032 | wikisql |
CREATE TABLE Person (
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different cities are they from?
| SELECT COUNT(DISTINCT city) FROM Person | sql_create_context |
CREATE TABLE table_25058 (
"South American Rank" real,
"World Rank" real,
"Nation" text,
"2011 (IMF)" text,
"2008 (CIA Factbook)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the south american rank for venezuela
| SELECT MIN("South American Rank") FROM table_25058 WHERE "Nation" = 'Venezuela' | wikisql |
CREATE TABLE table_name_44 (
year VARCHAR,
production VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During what year was Wicked associated with the Green Room Awards?
| SELECT year FROM table_name_44 WHERE production = "wicked" AND award = "green room awards" | sql_create_context |
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 cost (
costid number,
... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-155345') AND NOT patient.unitdischargetime I... | eicu |
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 * FROM t_kc21 WHERE PERSON_ID = '42289604' AND MED_SER_ORG_NO = '9183421' AND NOT MED_ORG_DEPT_NM LIKE '%内%' | css |
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 t_kc22.PRESCRIPTION_CODE, t_kc22.PRESCRIPTION_ID FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '78945033351' | css |
CREATE TABLE table_name_43 (
opponent VARCHAR,
week INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent after week 16?
| SELECT opponent FROM table_name_43 WHERE week > 16 | sql_create_context |
CREATE TABLE table_50301 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Total, when Gold is less than 1, when Silver is greater than 0, ... | SELECT COUNT("Total") FROM table_50301 WHERE "Gold" < '1' AND "Silver" > '0' AND "Rank" = '14' AND "Nation" = 'afghanistan' | wikisql |
CREATE TABLE table_22815568_13 (
market_income_per_capita VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the market income per capita where the county is hancock?
| SELECT market_income_per_capita FROM table_22815568_13 WHERE county = "Hancock" | sql_create_context |
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(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '周雪枫' AND t_kc22.STA_DATE BETWEEN '2007-09-27' AND '2016-08-29' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_name_29 (
entrant VARCHAR,
engine VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Entrant has a 1952 maserati straight-6 engine?
| SELECT entrant FROM table_name_29 WHERE engine = "maserati straight-6" AND year = 1952 | 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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2060" | mimicsql_data |
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 Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
... | SELECT UserId, U.DisplayName, TagName, PostCount, RANK() OVER (PARTITION BY TagName ORDER BY PostCount DESC) AS PostCountRank FROM (SELECT COUNT(C.PostId) AS PostCount, C.UserId, C.UserDisplayName, T.TagName FROM Comments AS C INNER JOIN Posts AS P ON C.Id = P.AcceptedAnswerId INNER JOIN PostTags AS PT ON P.Id = PT.Pos... | sede |
CREATE TABLE wrestler (
Name VARCHAR,
Days_held VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of wrestlers in descending order of days held.
| SELECT Name FROM wrestler ORDER BY Days_held DESC | sql_create_context |
CREATE TABLE table_31219 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is listed under skip (clu... | SELECT "Skip (Club)" FROM table_31219 WHERE "Ends Won" = '43' | 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 demographic ... | SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "21796" | mimicsql_data |
CREATE TABLE table_name_8 (
bore VARCHAR,
cyl VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the bore for a 9-cyl radial on a 9 AD?
| SELECT bore FROM table_name_8 WHERE cyl = "9-cyl radial" AND name = "9 ad" | sql_create_context |
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_36870 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Opponent that has the Date of october 11, 1953?
| SELECT "Opponent" FROM table_36870 WHERE "Date" = 'october 11, 1953' | wikisql |
CREATE TABLE table_79243 (
"Year" real,
"Winners" text,
"Runner-up" text,
"Third place" text,
"Fourth place" text,
"Best goalkeeper" text,
"Top goal scorer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the winners in 1998?
| SELECT "Winners" FROM table_79243 WHERE "Year" = '1998' | wikisql |
CREATE TABLE table_64216 (
"Rank" real,
"Athletes" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rank of the Athletes with a Time of 3:43.491?
| SELECT COUNT("Rank") FROM table_64216 WHERE "Time" = '3:43.491' | wikisql |
CREATE TABLE table_74339 (
"Team" text,
"Stadium" text,
"Home Games" real,
"Average Attendance" real,
"Total Attendance" real,
"Capacity Percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the capacity percentage when attendance ... | SELECT "Capacity Percentage" FROM table_74339 WHERE "Average Attendance" = '71080' | wikisql |
CREATE TABLE table_204_667 (
id number,
"year" number,
"film title" text,
"genre" text,
"cast" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what movie did sunil kumar desai star in before marma ?
| SELECT "film title" FROM table_204_667 WHERE "year" < (SELECT "year" FROM table_204_667 WHERE "film title" = 'marma') ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_43931 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player was from the British Columbia college?
| SELECT "Player" FROM table_43931 WHERE "College" = 'british columbia' | wikisql |
CREATE TABLE table_46873 (
"Date" text,
"Result" text,
"Opponent" text,
"Event" text,
"Location" text,
"Method" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the event when the result is loss and the record is 7-5?
| SELECT "Event" FROM table_46873 WHERE "Result" = 'loss' AND "Record" = '7-5' | wikisql |
CREATE TABLE table_name_44 (
location VARCHAR,
res VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the match that resulted in a win in 4:16 held?
| SELECT location FROM table_name_44 WHERE res = "win" AND time = "4:16" | sql_create_context |
CREATE TABLE table_name_74 (
length VARCHAR,
year VARCHAR,
version VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long was the instrumental version in 1986?
| SELECT length FROM table_name_74 WHERE year = 1986 AND version = "instrumental" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.