instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
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 ta (
campus_job_id int,
... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN cou... | advising |
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 t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', treatment.treatmenttime) = '2101' GROUP BY treatment.treatmentname... | eicu |
CREATE TABLE table_name_47 (
long INTEGER,
yards VARCHAR,
avg_g VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum for the long that has 926 yards and an avg/g less than 84.2?
| SELECT SUM(long) FROM table_name_47 WHERE yards = 926 AND avg_g < 84.2 | sql_create_context |
CREATE TABLE table_name_55 (
year INTEGER,
mixed_doubles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did mika heinonen susanna dahlberg win mixed doubles?
| SELECT AVG(year) FROM table_name_55 WHERE mixed_doubles = "mika heinonen susanna dahlberg" | sql_create_context |
CREATE TABLE Products (
product_id INTEGER,
product_type_code VARCHAR(10),
product_name VARCHAR(80),
product_price DECIMAL(19,4)
)
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VAR... | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY MAX(product_price) DESC | nvbench |
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdes... | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = "BAL" | spider |
CREATE TABLE table_train_263 (
"id" int,
"breast_cancer" bool,
"fasting_blood_glucose_fbg" float,
"prostate_cancer" bool,
"hba1c" float,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- a ... | SELECT * FROM table_train_263 WHERE fasting_blood_glucose_fbg = 180 | criteria2sql |
CREATE TABLE table_name_95 (
colour_commentator_s_ VARCHAR,
play_by_play VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Were the color commentators who worked with Bill Hewitt doing the play-by-play?
| SELECT colour_commentator_s_ FROM table_name_95 WHERE play_by_play = "bill hewitt" | sql_create_context |
CREATE TABLE table_50806 (
"Year" text,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHICH Regular Season has a Division of 4?
| SELECT "Regular Season" FROM table_50806 WHERE "Division" = '4' | wikisql |
CREATE TABLE table_204_620 (
id number,
"title" text,
"year" number,
"language" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what movie did this actor star in after they starred in dil vil pyar vyar in 2002 ?
| SELECT "title" FROM table_204_620 WHERE id = (SELECT id FROM table_204_620 WHERE "title" = 'dil vil pyar vyar') + 1 | squall |
CREATE TABLE table_67490 (
"Film" text,
"Director(s)" text,
"Writer(s)" text,
"Recipient" text,
"Date" text,
"Award" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the director for maya vision international ltd
| SELECT "Director(s)" FROM table_67490 WHERE "Recipient" = 'maya vision international ltd' | wikisql |
CREATE TABLE table_204_814 (
id number,
"date" text,
"opposition" text,
"result" text,
"score" text,
"brazil scorers" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games did this team play in 1982 ?
| SELECT COUNT(*) FROM table_204_814 | squall |
CREATE TABLE table_name_49 (
points INTEGER,
driver VARCHAR,
average_pre_2010 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of points driver Romain Grosjean, who has an average pre-2010 less than 0, has?
| SELECT MIN(points) FROM table_name_49 WHERE driver = "romain grosjean" AND average_pre_2010 < 0 | sql_create_context |
CREATE TABLE table_name_89 (
status VARCHAR,
opened VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status of the junior coaster model that opened in 2008?
| SELECT status FROM table_name_89 WHERE opened = "2008" AND model = "junior coaster" | sql_create_context |
CREATE TABLE table_715 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum first elected for ed markey?
| SELECT MIN("First elected") FROM table_715 WHERE "Incumbent" = 'Ed Markey' | wikisql |
CREATE TABLE table_203_391 (
id number,
"season" text,
"greek league" text,
"greek cup" text,
"europe" text,
"coach" text,
"roster" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was on the roster from 1969 - 1976 ? and how do you spell ... | SELECT DISTINCT "roster" FROM table_203_391 WHERE "season" >= 1969 AND "season" <= 1976 | squall |
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_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-39247')) AND lab.labname = 'creatinine' AND DATETIME(lab.labresulttime) >= DATETIME(CURR... | eicu |
CREATE TABLE table_train_44 (
"id" int,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"corticosteroid_therapy" bool,
"immune_suppression" bool,
"hepatic_disease" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for... | SELECT * FROM table_train_44 WHERE hepatic_disease = 1 | criteria2sql |
CREATE TABLE table_name_16 (
player VARCHAR,
position VARCHAR,
caps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player is a lock with 1 cap?
| SELECT player FROM table_name_16 WHERE position = "lock" AND caps = 1 | sql_create_context |
CREATE TABLE table_21514460_1 (
graduation_rate__2011_12_ VARCHAR,
headquarters VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the graduation rate for the school district with headquarters located in Sydney?
| SELECT graduation_rate__2011_12_ FROM table_21514460_1 WHERE headquarters = "Sydney" | sql_create_context |
CREATE TABLE table_62826 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 200-metre time for the swimmer from Slovenia in lane 9?
| SELECT COUNT("Time") FROM table_62826 WHERE "Nationality" = 'slovenia' AND "Lane" < '9' | wikisql |
CREATE TABLE Member (
member_name VARCHAR,
party_id VARCHAR
)
CREATE TABLE party (
party_id VARCHAR,
Party_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show member names that are not in the Progress Party.
| SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> "Progress Party" | sql_create_context |
CREATE TABLE table_70156 (
"Year" real,
"Class" text,
"Tyres" text,
"Team" text,
"Co-Drivers" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Class Pos have Laps smaller than 304, and a Y... | SELECT "Class Pos." FROM table_70156 WHERE "Laps" < '304' AND "Year" > '2001' | wikisql |
CREATE TABLE table_1447 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many locations were there when sydney was th... | SELECT COUNT("Ground") FROM table_1447 WHERE "Home team" = 'Sydney' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
c... | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC | nvbench |
CREATE TABLE table_14200 (
"Rank" real,
"Heat" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many heats did Runners from Guinea-Bissau run, with rank higher than 33?
| SELECT SUM("Heat") FROM table_14200 WHERE "Nationality" = 'guinea-bissau' AND "Rank" < '33' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Po... | SELECT * FROM information_schema.tables | sede |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '52622012' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_name_93 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what team played on april 21
| SELECT opponent FROM table_name_93 WHERE date = "april 21" | sql_create_context |
CREATE TABLE Images (
image_id INTEGER,
image_alt_text VARCHAR(80),
image_name VARCHAR(40),
image_url VARCHAR(255)
)
CREATE TABLE Functional_Areas (
functional_area_code VARCHAR(15),
parent_functional_area_code VARCHAR(15),
functional_area_description VARCHAR(80)
)
CREATE TABLE Roles (
... | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code | nvbench |
CREATE TABLE table_name_31 (
dissolved VARCHAR,
assembled VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the dissolved date of the parliament assembled on 3 June 1467?
| SELECT dissolved FROM table_name_31 WHERE assembled = "3 june 1467" | sql_create_context |
CREATE TABLE table_11111116_7 (
directed_by VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed episodes that had 2.61 million U.S. viewers?
| SELECT directed_by FROM table_11111116_7 WHERE us_viewers__million_ = "2.61" | sql_create_context |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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 n... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '85281827' AND hz_info.YLJGDM = '5565030' AND NOT mzjzjlb.JZKSMC LIKE '%ICU%' | css |
CREATE TABLE table_203_296 (
id number,
"country" text,
"total gdp (nominal)\n(billion us$)" text,
"gdp per capita\n(us$, ppp)" text,
"gdp growth,\n2007-2011\n(in %)" number,
"hdi" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which countries h... | SELECT "country" FROM table_203_296 WHERE "country" <> 'mauritius' AND "gdp growth,\n2007-2011\n(in %)" = (SELECT "gdp growth,\n2007-2011\n(in %)" FROM table_203_296 WHERE "country" = 'mauritius') | squall |
CREATE TABLE table_name_59 (
react INTEGER,
name VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average react of bryan barnett, who has a lane less than 2?
| SELECT AVG(react) FROM table_name_59 WHERE name = "bryan barnett" AND lane < 2 | sql_create_context |
CREATE TABLE table_name_80 (
november INTEGER,
record VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When in November were they 11-7-3 with over 21 games?
| SELECT MAX(november) FROM table_name_80 WHERE record = "11-7-3" AND game > 21 | sql_create_context |
CREATE TABLE txmzjzjlb (
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 COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZSEBZ = '9925100' AND ftxmzjzjlb.JZKSRQ BETWEEN '2009-08-02' AND '2014-02-13' | css |
CREATE TABLE table_204_43 (
id number,
"name" text,
"rural\nmunicipality (rm)" text,
"population\n(2011)" number,
"population\n(2006)" number,
"change\n(%)" number,
"land\narea\n(km2)" number,
"population\ndensity\n(per km2)" number
)
-- Using valid SQLite, answer the following questio... | SELECT "name" FROM table_204_43 ORDER BY "population\n(2011)" LIMIT 1 | squall |
CREATE TABLE Invoices (
order_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the order ids and the number of invoices for each order.
| SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id | sql_create_context |
CREATE TABLE table_name_6 (
airport VARCHAR,
icao VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the airport for ICAO of flls
| SELECT airport FROM table_name_6 WHERE icao = "flls" | sql_create_context |
CREATE TABLE table_34146 (
"Rank" text,
"Common of" text,
"Population" real,
"Area (km 2 )" real,
"Density (inhabitants/km 2 )" real,
"Altitude (mslm)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Altitude (mslm) has a Density (inhabitan... | SELECT SUM("Altitude (mslm)") FROM table_34146 WHERE "Density (inhabitants/km 2 )" < '1467.5' AND "Common of" = 'moncalieri' | wikisql |
CREATE TABLE table_7925 (
"Season in Tamil" text,
"English Transliteration" text,
"English Translation" text,
"Season in Sanskrit" text,
"Season in English" text,
"Tamil Months" text,
"Gregorian Months" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Season in Tamil" FROM table_7925 WHERE "Season in English" = 'monsoon' | wikisql |
CREATE TABLE table_1373768_1 (
transmission VARCHAR,
trim VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the transmbeingsion with trim being xe (2009)
| SELECT transmission FROM table_1373768_1 WHERE trim = "XE (2009)" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14154 AND admissio... | mimic_iii |
CREATE TABLE table_name_16 (
round INTEGER,
overall VARCHAR,
position VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Round for wide receiver r. jay soward and Overall smaller than 29?
| SELECT AVG(round) FROM table_name_16 WHERE position = "wide receiver" AND name = "r. jay soward" AND overall < 29 | sql_create_context |
CREATE TABLE table_name_24 (
position INTEGER,
played VARCHAR,
drawn VARCHAR,
against VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest position of the team with an against of 12, less than 11 points, more than 2 ... | SELECT MAX(position) FROM table_name_24 WHERE against = 12 AND points < 11 AND drawn > 2 AND played > 9 | sql_create_context |
CREATE TABLE table_25729 (
"District" text,
"SC/ST" text,
"Nairs" text,
"Ezhavas" text,
"Syrian Christians" text,
"Latin Christians" text,
"Muslims" text,
"Others" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the... | SELECT "Syrian Christians" FROM table_25729 WHERE "District" = 'Kollam' | wikisql |
CREATE TABLE txmzjzjlb (
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 txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '63547220' AND hz_info.YLJGDM = '9574052' AND NOT txmzjzjlb.JZKSMC LIKE '%ICU%' UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOIN ftxmzjzjlb ON hz_info... | css |
CREATE TABLE table_72612 (
"Episode #" text,
"Country" text,
"City" text,
"Martial Art/Style" text,
"Masters" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which martial arts style was shown in Rio de Janeiro?
| SELECT "Martial Art/Style" FROM table_72612 WHERE "City" = 'Rio de Janeiro' | wikisql |
CREATE TABLE table_name_55 (
silver INTEGER,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least silvers where there are 39 bronzes and the total is less than 120?
| SELECT MIN(silver) FROM table_name_55 WHERE bronze = 39 AND total < 120 | sql_create_context |
CREATE TABLE table_29295463_9 (
champion VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the champion in the tournament where Scott Davis Chris Dunk was the runner up?
| SELECT champion FROM table_29295463_9 WHERE runner_up = "Scott Davis Chris Dunk" | sql_create_context |
CREATE TABLE table_name_16 (
tournament VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament ended with a winning score of 27 (65-68-64-64=261)?
| SELECT tournament FROM table_name_16 WHERE winning_score = –27(65 - 68 - 64 - 64 = 261) | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_17757 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Bens location" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the numb... | SELECT "No." FROM table_17757 WHERE "Directed by" = 'Tucker Gates' | wikisql |
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 sel.Questions, COUNT(*) AS Occurence FROM (SELECT COUNT(*) AS Questions FROM Posts AS p WHERE p.PostTypeId = 2 GROUP BY p.OwnerUserId) AS sel GROUP BY sel.Questions | sede |
CREATE TABLE table_12695 (
"Season" real,
"# of Episodes" real,
"Host" text,
"Mole" text,
"Winner" text,
"Runner-up" text,
"Destinations" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which # of Episodes has a Mole of craig slike?
| SELECT MIN("# of Episodes") FROM table_12695 WHERE "Mole" = 'craig slike' | wikisql |
CREATE TABLE table_11614581_3 (
seat VARCHAR,
name_in_russian VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What seat does hold?
| SELECT seat FROM table_11614581_3 WHERE name_in_russian = "Плоцкая губерния" | sql_create_context |
CREATE TABLE table_8977 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in Game 27?
| SELECT "Opponent" FROM table_8977 WHERE "Game" = '27' | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Mupirocin Cream 2%" | mimicsql_data |
CREATE TABLE table_57182 (
"Round" real,
"Pick" real,
"Player" text,
"Pos." text,
"Nationality" text,
"Team" text,
"School/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds have a Pick of 13?
| SELECT SUM("Round") FROM table_57182 WHERE "Pick" = '13' | wikisql |
CREATE TABLE table_64936 (
"Country" text,
"1960" real,
"1961" real,
"1962" real,
"1963" real,
"1964" real,
"1965" real,
"1966" real,
"1967" real,
"1968" real,
"1969" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1965 ... | SELECT MIN("1965") FROM table_64936 WHERE "1962" = '0.35000000000000003' AND "1967" < '0.53' | wikisql |
CREATE TABLE table_65241 (
"Stadium" text,
"Capacity" real,
"City" text,
"Province" text,
"Home team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What province is in Mendoza with a stadium feliciano gambarte?
| SELECT "Province" FROM table_65241 WHERE "City" = 'mendoza' AND "Stadium" = 'feliciano gambarte' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Id AS "post_link", AnswerCount AS "number_of_answers", Score, Tags FROM Posts WHERE PostTypeId = 1 ORDER BY AnswerCount DESC LIMIT 100 | sede |
CREATE TABLE table_36619 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the tournament won by Hale Irwin (19)?
| SELECT "Location" FROM table_36619 WHERE "Winner" = 'hale irwin (19)' | wikisql |
CREATE TABLE table_name_50 (
time VARCHAR,
nation VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time when the race was in Kenya and Lineth Chepkurui was the athlete?
| SELECT time FROM table_name_50 WHERE nation = "kenya" AND athlete = "lineth chepkurui" | sql_create_context |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | SELECT Season, COUNT(Season) FROM game ORDER BY Season | nvbench |
CREATE TABLE table_name_46 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game on January 12?
| SELECT score FROM table_name_46 WHERE date = "january 12" | sql_create_context |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Compa... | SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director ORDER BY MIN(T1.stars) | nvbench |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition (
Competition_ID int,
Year real,
... | SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country | nvbench |
CREATE TABLE table_name_26 (
tie_no VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tie No with a Score of 2 2?
| SELECT tie_no FROM table_name_26 WHERE score = "2–2" | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '07:45' AND course.course_id = course_offering.course_id AND course.department = 'COMP' AND course.number = 892 AND semester.semester = 'WN' AND ... | advising |
CREATE TABLE table_name_66 (
away_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team with a 5 tie no?
| SELECT away_team FROM table_name_66 WHERE tie_no = "5" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jybgb.JZLSH_MZJZJLB AND jybg... | css |
CREATE TABLE table_12857 (
"Designation" text,
"Launch date/time ( GMT )" text,
"Mass" text,
"Apogee" text,
"Inclination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Mass, when Launch Date/Time ( GMT ) is 25 November 1976, 03:59?
| SELECT "Mass" FROM table_12857 WHERE "Launch date/time ( GMT )" = '25 november 1976, 03:59' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'peripheral nerve graf... | mimic_iii |
CREATE TABLE table_204_903 (
id number,
"title" text,
"character" text,
"broadcaster" text,
"episodes" number,
"date" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- blandings and death in paradise both aired on which broadcaster ?
| SELECT "broadcaster" FROM table_204_903 WHERE "title" = 'blandings' | squall |
CREATE TABLE table_name_8 (
population VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population when the area is 4,575?
| SELECT population FROM table_name_8 WHERE area = "4,575" | sql_create_context |
CREATE TABLE table_204_293 (
id number,
"district" number,
"name" text,
"party" text,
"district office" text,
"first elected" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name a senator who was elected before brown .
| SELECT "name" FROM table_204_293 WHERE id = (SELECT id FROM table_204_293 WHERE "name" = 'troy brown') - 1 | squall |
CREATE TABLE table_name_90 (
location VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location of the game with a score of 2:3?
| SELECT location FROM table_name_90 WHERE score = "2:3" | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.short_title = "Open incis hern-grft NEC" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) >= '2103' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE table_29692554_2 (
eliminated VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was eliminated a person at 18:48?
| SELECT eliminated AS by FROM table_29692554_2 WHERE time = "18:48" | sql_create_context |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) | nvbench |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HBEHED' AND course.number = 900 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 | advising |
CREATE TABLE table_46239 (
"Season" text,
"Episodes" real,
"Season premiere" text,
"Season finale" text,
"Peak Series rating[ citation needed ]" text,
"Average series rating" text,
"DVD release date" text,
"Discs" real
)
-- Using valid SQLite, answer the following questions for the tab... | SELECT AVG("Episodes") FROM table_46239 WHERE "Season premiere" = '23 july 2008' | wikisql |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_F... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_date) | nvbench |
CREATE TABLE elimination (
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of distinct teams that suffer elimination?
| SELECT COUNT(DISTINCT team) FROM elimination | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'epinephrine') | eicu |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId... | SELECT ROW_NUMBER() OVER (ORDER BY p.Id) AS RowNum, p.Id, p.Title, p.PostTypeId, p.CreationDate, p.ClosedDate, p.Score, p.ViewCount, p.AnswerCount, p.Tags, p.OwnerUserId, p.OwnerDisplayName, owner.Location, owner.Reputation, c.Id AS AnswerId, c.Score AS AnswerScore, responseOwner.Id AS ResponseOwnerId, responseOwner.Di... | sede |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_care... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96006 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'blood culture' | mimic_iii |
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | SELECT title, studio FROM film WHERE studio LIKE "%Universal%" | spider |
CREATE TABLE table_15514 (
"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.
-- What is the record of the match at 6:00?
| SELECT "Record" FROM table_15514 WHERE "Time" = '6:00' | wikisql |
CREATE TABLE table_20106 (
"No" real,
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cars used number 48?
| SELECT COUNT("Engine") FROM table_20106 WHERE "No" = '48' | wikisql |
CREATE TABLE table_26258348_4 (
report VARCHAR,
grand_prix VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the report for the Belgian Grand Prix?
| SELECT report FROM table_26258348_4 WHERE grand_prix = "Belgian grand_prix" | sql_create_context |
CREATE TABLE table_name_87 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team 1 had a team 2 of Hafia FC?
| SELECT team_1 FROM table_name_87 WHERE team_2 = "hafia fc" | sql_create_context |
CREATE TABLE table_25161 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the team ... | SELECT "Race Time" FROM table_25161 WHERE "Team" = 'Billy Ballew Motorsports' | wikisql |
CREATE TABLE table_78864 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- on what date was tie number 4?
| SELECT "Date" FROM table_78864 WHERE "Tie no" = '4' | wikisql |
CREATE TABLE table_33584 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"In office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which member is from the state of SA and the grey electorate?
| SELECT "Member" FROM table_33584 WHERE "State" = 'sa' AND "Electorate" = 'grey' | wikisql |
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 Name, Weight FROM people ORDER BY Name | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.