context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
ro... | what is the maximum total cost of the hospital involving a laboratory basophils test since 2 years ago? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'basophils')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY cost.hadm_... | mimic_iii |
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
)
... | how many of the patients diagnosed with perforation of intestine had a lab test for blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Perforation of intestine" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_79044 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | What is the away team of the match with a 356 attendance? | SELECT "Away team" FROM table_79044 WHERE "Attendance" = '356' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground... | show me all flights from DENVER to PITTSBURGH which serve DINNER | 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, food_service WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food... | atis |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId ... | Get Posts by Tags (searching ddd synonimous). | SELECT * FROM Tags WHERE TagName = 'domain-driven-design' | sede |
CREATE TABLE table_2226817_4 (
original_air_date VARCHAR,
production_code VARCHAR
) | Name the original air date for 3.04 production code | SELECT original_air_date FROM table_2226817_4 WHERE production_code = "3.04" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id by a bar chart, I want to show y-axis in descending order please. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC | nvbench |
CREATE TABLE table_61916 (
"Region" text,
"Title" text,
"Label" text,
"Format" text,
"Catalog-Nr." text
) | What is the Title of the Pye Label mono LP release? | SELECT "Title" FROM table_61916 WHERE "Format" = 'mono lp' AND "Label" = 'pye' | wikisql |
CREATE TABLE table_78084 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How large was the crowd with a home team score of 18.25 (133)? | SELECT "Crowd" FROM table_78084 WHERE "Home team score" = '18.25 (133)' | wikisql |
CREATE TABLE table_2508633_5 (
position VARCHAR,
nfl_team VARCHAR
) | How many players did the philadelphia eagles pick? | SELECT COUNT(position) FROM table_2508633_5 WHERE nfl_team = "Philadelphia Eagles" | sql_create_context |
CREATE TABLE table_72223 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | How tall is the player jones, major major jones? | SELECT "Height in Ft." FROM table_72223 WHERE "Player" = 'Jones, Major Major Jones' | wikisql |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank i... | How many companies in each headquarter? Plot a bar chart. | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters | nvbench |
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... | 能知道患者16019866之前看病的医院吗 | SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '16019866' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjz... | css |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_far... | i'd like information on the least expensive airfare round trip from PITTSBURGH to BOSTON | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... | atis |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | find the number of patients diagnosed under icd9 code 36201. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "36201" | mimicsql_data |
CREATE TABLE table_12526 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | What is the party of the california 35 district? | SELECT "Party" FROM table_12526 WHERE "District" = 'california 35' | wikisql |
CREATE TABLE table_name_96 (
venue VARCHAR,
result VARCHAR
) | Which venue has a Result of 1 0? | SELECT venue FROM table_name_96 WHERE result = "1–0" | sql_create_context |
CREATE TABLE table_1590967_6 (
musical_guest__song_performed_ VARCHAR,
guest_host VARCHAR
) | Name the musical guest where guest host is elle macpherson | SELECT musical_guest__song_performed_ FROM table_1590967_6 WHERE guest_host = "Elle Macpherson" | sql_create_context |
CREATE TABLE table_46507 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Who was the opposing team in the test match? | SELECT "Opposing Team" FROM table_46507 WHERE "Status" = 'test match' | wikisql |
CREATE TABLE table_79295 (
"Time" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text
) | What is the away team when solon was the home team? | SELECT "Away team" FROM table_79295 WHERE "Home team" = 'solon' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE month (
month_number int,
month_name tex... | what 's the difference between fare code Q and fare code F | SELECT DISTINCT booking_class, class_description, rank FROM class_of_service WHERE booking_class = 'F' OR booking_class = 'Q' | atis |
CREATE TABLE table_203_730 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number,
"bye" text
) | which week had the least amount of people in attendance ? | SELECT "week" FROM table_203_730 ORDER BY "attendance" LIMIT 1 | squall |
CREATE TABLE table_name_97 (
fate VARCHAR,
nationality VARCHAR,
ship VARCHAR
) | what is the fate when the nationality is french and the ship is pierre lott? | SELECT fate FROM table_name_97 WHERE nationality = "french" AND ship = "pierre lott" | sql_create_context |
CREATE TABLE train (
name VARCHAR,
service VARCHAR,
TIME VARCHAR
) | Show the name and service for all trains in order by time. | SELECT name, service FROM train ORDER BY TIME | sql_create_context |
CREATE TABLE table_name_94 (
year VARCHAR,
title VARCHAR,
producer VARCHAR,
director VARCHAR
) | How many years was Kay Tagal Kang Hinintay directed by Rory Quintos and produced by Star Cinema? | SELECT COUNT(year) FROM table_name_94 WHERE producer = "star cinema" AND director = "rory quintos" AND title = "kay tagal kang hinintay" | sql_create_context |
CREATE TABLE table_name_7 (
e_score INTEGER,
total VARCHAR
) | What was the sum of the E scores when the total score was 19.466? | SELECT SUM(e_score) FROM table_name_7 WHERE total = 19.466 | sql_create_context |
CREATE TABLE table_name_70 (
tournament VARCHAR
) | What is the 2012 value at the Grand Slam Tournaments? | SELECT 2012 FROM table_name_70 WHERE tournament = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_45810 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | The country of Spain has what score? | SELECT "Score" FROM table_45810 WHERE "Country" = 'spain' | wikisql |
CREATE TABLE table_66763 (
"Rank" real,
"Year" real,
"Name" text,
"Moving from" text,
"Moving to" text
) | Isma l Bangoura with a rank larger than 5 after the year 2005 was moving to what football club? | SELECT "Moving to" FROM table_66763 WHERE "Year" > '2005' AND "Rank" > '5' AND "Name" = 'ismaël bangoura' | wikisql |
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... | 在编码为3151160的医院病患孙虹影入院诊断疾病名称不包含牙体的医疗就诊记录编号是啥? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '孙虹影' AND gwyjzb.MED_SER_ORG_NO = '3151160' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%牙体%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '孙虹影' AND fgwyjzb.MED_SER_ORG_NO = '3151160' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%牙体%' | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | find the number of elective type hospital admission patients who have ibuprofen suspension prescription. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Ibuprofen Suspension" | mimicsql_data |
CREATE TABLE table_25735_1 (
competition VARCHAR,
winner VARCHAR
) | Which competition did the toronto city saints win? | SELECT competition FROM table_25735_1 WHERE winner = "Toronto City Saints" | sql_create_context |
CREATE TABLE table_9302 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | What is the average Attendance, when Venue is 'A', and when Date is '5 January 2005'? | SELECT AVG("Attendance") FROM table_9302 WHERE "Venue" = 'a' AND "Date" = '5 january 2005' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | have any organisms appeared in the first urine, catheter specimen microbiology test of patient 031-15666 during the last month? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND microlab.culturesite = 'urine, catheter specimen' AND DATETIM... | eicu |
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... | 统计医疗记录中年龄高于25岁的患者的平均花费医疗费一共多少钱? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE > 25 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE > 25) | css |
CREATE TABLE table_11469 (
"Outcome" text,
"Date" text,
"Location" text,
"Surface" text,
"Opponent in final" text
) | What date was the opponent in the final Virginie Pichet? | SELECT "Date" FROM table_11469 WHERE "Opponent in final" = 'virginie pichet' | wikisql |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(15),
shipping_method_code VARCHAR(15),
order_placed_datetime DATETIME,
order_delivered_datetime DATETIME,
order_shipping_charges VARCHAR(255)
)
CREATE TABLE Mailshot_Campaigns (
mailshot_id I... | Show all distinct product categories along with the number of mailshots in each category Visualize by bar chart, order from low to high by the y-axis. | SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_2630 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
) | Name the successor for james noble died in previous congress | SELECT "Successor" FROM table_2630 WHERE "Reason for change" = 'James Noble died in previous Congress' | wikisql |
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
)
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
) | Return the names of wrestlers with fewer than 100 days held. | SELECT name FROM wrestler WHERE days_held < 100 | spider |
CREATE TABLE table_name_74 (
literary_tradition VARCHAR,
language_s_ VARCHAR,
year VARCHAR
) | What is the literary traidtion for the film in english in 2011? | SELECT literary_tradition FROM table_name_74 WHERE language_s_ = "english" AND year = 2011 | sql_create_context |
CREATE TABLE table_63662 (
"Name" text,
"Height" text,
"Weight" text,
"Spike" text,
"2008 club" text
) | What is the weight for Iraklis in 2008? | SELECT "Weight" FROM table_63662 WHERE "2008 club" = 'iraklis' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, list the average of employee id in descending order. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_name_39 (
winter_olympics INTEGER,
fis_nordic_world_ski_championships VARCHAR
) | what is the earliest winter olympics when the fis nordic world ski championships is 1976? | SELECT MIN(winter_olympics) FROM table_name_39 WHERE fis_nordic_world_ski_championships = "1976" | sql_create_context |
CREATE TABLE table_name_23 (
drew VARCHAR,
played VARCHAR,
lost VARCHAR
) | What is the number of draws when the played 9 and lost 3? | SELECT drew FROM table_name_23 WHERE played = "9" AND lost = "3" | sql_create_context |
CREATE TABLE table_37376 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" real,
"Class" text,
"Hometown" text,
"Games\u2191" real
) | What is the name of the player who is a wr and has a weight of 197? | SELECT "Name" FROM table_37376 WHERE "Position" = 'wr' AND "Weight" = '197' | wikisql |
CREATE TABLE table_27669 (
"GB" text,
"ISO \u2116" text,
"Province" text,
"Chinese Name" text,
"Capital" text,
"Population\u00b9" real,
"Density\u00b2" text,
"Area\u00b3" real,
"Abbreviation/Symbol" text
) | What is the chinese name of the province whose capital is hangzhou? | SELECT "Chinese Name" FROM table_27669 WHERE "Capital" = 'Hangzhou' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | 编码为69103720的病患有哪些检验报告单的报告日期在21年11月4日以前?这些报告单对应的住院就诊的流水号是什么 | 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.RYBH = '69103720' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-11-04') | css |
CREATE TABLE table_name_65 (
venue VARCHAR,
result VARCHAR
) | What is Venue, when Result is '0-0'? | SELECT venue FROM table_name_65 WHERE result = "0-0" | sql_create_context |
CREATE TABLE table_19351 (
"Pos" real,
"Member Association" text,
"Points (total 500)" real,
"Clubs" text,
"Group stage" real,
"Play-off" real,
"AFC Cup" real
) | how many pos with member association being china pr | SELECT COUNT("Pos") FROM table_19351 WHERE "Member Association" = 'China PR' | wikisql |
CREATE TABLE table_name_91 (
laps VARCHAR,
grid VARCHAR
) | How many laps for grid 25? | SELECT COUNT(laps) FROM table_name_91 WHERE grid = 25 | sql_create_context |
CREATE TABLE table_36965 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text
) | Which Method has a Round of 1, and a Time of 0:28? | SELECT "Method" FROM table_36965 WHERE "Round" = '1' AND "Time" = '0:28' | 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... | 名叫葛歌韵的患者在2019年12月22日到2020年12月16日期间开出的全部检验报告单的检验报告单号都是什么? | 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 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... | provide the number of patients whose year of birth is less than 2097 and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2097" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_99 (
wheels VARCHAR,
builder VARCHAR
) | What type of wheels did the locomotive have that was built by Baldwin Locomotive Works? | SELECT wheels FROM table_name_99 WHERE builder = "baldwin locomotive works" | sql_create_context |
CREATE TABLE table_name_1 (
losses VARCHAR,
games_played VARCHAR,
goals_against VARCHAR
) | How many games did the team lose that played 7 games and has a GA of less than 27? | SELECT COUNT(losses) FROM table_name_1 WHERE games_played = 7 AND goals_against < 27 | sql_create_context |
CREATE TABLE table_44404 (
"Poll Source" text,
"Date administered" text,
"Democrat" text,
"Republican" text,
"Lead Margin" real
) | Which Poll Source has a Date administered of october 30 november 2, 2008? | SELECT "Poll Source" FROM table_44404 WHERE "Date administered" = 'october 30 – november 2, 2008' | wikisql |
CREATE TABLE table_11340432_1 (
dysart VARCHAR,
information VARCHAR
) | What is the dysart of the principal? | SELECT dysart FROM table_11340432_1 WHERE information = "Principal" | sql_create_context |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
) | Show the name of track and the number of races in each track by a bar chart, rank from low to high by the bar. | SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY T2.Name | nvbench |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStat... | Questions tagged %backbase% over time. | SELECT YEAR(p.CreationDate) AS Year, TIME_TO_STR(p.CreationDate, '%q') AS Quarter, COUNT(Id) AS NumberOfQuestions FROM Posts AS p WHERE LOWER(Title) LIKE '%python%' OR LOWER(Tags) LIKE '%python%' GROUP BY YEAR(p.CreationDate), TIME_TO_STR(p.CreationDate, '%q') ORDER BY YEAR(p.CreationDate), TIME_TO_STR(p.CreationDate, ... | sede |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text... | what 's the smallest plane that flies from PITTSBURGH to BALTIMORE on eight 16 | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = ... | atis |
CREATE TABLE table_78733 (
"Date" text,
"Airline" text,
"Aircraft type" text,
"Registration" text,
"People on board" real,
"Fatalities" real
) | What is the number of people on board at Iberia Airline, with the aircraft type of lockheed l-1049g? | SELECT AVG("People on board") FROM table_78733 WHERE "Airline" = 'iberia' AND "Aircraft type" = 'lockheed l-1049g' | wikisql |
CREATE TABLE phone (
name text,
phone_id number,
memory_in_g number,
carrier text,
price number
)
CREATE TABLE phone_market (
market_id number,
phone_id text,
num_of_stock number
)
CREATE TABLE market (
market_id number,
district text,
num_of_employees number,
num_of_sh... | Show the names of phones and the districts of markets they are on. | SELECT T3.name, T2.district FROM phone_market AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id JOIN phone AS T3 ON T1.phone_id = T3.phone_id | spider |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the sum of salary , and group by attribute job_id in a bar chart, rank x-axis in descending order. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_13 (
venue VARCHAR,
crowd INTEGER
) | What venue saw a crowd larger than 29,840? | SELECT venue FROM table_name_13 WHERE crowd > 29 OFFSET 840 | 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,... | what is the number of patients whose age is less than 43 and lab test name is total protein, body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.label = "Total Protein, Body Fluid" | mimicsql_data |
CREATE TABLE table_47851 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is Opponent, when Attendance is 62,170? | SELECT "Opponent" FROM table_47851 WHERE "Attendance" = '62,170' | wikisql |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 28140515这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号 | SELECT zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb 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 WHERE hz_info.RYBH = '28140515' AND NOT zyjybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM ... | css |
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,... | find the number of patients whose admission type is elective and diagnoses is pressure ulcer, stage i. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.short_title = "Pressure ulcer, stage I" | mimicsql_data |
CREATE TABLE table_1015914_24 (
who_two VARCHAR,
you_and_i VARCHAR
) | What is who-two where you and i is ng ban? | SELECT who_two FROM table_1015914_24 WHERE you_and_i = "ngœban" | sql_create_context |
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... | 70688038255这次门诊就诊的诊断如何?列出诊断的名称和编码 | SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '70688038255' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '70688038255' | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | Does 555 usually have 2 or 3 lectures a week ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c... | advising |
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE papers (
paperid number,
title text
) | Find all the papers published by the institution 'Google'. | SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google" | spider |
CREATE TABLE table_name_88 (
to_par INTEGER,
score VARCHAR
) | What is the sum of the to par with a 76-77-74-75=302 score? | SELECT SUM(to_par) FROM table_name_88 WHERE score = 76 - 77 - 74 - 75 = 302 | sql_create_context |
CREATE TABLE table_64714 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the country with a rank less than 2? | SELECT "Country" FROM table_64714 WHERE "Rank" < '2' | wikisql |
CREATE TABLE table_name_25 (
year INTEGER,
points VARCHAR,
engine VARCHAR
) | What is the average year of an entrant that had fewer than 6 points and a Maserati Straight-6 engine? | SELECT AVG(year) FROM table_name_25 WHERE points < 6 AND engine = "maserati straight-6" | sql_create_context |
CREATE TABLE table_21339 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | How many high assists are listed for the game with a score of 68-60? | SELECT COUNT("High assists") FROM table_21339 WHERE "Score" = '68-60' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)... | flights from INDIANAPOLIS to SEATTLE | 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 = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'S... | atis |
CREATE TABLE table_20887670_1 (
institution VARCHAR,
location VARCHAR
) | what is the name of the institution of the sparta, wi location? | SELECT institution FROM table_20887670_1 WHERE location = "Sparta, WI" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 患者57773140在哪些医疗记录中被开出少于5299.72元的药品金额?请列出他的医疗就诊编号 | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '57773140' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 5299.72) | css |
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
) | For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over the name , and group by attribute name by a bar chart, sort y axis in ascending order. | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue | nvbench |
CREATE TABLE table_name_10 (
year INTEGER,
result VARCHAR
) | What is the sum of Year, when Result is 9th? | SELECT SUM(year) FROM table_name_10 WHERE result = "9th" | sql_create_context |
CREATE TABLE table_name_24 (
total VARCHAR,
percentage VARCHAR
) | What is the exact number of Total that has a percentage of precisely 12.03%? | SELECT COUNT(total) FROM table_name_24 WHERE percentage = "12.03%" | 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... | test. | SELECT SourceTagName, TargetTagName FROM TagSynonyms | sede |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
r... | what lab test was given to patient 3929 for the last time this month? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month'... | mimic_iii |
CREATE TABLE table_1773908_3 (
resale VARCHAR,
provider VARCHAR
) | What is the resale category for the provider NetCologne? | SELECT resale FROM table_1773908_3 WHERE provider = "Netcologne" | sql_create_context |
CREATE TABLE table_24613895_1 (
number_of_believers VARCHAR,
name_of_village VARCHAR
) | Name the number of believers for khosrowa | SELECT number_of_believers FROM table_24613895_1 WHERE name_of_village = "Khosrowa" | sql_create_context |
CREATE TABLE table_76377 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | What was the Location/Attendance on september 11? | SELECT "Location/Attendance" FROM table_76377 WHERE "Date" = 'september 11' | wikisql |
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
... | what's the date of patient 60572's birth? | SELECT patients.dob FROM patients WHERE patients.subject_id = 60572 | mimic_iii |
CREATE TABLE table_name_98 (
fleet_number_s_ VARCHAR,
wheel_arrangement VARCHAR,
class VARCHAR
) | What is Fleet Number(s), when Wheel Arrangement is '2-6-0', and when Class is 'Z'? | SELECT fleet_number_s_ FROM table_name_98 WHERE wheel_arrangement = "2-6-0" AND class = "z" | sql_create_context |
CREATE TABLE table_name_95 (
college VARCHAR,
round VARCHAR,
player VARCHAR
) | What college has a round greater than 1, with dylan mcfarland as the player? | SELECT college FROM table_name_95 WHERE round > 1 AND player = "dylan mcfarland" | sql_create_context |
CREATE TABLE table_574 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What was the points againt when played is played? | SELECT "Points against" FROM table_574 WHERE "Played" = 'Played' | wikisql |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of first_name and manager_id , and could you sort by the y-axis from high to low? | SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC | nvbench |
CREATE TABLE table_203_587 (
id number,
"country" text,
"weapon designation" text,
"weapon description" text,
"year(s) delivered" text,
"quantity delivered" number
) | which country had the largest number of towed guns delivered ? | SELECT "country" FROM table_203_587 GROUP BY "country" ORDER BY SUM("quantity delivered") DESC LIMIT 1 | squall |
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... | count the number of patients whose admission year is less than 2168 and lab test name is macrophages? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2168" AND lab.label = "Macrophages" | mimicsql_data |
CREATE TABLE table_18374 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what was the year first elected for district illinois 7? | SELECT MAX("First elected") FROM table_18374 WHERE "District" = 'Illinois 7' | wikisql |
CREATE TABLE table_name_94 (
high_rebounds VARCHAR,
game VARCHAR,
opponent VARCHAR
) | Which High rebounds has a Game smaller than 9, and a Opponent of detroit? | SELECT high_rebounds FROM table_name_94 WHERE game < 9 AND opponent = "detroit" | sql_create_context |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No... | How many wines are there for each grape, and show x-axis from high to low order. | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape DESC | nvbench |
CREATE TABLE table_35687 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What Partner had a Score of 6 3, 2 6, 6 3? | SELECT "Partner" FROM table_35687 WHERE "Score" = '6–3, 2–6, 6–3' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | how did patient 76327 enter the hospital since 6 years ago for the first time? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 76327 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-6 year') ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_145 (
"Player" text,
"Games Played" real,
"Attempts" real,
"Yards" real,
"Touchdowns" real,
"Longest run" real
) | How many yards did the player with 87 attempts rush? | SELECT "Yards" FROM table_145 WHERE "Attempts" = '87' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.