context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_32952 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the opponent when Richmond played as the home team? | SELECT "Away team" FROM table_32952 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE table_203_457 (
id number,
"tramway" text,
"country" text,
"city" text,
"height of pylons" text,
"span width,\nleaning straight line" text,
"span width,\nhorizontal measurement" text,
"height of cable over ground" text,
"year of inauguration" number,
"notes" text
) | was the sandia peak tramway innagurate before or after the 3s aerial tramway ? | SELECT (SELECT "year of inauguration" FROM table_203_457 WHERE "tramway" = 'sandia peak tramway') < (SELECT "year of inauguration" FROM table_203_457 WHERE "tramway" = '3s aerial tramway') | squall |
CREATE TABLE table_204_970 (
id number,
"year" number,
"award" text,
"category" text,
"title" text,
"result" text
) | what was the only tv show this actor was nominated for a daytime emmy award for ? | SELECT "title" FROM table_204_970 WHERE "award" = 'daytime emmy award' | squall |
CREATE TABLE table_name_43 (
lane INTEGER,
time VARCHAR,
heat VARCHAR
) | What is the lowest lane with a time of 2:05.90, and a Heat larger than 3? | SELECT MIN(lane) FROM table_name_43 WHERE time = "2:05.90" AND heat > 3 | sql_create_context |
CREATE TABLE table_15126 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Name the most points for years before 1979 and chassis of alfa romeo 177 | SELECT MAX("Points") FROM table_15126 WHERE "Chassis" = 'alfa romeo 177' AND "Year" < '1979' | wikisql |
CREATE TABLE table_62695 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | How many total goals scored when less than 30 games have been played? | SELECT COUNT("Goals scored") FROM table_62695 WHERE "Games played" < '30' | wikisql |
CREATE TABLE table_6803 (
"Round" text,
"Year" real,
"Team" text,
"Opponent" text,
"Goals" real,
"Behinds" real
) | What is the Round with 1 Behinds? | SELECT "Round" FROM table_6803 WHERE "Behinds" = '1' | wikisql |
CREATE TABLE table_name_96 (
laps VARCHAR,
time_retired VARCHAR,
driver VARCHAR
) | How many laps did riccardo patrese do when he had a time/retird of + 1 lap? | SELECT COUNT(laps) FROM table_name_96 WHERE time_retired = "+ 1 lap" AND driver = "riccardo patrese" | sql_create_context |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | Count the number of captains that have each rank by a bar chart, and sort in asc by the total number. | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY COUNT(*) | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 门诊就诊20851648462的首诊医生工号是什么还有其他所有接诊医生的工号都是多少? | SELECT txmzjzjlb.ZZYSGH, txmzjzjlb.QTJZYSGH FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '20851648462' UNION SELECT ftxmzjzjlb.ZZYSGH, ftxmzjzjlb.QTJZYSGH FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '20851648462' | css |
CREATE TABLE table_53804 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | What is the record when they play the canucks and have under 98 points? | SELECT "Record" FROM table_53804 WHERE "Points" < '98' AND "Opponent" = 'canucks' | wikisql |
CREATE TABLE table_29038 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Wins" real,
"Poles" real,
"Podiums" real,
"Points" real,
"Final Placing" text
) | When 24th is the final placing how many wins are there? | SELECT COUNT("Wins") FROM table_29038 WHERE "Final Placing" = '24th' | wikisql |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
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),... | How many accounts for each customer? Show a bar chart that groups by customer's last name, I want to order Y-axis from low to high order. | SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) | nvbench |
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... | What is the relationship between School_ID and ACC_Percent , and group by attribute Team_Name? | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE table_13260 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | What is the smallest amount of water having landmass over 34.864 sqmi, in Pierce township, with a GEO ID over 3800362460? | SELECT MIN("Water (sqmi)") FROM table_13260 WHERE "Land ( sqmi )" > '34.864' AND "Township" = 'pierce' AND "GEO ID" > '3800362460' | wikisql |
CREATE TABLE table_39151 (
"Date" text,
"Race" text,
"Distance" text,
"Venue" text,
"Radio" text
) | What is the venue of teh carfax 250 race? | SELECT "Venue" FROM table_39151 WHERE "Race" = 'carfax 250' | wikisql |
CREATE TABLE table_7112 (
"Year" real,
"Conventional plans" text,
"HMOs" text,
"PPOs" text,
"POS plans" text
) | How many years have a conventional plan of 7%? | SELECT SUM("Year") FROM table_7112 WHERE "Conventional plans" = '7%' | wikisql |
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 demographic (... | how many patients whose age is less than 56 and lab test name is sodium, whole blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "56" AND lab.label = "Sodium, Whole Blood" | mimicsql_data |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID 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,
meter_700 text,
Time text
)
... | Give me the comparison about ID over the meter_700 by a bar chart, sort by the y-axis in desc. | SELECT meter_700, ID FROM swimmer ORDER BY ID DESC | nvbench |
CREATE TABLE table_51044 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"TV Time" text,
"Attendance" text
) | Who was the opponent on september 27, 1998? | SELECT "Opponent" FROM table_51044 WHERE "Date" = 'september 27, 1998' | wikisql |
CREATE TABLE table_64469 (
"Season" real,
"Level" text,
"Division" text,
"Administration" text,
"Position" text
) | What Position has a Level of tier 4 with a Season smaller than 2003? | SELECT "Position" FROM table_64469 WHERE "Level" = 'tier 4' AND "Season" < '2003' | wikisql |
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | For each origin, how many flights came from there Show bar chart, and sort bar from low to high order please. | SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY origin | nvbench |
CREATE TABLE table_39227 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" text,
"To par" text,
"Margin of victory" text
) | Which Country has a Margin of victory of 2 strokes? | SELECT "Country" FROM table_39227 WHERE "Margin of victory" = '2 strokes' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a scatter chart about the correlation between School_ID and All_Games_Percent , and group by attribute ACC_Regular_Season. | SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season | nvbench |
CREATE TABLE table_name_75 (
rank INTEGER,
placings VARCHAR,
points VARCHAR
) | I want to know the highest rank with placings more than 123 and points greater than 88.06 | SELECT MAX(rank) FROM table_name_75 WHERE placings > 123 AND points > 88.06 | sql_create_context |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 列一下医院4970864所有就诊的记录里面不同的科室和出院诊断下病人平均岁数,保留其中均值大于21岁的记录 | SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4970864' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM HAVING AVG(gwyjzb.PERSON_AGE) > 21 UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb... | css |
CREATE TABLE table_74530 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Time" text,
"Grade" text
) | Which trainer won the hyroglyphic in a year that was before 2010? | SELECT "Trainer" FROM table_74530 WHERE "Year" < '2010' AND "Winner" = 'hyroglyphic' | wikisql |
CREATE TABLE table_name_55 (
away_team VARCHAR,
home_team VARCHAR
) | What was the opponents score when Carlton played at home? | SELECT away_team AS score FROM table_name_55 WHERE home_team = "carlton" | sql_create_context |
CREATE TABLE table_57786 (
"Phoneme" text,
"Realization" text,
"Environment" text,
"Example" text,
"Gloss" text
) | Name the phoneme for realizaiton of [ j] | SELECT "Phoneme" FROM table_57786 WHERE "Realization" = '[ɪj]' | wikisql |
CREATE TABLE table_name_13 (
s_motor_ship___s_naval_trawler VARCHAR,
grand_total VARCHAR
) | How many ships for the nation with grand total of 20? | SELECT s_motor_ship___s_naval_trawler FROM table_name_13 WHERE grand_total = 20 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | when did patient 025-19271's last microbiological test happen in 09/this year? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND DATETIME(microlab.culturetakentime, 'start of ye... | eicu |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What PHIL class is easy ? | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department LIKE '%PHIL%' AND program_course.course_id = course.course_id AND program_course.workload < 3 | advising |
CREATE TABLE table_name_54 (
rank INTEGER,
name VARCHAR
) | What is the highest rank for Josefin Lillhage? | SELECT MAX(rank) FROM table_name_54 WHERE name = "josefin lillhage" | sql_create_context |
CREATE TABLE table_name_33 (
transfer_fee VARCHAR,
ends VARCHAR,
transfer_window VARCHAR
) | What was the transfer fee for the player moving in the winter window and ending in a year after 2010? | SELECT transfer_fee FROM table_name_33 WHERE ends > 2010 AND transfer_window = "winter" | sql_create_context |
CREATE TABLE table_57995 (
"Track" real,
"Recorded" text,
"Catalogue" text,
"Release Date" text,
"Song Title" text,
"Time" text
) | What cataglogue has 27 tracks? | SELECT "Catalogue" FROM table_57995 WHERE "Track" = '27' | wikisql |
CREATE TABLE table_22297198_3 (
team VARCHAR,
date_of_vacancy VARCHAR
) | What team did a manager leave on 12 Dec 2009 | SELECT team FROM table_22297198_3 WHERE date_of_vacancy = "12 Dec 2009" | sql_create_context |
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... | 统计年龄不低于6岁患者的医疗记录的平均医疗费总额有多少? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 6) | css |
CREATE TABLE table_6708 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
) | Who was the opponent in the game that was attended by 48,000 people? | SELECT "Opponent#" FROM table_6708 WHERE "Attendance" = '48,000' | wikisql |
CREATE TABLE table_name_37 (
thumb_stick VARCHAR,
supplier VARCHAR,
basic_shape VARCHAR,
backlit VARCHAR
) | Which Thumb stick has a Basic shape of curved, a Backlit of yes, and a Supplier of genius? | SELECT thumb_stick FROM table_name_37 WHERE basic_shape = "curved" AND backlit = "yes" AND supplier = "genius" | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_c... | what is the cheapest ticket from BALTIMORE to SAN FRANCISCO on friday 8 30 | 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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
CREATE TABLE table_2267857_1 (
date VARCHAR,
year VARCHAR
) | Name the date for 2006 | SELECT date FROM table_2267857_1 WHERE year = 2006 | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | what is the daily average of chest tube output: pleural l output of patient 030-10407 since 02/10/2104? | SELECT AVG(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 = '030-10407')) AND intakeoutput.celllabel = 'chest... | eicu |
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pigs real,
Sheep_and_Goats real
)
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE farm_... | Use a group line chart to show how many competitions are held in each year, group by official name and bin by year. | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY Official_Name | nvbench |
CREATE TABLE ROLES (
role_code VARCHAR,
role_name VARCHAR,
role_description VARCHAR
) | List all role codes, role names, and role descriptions. | SELECT role_code, role_name, role_description FROM ROLES | sql_create_context |
CREATE TABLE table_name_7 (
southbridge VARCHAR,
model VARCHAR
) | What shows for Southbridge when the Model number is amd-640 chipset? | SELECT southbridge FROM table_name_7 WHERE model = "amd-640 chipset" | sql_create_context |
CREATE TABLE table_22936 (
"Tie no" real,
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | How many 1st leg have team 1 ofk belgrade? | SELECT COUNT("1st leg") FROM table_22936 WHERE "Team 1" = 'OFK Belgrade' | wikisql |
CREATE TABLE table_24596664_1 (
wins INTEGER
) | Name the least wins | SELECT MIN(wins) FROM table_24596664_1 | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees whose first name does not contain the letter M, display their average salary by binning the hire date into the day of week interval for visualizing a bar chart. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' | nvbench |
CREATE TABLE table_name_75 (
machine VARCHAR,
trophy VARCHAR
) | What machine did susan jenness trophy earn the trophy? | SELECT machine FROM table_name_75 WHERE trophy = "susan jenness trophy" | sql_create_context |
CREATE TABLE table_name_2 (
result VARCHAR,
week VARCHAR
) | What is the result week 1? | SELECT result FROM table_name_2 WHERE week = 1 | sql_create_context |
CREATE TABLE table_203_229 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
) | the chicago bears drafted bob long who went to the same college as what other player that was also drafter in round 17 of the 1969 nft draft ? | SELECT "player" FROM table_203_229 WHERE "player" <> 'bob long' AND "college" = (SELECT "college" FROM table_203_229 WHERE "player" = 'bob long' AND "nfl team" = 'chicago bears') | squall |
CREATE TABLE table_12109 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What was the playing surface for the Tournament of Great Britain F16? | SELECT "Surface" FROM table_12109 WHERE "Tournament" = 'great britain f16' | wikisql |
CREATE TABLE table_name_86 (
city_of_license VARCHAR,
class VARCHAR,
identifier VARCHAR
) | What city of license has A as a class, and cbec-fm as the identifier? | SELECT city_of_license FROM table_name_86 WHERE class = "a" AND identifier = "cbec-fm" | sql_create_context |
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 jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '... | css |
CREATE TABLE table_60793 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is the lowest total of the player with a t41 finish? | SELECT MIN("Total") FROM table_60793 WHERE "Finish" = 't41' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 查一下给患者云学博开315832这个药的医院有哪些 | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '云学博' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '315832') | 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,
... | 姓名是赵静逸的病人促肾上腺皮质激素情况在01年7月27日至07年7月19日之中这段时间内情况怎么样? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '赵静逸'... | css |
CREATE TABLE table_25951 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | When was the game with 13-5-6 record played? | SELECT "Date" FROM table_25951 WHERE "Record" = '13-5-6' | wikisql |
CREATE TABLE table_13898 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the heat for the time 57.97? | SELECT "Heat" FROM table_13898 WHERE "Time" = '57.97' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_... | for patients who have had packed cell transfusion since 2104, what are the top five most common diagnoses that followed during the same hospital visit? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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_i... | mimic_iii |
CREATE TABLE table_37161 (
"Rank" text,
"Scorer" text,
"Club" text,
"Goals" real,
"Matches" text
) | Which Rank has a Scorer of lee sang-cheol? | SELECT "Rank" FROM table_37161 WHERE "Scorer" = 'lee sang-cheol' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | what was patient 007-8066 diagnosed with the last time until 1 year ago? | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8066')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CUR... | eicu |
CREATE TABLE table_40942 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the fewest number of top-5s for events with more than 1 win? | SELECT MIN("Top-5") FROM table_40942 WHERE "Wins" > '1' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | what's the name of the drug that patient 006-1634's been prescribed two or more times when they visited the hospital last time? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006... | eicu |
CREATE TABLE table_name_23 (
region VARCHAR,
label VARCHAR,
catalogue VARCHAR
) | Which region has and eyeball label and catalogue 7200222? | SELECT region FROM table_name_23 WHERE label = "eyeball" AND catalogue = "7200222" | sql_create_context |
CREATE TABLE table_64885 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | What is the average lane for Australia? | SELECT AVG("Lane") FROM table_64885 WHERE "Nationality" = 'australia' | wikisql |
CREATE TABLE table_15350 (
"Media market name" text,
"Callsign" text,
"Analog" text,
"Digital" text,
"Affiliation" text
) | what is the analog type for wxmi? | SELECT "Analog" FROM table_15350 WHERE "Callsign" = 'wxmi' | wikisql |
CREATE TABLE table_28656 (
"Name / designation" text,
"Year of introduction" text,
"Country of origin" text,
"Primary cartridge" text,
"primary user" text
) | If the country of Origin is South Africa, who is the primary user? | SELECT "primary user" FROM table_28656 WHERE "Country of origin" = 'South Africa' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what is the average total hospital cost that includes the epithelial cells during the previous year? | SELECT AVG(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 = 'epithelial cells')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start ... | mimic_iii |
CREATE TABLE table_name_97 (
cancelable VARCHAR,
type VARCHAR,
bubbles VARCHAR,
category VARCHAR
) | When Bubbles of no, and a Category of miscellaneous, and a Type of propertychange, what was the Cancelable? | SELECT cancelable FROM table_name_97 WHERE bubbles = "no" AND category = "miscellaneous" AND type = "propertychange" | 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 diagnoses (
... | Tell me the number of patients with delta abnormal lab test who had a lipase test done. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "Lipase" | mimicsql_data |
CREATE TABLE table_name_76 (
laid_down VARCHAR,
name VARCHAR
) | What is the date the Fubuki ship laid down? | SELECT laid_down FROM table_name_76 WHERE name = "fubuki" | sql_create_context |
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Owner text
)
CREATE TABLE channel (
Channel_ID int,
Name text,
Owner text,
Share_in_percent real,
Rating_in_percen... | What is the total rating of channel for each channel owner Plot them as bar chart, and sort Y-axis in asc order. | SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent) | nvbench |
CREATE TABLE table_name_55 (
series_9 VARCHAR,
series_2 VARCHAR
) | Who in series 9 corresponds to Peter Jones in series 2? | SELECT series_9 FROM table_name_55 WHERE series_2 = "peter jones" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
... | when was the last time patient 15447 measured its respiratory rate greater than 13.0 since 07/13/2102? | SELECT chartevents.charttime 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 = 15447)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat... | mimic_iii |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Ac... | Show the number of documents in each day for all documents on project with details 'Graph Database project' and bin document date by weekday with a bar chart. | SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project' | nvbench |
CREATE TABLE table_17645 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power (kW)" text,
"Station Type" text,
"Coverage (Transmitter site)" text
) | What is the ch# of dwlj-tv? | SELECT "Ch. #" FROM table_17645 WHERE "Callsign" = 'DWLJ-TV' | wikisql |
CREATE TABLE table_name_96 (
polyunsaturated_fat VARCHAR,
total_fat VARCHAR,
monounsaturated_fat VARCHAR
) | Name the polyunsaturated fat with total fat of 100g and monounsaturated fat of 20g (84g in high oleic variety) | SELECT polyunsaturated_fat FROM table_name_96 WHERE total_fat = "100g" AND monounsaturated_fat = "20g (84g in high oleic variety)" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | provide the number of patients whose days of hospital stay is greater than 3 and admission year is less than 2146? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "3" AND demographic.admityear < "2146" | mimicsql_data |
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... | what is the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda and age is less than 41? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.age < "41" | mimicsql_data |
CREATE TABLE table_18923 (
"Year(s)" real,
"Grand Final Television Commentator" text,
"Grand Final Dual Television Commentator" text,
"Spokesperson" text,
"Semi Final Television Commentator" text,
"Semi Final Dual Television Commentator" text
) | What year was Thierry Beccaro the spokesperson? | SELECT MIN("Year(s)") FROM table_18923 WHERE "Spokesperson" = 'Thierry Beccaro' | wikisql |
CREATE TABLE table_name_28 (
rider VARCHAR,
grid VARCHAR
) | Who is the rider when the grid number is 3? | SELECT rider FROM table_name_28 WHERE grid = 3 | sql_create_context |
CREATE TABLE table_4803 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the opposing team at the match played at the Arden Street Oval? | SELECT "Away team" FROM table_4803 WHERE "Venue" = 'arden street oval' | wikisql |
CREATE TABLE table_11807 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
) | What is the total attendance for Detroit on hasek? | SELECT COUNT("Attendance") FROM table_11807 WHERE "Home" = 'detroit' AND "Decision" = 'hasek' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | what is the name of the drug for which patient 030-52395 was prescribed within the same hospital visit after having been diagnosed with acute coronary syndrome - acute myocardial infarction (with st elevation) in 04/2102? | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE table_17271495_1 (
team VARCHAR,
driver VARCHAR
) | Name the team of darren manning | SELECT team FROM table_17271495_1 WHERE driver = "Darren Manning" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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,... | what is the average total hospital cost that includes the nrbc lab test this year? | SELECT AVG(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 = 'nrbc')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-... | mimic_iii |
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... | What is my GPA at present ? | SELECT DISTINCT total_gpa FROM student WHERE student_id = 1 | advising |
CREATE TABLE table_name_92 (
location_attendance VARCHAR,
game VARCHAR,
team VARCHAR
) | Which Location Attendance has a Game larger than 67, and a Team of @ charlotte? | SELECT location_attendance FROM table_name_92 WHERE game > 67 AND team = "@ charlotte" | sql_create_context |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Show me the comparison of the total number of all ships' nationalities with a bar graph. | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality | nvbench |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | during a year before what are the top three most frequently ordered lab tests for patients during the same hospital visit after being diagnosed with concussion w coma nos? | 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, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W... | mimic_iii |
CREATE TABLE table_name_73 (
week VARCHAR,
air_date VARCHAR
) | Which Week has an Air Date of august 30, 2008? | SELECT week FROM table_name_73 WHERE air_date = "august 30, 2008" | sql_create_context |
CREATE TABLE table_name_34 (
away VARCHAR,
round VARCHAR
) | Who was the away team in the semifinals? | SELECT away FROM table_name_34 WHERE round = "semifinals" | sql_create_context |
CREATE TABLE table_61495 (
"Rank" real,
"Airport" text,
"Passengers" real,
"Aircraft Movements" real,
"Carriers" text
) | Which carrier is ranked 20? | SELECT "Carriers" FROM table_61495 WHERE "Rank" = '20' | wikisql |
CREATE TABLE zzmzjzjlb (
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... | 在门诊就诊中开出的检验报告单编号是18617943504对应的患者姓名可以告诉我吗? | SELECT person_info.XM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '1... | css |
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... | 从00.7.27开始,截止到06.10.24,在患者葛安易开出的所有药品里,自费金额高于1217.85元的总共有多少 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '葛安易' AND t_kc22.STA_DATE BETWEEN '2000-07-27' AND '2006-10-24' AND t_kc22.SELF_PAY_AMO > 1217.85 | css |
CREATE TABLE table_name_73 (
party VARCHAR,
district VARCHAR
) | What is the party of the maryland 6 district? | SELECT party FROM table_name_73 WHERE district = "maryland 6" | sql_create_context |
CREATE TABLE table_1341897_23 (
candidates VARCHAR,
first_elected VARCHAR
) | Name the candidate first elected in 1942 | SELECT candidates FROM table_1341897_23 WHERE first_elected = 1942 | sql_create_context |
CREATE TABLE table_name_70 (
home_team VARCHAR,
venue VARCHAR
) | Tell me the home team for venue of mcg | SELECT home_team FROM table_name_70 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_66823 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"FCC info" text
) | Name the average ERP W when it has a city of license of pound, virginia and frequency mhz more than 91.3 | SELECT AVG("ERP W") FROM table_66823 WHERE "City of license" = 'pound, virginia' AND "Frequency MHz" > '91.3' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.