instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE pilot (
pilot_id number,
name text,
age number
)
CREATE TABLE aircraft (
aircraft_id number,
aircraft text,
description text,
max_gross_weight text,
total_disk_area text,
max_disk_loading text
)
CREATE TABLE airport (
airport_id number,
airport_name text,
t... | SELECT AVG(T3.total_passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport AS T3 ON T2.airport_id = T3.airport_id WHERE T1.aircraft = "Robinson R-22" | spider |
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(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-43538')) AND medication.drugname IN ('lactated ringers injection 1,000... | eicu |
CREATE TABLE table_name_84 (
wins INTEGER,
byes INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most wins with 0 byes?
| SELECT MAX(wins) FROM table_name_84 WHERE byes > 0 | sql_create_context |
CREATE TABLE table_name_64 (
recopa_sudamericana_1996 VARCHAR,
copa_libertadores_1996 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the recoupa sudamericana 1996 of the team with a copa libertadores 1996 result of the round of 16?
| SELECT recopa_sudamericana_1996 FROM table_name_64 WHERE copa_libertadores_1996 = "round of 16" | sql_create_context |
CREATE TABLE table_name_38 (
isbn_uk VARCHAR,
author VARCHAR,
isbn_us VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ISBN UK, when Author is 'Dave Martin', and when ISBN US is 'N/A'?
| SELECT isbn_uk FROM table_name_38 WHERE author = "dave martin" AND isbn_us = "n/a" | sql_create_context |
CREATE TABLE table_name_62 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the Away team is essendon, what was the Date they played?
| SELECT date FROM table_name_62 WHERE away_team = "essendon" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_25129482_1 (
stadium VARCHAR,
manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which stadium is managed by Kari Martonen?
| SELECT stadium FROM table_25129482_1 WHERE manager = "Kari Martonen" | sql_create_context |
CREATE TABLE table_name_10 (
type VARCHAR,
nat VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the type of POR?
| SELECT type FROM table_name_10 WHERE nat = "por" | sql_create_context |
CREATE TABLE table_name_42 (
points VARCHAR,
position VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Points have a Position larger than 3, and a Played smaller than 14?
| SELECT COUNT(points) FROM table_name_42 WHERE position > 3 AND played < 14 | sql_create_context |
CREATE TABLE table_40141 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of laps when the grid number is 9?
| SELECT AVG("Laps") FROM table_40141 WHERE "Grid" = '9' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
... | SELECT Id AS "post_link", Score, ViewCount AS Views FROM Posts WHERE Body LIKE '% howtoubuntu.org %' AND ClosedDate IS NULL ORDER BY Views DESC | sede |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDi... | SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS "answers_with_images" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND Body LIKE '%<img%' GROUP BY Users.Id, DisplayName ORDER BY 'answers_with_images' DESC LIMIT 50 | sede |
CREATE TABLE table_54620 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game where Ottawa was the home team and A... | SELECT "Date" FROM table_54620 WHERE "Visitor" = 'atlanta' AND "Home" = 'ottawa' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT gwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9886124' GROUP BY gwyjzb.MED_ORG_DEPT_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI... | css |
CREATE TABLE table_16522 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest attendance at a game played by St. Johnstone?
| SELECT MAX("Highest") FROM table_16522 WHERE "Team" = 'St. Johnstone' | wikisql |
CREATE TABLE table_71923 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is rank of the year 1956?
| SELECT "Rank" FROM table_71923 WHERE "Year" = '1956' | wikisql |
CREATE TABLE table_23133482_1 (
sets_w_l VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are Ken Rosewall's sets w-l?
| SELECT sets_w_l FROM table_23133482_1 WHERE player = "Ken Rosewall" | sql_create_context |
CREATE TABLE table_62805 (
"Time" text,
"Show Name" text,
"Local/Networked" text,
"Ad Freq" text,
"News Freq" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the news frequency for the show Locker Room?
| SELECT "News Freq" FROM table_62805 WHERE "Show Name" = 'locker room' | wikisql |
CREATE TABLE table_78008 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the report on 20 may
| SELECT "Report" FROM table_78008 WHERE "Date" = '20 may' | wikisql |
CREATE TABLE table_12059 (
"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 home field of the South Melbourne te... | SELECT "Venue" FROM table_12059 WHERE "Home team" = 'south melbourne' | wikisql |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
birth_date text,
birth_place text
)
CREATE TABLE body_builder (
body_builder_id number,
people_id number,
snatch number,
clean_jerk number,
total number
)
-- Using valid SQLite, answer the fol... | SELECT birth_place FROM people GROUP BY birth_place ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | SELECT COUNT(*) AS "minecraft_post_count" FROM Posts WHERE Tags LIKE '%minecraft%' | sede |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptio... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23002) AND microbiologyevents.spec_type_desc = 'fluid wound' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = ... | mimic_iii |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHA... | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY Document_Date | nvbench |
CREATE TABLE table_name_15 (
school_club_team VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What School or Club team has an overall score of 21?
| SELECT school_club_team FROM table_name_15 WHERE overall = 21 | sql_create_context |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
-- Using valid SQLite, answer the following que... | SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY Nominee | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE i... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'bronchodilator - nebulized') AS t1 JOIN (SEL... | eicu |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
... | SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY COUNT(Manager_Name) | nvbench |
CREATE TABLE table_name_46 (
record VARCHAR,
opponent VARCHAR,
game VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game with a game number greater than 7 at boston garden with the providence steam rollers a... | SELECT record FROM table_name_46 WHERE game > 7 AND location = "boston garden" AND opponent = "providence steam rollers" | sql_create_context |
CREATE TABLE table_name_93 (
college VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did Leon Perry attend?
| SELECT college FROM table_name_93 WHERE player = "leon perry" | sql_create_context |
CREATE TABLE table_18424435_5 (
us_air_date VARCHAR,
canadian_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which air dates have 1.229 canadian viewers (millions)?
| SELECT us_air_date FROM table_18424435_5 WHERE canadian_viewers__million_ = "1.229" | sql_create_context |
CREATE TABLE table_name_25 (
loss VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who lost that has a score of w 4-3?
| SELECT loss FROM table_name_25 WHERE score = "w 4-3" | sql_create_context |
CREATE TABLE table_24154 (
"Year" real,
"Tournaments played" real,
"Cuts made*" real,
"Wins" real,
"2nd" real,
"3rd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ( $ )" real,
"Money list rank" real,
"Scoring average" text,
"Scoring rank" real
)
-- Using valid SQL... | SELECT MAX("Top 10s") FROM table_24154 WHERE "Best finish" = '2' | wikisql |
CREATE TABLE table_14208 (
"Draw" real,
"Artist" text,
"Song" text,
"Composer - Lyricist" text,
"Points" real,
"Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the song that has 17 points?
| SELECT "Song" FROM table_14208 WHERE "Points" = '17' | wikisql |
CREATE TABLE table_76505 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who manufactured grid 11?
| SELECT "Manufacturer" FROM table_76505 WHERE "Grid" = '11' | wikisql |
CREATE TABLE table_61929 (
"Athlete" text,
"Country" text,
"Run 1" real,
"Run 2" real,
"Run 3" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest run 2 of athlete eric neilson, who has a run 3 larger than 55.97?
| SELECT MAX("Run 2") FROM table_61929 WHERE "Athlete" = 'eric neilson' AND "Run 3" > '55.97' | wikisql |
CREATE TABLE table_18852 (
"Distribution" text,
"Compile time buffer checks" text,
"Mandatory access control" text,
"Software executable space protection" text,
"grsecurity" text,
"RSBAC" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the... | SELECT "Distribution" FROM table_18852 WHERE "grsecurity" = 'No' | wikisql |
CREATE TABLE table_53112 (
"Name" text,
"Actual version" text,
"System" text,
"Platform" text,
"License" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which System has an Actual Version 9.0?
| SELECT "System" FROM table_53112 WHERE "Actual version" = '9.0' | wikisql |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6462423' AND qtb.IN_HOSP_DATE BETWEEN '2003-01-10' AND '2006-09-27' AND qtb.INSURED_STS = '未就业' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6462423' AND gyb.IN_HOSP_DATE BETWEEN '2003-01-10' AND '2006-09-27' AND gyb.INSURED_STS = '未就业' UNION SELECT COU... | css |
CREATE TABLE table_69054 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the mixed doubles the same year that Andre... | SELECT "Mixed doubles" FROM table_69054 WHERE "Men's singles" = 'andrew downes' | 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_labitems (
row_id number,
itemid number,
label te... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94956) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2105-06' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_48 (
race VARCHAR,
pole_position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner when Niki Lauda held pole position?
| SELECT race AS Winner FROM table_name_48 WHERE pole_position = "niki lauda" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT JZLSH FROM jybgb WHERE BGDH = '60691424102' | css |
CREATE TABLE table_55797 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Constructor has a Grid less than 17, Laps under 52, and Olivier Panis as the Driver?
| SELECT "Constructor" FROM table_55797 WHERE "Grid" < '17' AND "Laps" < '52' AND "Driver" = 'olivier panis' | wikisql |
CREATE TABLE table_66873 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text,
"Note" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the note for catalog of 32xa-106
| SELECT "Note" FROM table_66873 WHERE "Catalog" = '32xa-106' | wikisql |
CREATE TABLE table_14094 (
"Club" text,
"League/Division" text,
"Home Ground" text,
"Location" text,
"Position in 2012-13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the position in 2012-13 is 13th, third division what is the location?
| SELECT "Location" FROM table_14094 WHERE "Position in 2012-13" = '13th, third division' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare (
fare_id int,
from_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND ... | atis |
CREATE TABLE table_22917458_15 (
winner VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Stage 1 winner?
| SELECT winner FROM table_22917458_15 WHERE stage = 1 | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | SELECT CreationDate AS Date, PostId AS "post_link" FROM Votes WHERE UserId = @UserId AND VoteTypeId = 6 ORDER BY CreationDate DESC | sede |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents... | 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 = 83901)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'r pleural #2' AND ... | mimic_iii |
CREATE TABLE table_203_633 (
id number,
"title" text,
"year" number,
"platform" text,
"developer" text,
"publisher" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the number of games available on playstation portable ?
| SELECT COUNT("title") FROM table_203_633 WHERE "platform" = 'playstation portable' | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Hematocrit, Calculated" | mimicsql_data |
CREATE TABLE table_70878 (
"Title" text,
"Studio" text,
"Role" text,
"Leading lady" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the leading lady in The Lonely Trail?
| SELECT "Leading lady" FROM table_70878 WHERE "Title" = 'the lonely trail' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '90180222' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2021-06-07') | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-11591') AND NOT patient.unitdischarg... | eicu |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "TP" | 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 CloseAsOffTopicReasonTypes (
Id number,
IsUniversal... | SELECT Question.Id, Question.Score, Question.ViewCount, Question.OwnerUserId FROM Posts AS "Question" WHERE Question.PostTypeId = 1 AND (Question.Id = 20047348 OR Question.Id = 10377228) | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admityear >= "2177" | mimicsql_data |
CREATE TABLE table_59968 (
"Geelong FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Against has more than 11 wins, and a Geelong FL of st josephs?
| SELECT MIN("Against") FROM table_59968 WHERE "Wins" > '11' AND "Geelong FL" = 'st josephs' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 (
row_id number,
... | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fx dorsal ... | mimic_iii |
CREATE TABLE table_name_13 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was home team South Melbourne's opponent?
| SELECT away_team FROM table_name_13 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
category text,
result text
)
CREATE TABLE movie (
movie_id number,
title text,
year number,
director text,
budget_million number,
gross_worldwide number... | SELECT COUNT(DISTINCT director) FROM movie | spider |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Year, COUNT(Year) FROM wine WHERE Price > 100 ORDER BY COUNT(Year) | nvbench |
CREATE TABLE table_31829 (
"Time" text,
"Name" text,
"Nationality" text,
"Date" text,
"Event/Place" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did someone run a 61:32
| SELECT "Event/Place" FROM table_31829 WHERE "Time" = '61:32' | wikisql |
CREATE TABLE table_name_6 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is Record of 16 16 taken?
| SELECT date FROM table_name_6 WHERE record = "16–16" | sql_create_context |
CREATE TABLE table_30083499_1 (
coefficient VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the 2010 clausura tournament?
| SELECT coefficient FROM table_30083499_1 WHERE tournament = "2010 Clausura" | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM 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 = '48404711' | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "29767" | mimicsql_data |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Student... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) | nvbench |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158338')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutp... | eicu |
CREATE TABLE table_204_574 (
id number,
"year" number,
"title" text,
"peak chart positions\nswe" number,
"peak chart positions\nswi" number,
"peak chart positions\nuk" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was t... | SELECT "year" FROM table_204_574 WHERE NOT "peak chart positions\nswe" IS NULL | squall |
CREATE TABLE table_57304 (
"city" text,
"position" real,
"Event" text,
"year" real,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years did he play in santiago de compostela?
| SELECT SUM("year") FROM table_57304 WHERE "city" = 'santiago de compostela' | wikisql |
CREATE TABLE table_2279 (
"Constituency" text,
"Electorate" real,
"s Spoilt vote" real,
"Total poll (%)" text,
"For (%)" text,
"Against (%)" text,
"\u00b1 Yes side 2008 (%)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 60,254 (58.0) i... | SELECT "For (%)" FROM table_2279 WHERE "Total poll (%)" = '60,254 (58.0)' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate ... | SELECT 'postid' AS "post_link", Id AS "suggested_edit_link", Comment, CreationDate, RejectionDate FROM SuggestedEdits WHERE Comment LIKE '% %' | sede |
CREATE TABLE table_10716893_3 (
network VARCHAR,
lap_by_lap VARCHAR,
host VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network has Marty Reid as host and lap-by-lap broadcaster?
| SELECT network FROM table_10716893_3 WHERE lap_by_lap = "Marty Reid" AND host = "Marty Reid" | sql_create_context |
CREATE TABLE table_73572 (
"Rank by average" real,
"Place" real,
"Couple" text,
"Number Of Dances" real,
"Total Points Earned" real,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of dances total number if the averag... | SELECT COUNT("Number Of Dances") FROM table_73572 WHERE "Average" = '22.3' | wikisql |
CREATE TABLE table_18850 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" real,
"Jockey" text,
"Winner/2nd" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the distance of ... | SELECT "Distance" FROM table_18850 WHERE "Group" = 'G3' | wikisql |
CREATE TABLE table_29669 (
"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.
-- Who was the original artist of the song choice 'Sozinho'?
| SELECT "Original Artist" FROM table_29669 WHERE "Song Choice" = 'Sozinho' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
Ta... | SELECT * FROM Users WHERE Location LIKE '%##location##%' AND Reputation >= 100 ORDER BY Reputation DESC LIMIT 100 | sede |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '20186568174' | css |
CREATE TABLE table_name_82 (
team VARCHAR,
winner VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team of Winner Mark Skaife in ATCC Round 7?
| SELECT team FROM table_name_82 WHERE winner = "mark skaife" AND series = "atcc round 7" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear >= "2144" | mimicsql_data |
CREATE TABLE table_52749 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which surface has a Score of 6 4, 6 2?
| SELECT "Surface" FROM table_52749 WHERE "Score" = '6–4, 6–2' | wikisql |
CREATE TABLE table_name_51 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Winnipeg Jets record?
| SELECT record FROM table_name_51 WHERE opponent = "winnipeg jets" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Bryant Johnson" | mimicsql_data |
CREATE TABLE table_name_32 (
pick INTEGER,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average pick number for Washington State?
| SELECT AVG(pick) FROM table_name_32 WHERE school = "washington state" | sql_create_context |
CREATE TABLE table_24518475_1 (
depth VARCHAR,
time__utc_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the depth of the aftershock at 18:00:22?
| SELECT depth FROM table_24518475_1 WHERE time__utc_ = "18:00:22" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
val... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73913) ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '魏浩邈' AND t_kc21.MED_SER_ORG_NO = '5236324') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE table_8083 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Record, when Method is KO, and when Opponent is Rich Guerin?
| SELECT "Record" FROM table_8083 WHERE "Method" = 'ko' AND "Opponent" = 'rich guerin' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
X... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '30218340' AND hz_info.YLJGDM = '0208580' AND NOT zyjzjlb.JZKSMC LIKE '%医学科%' | css |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '9085196' AND JZKSRQ BETWEEN '2013-03-19' AND '2013-09-25' AND TXBZ > 0 | css |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | SELECT Users.DisplayName, manager, COUNT(*) FROM Comments JOIN Users ON Comments.UserId = Users.Id JOIN Posts ON Comments.PostId = Posts.Id JOIN Users AS my ON my.Id = '##UserID##' LEFT JOIN (SELECT 'mgr' AS manager, Id FROM Users JOIN (SELECT DisplayName, MAX(Reputation) AS reputation FROM Users WHERE DisplayName IN (... | sede |
CREATE TABLE table_57310 (
"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 away team has a score of 17.4 (106)?
| SELECT "Away team" FROM table_57310 WHERE "Away team score" = '17.4 (106)' | wikisql |
CREATE TABLE table_54004 (
"Player" text,
"Pos." text,
"From" real,
"School/Country" text,
"Rebs" real,
"Asts" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest of a player with asts fewer than 0?
| SELECT MAX("From") FROM table_54004 WHERE "Asts" < '0' | wikisql |
CREATE TABLE table_54658 (
"Name" text,
"Scotland career" text,
"Caps" real,
"Goals" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the goal low with caps less than 38 and an average less than 1.083?
| SELECT MIN("Goals") FROM table_54658 WHERE "Caps" < '38' AND "Average" < '1.083' | wikisql |
CREATE TABLE table_47413 (
"Circuit" text,
"Location" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Winner, when Pole Position is Ben Spies, and when Date is Elkhart ... | SELECT "Winner" FROM table_47413 WHERE "Pole Position" = 'ben spies' AND "Date" = 'elkhart lake, wisconsin' | wikisql |
CREATE TABLE table_name_88 (
place VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place of the half marathon Event?
| SELECT place FROM table_name_88 WHERE event = "half marathon" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.