instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 hz_info (
KH text,
KLX number... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info... | css |
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
... | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'ameet soni' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_51507 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the value for 2007 when 2011 is a a... | SELECT "2007" FROM table_51507 WHERE "2011" = 'a' AND "2009" = 'q2' | wikisql |
CREATE TABLE table_39502 (
"Pos." text,
"Player" text,
"Team" text,
"Height" text,
"Weight" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height of the player, Larry Hughes?
| SELECT "Height" FROM table_39502 WHERE "Player" = 'larry hughes' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND patient.hospitaldischargetime IS NULL)) ORDER BY t... | eicu |
CREATE TABLE table_name_73 (
tries_for VARCHAR,
losing_bonus VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tries had a losing bonus of 5, and were part of the Maesteg Celtic RFC club?
| SELECT tries_for FROM table_name_73 WHERE losing_bonus = "5" AND club = "maesteg celtic rfc" | sql_create_context |
CREATE TABLE table_27630 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the seaso... | SELECT COUNT("Season") FROM table_27630 WHERE "Position" = '4th' | wikisql |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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 tex... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY... | css |
CREATE TABLE table_2516282_3 (
year VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year was the score 7 5, 7 6 (7 5)?
| SELECT year FROM table_2516282_3 WHERE score = "7–5, 7–6 (7–5)" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
... | 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 = 'BOSTON' AND CITY_2.cit... | atis |
CREATE TABLE table_37902 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which First elected has a Incumbent of none (new seat)?
| SELECT "First elected" FROM table_37902 WHERE "Incumbent" = 'none (new seat)' | wikisql |
CREATE TABLE table_name_12 (
loss INTEGER,
avg_g VARCHAR,
long VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Loss, when Avg/g is 0, and when Long is less than 0?
| SELECT AVG(loss) FROM table_name_12 WHERE avg_g = 0 AND long < 0 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id num... | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13054)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drain out #1 other... | mimic_iii |
CREATE TABLE table_14460937_2 (
points__total_500_ VARCHAR,
pos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many points (total 500) with pos being 11
| SELECT COUNT(points__total_500_) FROM table_14460937_2 WHERE pos = 11 | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158689')) AND medication.drugname = 'nexterone' AND DATETI... | eicu |
CREATE TABLE table_14580 (
"Type" text,
"Fleet numbers" text,
"Quantity made" real,
"Manufacturer" text,
"Date made" text,
"GSWR Class" real,
"GSWR Nos." text,
"GSR Class" text,
"Inchicore Class" text,
"Withdrawn" text
)
-- Using valid SQLite, answer the following questions for... | SELECT "GSR Class" FROM table_14580 WHERE "Type" = '0-4-2t' | wikisql |
CREATE TABLE table_8419 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE SCORE WITH VISITORS CHICAGO BLACK HAWKS ON MARCH 24?
| SELECT "Score" FROM table_8419 WHERE "Visitor" = 'chicago black hawks' AND "Date" = 'march 24' | wikisql |
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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_name_84 (
college_junior_club_team__league_ VARCHAR,
player VARCHAR,
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What league has a D position, a round smaller than 11 and is with Dennis Vial?
| SELECT college_junior_club_team__league_ FROM table_name_84 WHERE position = "d" AND round < 11 AND player = "dennis vial" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (... | SELECT LAST_DATE_OF_MONTH(v.CreationDate), COUNT(v.Id) AS "total_upvotes", SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "question_upvotes", SUM(CASE WHEN p.PostTypeId = 2 THEN 1 ELSE 0 END) AS "answer_upvotes" FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId = 2 GROUP BY LAST_DATE_OF_... | sede |
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(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE table_name_31 (
location VARCHAR,
design_flow__lpm_ VARCHAR,
partner VARCHAR,
population_served VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Location has a Partner of app, a Population Served larger than 2000, and a Design flow (L... | SELECT location FROM table_name_31 WHERE partner = "app" AND population_served > 2000 AND design_flow__lpm_ = 375 | sql_create_context |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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 tex... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY... | css |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
-- Using valid SQLite, answer the following questions for the ... | SELECT Name, COUNT(Name) FROM editor GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_49147 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Eagles points" real,
"Opponents" real,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest number of oppene... | SELECT MAX("Opponents") FROM table_49147 WHERE "Game" = '9' AND "Attendance" < '60,091' | wikisql |
CREATE TABLE table_15530 (
"Year" real,
"English title" text,
"Original title" text,
"Country" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the English title for 1984 from Sweden?
| SELECT "English title" FROM table_15530 WHERE "Year" = '1984' AND "Country" = 'sweden' | wikisql |
CREATE TABLE table_name_30 (
venue VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team venue for the New Zealand Breakers?
| SELECT venue FROM table_name_30 WHERE home_team = "new zealand breakers" | sql_create_context |
CREATE TABLE table_35642 (
"Date" text,
"Site" text,
"Sport" text,
"Winning team" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Series has a Winning team of iowa state and a Sport of w basketball?
| SELECT "Series" FROM table_35642 WHERE "Winning team" = 'iowa state' AND "Sport" = 'w basketball' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2138.0" AND diagnoses.icd9_code = "53190" | mimicsql_data |
CREATE TABLE table_name_40 (
episode_number INTEGER,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of the episode titled 'Sugar Daddy'?
| SELECT AVG(episode_number) FROM table_name_40 WHERE title = "sugar daddy" | sql_create_context |
CREATE TABLE table_name_72 (
name VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the race on 9 July?
| SELECT name FROM table_name_72 WHERE date = "9 july" | sql_create_context |
CREATE TABLE table_name_46 (
longitude INTEGER,
water__sqmi_ VARCHAR,
geo_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average longitude for the water area of 0.093 and has a GEO ID tag larger than 3808174460?
| SELECT AVG(longitude) FROM table_name_46 WHERE water__sqmi_ = 0.093 AND geo_id > 3808174460 | sql_create_context |
CREATE TABLE table_68271 (
"Unit" text,
"Type" text,
"Gross MW" text,
"Construction start" text,
"Operation start" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Type of phase ii has what gross mw?
| SELECT "Gross MW" FROM table_68271 WHERE "Type" = 'phase ii' | wikisql |
CREATE TABLE table_name_96 (
year INTEGER,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most year for points more than 0
| SELECT MAX(year) FROM table_name_96 WHERE points > 0 | 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 zyjybgb.BGRGH, zyjybgb.BGRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '15125060354' GROUP BY zyjybgb.BGRGH HAVING COUNT(*) > 26 UNION SELECT mzjybgb.BGRGH, mzjybgb.BGRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '15125060354' GROUP BY mzjybgb.BGRGH HAVING COUNT(*) > 26 | css |
CREATE TABLE table_7743 (
"Province" text,
"Capital" text,
"Area (km\u00b2)" real,
"Population census 1999" real,
"Population per km\u00b2 (2009)" real,
"Population census 2009" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest ... | SELECT MAX("Population per km\u00b2 (2009)") FROM table_7743 WHERE "Province" = 'western province' AND "Area (km\u00b2)" > '5,475' | wikisql |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show me how... | SELECT Class, COUNT(Class) FROM race GROUP BY Class ORDER BY COUNT(Class) | nvbench |
CREATE TABLE table_27830 (
"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.
-- Who wrote 'to live and die... | SELECT "Written by" FROM table_27830 WHERE "Title" = 'To Live and Diet in L.A.' | wikisql |
CREATE TABLE table_name_27 (
median_household_income VARCHAR,
per_capita_income VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the median household income where the per capita is $28,789?
| SELECT median_household_income FROM table_name_27 WHERE per_capita_income = "$28,789" | sql_create_context |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY COUNT(roomName) | nvbench |
CREATE TABLE diagnoses (
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
)
C... | SELECT diagnoses.short_title, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Gonzalo Wasson" | mimicsql_data |
CREATE TABLE table_28355 (
"\u00d7" text,
"Wehdat" text,
"Faisaly" text,
"Ramtha" text,
"Ahli" text,
"Hussein" text,
"Jazeera" text,
"Amman" text,
"Qadisiya" text,
"Jeel" text,
"Baqaa" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "\u00d7" FROM table_28355 WHERE "Jeel" = '1-1' AND "Ramtha" = '1-1' | wikisql |
CREATE TABLE table_name_26 (
league_goals INTEGER,
fa_cup_goals INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of League Goals for palyers with 0 FA Cup Goals?
| SELECT AVG(league_goals) FROM table_name_26 WHERE fa_cup_goals < 0 | sql_create_context |
CREATE TABLE table_name_35 (
music_director VARCHAR,
film VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the musical director of the film Vettaiyaadu vilaiyaadu?
| SELECT music_director FROM table_name_35 WHERE film = "vettaiyaadu vilaiyaadu" | sql_create_context |
CREATE TABLE table_79137 (
"Date" text,
"Result" text,
"Score" text,
"Opponent" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record has w as the result, with January 2 as the date?
| SELECT "Record" FROM table_79137 WHERE "Result" = 'w' AND "Date" = 'january 2' | wikisql |
CREATE TABLE table_1594772_2 (
s_no INTEGER,
margin VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number for 74 runs margins
| SELECT MAX(s_no) FROM table_1594772_2 WHERE margin = "74 runs" | sql_create_context |
CREATE TABLE table_23099 (
"Year" text,
"Marriages between men" real,
"Marriages between women" real,
"Same-sex marriages" real,
"Total marriages" real,
"% same-sex marriages" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the % of same-... | SELECT "% same-sex marriages" FROM table_23099 WHERE "Year" = '2011' | wikisql |
CREATE TABLE table_6997 (
"Locomotive" text,
"Serial No" text,
"Entered service" text,
"Owner" text,
"Operator" text,
"Livery" text,
"Gauge" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Serial Number of the L... | SELECT "Serial No" FROM table_6997 WHERE "Entered service" = 'october 1989' | wikisql |
CREATE TABLE table_73888 (
"\u00d7" text,
"Faisaly" text,
"Wehdat" text,
"Ramtha" text,
"Ahli" text,
"Jazeera" text,
"Hussein" text,
"Amman" text,
"Orthodoxy" text,
"Jeel" text,
"Ain Karem" text
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT "\u00d7" FROM table_73888 WHERE "Faisaly" = '0-0' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "VENTRICULAR TACHYCARDIA" AND lab.flag = "delta" | mimicsql_data |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT demographic.insurance, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "21796" | mimicsql_data |
CREATE TABLE table_3242 (
"Name of Bowl" text,
"Record" text,
"Appearances" real,
"Last Appearance" text,
"Winning %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the appearance for independence bowl
| SELECT COUNT("Appearances") FROM table_3242 WHERE "Name of Bowl" = 'Independence Bowl' | wikisql |
CREATE TABLE table_11256021_1 (
extroverted VARCHAR,
_relationship_oriented VARCHAR,
moderate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the extroverted, relationship-oriented where moderate is introverted sanguine
| SELECT extroverted, _relationship_oriented FROM table_11256021_1 WHERE moderate = "Introverted Sanguine" | sql_create_context |
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.MED_AMOUT) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '窦德水' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-27' AND '2009-12-29' | 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_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '14360011' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-02-17' AND '2013-01-19' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_8 (
engine VARCHAR,
year VARCHAR,
power VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Engine has a Year that's Larger than 2006 and Power of BHP (KW)?
| SELECT engine FROM table_name_8 WHERE year > 2006 AND power = "bhp (kw)" | sql_create_context |
CREATE TABLE table_23225927_1 (
original_air_date VARCHAR,
no_in_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the number in the season is 22, what is the original air date?
| SELECT original_air_date FROM table_23225927_1 WHERE no_in_season = 22 | sql_create_context |
CREATE TABLE table_78635 (
"Name" text,
"Wins" real,
"Start" text,
"Duration" text,
"Defeated by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins were held before being defeated by toda?
| SELECT COUNT("Wins") FROM table_78635 WHERE "Defeated by" = 'toda' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_300 DESC | nvbench |
CREATE TABLE table_name_95 (
theme VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Theme has a Result of eliminated?
| SELECT theme FROM table_name_95 WHERE result = "eliminated" | sql_create_context |
CREATE TABLE table_63892 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the years when the soap opera is glenroe and the actor is mick lally?
| SELECT "Years" FROM table_63892 WHERE "Soap Opera" = 'glenroe' AND "Actor" = 'mick lally' | wikisql |
CREATE TABLE table_1550 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the location for 15046 attendance
| SELECT "Location" FROM table_1550 WHERE "Attendance" = '15046' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_49751 (
"Months in Malayalam Era" text,
"In Malayalam" text,
"Gregorian Calendar" text,
"Tamil calendar" text,
"Saka era" text,
"Sign of Zodiac" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE GREGORIAN CALENDAR FOR... | SELECT "Gregorian Calendar" FROM table_49751 WHERE "Sign of Zodiac" = 'aquarius' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MEMS' AND number = 213 | advising |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_152 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the minimum rank
| SELECT MIN("Rank") FROM table_152 | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-12313... | eicu |
CREATE TABLE table_24072 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes ran 24:33?
| SELECT COUNT("Episode") FROM table_24072 WHERE "Run time" = '24:33' | wikisql |
CREATE TABLE table_train_217 (
"id" int,
"gender" string,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"hematocrit_hct" float,
"insulin_requirement" float,
"serum_creatinine" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT * FROM table_train_217 WHERE insulin_requirement = 1.4 | criteria2sql |
CREATE TABLE table_39322 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of rounds for gina carano
| SELECT COUNT("Round") FROM table_39322 WHERE "Opponent" = 'gina carano' | wikisql |
CREATE TABLE table_name_74 (
victory_margin__in_lengths_ VARCHAR,
time VARCHAR,
finish VARCHAR,
jockey VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the victory margin for a finish of 1st with a rider of Kent Desormeaux, with a time of 1:35... | SELECT victory_margin__in_lengths_ FROM table_name_74 WHERE finish = "1st" AND jockey = "kent desormeaux" AND time = "1:35.66" | sql_create_context |
CREATE TABLE table_2201541_3 (
outcome VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different outcomes did the final with Paul McNamee as a partner have?
| SELECT COUNT(outcome) FROM table_2201541_3 WHERE partner = "Paul McNamee" | sql_create_context |
CREATE TABLE table_name_98 (
name VARCHAR,
qual_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a qual 1 of 1:01.461?
| SELECT name FROM table_name_98 WHERE qual_1 = "1:01.461" | sql_create_context |
CREATE TABLE table_name_13 (
date VARCHAR,
rank VARCHAR,
network VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When has a Rank larger than 2 and a Network of itv?
| SELECT date FROM table_name_13 WHERE rank > 2 AND network = "itv" | sql_create_context |
CREATE TABLE table_name_54 (
ht VARCHAR,
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the HT for the game at Zagreb, with a full-time score of 0-2?
| SELECT ht FROM table_name_54 WHERE venue = "zagreb" AND score = "0-2" | sql_create_context |
CREATE TABLE table_28351 (
"\u00d7" text,
"Wehdat" text,
"Faisaly" text,
"Ramtha" text,
"Ahli" text,
"Hussein" text,
"Jazeera" text,
"Amman" text,
"Qadisiya" text,
"Jeel" text,
"Baqaa" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Amman" FROM table_28351 WHERE "Qadisiya" = '2-1' | wikisql |
CREATE TABLE table_32579 (
"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.
-- Which home team played against Hawthorn?
| SELECT "Home team score" FROM table_32579 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE table_47358 (
"Date" text,
"Opponent#" text,
"Rank #" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance of the match on October 26?
| SELECT "Attendance" FROM table_47358 WHERE "Date" = 'october 26' | wikisql |
CREATE TABLE table_name_63 (
result VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the result for team of giants
| SELECT result FROM table_name_63 WHERE team = "giants" | sql_create_context |
CREATE TABLE table_name_99 (
home VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home has an attendance of 507?
| SELECT home FROM table_name_99 WHERE attendance = 507 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sedated - responsive' AND DATETIME(diagn... | eicu |
CREATE TABLE table_9423 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a score of 68-67=135?
| SELECT "Player" FROM table_9423 WHERE "Score" = '68-67=135' | wikisql |
CREATE TABLE table_name_50 (
played INTEGER,
points VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of played games a club with more than 71 points and less than 8 losses has?
| SELECT SUM(played) FROM table_name_50 WHERE points > 71 AND losses < 8 | sql_create_context |
CREATE TABLE table_name_35 (
opponent VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when the loss was Wells (4-7)?
| SELECT opponent FROM table_name_35 WHERE loss = "wells (4-7)" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2151" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55642' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'creatinin... | eicu |
CREATE TABLE table_19931 (
"Series Ep." text,
"Episode" real,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the titles of segment c for series episode is 21-08?
| SELECT "Segment C" FROM table_19931 WHERE "Series Ep." = '21-08' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road | nvbench |
CREATE TABLE available_policies (
policy_id number,
policy_type_code text,
customer_phone text
)
CREATE TABLE settlements (
settlement_id number,
claim_id number,
effective_date time,
settlement_amount number
)
CREATE TABLE first_notification_of_loss (
fnol_id number,
customer_id n... | SELECT SUM(settlement_amount), AVG(settlement_amount) FROM settlements | spider |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '2 ml: ondansetron hcl 4 mg/2ml ij soln' AND patient.uniquepid = '030-75705' AND DATETIME(medication.drugstarttime, 'start... | eicu |
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_23662272_4 (
total_points_earned VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total points earned total number if the average is 21.3?
| SELECT COUNT(total_points_earned) FROM table_23662272_4 WHERE average = "21.3" | sql_create_context |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_14219514_2 (
home__1st_leg_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When altos hornos zapla is the home (1st leg) what is overall amount of 1st leg?
| SELECT COUNT(1 AS st_leg) FROM table_14219514_2 WHERE home__1st_leg_ = "Altos Hornos Zapla" | sql_create_context |
CREATE TABLE table_30252 (
"School" text,
"Nickname" text,
"Location" text,
"Colors" text,
"Tenure" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When were the members tenured in the Field school?
| SELECT "Tenure" FROM table_30252 WHERE "School" = 'Field' | wikisql |
CREATE TABLE table_21256068_3 (
venue VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many venues were played on in round 1
| SELECT COUNT(venue) FROM table_21256068_3 WHERE round = "1" | 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_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... | advising |
CREATE TABLE table_204_277 (
id number,
"region" text,
"country" text,
"location" text,
"size (m)" text,
"payload (metric tonnes)" text,
"degrees of freedom" number,
"x horiz disp (mm)" number,
"y horiz disp (mm)" number,
"z vert disp (mm)" number,
"x horiz vel (mm/s)" number... | SELECT COUNT(*) FROM table_204_277 WHERE "region" = 'asia' | squall |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3713663' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-07-24' AND '2015-01-04' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3713663' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-07-24' AND '2015-01-04' AND t_kc21.IN_DIAG_DIS_CD = t_kc21.OUT_DIAG_DIS_CD | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.