instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_55 (
location VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The event rip curl pro mademoiselle is in which location?
| SELECT location FROM table_name_55 WHERE event = "rip curl pro mademoiselle" | sql_create_context |
CREATE TABLE table_38753 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the crowd size for ... | SELECT COUNT("Crowd") FROM table_38753 WHERE "Home team" = 'melbourne' | wikisql |
CREATE TABLE table_22973 (
"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_22973 WHERE "Production code" = '10018' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "EMERGENCY" | mimicsql_data |
CREATE TABLE table_26974 (
"DS Division" text,
"Main Town" text,
"GN Divisions" real,
"Area (km 2 )" real,
"Sri Lankan Tamil" real,
"Sri Lankan Moors" real,
"Sinhalese" real,
"Indian Tamil" real,
"Other" real,
"Total" real,
"Population Density (/km 2 )" real
)
-- Using vali... | SELECT "Population Density (/km 2 )" FROM table_26974 WHERE "DS Division" = 'Manthai West' | wikisql |
CREATE TABLE table_70445 (
"Year" real,
"Champion" text,
"City" text,
"LLWS" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Years when the LLWS is 4th place, and when the City is Westport?
| SELECT COUNT("Year") FROM table_70445 WHERE "LLWS" = '4th place' AND "City" = 'westport' | wikisql |
CREATE TABLE table_name_76 (
iata VARCHAR,
icao VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is RJCM's IATA?
| SELECT iata FROM table_name_76 WHERE icao = "rjcm" | sql_create_context |
CREATE TABLE table_2534578_1 (
language VARCHAR,
reading VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the language score when the reading score was 94.47?
| SELECT language FROM table_2534578_1 WHERE reading = "94.47" | sql_create_context |
CREATE TABLE performance (
performance_id number,
date text,
host text,
location text,
attendance number
)
CREATE TABLE member_attendance (
member_id number,
performance_id number,
num_of_pieces number
)
CREATE TABLE member (
member_id text,
name text,
nationality text,
... | SELECT AVG(attendance) FROM performance | spider |
CREATE TABLE table_50346 (
"Callsign" text,
"Area served" text,
"Band" text,
"Freq currently" text,
"Purpose" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Purpose of the Callsign with a Freq currently of 4rph?
| SELECT "Purpose" FROM table_50346 WHERE "Freq currently" = '4rph' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT PERSON_NM, PERSON_SEX, PERSON_AGE, IDENTITY_CARD FROM t_kc21 WHERE MED_CLINIC_ID = '96681951393' | css |
CREATE TABLE table_23872 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Tar Heels points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games were against Furman?
| SELECT MAX("Game") FROM table_23872 WHERE "Opponent" = 'Furman' | wikisql |
CREATE TABLE table_51367 (
"Year" real,
"Property Taxes" text,
"Investment Earnings" text,
"Other Local Sources" text,
"State & Federal" text,
"Total Revenue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the investment earnings in a ... | SELECT "Investment Earnings" FROM table_51367 WHERE "Total Revenue" = '21,779,618' | wikisql |
CREATE TABLE table_name_41 (
jockey VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the jockey for the winning horse Helioptic?
| SELECT jockey FROM table_name_41 WHERE winner = "helioptic" | sql_create_context |
CREATE TABLE table_name_73 (
director VARCHAR,
nomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the director nominated for best actor in a leading role
| SELECT director FROM table_name_73 WHERE nomination = "best actor in a leading role" | sql_create_context |
CREATE TABLE table_name_60 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2004 value with 2r in 1994?
| SELECT 2004 FROM table_name_60 WHERE 1994 = "2r" | sql_create_context |
CREATE TABLE table_name_13 (
drawn INTEGER,
points VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the drawn amount for teams with points of 12 and played smaller than 10?
| SELECT AVG(drawn) FROM table_name_13 WHERE points = 12 AND played < 10 | sql_create_context |
CREATE TABLE table_42201 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks had the Green Bay packers as opponents?
| SELECT SUM("Week") FROM table_42201 WHERE "Opponent" = 'green bay packers' | wikisql |
CREATE TABLE table_name_7 (
total_foreign_born__1000_ INTEGER,
country VARCHAR,
born_in_other_eu_state__1000_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Foreign-born (1000) are from Sweden and born in some other EU state (1000) larger than 4... | SELECT SUM(total_foreign_born__1000_) FROM table_name_7 WHERE country = "sweden" AND born_in_other_eu_state__1000_ > 477 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH ... | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND j... | css |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY COUNT(Sex) DESC | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47... | eicu |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId... | SELECT COUNT(u.DisplayName) FROM Users AS u WHERE (SELECT COUNT(*) FROM Posts WHERE OwnerUserId = u.Id AND PostTypeId = 2) = 0 AND (SELECT COUNT(*) FROM Posts WHERE OwnerUserId = u.Id AND PostTypeId = 1) != 0 | sede |
CREATE TABLE table_23285805_8 (
high_assists VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has the high assists when the team is Oklahoma City?
| SELECT high_assists FROM table_23285805_8 WHERE team = "Oklahoma City" | sql_create_context |
CREATE TABLE table_19170 (
"Song title" text,
"Artist" text,
"Language" text,
"Decade" text,
"Genre" text,
"Exportable" text,
"Family Friendly" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What language for the glam genre?
| SELECT "Language" FROM table_19170 WHERE "Genre" = 'Glam' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT procedures.icd9_code, prescriptions.drug FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "10317" | mimicsql_data |
CREATE TABLE table_train_91 (
"id" int,
"mini_mental_state_examination_mmse" int,
"stroke" bool,
"rosen_modified_hachinski_ischemic_score" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- rosen modified hachinski ischemic score less than... | SELECT * FROM table_train_91 WHERE rosen_modified_hachinski_ischemic_score <= 4 | criteria2sql |
CREATE TABLE table_22985 (
"Name" text,
"Completions" real,
"Attempts" real,
"Completion %" text,
"Yards" real,
"Touchdowns" real,
"Interceptions" real,
"QB Rating" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest numbe... | SELECT MAX("Interceptions") FROM table_22985 | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDat... | SELECT t.TagName, YEAR(p.CreationDate), MONTH(p.CreationDate), COUNT(t.TagName) AS d FROM Tags AS t INNER JOIN PostTags AS pt ON t.Id = pt.TagId INNER JOIN Posts AS P ON p.Id = pt.PostId WHERE t.TagName = '##TagNam##' AND NOT p.ClosedDate IS NULL GROUP BY YEAR(p.CreationDate), MONTH(p.CreationDate), t.TagName ORDER BY ... | sede |
CREATE TABLE table_name_62 (
venue VARCHAR,
goal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue has a Goal of 4?
| SELECT venue FROM table_name_62 WHERE goal = 4 | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dob_year < "2085" | mimicsql_data |
CREATE TABLE table_76810 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average score for the player who is T5 in the United States?
| SELECT AVG("Score") FROM table_76810 WHERE "Place" = 't5' AND "Country" = 'united states' | wikisql |
CREATE TABLE table_15703 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest rank with poland as the nationality and a time greater than 55.34?
| SELECT MIN("Rank") FROM table_15703 WHERE "Nationality" = 'poland' AND "Time" > '55.34' | wikisql |
CREATE TABLE table_3814 (
"Sd" real,
"Rk" real,
"Player" text,
"Points" real,
"Points defending" text,
"Points won" real,
"New points" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's Kaia Kanepi's Sd?
| SELECT MIN("Sd") FROM table_3814 WHERE "Player" = 'Kaia Kanepi' | wikisql |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.route = "SC" | mimicsql_data |
CREATE TABLE addresses (
address_id text,
line_1 text,
line_2 text,
city_town text,
state_county text,
other_details text
)
CREATE TABLE performers_in_bookings (
order_id number,
performer_id number
)
CREATE TABLE bookings (
booking_id number,
customer_id number,
workshop_g... | SELECT marketing_region_descriptrion FROM marketing_regions WHERE marketing_region_name = "China" | spider |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END... | SELECT EMAIL, SALARY FROM employees | nvbench |
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 WHERE demographic.gender = "F" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" | mimicsql_data |
CREATE TABLE table_6061 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game took place April 6?
| SELECT "Game" FROM table_6061 WHERE "April" = '6' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | 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 = '027-106613')) AND lab.labname = 'tv' AND STRFTIME('%y-%m', lab.labresulttime) = '21... | eicu |
CREATE TABLE gwyjzb (
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 FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '88565682' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_name_70 (
home__1st_leg_ VARCHAR,
aggregate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team played their first leg at home with an aggregate score of 3-4?
| SELECT home__1st_leg_ FROM table_name_70 WHERE aggregate = "3-4" | sql_create_context |
CREATE TABLE table_25525 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 129 is the number in the series who is the writer... | SELECT "Written by" FROM table_25525 WHERE "No. in series" = '129' | wikisql |
CREATE TABLE table_name_69 (
category VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Category of the Rodez, France Tournament?
| SELECT category FROM table_name_69 WHERE tournament = "rodez, france" | sql_create_context |
CREATE TABLE table_24725951_1 (
episode VARCHAR,
celebrities VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode had celebrities Nick Hewer and Saira Khan in them?
| SELECT episode FROM table_24725951_1 WHERE celebrities = "Nick Hewer and Saira Khan" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC | nvbench |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Trnspl status-bne marrow" AND prescriptions.route = "IM" | mimicsql_data |
CREATE TABLE table_name_92 (
rating INTEGER,
rank__timeslot_ VARCHAR,
rank__night_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the rating when the rank (timeslot) is less than 3 and the rank (night) is less than 8?
| SELECT SUM(rating) FROM table_name_92 WHERE rank__timeslot_ < 3 AND rank__night_ < 8 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2139" AND lab.label = "Bilirubin, Indirect" | mimicsql_data |
CREATE TABLE table_name_70 (
points INTEGER,
entrant VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total points that an 1951 Entrant alfa romeo spa have?
| SELECT SUM(points) FROM table_name_70 WHERE entrant = "alfa romeo spa" AND year < 1951 | sql_create_context |
CREATE TABLE review (
name VARCHAR,
u_id VARCHAR
)
CREATE TABLE useracct (
name VARCHAR,
u_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of users who did not leave any review.
| SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review) | sql_create_context |
CREATE TABLE table_name_15 (
goals_scored VARCHAR,
points VARCHAR,
draws VARCHAR,
loses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of goals scored of the club with more than 3 draws, more than 1 loses, and less than 26 po... | SELECT COUNT(goals_scored) FROM table_name_15 WHERE draws > 3 AND loses > 1 AND points < 26 | sql_create_context |
CREATE TABLE table_23032 (
"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.
-- Name the title for... | SELECT "Title" FROM table_23032 WHERE "U.S. viewers (millions)" = '18.29' | wikisql |
CREATE TABLE table_name_29 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 2006 has 0-0 as the 2011?
| SELECT 2006 FROM table_name_29 WHERE 2011 = "0-0" | sql_create_context |
CREATE TABLE table_name_33 (
competition VARCHAR,
score VARCHAR,
opponents VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Competition has a Score of 0-1, and Opponents of pkns fc?
| SELECT competition FROM table_name_33 WHERE score = "0-1" AND opponents = "pkns fc" | sql_create_context |
CREATE TABLE table_25517718_3 (
extra_points INTEGER,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number of extra points for a left halfback?
| SELECT MIN(extra_points) FROM table_25517718_3 WHERE position = "Left halfback" | sql_create_context |
CREATE TABLE table_name_27 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue featured north melbourne as the away side?
| SELECT venue FROM table_name_27 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_16400 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest selection number for the saskatchewan roughriders team?
| SELECT MAX("Pick #") FROM table_16400 WHERE "CFL Team" = 'Saskatchewan Roughriders' | wikisql |
CREATE TABLE table_18012 (
"Release" text,
"Title" text,
"Windows" text,
"5th Gen" text,
"6th Gen" text,
"Handheld" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Was the release on April 8 available on Windows?
| SELECT "Windows" FROM table_18012 WHERE "Release" = 'April 8' | wikisql |
CREATE TABLE endowment (
donator_name VARCHAR,
amount INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List each donator name and the amount of endowment in descending order of the amount of endowment.
| SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_name_10 (
crew_chief VARCHAR,
team VARCHAR,
driver_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the crew chief of team Chip Ganassi Racing with Felix Sabates, which has Casey Mears as the driver?
| SELECT crew_chief FROM table_name_10 WHERE team = "chip ganassi racing with felix sabates" AND driver_s_ = "casey mears" | sql_create_context |
CREATE TABLE table_name_97 (
total INTEGER,
nation VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Total of kyrgyzstan with a Silver smaller than 0?
| SELECT AVG(total) FROM table_name_97 WHERE nation = "kyrgyzstan" AND silver < 0 | sql_create_context |
CREATE TABLE table_11964263_13 (
game INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the minimum game
| SELECT MIN(game) FROM table_11964263_13 | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE i... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE mzb (
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 JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '40200914' AND t_kc22.STA_DATE BETWEEN '2007-11-20' AND '2017-11-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '4... | css |
CREATE TABLE table_name_93 (
others VARCHAR,
fidesz VARCHAR,
jobbik VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage of others with a Fidesz of 62% and a Jobbik of 4%?
| SELECT others FROM table_name_93 WHERE fidesz = "62%" AND jobbik = "4%" | sql_create_context |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state tex... | SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE table_51420 (
"Player" text,
"Position" text,
"Tries" real,
"Goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of points that Tevita Vaikona scored when making more than 23 tries?
| SELECT MIN("Points") FROM table_51420 WHERE "Tries" > '23' AND "Player" = 'tevita vaikona' | wikisql |
CREATE TABLE table_68026 (
"Year" real,
"Result" text,
"Award" text,
"Category" text,
"Nominated work" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the category that has the people's choice awards?
| SELECT "Category" FROM table_68026 WHERE "Award" = 'people''s choice awards' | wikisql |
CREATE TABLE table_269888_1 (
no_of_s_barangay VARCHAR,
pop_density__per_km²_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of barangay for 205.4 density
| SELECT no_of_s_barangay FROM table_269888_1 WHERE pop_density__per_km²_ = "205.4" | 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 KH, KLX FROM zyjzjlb WHERE JZLSH = '28664417730' | css |
CREATE TABLE table_name_10 (
position_in_1998 VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position of the Slavia team in 1998?
| SELECT position_in_1998 FROM table_name_10 WHERE team = "slavia" | sql_create_context |
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 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 = '013-9305')) AND DATETIME(treatment.treatmenttime, 'start of year'... | eicu |
CREATE TABLE table_name_73 (
partner VARCHAR,
outcome VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Partner, when Outcome is Winner, and when Date is 12 October 2003?
| SELECT partner FROM table_name_73 WHERE outcome = "winner" AND date = "12 october 2003" | sql_create_context |
CREATE TABLE table_77613 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the city of license with frequency of Mhz of 90.3 fm
| SELECT "City of license" FROM table_77613 WHERE "Frequency MHz" = '90.3 fm' | wikisql |
CREATE TABLE table_name_67 (
score VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Spennymoor United as the away team?
| SELECT score FROM table_name_67 WHERE away_team = "spennymoor united" | 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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8871738' AND t_kc22.SOC_SRT_DIRE_NM = '米氮平片(薄膜衣)' | css |
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE customer (
customerid number,
firstname text,
lastname text,
company text,
address text,
city text,
state text,
country text,
postalcode text,
phone text,
fax text,
email text,
supportrepid n... | SELECT T1.lastname FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid GROUP BY T1.supportrepid HAVING COUNT(*) <= 20 | spider |
CREATE TABLE table_25688 (
"Episode Number" text,
"Title" text,
"Villains" text,
"Director" text,
"Writer" text,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the villains in 'the others'?
| SELECT "Villains" FROM table_25688 WHERE "Title" = 'The Others' | wikisql |
CREATE TABLE table_50163 (
"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.
-- What t... | SELECT "Team" FROM table_50163 WHERE "Location Attendance" = 'seattle center coliseum 12,591' | wikisql |
CREATE TABLE table_name_26 (
final_score VARCHAR,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score of the game at Texas Stadium?
| SELECT final_score FROM table_name_26 WHERE stadium = "texas stadium" | sql_create_context |
CREATE TABLE table_38452 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Record of 27-11-10?
| SELECT AVG("Game") FROM table_38452 WHERE "Record" = '27-11-10' | wikisql |
CREATE TABLE table_26375386_28 (
average VARCHAR,
number_of_dances VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every average when number of dances is 1?
| SELECT average FROM table_26375386_28 WHERE number_of_dances = 1 | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.name = "James Sloan" | mimicsql_data |
CREATE TABLE table_46974 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Year was the Game on September 26?
| SELECT SUM("Year") FROM table_46974 WHERE "Date" = 'september 26' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABL... | SELECT CreationDate, Id AS "comment_link" FROM Comments WHERE LOWER(Text) LIKE '%edited%' AND CreationDate >= '2019-01-01' ORDER BY LENGTH(Text) LIMIT 1000 | sede |
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 WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2092" | mimicsql_data |
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 Answers.Id AS "post_link", Answers.CreationDate AS "Answered Date", Questions.CreationDate AS "Asked Date", DATEDIFF(day, Questions.CreationDate, CreationDate) AS "Date Delta Days", Answers.Score FROM Posts AS Answers INNER JOIN Posts AS Questions ON Answers.PostTypeId = 2 AND Answers.OwnerUserId = '##UserId?895... | sede |
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE instruc... | SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance' | spider |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_17323092_6 (
location_attendance VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location and attendance for the Orlando team?
| SELECT location_attendance FROM table_17323092_6 WHERE team = "Orlando" | sql_create_context |
CREATE TABLE table_9646 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" real,
"React" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Mark, when Country is 'Russia', and when React is less than 0.165?
| SELECT COUNT("Mark") FROM table_9646 WHERE "Country" = 'russia' AND "React" < '0.165' | wikisql |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
... | SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_ID DESC | nvbench |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25312)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2104-12-27' | mimic_iii |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | SELECT 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 = '022-166510')) AND STRFTIME('%y-%m', lab.labresulttime) = '2101-12' ORDER BY lab.lab... | eicu |
CREATE TABLE table_63476 (
"District" real,
"Incumbent" text,
"2008 Status" text,
"Democratic" text,
"Republican" text,
"Green" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the 2008 Status of Rosa Delauro?
| SELECT "2008 Status" FROM table_63476 WHERE "Democratic" = 'rosa delauro' | wikisql |
CREATE TABLE table_48702 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the person that was... | SELECT "Replaced by" FROM table_48702 WHERE "Date of appointment" = '13 may 2009' | 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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.