instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i... | mimic_iii |
CREATE TABLE table_train_33 (
"id" int,
"active_infection" bool,
"allergy_to_thiamine" bool,
"receiving_vasopressor" bool,
"liver_disease" bool,
"allergy_to_vitamin_c" bool,
"allergy_to_hydrocortisone" bool,
"hypertension" bool,
"age" float,
"serum_aminotransferase_level_alt_ast"... | SELECT * FROM table_train_33 WHERE liver_disease = 1 OR serum_aminotransferase_level_alt_ast > 120 | criteria2sql |
CREATE TABLE table_23285849_5 (
location_attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What location and how many people were in attendance where the record was 9-4 for the season?
| SELECT location_attendance FROM table_23285849_5 WHERE record = "9-4" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
chartt... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... | mimic_iii |
CREATE TABLE table_name_52 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team of the game where Footscray is the away team?
| SELECT home_team AS score FROM table_name_52 WHERE away_team = "footscray" | sql_create_context |
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 zyjzjlb_jybgb (
YLJGDM_ZYJZJLB te... | SELECT zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '01702037552' | css |
CREATE TABLE table_26065 (
"Place came" text,
"Artist" text,
"Category" text,
"Act" text,
"Semi-final" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During the act, Performance of 'Lost' by Anouk, what was the result?
| SELECT "Result" FROM table_26065 WHERE "Act" = 'Performance of "Lost" by Anouk' | wikisql |
CREATE TABLE table_name_4 (
lost INTEGER,
points VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least lost with points more than 6 and games less than 5
| SELECT MIN(lost) FROM table_name_4 WHERE points > 6 AND games < 5 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "50" AND procedures.icd9_code = "4131" | mimicsql_data |
CREATE TABLE table_name_33 (
generation VARCHAR,
birthday VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What generation is the member born on 1996.04.17 in?
| SELECT generation FROM table_name_33 WHERE birthday = "1996.04.17" | sql_create_context |
CREATE TABLE table_39749 (
"Year" text,
"Total" real,
"Wins" real,
"Losses" real,
"No result" real,
"% Win" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest no result when the year was 2012 and there were more than 10 wins?
| SELECT MIN("No result") FROM table_39749 WHERE "Year" = '2012' AND "Wins" > '10' | wikisql |
CREATE TABLE table_16799784_8 (
diameter__km_ VARCHAR,
longitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the diameter in km of the feature with a longitude of 40.2E?
| SELECT diameter__km_ FROM table_16799784_8 WHERE longitude = "40.2E" | sql_create_context |
CREATE TABLE table_name_6 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the opponent on november 8, 1981?
| SELECT opponent FROM table_name_6 WHERE date = "november 8, 1981" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Ammonia" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | (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 table_name_1 (
athlete VARCHAR,
round_3 VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which athlete in the 76 kg class, did not advance at the end of Round 3.
| SELECT athlete FROM table_name_1 WHERE round_3 = "did not advance" AND event = "76 kg" | sql_create_context |
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 number
)
CREATE TABLE invoiceline (
invoicelineid number,
... | SELECT name FROM artist WHERE name LIKE "%a%" | spider |
CREATE TABLE table_name_14 (
result VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Result for the Competition of 1994 FIFA World Cup Qualification, with the Date of May 15, 1993?
| SELECT result FROM table_name_14 WHERE competition = "1994 fifa world cup qualification" AND date = "may 15, 1993" | sql_create_context |
CREATE TABLE authors (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many authors are there?
| SELECT COUNT(*) FROM authors | sql_create_context |
CREATE TABLE table_name_24 (
nationality VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the nationality for pick of 18
| SELECT nationality FROM table_name_24 WHERE pick = "18" | sql_create_context |
CREATE TABLE zyb (
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 zyb WHERE zyb.PERSON_NM = '35826599' AND zyb.IN_HOSP_DAYS BETWEEN '2013-01-05' AND '2017-02-08' | css |
CREATE TABLE table_name_86 (
matches INTEGER,
against VARCHAR,
draw VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many matches has 51 draws and more than 6 against?
| SELECT SUM(matches) FROM table_name_86 WHERE against > 6 AND draw = 51 | sql_create_context |
CREATE TABLE tweets (
id bigint(20),
uid int(11),
text char(140),
createdate datetime
)
CREATE TABLE user_profiles (
uid int(11),
name varchar(255),
email varchar(255),
partitionid int(11),
followers int(11)
)
CREATE TABLE follows (
f1 int(11),
f2 int(11)
)
-- Using valid... | SELECT name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid ORDER BY name DESC | nvbench |
CREATE TABLE table_70960 (
"Date" text,
"Location" text,
"Nature of incident" text,
"Circumstances" text,
"Casualties" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the circumstances of the Hostile incident on the road to Jalalabad?
| SELECT "Circumstances" FROM table_70960 WHERE "Nature of incident" = 'hostile' AND "Location" = 'road to jalalabad' | wikisql |
CREATE TABLE table_31951 (
"Year" real,
"Director" text,
"Project" text,
"Category" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Year for the project The Untouchables?
| SELECT AVG("Year") FROM table_31951 WHERE "Project" = 'the untouchables' | wikisql |
CREATE TABLE table_50583 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the pick is under 28 and the position is k, what's the highest Overall pick?
| SELECT MAX("Overall") FROM table_50583 WHERE "Position" = 'k' AND "Pick" < '28' | wikisql |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER... | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_63518 (
"Year" real,
"Home Team" text,
"Away Team" text,
"Winner" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the winner when the score is 71-62?
| SELECT "Winner" FROM table_63518 WHERE "Score" = '71-62' | wikisql |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
... | 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 = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS V... | atis |
CREATE TABLE table_46699 (
"Class" text,
"Leading bits" real,
"Size of network number bit field" text,
"Size of rest bit field" text,
"Number of networks" text,
"Addresses per network" text,
"Start address" text,
"End address" text
)
-- Using valid SQLite, answer the following question... | SELECT "Start address" FROM table_46699 WHERE "Size of network number bit field" = '16' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
item... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72364) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ethanol') AND STRFTIME('%y-%m', labevents.charttime) >= '2105-06' | mimic_iii |
CREATE TABLE table_name_16 (
goals VARCHAR,
ratio VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Goals have a Ratio of 0.29?
| SELECT goals FROM table_name_16 WHERE ratio = 0.29 | sql_create_context |
CREATE TABLE table_14973 (
"Rank" text,
"Event" text,
"Place" text,
"Name" text,
"Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event had a prize of $2,434,061?
| SELECT "Name" FROM table_14973 WHERE "Prize" = '$2,434,061' | wikisql |
CREATE TABLE table_name_2 (
title VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the title for 2005
| SELECT title FROM table_name_2 WHERE year = 2005 | 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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "Acute diastolic heart failure" | mimicsql_data |
CREATE TABLE table_49183 (
"Municipality" text,
"Inhabitants" real,
"Mayor" text,
"Party" text,
"Election" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party has more than 241,310 inhabitants after 2012?
| SELECT "Party" FROM table_49183 WHERE "Election" > '2012' AND "Inhabitants" > '241,310' | wikisql |
CREATE TABLE table_30162 (
"Proceed to Quarter-final" text,
"Match points" text,
"Aggregate score" text,
"Points margin" real,
"Eliminated from competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the match points when Bordeaux-B gl... | SELECT "Match points" FROM table_30162 WHERE "Eliminated from competition" = 'Bordeaux-Bègles' | wikisql |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE table_name_33 (
creator VARCHAR,
latest_stable_release VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Creator has the Latest stable release of unknown, and a Name of myeclipse?
| SELECT creator FROM table_name_33 WHERE latest_stable_release = "unknown" AND name = "myeclipse" | 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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year < "2071" | mimicsql_data |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
-- Using valid SQLite, answer the ... | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue ORDER BY COUNT(Venue) | nvbench |
CREATE TABLE table_25199 (
"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 t... | SELECT "Team" FROM table_25199 WHERE "Record" = '3-2' | wikisql |
CREATE TABLE table_name_30 (
year VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the game at Bad Neuenahr Eppelborn?
| SELECT year FROM table_name_30 WHERE venue = "bad neuenahr eppelborn" | sql_create_context |
CREATE TABLE table_52807 (
"Year" text,
"2010" real,
"2009" real,
"2008" real,
"2005" real,
"2000" real,
"1995" real,
"1990" real,
"1985" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the GDP in 2008 for the region where 200... | SELECT COUNT("2008") FROM table_52807 WHERE "2009" < '3,355' AND "2005" > '1,103' AND "2010" = '3,977' AND "1995" > '413' | wikisql |
CREATE TABLE table_12094609_1 (
average VARCHAR,
evening_gown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of average where evening gown is 8.988
| SELECT COUNT(average) FROM table_12094609_1 WHERE evening_gown = "8.988" | sql_create_context |
CREATE TABLE table_name_8 (
engine VARCHAR,
start VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Engine with 3 as the start in the year of 2007?
| SELECT engine FROM table_name_8 WHERE start = "3" AND year = 2007 | sql_create_context |
CREATE TABLE table_name_90 (
total_score VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the champion was Gay Brewer Category:Articles with hCards what was the total score?
| SELECT total_score FROM table_name_90 WHERE champion = "gay brewer category:articles with hcards" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | WITH MyPostsWITHDates AS (SELECT p.Id, p.CreationDate, p.CreationDate AS DateFormat, p.Score, p.OwnerUserId, p.PostTypeId FROM Posts AS p WHERE p.OwnerUserId = 11742502) SELECT CAST(d.DateFormat + '-01' AS DATETIME), COUNT(CASE WHEN d.PostTypeId = 1 THEN 1 END) AS "question_count", COUNT(CASE WHEN d.PostTypeId = 2 THEN... | sede |
CREATE TABLE table_52291 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average crowd size for an away team ... | SELECT SUM("Crowd") FROM table_52291 WHERE "Away team score" = '14.2 (86)' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'CHE' AND course.number = 528 AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_26 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Tiger Woods' to par?
| SELECT to_par FROM table_name_26 WHERE player = "tiger woods" | sql_create_context |
CREATE TABLE table_46658 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Country is 'United States', and when Total is '154'?
| SELECT "Player" FROM table_46658 WHERE "Country" = 'united states' AND "Total" = '154' | 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 person_info.XM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '2... | css |
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 zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '鲁嘉歆' ... | css |
CREATE TABLE table_train_220 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"fasting_plasma_glucose" int,
"hba1c" float,
"serum_creatinine" float,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the follow... | SELECT * FROM table_train_220 WHERE serum_creatinine < 1.8 | criteria2sql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '98736904' AND t_kc22.STA_DATE BETWEEN '2007-01-26' AND '2015-08-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-29887' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp... | eicu |
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 patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '010-32698' AND STRFTIME('%y', patient.hospitaladmittime) >= '2105' ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_9491 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponents In The Final, when... | SELECT "Opponents in the final" FROM table_9491 WHERE "Surface" = 'carpet' AND "Tournament" = 'milan , italy' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 89565 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'perica... | mimic_iii |
CREATE TABLE table_name_36 (
region VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what region is the city of Austin?
| SELECT region FROM table_name_36 WHERE city = "austin" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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,
C... | SELECT t_kc22.SOC_SRT_DIRE_CD FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '81874802004' AND t_kc22.SOC_SRT_DIRE_NM = '复方鲜竹沥液' | css |
CREATE TABLE table_57380 (
"Channel" real,
"Video" text,
"Aspect" text,
"PSIP Short Name" text,
"Programming" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Programming is on a channel less than 26.5, has a Video of 480i and a PSIP Short Name ... | SELECT "Programming" FROM table_57380 WHERE "Channel" < '26.5' AND "Video" = '480i' AND "PSIP Short Name" = 'jtv' | wikisql |
CREATE TABLE table_63606 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Attendance of the game on December 12, 2004?
| SELECT "Attendance" FROM table_63606 WHERE "Date" = 'december 12, 2004' | wikisql |
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 COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 431 OR course.number = 823) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = ... | advising |
CREATE TABLE table_79207 (
"Country" text,
"Event" text,
"Time" text,
"Date" text,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the Event with a Time of 2:23:47?
| SELECT "Date" FROM table_79207 WHERE "Time" = '2:23:47' | wikisql |
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 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 = '1368313' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-02-22' AND '2005-11-03' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 26 | css |
CREATE TABLE table_12419515_4 (
total_viewers__in_millions_ VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many millions of total viewers watched series #57?
| SELECT COUNT(total_viewers__in_millions_) FROM table_12419515_4 WHERE series__number = 57 | sql_create_context |
CREATE TABLE Songs (
Title VARCHAR,
SongId VARCHAR
)
CREATE TABLE Band (
id VARCHAR,
Lastname VARCHAR
)
CREATE TABLE Performance (
bandmate VARCHAR,
SongId VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all the songs performed by artis... | SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo" | sql_create_context |
CREATE TABLE table_name_50 (
byes INTEGER,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many byes when there are more than 16 wins?
| SELECT AVG(byes) FROM table_name_50 WHERE wins > 16 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Hx of GI malignancy NOS" | mimicsql_data |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.icd9_code = "92" | mimicsql_data |
CREATE TABLE table_71329 (
"District" text,
"Counties Represented" text,
"Delegate" text,
"Party" text,
"First Elected" real,
"Committee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Committee has the First Elected of 1993?
| SELECT "Committee" FROM table_71329 WHERE "First Elected" = '1993' | wikisql |
CREATE TABLE table_45595 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Laps have a Time of +23.002, and a Grid smaller than 11?
| SELECT AVG("Laps") FROM table_45595 WHERE "Time" = '+23.002' AND "Grid" < '11' | wikisql |
CREATE TABLE table_name_98 (
binary VARCHAR,
operation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Operation of find-min has what binary?
| SELECT binary FROM table_name_98 WHERE operation = "find-min" | sql_create_context |
CREATE TABLE table_15457 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home captain has a Venue of melbourne cricket ground?
| SELECT "Home captain" FROM table_15457 WHERE "Venue" = 'melbourne cricket ground' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_49843 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result when his record was 25-15?
| SELECT "Res." FROM table_49843 WHERE "Record" = '25-15' | wikisql |
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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_pro... | mimic_iii |
CREATE TABLE Scientists (
SSN int,
Name Char(30)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
)
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of scien... | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_203_594 (
id number,
"canal" text,
"length (miles)" number,
"locks" number,
"max length (ft)" number,
"width (ft)" number,
"year opened" number,
"year abandoned" number,
"year restored" number
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "length (miles)" FROM table_203_594 WHERE "canal" = 'dingwall canal' | squall |
CREATE TABLE table_name_6 (
rank INTEGER,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the sum of rank with wins of 17
| SELECT SUM(rank) FROM table_name_6 WHERE wins = 17 | sql_create_context |
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 vitalperiodic (
vitalperiodicid nu... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mechanical ventilation' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 's... | eicu |
CREATE TABLE table_33723 (
"Year" real,
"Kit Supplier" text,
"Sponsor" text,
"Shirt Printing" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the notes for the shirt that said Pavv after 2007?
| SELECT "Notes" FROM table_33723 WHERE "Shirt Printing" = 'pavv' AND "Year" > '2007' | wikisql |
CREATE TABLE table_13367 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest bronzes for ranks of 3 with totals under 2?
| SELECT MIN("Bronze") FROM table_13367 WHERE "Rank" = '3' AND "Total" < '2' | wikisql |
CREATE TABLE table_25030512_41 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of district for tom marino
| SELECT COUNT(district) FROM table_25030512_41 WHERE incumbent = "Tom Marino" | sql_create_context |
CREATE TABLE table_39187 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was result of goal 4?
| SELECT "Result" FROM table_39187 WHERE "Goal" = '4' | wikisql |
CREATE TABLE table_name_91 (
round INTEGER,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest round drafted for a University of Southern California player?
| SELECT MIN(round) FROM table_name_91 WHERE school = "university of southern california" | sql_create_context |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '褚朋兴' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 5670.35) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '褚朋兴' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLIN... | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 departments (
DEPARTMENT_ID decimal... | SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_34 (
icao VARCHAR,
province VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which ICAO has a Province of heilongjiang, and a IATA of jmu?
| SELECT icao FROM table_name_34 WHERE province = "heilongjiang" AND iata = "jmu" | sql_create_context |
CREATE TABLE table_36565 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Draws average that ... | SELECT AVG("Draws") FROM table_36565 WHERE "Played" < '18' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT diagnoses.icd9_code, procedures.icd9_code FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "2110" | mimicsql_data |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby... | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'linda shapiro' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_name_96 (
lost INTEGER,
played VARCHAR,
against VARCHAR,
drawn VARCHAR,
_percentage_won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of games lost that has less than 1 game drawn, a 50% winning perce... | SELECT MIN(lost) FROM table_name_96 WHERE drawn < 1 AND _percentage_won = "50%" AND against = "netherlands" AND played > 2 | sql_create_context |
CREATE TABLE table_1271 (
"School" text,
"Nickname" text,
"Colors" text,
"League" text,
"Class" text,
"Division" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Middletown High School uses which colors
| SELECT "Colors" FROM table_1271 WHERE "School" = 'Middletown High School' | wikisql |
CREATE TABLE table_12888 (
"Engine" text,
"Cyl." text,
"Power" text,
"Torque" text,
"Engine code" text,
"0\u2013100km/h (sec.)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much torque does the engine that has a 10.9 0-100km/h (sec) rating... | SELECT "Torque" FROM table_12888 WHERE "0\u2013100km/h (sec.)" = '10.9' | wikisql |
CREATE TABLE table_name_7 (
matches VARCHAR,
tally VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Matches have a Tally of 1-38?
| SELECT matches FROM table_name_7 WHERE tally = "1-38" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.dob_year < "2087" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.