instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZX... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205')) AND intakeoutput.cellpath LIKE '%output%' AND DA... | eicu |
CREATE TABLE table_2668405_17 (
first_elected INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest first elected?
| SELECT MAX(first_elected) FROM table_2668405_17 | sql_create_context |
CREATE TABLE table_name_43 (
country VARCHAR,
money___$__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country that has 600?
| SELECT country FROM table_name_43 WHERE money___$__ = 600 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" AND procedures.short_title = "Procedure-two vessels" | mimicsql_data |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | SELECT DisplayName FROM Users WHERE LastAccessDate > DATEADD(d, -1, GETDATE()) | sede |
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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
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 WHERE prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE table_60330 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE SCORE WITH A WINNER AND OPPONENT BYRON BLACK?
| SELECT "Score" FROM table_60330 WHERE "Outcome" = 'winner' AND "Opponent" = 'byron black' | wikisql |
CREATE TABLE table_21535453_1 (
brian_moran VARCHAR,
creigh_deeds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Brian Moran's share of the votes when Creigh Deeds had 30%?
| SELECT brian_moran FROM table_21535453_1 WHERE creigh_deeds = "30%" | sql_create_context |
CREATE TABLE table_62032 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Incumbent, when District is 'Louisiana 4'?
| SELECT "Incumbent" FROM table_62032 WHERE "District" = 'louisiana 4' | wikisql |
CREATE TABLE table_51379 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What size was the crowd when Hawthorn was the ho... | SELECT COUNT("Crowd") FROM table_51379 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),
login_name VARCHAR(80),
login_password VARCHAR(20),
phone_number VARCHAR(255),
town_ci... | SELECT product_name, SUM(T1.product_quantity) FROM Order_Items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name | nvbench |
CREATE TABLE table_name_20 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team score with Away team Richmond?
| SELECT home_team AS score FROM table_name_20 WHERE away_team = "richmond" | sql_create_context |
CREATE TABLE table_name_1 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Tournament that has the 2009 of 1r, and the 2012 of w?
| SELECT tournament FROM table_name_1 WHERE 2009 = "1r" AND 2012 = "w" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSMC = '中医风湿免疫病科' AND zyjzjlb.RYDJSJ BETWEEN '2002-04-24' AND '2003-09-08' | css |
CREATE TABLE table_66253 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Serial numbers" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Quantity preserved" FROM table_66253 WHERE "Serial numbers" = 'mallet and simple articulated locomotives' | wikisql |
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date D... | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY Document_Type_Code DESC | nvbench |
CREATE TABLE table_27236 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the p... | SELECT "Production code" FROM table_27236 WHERE "Written by" = 'Cathryn Humphris' | wikisql |
CREATE TABLE table_23284271_8 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the Mavericks have a record of 32-19?
| SELECT date FROM table_23284271_8 WHERE record = "32-19" | sql_create_context |
CREATE TABLE table_name_82 (
player VARCHAR,
round VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has a round larger than 6 with a D position.
| SELECT player FROM table_name_82 WHERE round > 6 AND position = "d" | sql_create_context |
CREATE TABLE table_name_12 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the opponent when the record was 43-56?
| SELECT opponent FROM table_name_12 WHERE record = "43-56" | sql_create_context |
CREATE TABLE table_24910733_2 (
episode VARCHAR,
air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes aired on October 17, 2007?
| SELECT COUNT(episode) FROM table_24910733_2 WHERE air_date = "October 17, 2007" | sql_create_context |
CREATE TABLE table_23390604_1 (
mir_hossein_mousavi INTEGER,
province VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest score of candidate mir-hossein mousavi in the location known as azarbaijan, west?
| SELECT MAX(mir_hossein_mousavi) FROM table_23390604_1 WHERE province = "Azarbaijan, West" | sql_create_context |
CREATE TABLE table_39491 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a College of stanford, and an Overall smaller than 8?
| SELECT AVG("Round") FROM table_39491 WHERE "College" = 'stanford' AND "Overall" < '8' | wikisql |
CREATE TABLE table_38950 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which average Lost has an Against larger than 1... | SELECT AVG("Lost") FROM table_38950 WHERE "Against" > '19' AND "Drawn" < '1' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | SELECT name, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
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_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '陶秀英' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-06-26' AND '2009-10-18' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_34273 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps are associated with a grid greater than 8, under 11 points, and will powe... | SELECT COUNT("Laps") FROM table_34273 WHERE "Grid" > '8' AND "Points" < '11' AND "Driver" = 'will power' | wikisql |
CREATE TABLE table_1037590_1 (
yards VARCHAR,
attempts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years were there with 348 attempts?
| SELECT COUNT(yards) FROM table_1037590_1 WHERE attempts = 348 | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLO... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_name_22 (
decision VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the decision when they're at phoenix?
| SELECT decision FROM table_name_22 WHERE visitor = "phoenix" | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ACIDOSIS" AND procedures.short_title = "Contrast aortogram" | mimicsql_data |
CREATE TABLE table_name_70 (
high_rebounds VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the High rebounds of a Game with 56?
| SELECT high_rebounds FROM table_name_70 WHERE game = 56 | sql_create_context |
CREATE TABLE table_name_22 (
position VARCHAR,
pts_agst VARCHAR,
pts_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Pts Agst of 572, and a Pts For larger than 346 has what total number of position?
| SELECT COUNT(position) FROM table_name_22 WHERE pts_agst = 572 AND pts_for > 346 | sql_create_context |
CREATE TABLE table_name_22 (
opponents_in_final VARCHAR,
surface VARCHAR,
score_in_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the opponents in the final when the game was played on hard surface and the score of the final was 6 1, 1 6, ... | SELECT opponents_in_final FROM table_name_22 WHERE surface = "hard" AND score_in_final = "6–1, 1–6, 7–6(4)" | sql_create_context |
CREATE TABLE table_name_16 (
position VARCHAR,
division VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- on week of february 12, in the west division, what is the position?
| SELECT position FROM table_name_16 WHERE division = "west" AND week = "february 12" | sql_create_context |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'A48.710' AND jyjgzbb.JCZBMC = '... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "SPAN" AND lab.label = "Calcium, Total" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title 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
... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 68280 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE Aircraft (
aid VARCHAR,
distance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show ids for all aircrafts with more than 1000 distance.
| SELECT aid FROM Aircraft WHERE distance > 1000 | 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 demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Francis Baseler" | mimicsql_data |
CREATE TABLE table_name_86 (
report VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the report for 30 july
| SELECT report FROM table_name_86 WHERE date = "30 july" | sql_create_context |
CREATE TABLE table_name_63 (
time INTEGER,
swimmer VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the least time for apostolos tsagkarakis for lane less than 6
| SELECT MIN(time) FROM table_name_63 WHERE swimmer = "apostolos tsagkarakis" AND lane < 6 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE proced... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5364)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit... | mimic_iii |
CREATE TABLE table_name_71 (
new_entries VARCHAR,
fixtures VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for New entries, when the value for Fixtures is 2?
| SELECT new_entries FROM table_name_71 WHERE fixtures = 2 | sql_create_context |
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 Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation | 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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2089" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id... | SELECT p.Id AS "post_link", u.Id AS "user_link", u.Location, u.Age FROM Posts AS myanswers JOIN Posts AS p ON p.AcceptedAnswerId = myanswers.Id JOIN PostTypes AS pt ON myanswers.PostTypeId = pt.Id JOIN Users AS u ON p.OwnerUserId = u.Id WHERE NOT p.AcceptedAnswerId IS NULL AND myanswers.OwnerUserId = '##UserId##' AND p... | sede |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '谢飞烟' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2015-03-08') | css |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC | nvbench |
CREATE TABLE table_train_188 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 3... | SELECT * FROM table_train_188 WHERE age >= 30 AND age <= 70 | criteria2sql |
CREATE TABLE table_72507 (
"Position" real,
"Club (City/Town)" text,
"Games Played" real,
"W-L-D" text,
"Goals For/Against" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the the club (city/town) with goals for/against bein... | SELECT "Club (City/Town)" FROM table_72507 WHERE "Goals For/Against" = '14-2' | wikisql |
CREATE TABLE table_58346 (
"Lt. Governor" text,
"Commission Date" text,
"End Date" text,
"Governor" text,
"Party" text,
"Term" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the end date of the term for Governor of richard j. oglesby, an... | SELECT "End Date" FROM table_58346 WHERE "Governor" = 'richard j. oglesby' AND "Term" = '1885–1889' | wikisql |
CREATE TABLE table_name_69 (
leagues_entering VARCHAR,
clubs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the item for Leagues entering, when the value for Clubs is 8 4?
| SELECT leagues_entering FROM table_name_69 WHERE clubs = "8 → 4" | sql_create_context |
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TABLE Ref_Detention_Type (
detention_type_code VARCHAR(10),
detention_type_description VARCHAR(80)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
... | SELECT date_address_from, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_19 (
enrollment INTEGER,
founded VARCHAR,
joined_conference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest enrolled school that was founded in 1992 and joined a conference before 1998?
| SELECT MIN(enrollment) FROM table_name_19 WHERE founded = "1992" AND joined_conference < 1998 | sql_create_context |
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 lab.label = "Platelet Count" | mimicsql_data |
CREATE TABLE table_name_60 (
game VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game was the final score 82-79?
| SELECT game FROM table_name_60 WHERE score = "82-79" | sql_create_context |
CREATE TABLE table_1206 (
"Year" real,
"Dates" text,
"Venue" text,
"Champion" text,
"Country" text,
"Score" real,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text,
"Purse ( $ )" real,
"Winners share ($)" real
)
-- Using valid SQLite, answer the following questio... | SELECT "Purse ( $ )" FROM table_1206 WHERE "Winners share ($)" = '428650' | wikisql |
CREATE TABLE table_54924 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Away team score when they played Geelong as the Home t... | SELECT "Away team score" FROM table_54924 WHERE "Home team" = 'geelong' | wikisql |
CREATE TABLE table_name_25 (
total INTEGER,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total of the player with a t41 finish?
| SELECT MIN(total) FROM table_name_25 WHERE finish = "t41" | sql_create_context |
CREATE TABLE table_14342367_11 (
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who scored the most points?
| SELECT MAX(points) FROM table_14342367_11 | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | SELECT * FROM Users | sede |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '21485426' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7162.91) | css |
CREATE TABLE table_name_98 (
date VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game that had a loss of Gott (2-7)?
| SELECT date FROM table_name_98 WHERE loss = "gott (2-7)" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
... | SELECT 'http://stackoverflow.com/questions/' + CAST(c.PostId AS TEXT) FROM Comments AS c INNER JOIN Posts AS p ON (p.Id = c.PostId) WHERE c.Text LIKE '%This does not provide an answer to the question.%' AND c.Score >= 0 AND p.Body LIKE '%?%' AND p.Score <= 0 AND NOT EXISTS(SELECT * FROM PostHistory AS h WHERE PostHisto... | sede |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id IN... | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY COUNT(date_test_taken) | nvbench |
CREATE TABLE table_28571 (
"Name" text,
"Population (2011)" real,
"Population (2006)" real,
"Change (%)" text,
"Area (km\u00b2)" text,
"Population density" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for area for populatio... | SELECT "Area (km\u00b2)" FROM table_28571 WHERE "Population density" = '100.8' | wikisql |
CREATE TABLE table_name_14 (
year_to INTEGER,
engine VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year To has an Engine of 119.972, and a Chassis smaller than 129.067?
| SELECT MIN(year_to) FROM table_name_14 WHERE engine = 119.972 AND chassis < 129.067 | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.celllabel = 'tpn/p... | eicu |
CREATE TABLE table_22897453_1 (
kr_narayanan__votes_ VARCHAR,
kr_narayanan__values_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the kr narayanan votes for values being 936 for kr
| SELECT kr_narayanan__votes_ FROM table_22897453_1 WHERE kr_narayanan__values_ = 936 | sql_create_context |
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, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_name_24 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for opponent Anna Barone?
| SELECT record FROM table_name_24 WHERE opponent = "anna barone" | sql_create_context |
CREATE TABLE table_52836 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the home team in the game where South Mel... | SELECT "Home team score" FROM table_52836 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_name_88 (
week VARCHAR,
date VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks had a game on November 26, 1978, and an attendance higher than 26,248?
| SELECT COUNT(week) FROM table_name_88 WHERE date = "november 26, 1978" AND attendance > 26 OFFSET 248 | sql_create_context |
CREATE TABLE table_name_47 (
against INTEGER,
difference VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Difference of - 20, and a Position smaller than 17 is the highest against?
| SELECT MAX(against) FROM table_name_47 WHERE difference = "- 20" AND position < 17 | sql_create_context |
CREATE TABLE table_name_73 (
value INTEGER,
ungegn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is the total value of kau s b UNGEGN ?
| SELECT SUM(value) FROM table_name_73 WHERE ungegn = "kau sĕb" | sql_create_context |
CREATE TABLE table_name_14 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team at the Junction Oval venue?
| SELECT home_team FROM table_name_14 WHERE venue = "junction oval" | 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 MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" | mimicsql_data |
CREATE TABLE table_name_53 (
nation VARCHAR,
total VARCHAR,
gold VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation has 0 gold, 0 silver and 2 total?
| SELECT nation FROM table_name_53 WHERE gold = 0 AND silver = 0 AND total = 2 | sql_create_context |
CREATE TABLE table_41735 (
"Date" text,
"Title" text,
"Director" text,
"Producer" text,
"Production Cost" text,
"Singapore Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director when the title is 2003?
| SELECT "Director" FROM table_41735 WHERE "Title" = '2003' | wikisql |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric... | SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building ORDER BY building DESC | nvbench |
CREATE TABLE table_name_72 (
attendance VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended round f?
| SELECT COUNT(attendance) FROM table_name_72 WHERE round = "f" | sql_create_context |
CREATE TABLE table_2731 (
"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 wa... | SELECT "Score" FROM table_2731 WHERE "Date" = 'February 24' | 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 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status-post ptca" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_name_51 (
position INTEGER,
goal_difference VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest position with a -22 goal difference and more than 5 points?
| SELECT MIN(position) FROM table_name_51 WHERE goal_difference = -22 AND points > 5 | sql_create_context |
CREATE TABLE table_28211213_2 (
institution VARCHAR,
team_nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When gray wolves is the team nickname how many institutions are there?
| SELECT COUNT(institution) FROM table_28211213_2 WHERE team_nickname = "Gray Wolves" | sql_create_context |
CREATE TABLE table_name_86 (
head_coach VARCHAR,
president VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Head Coach of the team whose President is Mario Volarevic?
| SELECT head_coach FROM table_name_86 WHERE president = "mario volarevic" | sql_create_context |
CREATE TABLE table_70868 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Competition where the Score was 3 0, and the was Goal larger than 4?
| SELECT "Competition" FROM table_70868 WHERE "Score" = '3–0' AND "Goal" > '4' | wikisql |
CREATE TABLE table_name_51 (
year_s__won VARCHAR,
total VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year(s) won has a Total smaller than 285, and a Player of tom watson?
| SELECT year_s__won FROM table_name_51 WHERE total < 285 AND player = "tom watson" | sql_create_context |
CREATE TABLE table_1016 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name all the players for fullback
| SELECT "Player" FROM table_1016 WHERE "Position" = 'Fullback' | wikisql |
CREATE TABLE table_name_81 (
competition VARCHAR,
year VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition in 2003 has a score of 2 1?
| SELECT competition FROM table_name_81 WHERE year = 2003 AND score = "2–1" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT demographic.name, demographic.dob FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_57021 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game played at Victoria... | SELECT "Date" FROM table_57021 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE Department (
DNO INTEGER,
Division VARCHAR(2),
DName VARCHAR(25),
Room VARCHAR(5),
Building VARCHAR(13),
DPhone INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTE... | SELECT Credits, DNO FROM Course ORDER BY Credits | nvbench |
CREATE TABLE table_45479 (
"Competition" text,
"Played" real,
"Draw" real,
"Lost" real,
"Favour" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least ties when they played less than 14 games, and a lost less than 8 of... | SELECT MIN("Draw") FROM table_45479 WHERE "Played" < '14' AND "Lost" < '8' | wikisql |
CREATE TABLE table_73008 (
"No. overall" real,
"Title" text,
"Director" text,
"Writer" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest production code of an episode written by ... | SELECT MAX("Production code") FROM table_73008 WHERE "Writer" = 'Tim Loane' | wikisql |
CREATE TABLE table_name_2 (
attendance VARCHAR,
opponent VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of attendance values for ties having an opponent of Middlesbrough and result of 3-1?
| SELECT COUNT(attendance) FROM table_name_2 WHERE opponent = "middlesbrough" AND result = "3-1" | sql_create_context |
CREATE TABLE table_name_20 (
draws VARCHAR,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of draws when there are fewer than 3 wins?
| SELECT COUNT(draws) FROM table_name_20 WHERE wins < 3 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.