instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_7 (
stage VARCHAR,
team_classification VARCHAR,
points_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which stage corresponds to Banesto and Tony Rominger?
| SELECT stage FROM table_name_7 WHERE team_classification = "banesto" AND points_classification = "tony rominger" | sql_create_context |
CREATE TABLE table_18893428_1 (
report VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times did Charles Jarrott report?
| SELECT COUNT(report) FROM table_18893428_1 WHERE driver = "Charles Jarrott" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-20205') AND NOT patient.unitdischargetime IS NU... | eicu |
CREATE TABLE procedures (
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 WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.admityear < "2145" | mimicsql_data |
CREATE TABLE table_name_67 (
home VARCHAR,
attendance VARCHAR,
away VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team for the game with Platense as the away team and attendance under 529?
| SELECT home FROM table_name_67 WHERE attendance < 529 AND away = "platense" | sql_create_context |
CREATE TABLE table_204_26 (
id number,
"name" text,
"position" text,
"birth date/age at start of campaign" text,
"games in campaign" text,
"club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the average age of the grasshoppers ?
| SELECT AVG("birth date/age at start of campaign") FROM table_204_26 WHERE "club" = 'grasshoppers' | squall |
CREATE TABLE table_204_299 (
id number,
"name of place" text,
"number of counties" number,
"principal county" text,
"lower zip code" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- does pulaski county have more cities beginning with the letter a th... | SELECT (SELECT COUNT(*) FROM table_204_299 WHERE "principal county" = 'pulaski county') > (SELECT COUNT(*) FROM table_204_299 WHERE "principal county" = 'montgomery county') | squall |
CREATE TABLE table_42222 (
"Former kingdom" text,
"Province" text,
"Hangul" text,
"Hanja" text,
"Capital" text,
"Modern equivalent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capital of the province with in Hangul?
| SELECT "Capital" FROM table_42222 WHERE "Hangul" = '양주' | wikisql |
CREATE TABLE table_13133 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Total has a Player of todd hamilton, and a To par smaller than 15?
| SELECT COUNT("Total") FROM table_13133 WHERE "Player" = 'todd hamilton' AND "To par" < '15' | wikisql |
CREATE TABLE table_69109 (
"Match" text,
"Date" text,
"Location" text,
"Lineup" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the London 2012 Women's Olympic Football Tournament?
| SELECT "Result" FROM table_69109 WHERE "Location" = 'london 2012 women''s olympic football tournament' | wikisql |
CREATE TABLE table_1245148_1 (
location VARCHAR,
year_opened VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the track that opened in 1950?
| SELECT location FROM table_1245148_1 WHERE year_opened = 1950 | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '鲁同济' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 8376.61) | css |
CREATE TABLE table_name_24 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the venue that hosted Carlton as the away team?
| SELECT venue FROM table_name_24 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE table_2985714_2 (
_number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum overall number?
| SELECT MAX(_number) FROM table_2985714_2 | sql_create_context |
CREATE TABLE table_57584 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date with Ellis as the decision and St. Louis as the visitor?
| SELECT "Date" FROM table_57584 WHERE "Decision" = 'ellis' AND "Visitor" = 'st. louis' | wikisql |
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amo... | SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Amount_Payment DESC | nvbench |
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
... | SELECT OwnerUserId AS "user_link", OwnerUserId, SUM(LENGTH(Body)) AS totalLen, SUM(LENGTH(Body) - LENGTH(REPLACE(LOWER(Body), '1', ''))) AS "1", SUM(LENGTH(Body) - LENGTH(REPLACE(LOWER(Body), '2', ''))) AS "2", SUM(LENGTH(Body) - LENGTH(REPLACE(LOWER(Body), '3', ''))) AS "3", SUM(LENGTH(Body) - LENGTH(REPLACE(LOWER(Bod... | sede |
CREATE TABLE table_1046454_1 (
league VARCHAR,
regular_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the league where regular season is 2nd, northwest
| SELECT league FROM table_1046454_1 WHERE regular_season = "2nd, Northwest" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Dermatitis NOS" | mimicsql_data |
CREATE TABLE table_64875 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank is Bulgaria with less than 3 silver and more than 1 bronze?
| SELECT "Rank" FROM table_64875 WHERE "Silver" < '3' AND "Bronze" > '1' AND "Nation" = 'bulgaria' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_name_27 (
away_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In Tie #19, what was the name of the away team?
| SELECT away_team FROM table_name_27 WHERE tie_no = "19" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
fi... | 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 = 'hx of bladder mali... | mimic_iii |
CREATE TABLE table_19788 (
"Round" real,
"Choice" real,
"Player" text,
"Position" text,
"Height" text,
"Weight" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did steve justice attend?
| SELECT "College" FROM table_19788 WHERE "Player" = 'Steve Justice' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.itemid = "51259" | mimicsql_data |
CREATE TABLE table_203_353 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many songs were produced by chaos ?
| SELECT COUNT("title") FROM table_203_353 WHERE "producer(s)" = 'chaos' | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.diagnosis FROM demographic WHERE demographic.subject_id = "92796" | mimicsql_data |
CREATE TABLE table_79809 (
"Club" text,
"Manager" text,
"Captain" text,
"Manufacturer" text,
"Sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which club is Ledley King a captain?
| SELECT "Club" FROM table_79809 WHERE "Captain" = 'ledley king' | wikisql |
CREATE TABLE phone (
Memory_in_G VARCHAR,
Carrier VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the memories and carriers of phones?
| SELECT Memory_in_G, Carrier FROM phone | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "RUQ PAIN" | mimicsql_data |
CREATE TABLE table_name_51 (
first_class_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What first class team does sanath jayasuriya play for?
| SELECT first_class_team FROM table_name_51 WHERE player = "sanath jayasuriya" | sql_create_context |
CREATE TABLE table_286271_1 (
election VARCHAR,
_percentage_of_popular_vote VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the election for the percent of popular vote being 4.48%
| SELECT election FROM table_286271_1 WHERE _percentage_of_popular_vote = "4.48%" | sql_create_context |
CREATE TABLE table_66090 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the location of Game 4?
| SELECT "Location/Attendance" FROM table_66090 WHERE "Game" = '4' | wikisql |
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory distress' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1) - (SELECT C... | eicu |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM jybgb WHERE jybgb.JZLSH = '48646598839' | css |
CREATE TABLE procedures (
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.dob_year < "2123" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREA... | SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code | nvbench |
CREATE TABLE table_46958 (
"Squad No." real,
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Using valid SQLite, answe... | SELECT "League Cup Apps" FROM table_46958 WHERE "Position" = 'mf' AND "League Goals" > '3' AND "Total Apps" = '30 (2)' | wikisql |
CREATE TABLE table_name_37 (
year INTEGER,
weight_class__kg_ VARCHAR,
event VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year that has fila world championships as the event, with toledo, united states as the venue... | SELECT MAX(year) FROM table_name_37 WHERE event = "fila world championships" AND venue = "toledo, united states" AND weight_class__kg_ < 97 | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Ureteral catheterization" | mimicsql_data |
CREATE TABLE table_16072430_1 (
viewers VARCHAR,
share VARCHAR,
weekly_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of viewers where the share is 7 and the week rank is 64?
| SELECT COUNT(viewers) FROM table_16072430_1 WHERE share = 7 AND weekly_rank = "64" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "ABDOMINAL ABSCESS" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antic... | eicu |
CREATE TABLE table_22879323_10 (
high_points VARCHAR,
high_rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the high points when rebounds were Terrence Williams (8)?
| SELECT high_points FROM table_22879323_10 WHERE high_rebounds = "Terrence Williams (8)" | sql_create_context |
CREATE TABLE table_25800134_12 (
director VARCHAR,
airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people directed the episode that aired on February 5, 1968?
| SELECT COUNT(director) FROM table_25800134_12 WHERE airdate = "February 5, 1968" | sql_create_context |
CREATE TABLE table_72005 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total of Goals Scored with Poin... | SELECT SUM("Goals Scored") FROM table_72005 WHERE "Points" < '27' AND "Team" = 'c.d. atlético balboa' | wikisql |
CREATE TABLE table_204_698 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how old was pierre vallieres before he died ?
| SELECT "lifetime" - "lifetime" FROM table_204_698 WHERE "name" = 'pierre vallieres' | squall |
CREATE TABLE table_23316034_23 (
dismissals VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of dismissals for adam gilchrist
| SELECT COUNT(dismissals) FROM table_23316034_23 WHERE player = "Adam Gilchrist" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | SELECT JCZBDM, JCZBMC, JCZBJGDX, JCZBJGDL, JCZBJGDW, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE BGDH = '26969338360' | css |
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
... | SELECT MIN(Age), MAX(Age), Major FROM Student GROUP BY Major | nvbench |
CREATE TABLE Addresses (
zip_postcode VARCHAR,
address_id VARCHAR
)
CREATE TABLE Student_Addresses (
address_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the id and zip code of the address with the highest monthly rental?
| SELECT T2.address_id, T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_6322 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the finish for the chip ganassi racing team that was later than 2010 and a Start of ... | SELECT "Finish" FROM table_6322 WHERE "Team" = 'chip ganassi racing' AND "Year" > '2010' AND "Start" = '17' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, 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 = 'cardioversion' AND DATETIME(treatment.tr... | eicu |
CREATE TABLE table_52907 (
"Ship" text,
"Date Commissioned" real,
"Gross Tonnage" real,
"Propulsion" text,
"Material" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of gross tonnage for wood on date more tahn 1846 for comissioned and sh... | SELECT SUM("Gross Tonnage") FROM table_52907 WHERE "Material" = 'wood' AND "Date Commissioned" > '1846' AND "Ship" = 'esk' | wikisql |
CREATE TABLE table_16971 (
"Series #" real,
"Season #" 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 was the season number for the e... | SELECT MAX("Season #") FROM table_16971 WHERE "Series #" = '61' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = '-monos' O... | eicu |
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What a... | SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC | spider |
CREATE TABLE table_41437 (
"Date" text,
"Location" text,
"Country" text,
"Event" text,
"Winner" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date when Runner-up is Sof a Mul novich ( per )?
| SELECT "Date" FROM table_41437 WHERE "Runner-up" = 'sofía mulánovich ( per )' | 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 demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.name = "Elizabeth Bateman" | mimicsql_data |
CREATE TABLE table_46147 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which location did he win the Superbrawl 16 event?
| SELECT "Location" FROM table_46147 WHERE "Res." = 'win' AND "Event" = 'superbrawl 16' | wikisql |
CREATE TABLE table_name_43 (
pick__number INTEGER,
reg_gp VARCHAR,
rd__number VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Pick number that had a road number that was less than 6, featured Bob Dailey as a player,... | SELECT MAX(pick__number) FROM table_name_43 WHERE rd__number < 6 AND player = "bob dailey" AND reg_gp > 257 | sql_create_context |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
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 re... | SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE procedures (
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 WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "74" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.admityear >= "2187" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "27" AND diagnoses.long_title = "Hypoxemia" | mimicsql_data |
CREATE TABLE item (
title VARCHAR,
i_id VARCHAR
)
CREATE TABLE review (
i_id VARCHAR,
rating INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the titles of items that received both a rating higher than 8 and a rating below 5.
| SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5 | sql_create_context |
CREATE TABLE table_name_50 (
date VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What dates had matches at the venue Sabina Park?
| SELECT date FROM table_name_50 WHERE venue = "sabina park" | sql_create_context |
CREATE TABLE table_204_854 (
id number,
"#" number,
"wrestlers" text,
"reign" number,
"date" text,
"days\nheld" number,
"location" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of times that miracle man ... | SELECT COUNT(*) FROM table_204_854 WHERE "wrestlers" = 'miracle man' | squall |
CREATE TABLE table_name_76 (
opponent VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has an Attendance of bye?
| SELECT opponent FROM table_name_76 WHERE attendance = "bye" | sql_create_context |
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.admityear < "2138" AND diagnoses.long_title = "Unspecified schizophrenia, unspecified" | mimicsql_data |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE venue (
venueid int,
venue... | SELECT DISTINCT venueid FROM paper WHERE year = 2013 | scholar |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_21806 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real,
"2000 result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Kerry# was 199060, what was the percent... | SELECT "Kerry%" FROM table_21806 WHERE "Kerry#" = '199060' | wikisql |
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 WHERE demographic.gender = "F" AND demographic.dob_year < "2087" | mimicsql_data |
CREATE TABLE table_name_50 (
home_team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what team played on may 20 on the home side
| SELECT home_team FROM table_name_50 WHERE date = "may 20" | sql_create_context |
CREATE TABLE table_name_2 (
money___ INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE LOWEST MONEY WITH 74-74-76-74=298 SCORE?
| SELECT MIN(money___) AS $__ FROM table_name_2 WHERE score = 74 - 74 - 76 - 74 = 298 | sql_create_context |
CREATE TABLE table_40147 (
"Value" text,
"\u20ac equiv." text,
"Diameter" text,
"Weight" text,
"Composition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the coin that weighs 3 g made of?
| SELECT "Composition" FROM table_40147 WHERE "Weight" = '3 g' | wikisql |
CREATE TABLE table_21839208_4 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was their record when they played the stampeders?
| SELECT record FROM table_21839208_4 WHERE opponent = "Stampeders" | sql_create_context |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
... | SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_25 (
semi_finalists VARCHAR,
runner_up VARCHAR,
week_of VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the runner-up is listed as Gigi Fern ndez Natalia Zvereva and the week is 26 June 2 weeks, who are the semi finalists?
| SELECT semi_finalists FROM table_name_25 WHERE runner_up = "gigi fernández natalia zvereva" AND week_of = "26 june 2 weeks" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Neutral, School_ID FROM basketball_match | nvbench |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-6959'... | eicu |
CREATE TABLE table_name_50 (
score VARCHAR,
opponent_in_final VARCHAR,
outcome VARCHAR,
partnering VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Outcome is 'winner', when Partnering is 'Nicole Sewell', and when Opponent in Final ... | SELECT score FROM table_name_50 WHERE outcome = "winner" AND partnering = "nicole sewell" AND opponent_in_final = "victoria davies / kate warne-holland" | sql_create_context |
CREATE TABLE table_53662 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Tyre" text,
"Driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you say what was the entrant of maserati built item with a Tyre of p with a ch... | SELECT "Entrant" FROM table_53662 WHERE "Constructor" = 'maserati' AND "Tyre" = 'p' AND "Chassis" = '250f a6gcm' AND "Driver" = 'luigi villoresi' | wikisql |
CREATE TABLE table_204_927 (
id number,
"title" text,
"year" number,
"artist(s)" text,
"album" text,
"writer(s)" text,
"producer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of titles in 2011 ?
| SELECT COUNT("title") FROM table_204_927 WHERE "year" = 2011 | squall |
CREATE TABLE table_name_81 (
outcome VARCHAR,
partner VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Outcome in the Malaysia Open with Partner Yoo Sang-Hee?
| SELECT outcome FROM table_name_81 WHERE partner = "yoo sang-hee" AND venue = "malaysia open" | sql_create_context |
CREATE TABLE table_15060 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"Career Win-Loss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the win-loss when 2008 has a value of Q1 at Australian Open?
| SELECT "Career Win-Loss" FROM table_15060 WHERE "2008" = 'q1' AND "Tournament" = 'australian open' | wikisql |
CREATE TABLE table_55678 (
"Riding" text,
"Candidate" text,
"Gender" text,
"Residence" text,
"Occupation" text,
"Votes" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the occupation of the candidate that resides in Winds... | SELECT "Occupation" FROM table_55678 WHERE "Residence" = 'windsor junction' | wikisql |
CREATE TABLE table_name_10 (
eviction_result VARCHAR,
net_vote VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Eviction result has a Net vote of 31.86%?
| SELECT eviction_result FROM table_name_10 WHERE net_vote = "31.86%" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
ro... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ... | mimic_iii |
CREATE TABLE table_46947 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the opponent when the score is 7 5, 7 6 (8 6)?
| SELECT "Opponent" FROM table_46947 WHERE "Score" = '7–5, 7–6 (8–6)' | wikisql |
CREATE TABLE table_76069 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank with 0 bronze?
| SELECT AVG("Rank") FROM table_76069 WHERE "Bronze" < '0' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4076214' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-03-08' AND '2014-07-22' AND t_kc21.CLINIC_TYPE = '购药' | css |
CREATE TABLE table_34960 (
"Outcome" text,
"Year" text,
"Venue" text,
"Last opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Outcome of 13, and a Year of 2007 happened in what venue?
| SELECT "Venue" FROM table_34960 WHERE "Outcome" = '13' AND "Year" = '2007' | wikisql |
CREATE TABLE regions (
region_id number,
region_name text
)
CREATE TABLE job_history (
employee_id number,
start_date time,
end_date time,
job_id text,
department_id number
)
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone... | SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50 | spider |
CREATE TABLE table_204_258 (
id number,
"location" text,
"frequency" number,
"call sign" text,
"network" text,
"call sign meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many stations have frequencies between 88 and 92 ?
| SELECT COUNT(*) FROM table_204_258 WHERE "frequency" >= 88 AND "frequency" <= 92 | squall |
CREATE TABLE table_name_74 (
round INTEGER,
grand_prix VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest round with a Grand Prix of indian gp?
| SELECT MIN(round) FROM table_name_74 WHERE grand_prix = "indian gp" | sql_create_context |
CREATE TABLE table_name_93 (
year INTEGER,
playoffs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year is the lowest one when the playoffs did not qualify?
| SELECT MIN(year) FROM table_name_93 WHERE playoffs = "did not qualify" | sql_create_context |
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
product_characteristic_value VARCHAR(50)
)
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Ref_Colors (
color_code VARC... | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.