instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "REPLACE" | mimicsql_data |
CREATE TABLE table_10419 (
"7:00 PM" text,
"8:00 PM" text,
"8:30 PM" text,
"9:00 PM" text,
"9:30 PM" text,
"10:00 PM" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 7:00 PM when the 8:00 PM is les parent?
| SELECT "7:00 PM" FROM table_10419 WHERE "8:00 PM" = 'les parent' | wikisql |
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 person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '褚丽佳' AND hz_info.YLJGDM = '0572536' AND txmzjzjlb.JZZDSM LIKE '%(%' UNION SELECT * FROM person_info JOIN hz... | css |
CREATE TABLE table_27877656_7 (
surface VARCHAR,
score VARCHAR,
edition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For edition is 2011 europe/africa group iiib and surface where score is 6 4, 6 1 please specify all the surface
| SELECT surface FROM table_27877656_7 WHERE score = "6–4, 6–1" AND edition = "2011 Europe/Africa Group IIIB" | sql_create_context |
CREATE TABLE table_69642 (
"Tournament" text,
"Date" text,
"Surface" text,
"Round" text,
"Opponent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the tournament for kathy horvath opponent
| SELECT "Tournament" FROM table_69642 WHERE "Opponent" = 'kathy horvath' | wikisql |
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 * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2674806' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-05-19' AND '2004-09-02' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2674806' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-05-19' AND '2004-09-02' AND t_kc21.MED_ORG_DEPT_CD = '3452' | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | SELECT * FROM (SELECT Posts.Id, TagName, Posts.Title, Posts.Body AS qBody, Posts.Score AS qScore, Answers.Body AS aBODY, Answers.Score AS aScore FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId INNER JOIN Posts AS Answers ON Answers.Id = Posts.AcceptedAnswerId WHE... | sede |
CREATE TABLE table_name_65 (
d_50 VARCHAR,
d_41 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the D 50 when the D 41 is d 41?
| SELECT d_50 FROM table_name_65 WHERE d_41 = "d 41" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "27" | mimicsql_data |
CREATE TABLE table_name_73 (
round3 INTEGER,
round4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest round3 when round4 is 37?
| SELECT MIN(round3) FROM table_name_73 WHERE round4 = 37 | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "51352" | mimicsql_data |
CREATE TABLE table_67240 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score for the August 25, 1996 match?
| SELECT "Score in the final" FROM table_67240 WHERE "Date" = 'august 25, 1996' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE labevents (
ro... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7698) AND prescriptions.drug = 'atorvastatin' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') | mimic_iii |
CREATE TABLE table_name_59 (
high_points VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the high points from a game of 30?
| SELECT high_points FROM table_name_59 WHERE game = 30 | sql_create_context |
CREATE TABLE table_74467 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the area for civil parish ballynoe and killasseragh
| SELECT "Area( acres )" FROM table_74467 WHERE "Civil parish" = 'Ballynoe' AND "Townland" = 'Killasseragh' | wikisql |
CREATE TABLE table_name_81 (
result VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the Best Actor in a Musical category?
| SELECT result FROM table_name_81 WHERE category = "best actor in a musical" | sql_create_context |
CREATE TABLE table_name_75 (
tournament VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had a score of 6 3, 7 6?
| SELECT tournament FROM table_name_75 WHERE score = "6–3, 7–6" | sql_create_context |
CREATE TABLE table_44086 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Streak" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the week number when they played on Dec. 19?
| SELECT COUNT("Week") FROM table_44086 WHERE "Date" = 'dec. 19' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "THYM25I" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_25377 (
"No." real,
"Player" text,
"Hometown" text,
"Class" text,
"Position" text,
"Height" text,
"Weight" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is every player with a height of 6-5?
| SELECT "Player" FROM table_25377 WHERE "Height" = '6-5' | wikisql |
CREATE TABLE table_name_31 (
points INTEGER,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What points average has a played greater than 20?
| SELECT AVG(points) FROM table_name_31 WHERE played > 20 | sql_create_context |
CREATE TABLE table_61223 (
"Event" text,
"Time" text,
"Date" text,
"Meet" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the 200m individual medley?
| SELECT "Date" FROM table_61223 WHERE "Event" = '200m individual medley' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6440) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND STRFTIME('%y-%m', labevents.charttime) >= '2102-12' ORDER BY labev... | mimic_iii |
CREATE TABLE table_221315_3 (
pilot VARCHAR,
max_altitude__miles_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the pilot of max altitude of 55.9 miles?
| SELECT pilot FROM table_221315_3 WHERE max_altitude__miles_ = "55.9" | sql_create_context |
CREATE TABLE table_5384 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least round number for Jon Olinger, who was picked before pick # 24?
| SELECT MIN("Round") FROM table_5384 WHERE "Name" = 'jon olinger' AND "Pick #" < '24' | wikisql |
CREATE TABLE table_2499 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many podium... | SELECT "Podiums" FROM table_2499 WHERE "Series" = 'Italian Formula Renault 2.0 Winter Series' | wikisql |
CREATE TABLE farm (
farm_id number,
year number,
total_horses number,
working_horses number,
total_cattle number,
oxen number,
bulls number,
cows number,
pigs number,
sheep_and_goats number
)
CREATE TABLE city (
city_id number,
official_name text,
status text,
ar... | SELECT AVG(working_horses) FROM farm WHERE total_horses > 5000 | spider |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_... | advising |
CREATE TABLE table_name_72 (
appointed_by VARCHAR,
presentation_of_credentials VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who appointed the representative that had a Presentation of Credentials on March 25, 1976?
| SELECT appointed_by FROM table_name_72 WHERE presentation_of_credentials = "march 25, 1976" | sql_create_context |
CREATE TABLE table_name_16 (
years VARCHAR,
free_or_pay VARCHAR,
transmission VARCHAR,
on_demand VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Years which have Transmission of digital satellite, an On demand of no, and a Free or pay of free... | SELECT years FROM table_name_16 WHERE transmission = "digital satellite" AND on_demand = "no" AND free_or_pay = "free + ppv" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '015-58787' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '015-58787' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE temperature (
city_id number,
jan number,
feb number,
mar number,
apr number,
jun number,
jul number,
aug number,
sep number,
oct number,
nov number,
dec number
)
CREATE TABLE match (
match_id number,
date text,
venue text,
score text,
re... | SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.mar < T2.jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city | spider |
CREATE TABLE table_24434 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Team" FROM table_24434 WHERE "Driver" = 'Ricky Rudd' | wikisql |
CREATE TABLE customer (
cust_name VARCHAR,
credit_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of customer who has the lowest credit score.
| SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 | sql_create_context |
CREATE TABLE table_204_107 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- number of gold medals earned by the netherlands and italy
| SELECT SUM("gold") FROM table_204_107 WHERE "nation" IN ('netherlands', 'italy') | squall |
CREATE TABLE table_15780049_8 (
high_points VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the high points for march 7
| SELECT high_points FROM table_15780049_8 WHERE date = "March 7" | sql_create_context |
CREATE TABLE table_55344 (
"Name" text,
"Date of Birth (Age)" text,
"Club" text,
"Caps" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club is associated with Hafiz Abu Sujad?
| SELECT "Club" FROM table_55344 WHERE "Name" = 'hafiz abu sujad' | wikisql |
CREATE TABLE table_name_92 (
local_position VARCHAR,
mission VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Local Position, when Mission is 'Paraguay'?
| SELECT local_position FROM table_name_92 WHERE mission = "paraguay" | sql_create_context |
CREATE TABLE table_1247 (
"No. in season" real,
"No. disc" 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.
-- What is the title for episode number 7 in the season?
| SELECT COUNT("Title") FROM table_1247 WHERE "No. in season" = '7' | wikisql |
CREATE TABLE table_79005 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE ... | SELECT MAX("Lost") FROM table_79005 WHERE "Drawn" = '11' AND "Team" = 'leek town' | wikisql |
CREATE TABLE table_name_67 (
score VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Away Team is 'Thame United'?
| SELECT score FROM table_name_67 WHERE away_team = "thame united" | sql_create_context |
CREATE TABLE table_24585 (
"Year" text,
"MAAC" text,
"Overall" text,
"Regular Season Results" text,
"MAAC Tournament Result" text,
"NCAA Seed" text,
"NCAA Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maac in the macc tou... | SELECT "MAAC" FROM table_24585 WHERE "MAAC Tournament Result" = 'Quarterfinals' | wikisql |
CREATE TABLE table_name_4 (
score VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the away team was West Ham United?
| SELECT score FROM table_name_4 WHERE away_team = "west ham united" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.icd9_code = "5783" | mimicsql_data |
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
)
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
-- U... | SELECT College_Location, COUNT(College_Location) FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID GROUP BY College_Location | nvbench |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | SELECT MIN(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 = 4684)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... | mimic_iii |
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '44236721' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2819.61) | css |
CREATE TABLE table_49551 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the report when the home team is new zealand breakers?
| SELECT "Report" FROM table_49551 WHERE "Home team" = 'new zealand breakers' | wikisql |
CREATE TABLE table_28578594_1 (
entrant VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the entrant for bruno sterzi
| SELECT entrant FROM table_28578594_1 WHERE driver = "Bruno Sterzi" | sql_create_context |
CREATE TABLE table_name_25 (
yards INTEGER,
solo VARCHAR,
sack VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many yards for the player with 1 solo tackle and over 0 sacks?
| SELECT MAX(yards) FROM table_name_25 WHERE solo = 1 AND sack > 0 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636') AND patient.unitdischargetime IS NUL... | eicu |
CREATE TABLE table_name_94 (
lead VARCHAR,
skip VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lead has a Skip of pavol pitonak?
| SELECT lead FROM table_name_94 WHERE skip = "pavol pitonak" | sql_create_context |
CREATE TABLE table_name_58 (
date VARCHAR,
goal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game that had a goal of 4?
| SELECT date FROM table_name_58 WHERE goal = 4 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'oxygen therapy (> 60%)' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '47624266393' | css |
CREATE TABLE table_59747 (
"A. Dyck" text,
"H. Rempel" text,
"R. Epp" text,
"J. Thiessen" text,
"J. J. Neufeld" text,
"Ed Zacharias" text,
"word meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which of the H. Rempel has J. J. Neufeld... | SELECT "H. Rempel" FROM table_59747 WHERE "J. J. Neufeld" = 'sajen' | wikisql |
CREATE TABLE table_23696862_6 (
name VARCHAR,
wsop_earnings VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whose WSOP earnings were $36,372?
| SELECT name FROM table_23696862_6 WHERE wsop_earnings = "$36,372" | sql_create_context |
CREATE TABLE table_name_75 (
attendance VARCHAR,
week INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance before week 1?
| SELECT COUNT(attendance) FROM table_name_75 WHERE week < 1 | sql_create_context |
CREATE TABLE table_19474 (
"Date Released" text,
"Polling institute" text,
"Socialist" text,
"Social Democratic" text,
"Peoples Party" text,
"Green-Communist" text,
"Left Bloc" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Social Democratic" FROM table_19474 WHERE "Left Bloc" = '5.5%' | wikisql |
CREATE TABLE table_204_961 (
id number,
"title" text,
"director" text,
"production" text,
"music" text,
"cast" text,
"release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many films were released ?
| SELECT COUNT("title") FROM table_204_961 | squall |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT School_ID, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_10236830_1 (
film_name VARCHAR,
director VARCHAR,
nomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What film did michaylo ilyenko make with best actor in a supporting role?
| SELECT film_name FROM table_10236830_1 WHERE director = "Michaylo Ilyenko" AND nomination = "Best Actor in a Supporting Role" | sql_create_context |
CREATE TABLE table_40275 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the margin of victory when the winning score was 14 (70-68-67=205)?
| SELECT "Margin of victory" FROM table_40275 WHERE "Winning score" = '–14 (70-68-67=205)' | wikisql |
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_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5802131' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-07-23' AND '2015-10-30' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 12 | css |
CREATE TABLE table_245801_1 (
duration__days_ VARCHAR,
crew VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the duration for vladimir vasyutin , alexander volkov
| SELECT COUNT(duration__days_) FROM table_245801_1 WHERE crew = "Vladimir Vasyutin , Alexander Volkov" | sql_create_context |
CREATE TABLE table_204_60 (
id number,
"sl no" number,
"constituency\nname" text,
"constituency\nnumber" number,
"member of legislative assembly" text,
"political party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which constituencies have on... | SELECT "constituency\nname" FROM table_204_60 WHERE "constituency\nnumber" = 1 | squall |
CREATE TABLE table_13567 (
"Year" real,
"Stage" real,
"Start of stage" text,
"Distance (km)" text,
"Category of climb" text,
"Stage winner" text,
"Yellow jersey" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Start of stage when ... | SELECT "Start of stage" FROM table_13567 WHERE "Stage winner" = 'bernard hinault' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND demographic.admityear < "2197" | mimicsql_data |
CREATE TABLE table_29811 (
"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 "Directed by" FROM table_29811 WHERE "Production code" = '227424' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb... | css |
CREATE TABLE table_name_79 (
birthplace VARCHAR,
jersey_number VARCHAR,
position VARCHAR,
height__cm_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the birthplace of the player who is 190 CM tall, plays the D position, and wears number 11?
| SELECT birthplace FROM table_name_79 WHERE position = "d" AND height__cm_ = 190 AND jersey_number = 11 | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%DHYGRACK%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE supplier_addresses (
supplier_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE customers (
customer_id number,
payment_method_code text,
customer_code text,
customer_name text,
customer_address text,
customer_phone text,
customer_email t... | SELECT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details | spider |
CREATE TABLE table_name_59 (
launch_vehicle VARCHAR,
institutional_authority VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the launch vehicle with Institutional authority of ndc
| SELECT launch_vehicle FROM table_name_59 WHERE institutional_authority = "ndc" | sql_create_context |
CREATE TABLE table_54735 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school did Paul Dawkins play for?
| SELECT "School/Club Team" FROM table_54735 WHERE "Player" = 'paul dawkins' | wikisql |
CREATE TABLE table_39638 (
"Episode #" real,
"Season #" real,
"Format #" text,
"Title" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season has q145 as its format?
| SELECT MIN("Season #") FROM table_39638 WHERE "Format #" = 'q145' | wikisql |
CREATE TABLE table_name_13 (
years VARCHAR,
decile VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years had the decile smaller than 8 in the area of southbrook?
| SELECT years FROM table_name_13 WHERE decile < 8 AND area = "southbrook" | sql_create_context |
CREATE TABLE table_634 (
"Season" real,
"Champion" text,
"Motorcycle" text,
"Wins" real,
"2nd pl." real,
"3rd pl." real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number for 3rd place for ducati xerox?
| SELECT COUNT("3rd pl.") FROM table_634 WHERE "Team" = 'Ducati Xerox' | wikisql |
CREATE TABLE table_26336060_19 (
coinage_metal VARCHAR,
km_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the coinage metal for KM numbers of S45?
| SELECT coinage_metal FROM table_26336060_19 WHERE km_number = "S45" | sql_create_context |
CREATE TABLE table_26240046_1 (
first_appearance VARCHAR,
played_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first appearance of the character played by Obdul Reid?
| SELECT first_appearance FROM table_26240046_1 WHERE played_by = "Obdul Reid" | sql_create_context |
CREATE TABLE table_45662 (
"Country" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average Blank Ends which has a Shot % smaller ... | SELECT AVG("Blank Ends") FROM table_45662 WHERE "Shot %" < '78' AND "Ends Won" > '43' | wikisql |
CREATE TABLE table_2384 (
"\u2116" real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ev... | SELECT "Directed by" FROM table_2384 WHERE "Production code" = 'NABF13' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '484' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-05-03' AND '2016-07-20' AND t_kc21.IN_DIAG_DIS_CD = 'K33.439' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE table_203_513 (
id number,
"no." number,
"date" text,
"home team" text,
"visiting team" text,
"goals" text,
"score" text,
"result" text,
"venue" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in w... | SELECT MIN("date") FROM table_203_513 WHERE "home team" = 'finland' AND "visiting team" = 'greece' | squall |
CREATE TABLE table_60130 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Event has a Competition of world championships?
| SELECT "Event" FROM table_60130 WHERE "Competition" = 'world championships' | wikisql |
CREATE TABLE table_10333757_1 (
frequency VARCHAR,
calls VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Frequency is used for WEGP calls?
| SELECT frequency FROM table_10333757_1 WHERE calls = "WEGP" | sql_create_context |
CREATE TABLE table_3866 (
"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.
-- Name th... | SELECT "Record" FROM table_3866 WHERE "Game" = '23' | wikisql |
CREATE TABLE table_27626 (
"Episode" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the theme where the original artist is AC/DC?
| SELECT "Theme" FROM table_27626 WHERE "Original artist" = 'AC/DC' | wikisql |
CREATE TABLE table_204_246 (
id number,
"department" text,
"total deputies" number,
"uninominal deputies" number,
"plurinominal deputies" number,
"special indigenous\nor campesino deputies" number,
"senators" number
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT SUM("senators") FROM table_204_246 | squall |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt ... | 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 WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHIN... | atis |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2104' GROUP BY procedures_icd.icd9_code) AS t1 ... | mimic_iii |
CREATE TABLE table_64887 (
"Final" text,
"Date" text,
"Home Team" text,
"Score" text,
"Away Team" text,
"Attendance" real,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance for the final quarter (1)?
| SELECT "Attendance" FROM table_64887 WHERE "Final" = 'quarter (1)' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
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 lab (
labid number,
patientuni... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-4674' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... | eicu |
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE domain_conference (
cid int,
did int
)
C... | SELECT COUNT(DISTINCT (publication.title)) FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid | academic |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Exc/des hrt les,endovasc" | mimicsql_data |
CREATE TABLE table_74704 (
"Name" text,
"Case type" text,
"Bullet diameter" text,
"Neck diameter" text,
"Base diameter" text,
"Rim diameter" text,
"Case length" text,
"Cartridge length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whic... | SELECT "Bullet diameter" FROM table_74704 WHERE "Neck diameter" = '12.17 (.479)' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCAT... | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME | nvbench |
CREATE TABLE table_26218124_1 (
original_club VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club was originally named the newcastle falcons?
| SELECT original_club FROM table_26218124_1 WHERE name = "Newcastle Falcons" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.