instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_6403 (
"Year" real,
"Country" text,
"Song" text,
"Artist" text,
"Written by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year was the artist Afro-dite?
| SELECT "Year" FROM table_6403 WHERE "Artist" = 'afro-dite' | wikisql |
CREATE TABLE table_13854 (
"Date" text,
"Label" text,
"Format" text,
"Country" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What format was the release in form the Edsel label, and that was from the EDCD 262 catalog?
| SELECT "Format" FROM table_13854 WHERE "Label" = 'edsel' AND "Catalog" = 'edcd 262' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | 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 = 'pleural effusion - transudate by lab ana... | eicu |
CREATE TABLE table_name_80 (
Group VARCHAR,
song VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Group Song, when Song is ?
| SELECT Group AS song FROM table_name_80 WHERE song = "换季" | sql_create_context |
CREATE TABLE table_72885 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High points" FROM table_72885 WHERE "Team" = 'Cleveland' | wikisql |
CREATE TABLE table_63184 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the frequency when the identifier is cbf-fm-9?
| SELECT "Frequency" FROM table_63184 WHERE "Identifier" = 'cbf-fm-9' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CRE... | SELECT * FROM Posts WHERE CreationDate >= '2019-03-25' | sede |
CREATE TABLE table_name_13 (
byes INTEGER,
losses VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of Byes for the team that had 15 Losses, and less than 1 Win?
| SELECT AVG(byes) FROM table_name_13 WHERE losses = 15 AND wins < 1 | sql_create_context |
CREATE TABLE table_name_66 (
actor VARCHAR,
character VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What actor plays glen cole?
| SELECT actor FROM table_name_66 WHERE character = "glen cole" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH =... | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
... | WITH CTE_TopPosts AS (SELECT OwnerUserId FROM Posts ORDER BY Score DESC LIMIT 100000) SELECT OwnerUserId, DisplayName, COUNT(OwnerUserId) AS Count FROM CTE_TopPosts JOIN Users ON CTE_TopPosts.OwnerUserId = Users.Id GROUP BY OwnerUserId, DisplayName ORDER BY Count DESC LIMIT 1000 | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT diagnoses.icd9_code, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Francis Baseler" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId numb... | WITH Keyed AS (SELECT CAST(Posts.Score AS FLOAT) AS Score, POWER(ROUND(SQRT(LENGTH(Body)), 0), 2) AS PostLength FROM Posts WHERE PostTypeId = 1), Sized AS (SELECT PostLength, AVG(Score) AS MeanScore, COUNT(Score) AS ClusterSize FROM Keyed GROUP BY PostLength) SELECT PostLength, MeanScore, ClusterSize FROM Sized WHERE C... | sede |
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(5... | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id | nvbench |
CREATE TABLE table_name_96 (
team__number2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2nd Leg, when Team #2 is 'San Lorenzo'?
| SELECT 2 AS nd_leg FROM table_name_96 WHERE team__number2 = "san lorenzo" | sql_create_context |
CREATE TABLE table_68070 (
"School" text,
"Team" text,
"Division Record" text,
"Overall Record" text,
"Season Outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the school for eagles
| SELECT "School" FROM table_68070 WHERE "Team" = 'eagles' | wikisql |
CREATE TABLE table_2562572_46 (
settlement VARCHAR,
cyrillic_name_other_names VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which settlement has a cyrillic and other name of (romanian: voivodin )?
| SELECT settlement FROM table_2562572_46 WHERE cyrillic_name_other_names = "Војводинци (Romanian: Voivodinţ)" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
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,... | SELECT DISTINCT name FROM course WHERE department = 'ELI' AND number = 530 | advising |
CREATE TABLE table_18041 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Title" FROM table_18041 WHERE "U.S. viewers (millions)" = '11.75' | wikisql |
CREATE TABLE table_44260 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who scored the lowest with 8 gold medals and less than 4 silver medals?
| SELECT MIN("Total") FROM table_44260 WHERE "Gold" = '8' AND "Silver" < '4' | wikisql |
CREATE TABLE table_38253 (
"Election" text,
"D\u00e1il" text,
"Share of votes" text,
"Seats" real,
"Government" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 6th dail share of votes?
| SELECT "Share of votes" FROM table_38253 WHERE "D\u00e1il" = '6th' | wikisql |
CREATE TABLE table_49713 (
"Model number" text,
"Frequency" text,
"L2 cache" text,
"Mult." text,
"Voltage" text,
"Socket" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Frequency, when Model Number is Pentium II 400?
| SELECT "Frequency" FROM table_49713 WHERE "Model number" = 'pentium ii 400' | wikisql |
CREATE TABLE table_18600760_8 (
township VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the township for kidder
| SELECT township FROM table_18600760_8 WHERE county = "Kidder" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT diagnoses.icd9_code FROM diagnoses WHERE diagnoses.subject_id = "2560" | mimicsql_data |
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.dob_year < "2058" AND diagnoses.short_title = "Stevens-Johnson-TEN syn" | mimicsql_data |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Need prphyl vc vrl hepat" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_15398 (
"Date" text,
"Opponent" text,
"Site" text,
"Score" text,
"Loss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game when there was a loss of Kern (0-2)?
| SELECT "Score" FROM table_15398 WHERE "Loss" = 'kern (0-2)' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
... | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'CHEMBIO' AND COURSE_0.number = 530 AND COURSE_1.course_id = course_prerequisite.course_id | advising |
CREATE TABLE table_23892 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment (2009)" real,
"Founded" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was Southern Vermont College founded?
| SELECT MAX("Founded") FROM table_23892 WHERE "School" = 'Southern Vermont College' | wikisql |
CREATE TABLE table_74526 (
"Year" real,
"Tournaments played" real,
"Cuts made*" real,
"Wins" real,
"Top 10s" real,
"Best finish" text,
"Earnings ( $ )" text,
"Scoring average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the sc... | SELECT "Scoring average" FROM table_74526 WHERE "Year" < '1998' AND "Wins" > '3' | wikisql |
CREATE TABLE table_name_77 (
winning_constructor VARCHAR,
fastest_lap VARCHAR,
grand_prix VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winning constructor for when the fastest lap was mark webber at the malaysian grand prix
| SELECT winning_constructor FROM table_name_77 WHERE fastest_lap = "mark webber" AND grand_prix = "malaysian grand prix" | sql_create_context |
CREATE TABLE table_1601027_1 (
earpads VARCHAR,
headphone_class VARCHAR,
us_msrp VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many values for earpads correspond to the headphone class Prestige and a US MSRP of $79?
| SELECT COUNT(earpads) FROM table_1601027_1 WHERE headphone_class = "Prestige" AND us_msrp = "$79" | sql_create_context |
CREATE TABLE table_name_71 (
first_season INTEGER,
wins VARCHAR,
seasons VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of First Season games with 1537 Wins and a Season greater than 109?
| SELECT SUM(first_season) FROM table_name_71 WHERE wins = 1537 AND seasons > 109 | sql_create_context |
CREATE TABLE table_name_98 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the home team was geelong, what did the away team score?
| SELECT away_team AS score FROM table_name_98 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_30580 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many college/junior/club teams are ther when nhl team is... | SELECT COUNT("College/junior/club team") FROM table_30580 WHERE "NHL team" = 'Edmonton Oilers' | wikisql |
CREATE TABLE table_name_87 (
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day is st kilda the home side?
| SELECT date FROM table_name_87 WHERE home_team = "st kilda" | sql_create_context |
CREATE TABLE table_29108 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first series episode number for 'the christmas watch'?
| SELECT MIN("Series #") FROM table_29108 WHERE "Title" = 'The Christmas Watch' | wikisql |
CREATE TABLE table_38013 (
"Name" text,
"Life" text,
"Age at death" text,
"First contact with Hitler" text,
"Relationship" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the relationship of the woman who died at 96?
| SELECT "Relationship" FROM table_38013 WHERE "Age at death" = '96' | wikisql |
CREATE TABLE table_3955 (
"Code" text,
"District" text,
"Headquarters" text,
"Population (2001 Census)" real,
"Population (2011 Census)" real,
"Area (km\u00b2)" real,
"Density in 2011 (/km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Population (2001 Census)" FROM table_3955 WHERE "Headquarters" = 'Bhubaneswar' | wikisql |
CREATE TABLE table_11545282_4 (
years_for_jazz VARCHAR,
no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years did number 54 play for the jazz
| SELECT years_for_jazz FROM table_11545282_4 WHERE no = 54 | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId ... | SELECT T.TagName AS "tag", TIME_TO_STR(CreationDate, '%Y') AS "year", COUNT(PT.PostId) AS "number_of_posts" FROM Tags AS T, PostTags AS PT, Posts AS P WHERE T.Id = PT.TagId AND P.Id = PT.PostId GROUP BY T.TagName, TIME_TO_STR(CreationDate, '%Y') ORDER BY TIME_TO_STR(CreationDate, '%Y') | sede |
CREATE TABLE table_33004 (
"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.
-- What is the venue when melbourne is the away tea... | SELECT "Venue" FROM table_33004 WHERE "Away team" = 'melbourne' | wikisql |
CREATE TABLE table_name_31 (
geohash_length INTEGER,
lng_error VARCHAR,
lng_bits VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest geohash length when there is a ng error of 0.00017, and a lng bits smaller than 20?
| SELECT MAX(geohash_length) FROM table_name_31 WHERE lng_error = "±0.00017" AND lng_bits < 20 | sql_create_context |
CREATE TABLE table_51530 (
"Feb 2010" text,
"Mar 2010" text,
"May 2010" real,
"Jun 2010" real,
"Jul 2010" real,
"Aug 2010" real,
"Sep 2010" real,
"Oct 2010" real,
"Nov 2010" real,
"Dec 2010" real,
"Jan 2011" real,
"Feb 2011" real,
"Mar 2011" real,
"Apr 2011" real,... | SELECT AVG("Feb 2013") FROM table_51530 WHERE "Feb 2010" = '37' AND "Nov 2012" < '32' | wikisql |
CREATE TABLE table_name_70 (
score VARCHAR,
surface VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the match played on hard with a person ranked 10?
| SELECT score FROM table_name_70 WHERE surface = "hard" AND rank = 10 | sql_create_context |
CREATE TABLE table_name_86 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the away team was collingwood, what was the away team score?
| SELECT away_team AS score FROM table_name_86 WHERE away_team = "collingwood" | sql_create_context |
CREATE TABLE table_55070 (
"Rank" real,
"Movie" text,
"Year" real,
"Studio(s)" text,
"Lifetime India Distributor share" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Lifetime India Distributor share earlier than 2009?
| SELECT COUNT("Lifetime India Distributor share") FROM table_55070 WHERE "Year" < '2009' | wikisql |
CREATE TABLE table_10015132_3 (
years_in_toronto VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During what period did Dell Curry play for Toronto?
| SELECT years_in_toronto FROM table_10015132_3 WHERE player = "Dell Curry" | sql_create_context |
CREATE TABLE table_name_75 (
band VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What band has a year above 2011?
| SELECT band FROM table_name_75 WHERE year > 2011 | sql_create_context |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | SELECT AVG(population) FROM county | spider |
CREATE TABLE table_14637853_3 (
directed_by VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who directed with original air date being november18,1995
| SELECT directed_by FROM table_14637853_3 WHERE original_air_date = "November18,1995" | sql_create_context |
CREATE TABLE table_40289 (
"Week of" text,
"Tier" text,
"Winner" text,
"Runner-up" text,
"Semi finalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Week when the winner was mary joe fern ndez 6 4, 7 5?
| SELECT "Week of" FROM table_40289 WHERE "Winner" = 'mary joe fernández 6–4, 7–5' | 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 * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '77235231928') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '77235231928') AND jyjgzbb.JCZBJGDL < (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '77235231928') | css |
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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "0" AND procedures.short_title = "Contrast arteriogram-leg" | mimicsql_data |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT pt.PostId, p.Title, COUNT(*) AS posts, COUNT(CASE WHEN pf.VoteTypeId = 2 THEN 1 ELSE NULL END) AS Anon_up, COUNT(CASE WHEN pf.VoteTypeId = 3 THEN 1 ELSE NULL END) AS Anon_down FROM Tags AS t JOIN PostTags AS pt ON pt.TagId = t.Id JOIN PostFeedback AS pf ON pf.PostId = pt.PostId JOIN Posts AS p ON p.Id = pt.PostI... | sede |
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 WHERE demographic.gender = "M" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" | mimicsql_data |
CREATE TABLE table_3106 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the episode that aired originally... | SELECT "Title" FROM table_3106 WHERE "Original air date" = 'October 18, 1991' | wikisql |
CREATE TABLE table_name_30 (
record VARCHAR,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record at Tiger Stadium?
| SELECT record FROM table_name_30 WHERE game_site = "tiger stadium" | sql_create_context |
CREATE TABLE table_name_26 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won that game on 24 July 2010?
| SELECT result FROM table_name_26 WHERE date = "24 july 2010" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
P... | SELECT COUNT(UserId) FROM Votes AS V, Posts AS P WHERE P.PostTypeId = 2 AND P.Id = V.PostId GROUP BY V.UserId | sede |
CREATE TABLE table_43823 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of game 37?
| SELECT "Score" FROM table_43823 WHERE "Game" = '37' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'cardiac hardware malfunction - pacemaker' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis... | eicu |
CREATE TABLE table_name_22 (
director VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Director has a Rank of 12?
| SELECT director FROM table_name_22 WHERE rank = 12 | sql_create_context |
CREATE TABLE table_13981938_1 (
vineyard_surface__2010_ VARCHAR,
grand_cru VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the vineyard surface (2010) with grand cru being bienvenues-b tard-montrachet
| SELECT vineyard_surface__2010_ FROM table_13981938_1 WHERE grand_cru = "Bienvenues-Bâtard-Montrachet" | sql_create_context |
CREATE TABLE table_19018191_5 (
nat VARCHAR,
total_apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the nat for total apps for 27
| SELECT nat FROM table_19018191_5 WHERE total_apps = 27 | sql_create_context |
CREATE TABLE table_78342 (
"Candidate" text,
"Money Raised, 2Q" text,
"Loans Received, 2Q" text,
"Money Spent, 2Q" text,
"Total Receipts" text,
"Cash On Hand" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the loans received for 2Q having t... | SELECT "Loans Received, 2Q" FROM table_78342 WHERE "Total Receipts" = '$25,328,694' | wikisql |
CREATE TABLE table_40568 (
"Rank" text,
"Route" text,
"Avg. Daily Flts" real,
"# of Airlines" real,
"Distance (km)" real,
"Market Share Leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Airlines have a total distance of 705 (km)?
| SELECT COUNT("# of Airlines") FROM table_40568 WHERE "Distance (km)" = '705' | wikisql |
CREATE TABLE table_203_98 (
id number,
"title" text,
"year" number,
"director" text,
"budget" text,
"gross (worldwide)" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which morgan creek film grossed the most money prior to 1994... | SELECT "title" FROM table_203_98 WHERE "year" < 1994 ORDER BY "gross (worldwide)" DESC LIMIT 1 | squall |
CREATE TABLE table_35822 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what city has a game of friendly and an opponent of tunisia?
| SELECT "City" FROM table_35822 WHERE "Type of game" = 'friendly' AND "Opponent" = 'tunisia' | wikisql |
CREATE TABLE table_41190 (
"City" text,
"Comprehension of Danish" text,
"Comprehension of Swedish" text,
"Comprehension of Norwegian" text,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Comprehension of Danish has an Average smaller... | SELECT "Comprehension of Danish" FROM table_41190 WHERE "Average" < '6.85' AND "Comprehension of Norwegian" = '4.13' | wikisql |
CREATE TABLE table_49620 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "No. 1" FROM table_49620 WHERE "No. 2" = 'john' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id nu... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiologyevent... | mimic_iii |
CREATE TABLE table_10874 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent of the match with an attendance larger than 59,000?
| SELECT "Opponent" FROM table_10874 WHERE "Attendance" > '59,000' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category 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 v... | SELECT COUNT(*) = 0 FROM course, course_offering, instructor, offering_instructor WHERE (NOT instructor.name LIKE '%Karie Slavik%' AND NOT instructor.name LIKE '%Stephen Rush%') AND course.course_id = course_offering.course_id AND course.department = 'MCDB' AND course.number = 310 AND offering_instructor.instructor_id ... | advising |
CREATE TABLE table_29652 (
"Week #" text,
"Theme" text,
"Song Choice" text,
"Original Artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Barreto's song choice when the theme was samba?
| SELECT "Song Choice" FROM table_29652 WHERE "Theme" = 'Samba' | wikisql |
CREATE TABLE table_21284653_1 (
municipal_status VARCHAR,
population_density VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the municipal status where the population density is 895.5?
| SELECT municipal_status FROM table_21284653_1 WHERE population_density = "895.5" | sql_create_context |
CREATE TABLE table_60444 (
"Year" real,
"Delegate" text,
"Hometown" text,
"Placement in Miss Universe" text,
"Other awards" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Placement in Miss Universe has a Delegate of janine mari raymundo tugono... | SELECT "Placement in Miss Universe" FROM table_60444 WHERE "Delegate" = 'janine mari raymundo tugonon' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | SELECT Id AS "post_link", LENGTH(Body) * 1.0 / Score AS "letters_per_upvote" FROM Posts WHERE OwnerUserId = '##user##' AND Score > 0 ORDER BY 2 | sede |
CREATE TABLE table_204_631 (
id number,
"#" number,
"title" text,
"english translation" text,
"original album" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of songs that were also on the bintang di surga album... | SELECT COUNT("title") FROM table_204_631 WHERE "original album" = 'bintang di surga' | squall |
CREATE TABLE lessons (
lesson_id number,
customer_id number,
lesson_status_code text,
staff_id number,
vehicle_id number,
lesson_date time,
lesson_time text,
price number
)
CREATE TABLE customers (
customer_id number,
customer_address_id number,
customer_status_code text,
... | SELECT date_became_customer FROM customers WHERE first_name = "Carole" AND last_name = "Bernhard" | spider |
CREATE TABLE table_9771 (
"Episode #" text,
"Original airdate (UK)" text,
"Episode title" text,
"Doctor Who episode" text,
"Webcast link" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Original airdate (UK) has a Doctor Who episode of ' the do... | SELECT "Original airdate (UK)" FROM table_9771 WHERE "Doctor Who episode" = ' the doctor dances ' | wikisql |
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,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | 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_204_783 (
id number,
"position" text,
"player" text,
"free agency\ntag" text,
"date signed" text,
"2013 team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players play cb or og ?
| SELECT COUNT("player") FROM table_204_783 WHERE "position" IN ('cb', 'og') | squall |
CREATE TABLE table_14589 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the place for south africa and retief goosen
| SELECT "Place" FROM table_14589 WHERE "Country" = 'south africa' AND "Player" = 'retief goosen' | wikisql |
CREATE TABLE table_name_6 (
opponents VARCHAR,
partner VARCHAR,
outcome VARCHAR,
surface VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the Opponents in the match on a Hard Surface with Catherine Suire as Partner and Outcome of runner-up?
| SELECT opponents FROM table_name_6 WHERE outcome = "runner-up" AND surface = "hard" AND partner = "catherine suire" | sql_create_context |
CREATE TABLE table_32427 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tires" text,
"Drivers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the engine for the Machinists Union Racing team?
| SELECT "Engine" FROM table_32427 WHERE "Team" = 'machinists union racing' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT c.Id AS "comment_link", u.DisplayName FROM Comments AS c FULL OUTER JOIN Posts AS p ON c.PostId = p.Id JOIN Users AS u ON u.Id = p.OwnerUserId WHERE u.Id != '##Userid##' AND Text LIKE '##SearchString##' | sede |
CREATE TABLE table_name_1 (
genitive VARCHAR,
ergative VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the genitive for the ergative shen?
| SELECT genitive FROM table_name_1 WHERE ergative = "shen" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '口齿病(龋齿病)' AND jyjgzbb.JCZBDM = '559847' | css |
CREATE TABLE table_22997 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who directed the e... | SELECT "Directed by" FROM table_22997 WHERE "U.S. viewers (millions)" = '14.59' | wikisql |
CREATE TABLE table_22032 (
"Home (1st leg)" text,
"Home (2nd leg)" text,
"1st Leg" text,
"2nd leg" text,
"Aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If second leg is Newell's Old Boys, what name is first leg?
| SELECT "1st Leg" FROM table_22032 WHERE "Home (2nd leg)" = 'Newell''s Old Boys' | wikisql |
CREATE TABLE table_name_68 (
population INTEGER,
simplified VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sum of the population for the place simplified with an area smaller than 2,879?
| SELECT SUM(population) FROM table_name_68 WHERE simplified = "上杭县" AND area < 2 OFFSET 879 | sql_create_context |
CREATE TABLE table_name_47 (
school_club_team VARCHAR,
round VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has fewer than 4 rounds for Jan Van Breda Kolff?
| SELECT school_club_team FROM table_name_47 WHERE round < 4 AND player = "jan van breda kolff" | sql_create_context |
CREATE TABLE table_40704 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest week with a game attended by 60,233?
| SELECT MIN("Week") FROM table_40704 WHERE "Attendance" = '60,233' | wikisql |
CREATE TABLE station (
id number,
name text,
lat number,
long number,
dock_count number,
city text,
installation_date text
)
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_stat... | SELECT id, duration FROM trip ORDER BY duration DESC LIMIT 3 | spider |
CREATE TABLE table_52456 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attended the game at Busch Stadium (ii) when the time was 3:54?
| SELECT "Attendance" FROM table_52456 WHERE "Location" = 'busch stadium (ii)' AND "Time" = '3:54' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
me... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = '-bands') | eicu |
CREATE TABLE PersonFriend (
name VARCHAR,
friend VARCHAR
)
CREATE TABLE Person (
name VARCHAR,
gender VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of females who are friends with Zach
| SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female' | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-149686')) AND medication.routeadmin = 'iv push' ORDER BY medica... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.