context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_7519 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text
) | What is the highest heat for Ihor Bodrov when the mark is 6.76 and the lane is less than 1? | SELECT MAX("Heat") FROM table_7519 WHERE "Mark" = '6.76' AND "Name" = 'ihor bodrov' AND "Lane" < '1' | wikisql |
CREATE TABLE table_28947 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the district with the candidates leven powell (f) 63.8% roger west (dr) 36.4%? | SELECT "District" FROM table_28947 WHERE "Candidates" = 'Leven Powell (F) 63.8% Roger West (DR) 36.4%' | 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
)
... | give me the number of patients whose gender is f and diagnoses short title is paralytic ileus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Paralytic ileus" | mimicsql_data |
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_id INTEGER,
attribute_value VARCHAR(255)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_en... | Compute how many attributes in each name of the attribute definitions with attribute value 0 Show the result with a bar chart, sort in ascending by the x axis. | SELECT attribute_name, COUNT(attribute_name) FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 GROUP BY attribute_name ORDER BY attribute_name | nvbench |
CREATE TABLE table_19481 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What college did the defensive back attend? | SELECT "College" FROM table_19481 WHERE "Position" = 'Defensive Back' | wikisql |
CREATE TABLE table_20434 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Time" text,
"Jockey" text,
"Winner/2nd" text
) | What is the entry for weight in kilograms of jockey D. Nikolic? | SELECT "Weight (kg)" FROM table_20434 WHERE "Jockey" = 'D. Nikolic' | wikisql |
CREATE TABLE table_204_208 (
id number,
"year" text,
"title" text,
"role" text,
"episodes" text
) | what title came directly after this morning ? | SELECT "title" FROM table_204_208 WHERE id = (SELECT id FROM table_204_208 WHERE "title" = 'this morning') + 1 | squall |
CREATE TABLE table_name_24 (
lost VARCHAR,
points_difference VARCHAR
) | What is the number of losses for the team with a points difference of -25? | SELECT lost FROM table_name_24 WHERE points_difference = "-25" | sql_create_context |
CREATE TABLE table_28803 (
"English" text,
"Galician ( Official )" text,
"Galician ( Reintegrationist )" text,
"Portuguese" text,
"Spanish" text
) | What is the Galician (reintegrationist) word of the Galician (Official) is bo d a / bos d as? | SELECT "Galician ( Reintegrationist )" FROM table_28803 WHERE "Galician ( Official )" = 'Bo día / Bos días' | wikisql |
CREATE TABLE table_24915874_1 (
placing VARCHAR,
jockey VARCHAR
) | What was the placing when the jockey was Damien Oliver? | SELECT placing FROM table_24915874_1 WHERE jockey = "Damien Oliver" | sql_create_context |
CREATE TABLE table_8423 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the score of the United States, which has a to par of +5? | SELECT "Score" FROM table_8423 WHERE "Country" = 'united states' AND "To par" = '+5' | wikisql |
CREATE TABLE table_72529 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | Name the number of points for field goals being 1 | SELECT COUNT("Points") FROM table_72529 WHERE "Field goals" = '1' | wikisql |
CREATE TABLE table_name_83 (
tournament VARCHAR
) | What's the 2012 during Wimbledon and had a Q3 in 2008? | SELECT 2012 FROM table_name_83 WHERE 2008 = "q3" AND tournament = "wimbledon" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_cred... | Is it possible to take 560 on Wednesdays and Mondays ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... | advising |
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... | 编号是5136139的这个医院在2012年9月20日至2019年5月4日之内门诊医疗记录的具体数量是多少? | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5136139' AND t_kc21.IN_HOSP_DATE BETWEEN '2012-09-20' AND '2019-05-04' AND t_kc21.CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_14189 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | Which Name has a Number of electorates (2009) greater than 188,799? | SELECT "Name" FROM table_14189 WHERE "Number of electorates (2009)" > '188,799' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number... | Top Users 25 And Under. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, DisplayName, Age, CreationDate, Reputation, CONCAT('http://stackoverflow.com/users/', Id) AS Profile FROM Users WHERE Age <= 25 AND Reputation > 8000 ORDER BY Reputation DESC | sede |
CREATE TABLE mzjybgb (
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,
... | 医院1771451在2003年9月14日到2010年1月28日期间,有多少科室在门诊就诊中开出20张以下的检验报告单 | SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '1771451' AND zyjybgb.BGRQ BETWEEN '2003-09-14' AND '2010-01-28' GROUP BY zyjybgb.KSBM HAVING COUNT(*) <= 20 UNION SELECT mzjybgb.KSBM FROM mzjz... | css |
CREATE TABLE table_name_78 (
record VARCHAR,
game VARCHAR
) | What was the record of the game for game 31? | SELECT record FROM table_name_78 WHERE game = 31 | sql_create_context |
CREATE TABLE table_67669 (
"Position" text,
"Player" text,
"County team" text,
"Club team(s)" text,
"Team Number" real
) | Which county team has jimmy finn as the player? | SELECT "County team" FROM table_67669 WHERE "Player" = 'jimmy finn' | wikisql |
CREATE TABLE table_name_71 (
game INTEGER,
november VARCHAR,
record VARCHAR
) | When the record is listed as 2-0-0, and the November date is less than 27, what is the sum of the game? | SELECT SUM(game) FROM table_name_71 WHERE november < 27 AND record = "2-0-0" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | what is the actual number of patients discharged from a hospital in 2102? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) = '2102' | eicu |
CREATE TABLE table_51817 (
"Tournament" text,
"1968" text,
"1969" text,
"1970" text,
"1971" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"Career SR" text,
"Career W\u2013L" text,
"Career Win ... | What is theW-L of the tournament listed as A for 1976? | SELECT "Career W\u2013L" FROM table_51817 WHERE "1976" = 'a' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... | how much neo*iv*gentamicin is prescribed the last time the previous month to patient 40435? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.drug = 'neo*iv*gentamicin' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month')... | mimic_iii |
CREATE TABLE table_name_63 (
date VARCHAR,
record VARCHAR
) | When was there a record of 13 17 3? | SELECT date FROM table_name_63 WHERE record = "13–17–3" | sql_create_context |
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 admissions (
row_id num... | until 2104, what are the top five most frequent lab tests ordered for patients in the same month after being diagnosed with tachycardia 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 FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i... | mimic_iii |
CREATE TABLE table_28750142_1 (
jockey VARCHAR,
name VARCHAR
) | What is the name of the jockey for Pink Gin? | SELECT jockey FROM table_28750142_1 WHERE name = "Pink Gin" | sql_create_context |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_middle_initial text,
customer_last_name text,
gender text,
email_address text,
login_name text,
login_password text,
phone_number text,
town_city text,
state_county_province text,
country text... | Show invoice dates and order id and details for all invoices. | SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id | spider |
CREATE TABLE table_22457674_1 (
european_tier VARCHAR,
artist VARCHAR
) | Name the european tier for rick springfield | SELECT european_tier FROM table_22457674_1 WHERE artist = "Rick Springfield" | sql_create_context |
CREATE TABLE table_12792876_3 (
drawn VARCHAR,
tries_against VARCHAR
) | What was the drawn when the tries against was 89? | SELECT drawn FROM table_12792876_3 WHERE tries_against = "89" | sql_create_context |
CREATE TABLE table_10797 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Away team has a Home team score of 7.8 (50)? | SELECT "Away team" FROM table_10797 WHERE "Home team score" = '7.8 (50)' | wikisql |
CREATE TABLE table_12265 (
"Draft" real,
"Round" text,
"Pick" real,
"Player" text,
"Nationality" text
) | What is the round of player brad winton with a draft before 1983 and a pick less than 132? | SELECT "Round" FROM table_12265 WHERE "Draft" < '1983' AND "Pick" < '132' AND "Player" = 'brad winton' | wikisql |
CREATE TABLE table_28970 (
"Species" text,
"Common Name" text,
"Protein Name" text,
"Accession Number" text,
"NT Length" text,
"NT Identity" text,
"AA Length" text,
"AA Identity" text,
"E-Value" text
) | What is the protein name when the e-value is 2.50e-41? | SELECT "Protein Name" FROM table_28970 WHERE "E-Value" = '2.50E-41' | wikisql |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 孙和煦病患在号码是4311972的医院门诊中所诊断的名称含有脑血管病的门诊就诊记录列出来? | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '孙和煦' AND hz_info.YLJGDM = '4311972' AND wdmzjzjlb.JZZDSM LIKE '%脑血管病%' UNION SELECT * FROM person_info JOIN... | css |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE date_day (
... | please give me flight schedules from BALTIMORE to PHILADELPHIA | SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND C... | atis |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_... | i would like to fly from BOSTON to SAN FRANCISCO | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... | atis |
CREATE TABLE table_1346 (
"Num" real,
"Team" text,
"W" real,
"L" real,
"PCT" text,
"PF" real,
"PA" real,
"Last appearance" real,
"Last championship" real,
"HOME games" real,
"Home wins" real,
"Home losses" real,
"Home Win Pct." text,
"ROAD games" real,
"Road w... | Name the maximum mum l is less than 6.0 | SELECT MAX("Num") FROM table_1346 WHERE "L" < '6.0' | wikisql |
CREATE TABLE table_name_5 (
points INTEGER,
february INTEGER
) | How many Points a February smaller than 1 have? | SELECT MIN(points) FROM table_name_5 WHERE february < 1 | sql_create_context |
CREATE TABLE table_name_91 (
completed VARCHAR,
builder VARCHAR,
name VARCHAR
) | When did chatham complete the Hmsmedusa? | SELECT completed FROM table_name_91 WHERE builder = "chatham" AND name = "hmsmedusa" | sql_create_context |
CREATE TABLE table_14209245_9 (
nationality VARCHAR,
college_junior_club_team__league_ VARCHAR
) | What is the nationality of the player whose college/junior/club team (league) is Seattle Thunderbirds (WHL)? | SELECT nationality FROM table_14209245_9 WHERE college_junior_club_team__league_ = "Seattle Thunderbirds (WHL)" | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
... | What is the type of video game Call of Destiny. | SELECT gtype FROM video_games WHERE gname = "Call of Destiny" | spider |
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE... | Count different addresses of each school. | SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code | spider |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | tell me the number of patients diagnosed with polymyalgia rheumatica who are less than 81 years. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "81" AND diagnoses.short_title = "Polymyalgia rheumatica" | mimicsql_data |
CREATE TABLE table_25887826_17 (
avg VARCHAR
) | How many figures for 08 A points for the team with 1.1863 average? | SELECT COUNT(08 AS _a_pts) FROM table_25887826_17 WHERE avg = "1.1863" | sql_create_context |
CREATE TABLE table_name_95 (
tournament VARCHAR,
score VARCHAR,
outcome VARCHAR,
surface VARCHAR
) | Which tournament has an Outcome of runner-up, a Surface of hard, and a Score of 6 4, 6 2? | SELECT tournament FROM table_name_95 WHERE outcome = "runner-up" AND surface = "hard" AND score = "6–4, 6–2" | sql_create_context |
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, find name and the sum of code , and group by attribute name, and visualize them by a bar chart, and sort by the Y-axis from high to low. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC | nvbench |
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... | Give the number of patients who were admitted in the emergency room that had a procedure icd9 code of 9672. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "9672" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | what are the three most frequently performed procedures for patients who previously received oxygen therapy (40% to 60%) - reduce fio2 as tolerated within 2 months in the previous year? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxygen therapy (40% to 60%) - reduce fio... | eicu |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Return a pie chart on what are the number of rooms for each bed type? | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType | nvbench |
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date text,
Share_in_percent real
)
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Owner text
)
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE... | Plot the total number by grouped by time of day as a bar graph, rank in ascending by the total number. | SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_16226 (
"1st players choice" text,
"2nd players choice" text,
"Probability 1st player wins" text,
"Probability 2nd player wins" text,
"Probability of a draw" text
) | In Penney's game what is the probability where the 1st player wins if the probability of a draw is 8.28% and the 2nd player chooses B BR? | SELECT "Probability 1st player wins" FROM table_16226 WHERE "Probability of a draw" = '8.28%' AND "2nd players choice" = 'B BR' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 在医院4316976中列举出患者81533659门诊诊断名称包含相的门诊就诊记录有哪些? | SELECT * 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 = '81533659' AND hz_info.YLJGDM = '4316976' AND mzjzjlb.JZZDSM LIKE '%相%' | css |
CREATE TABLE table_14160327_4 (
family_friendly VARCHAR,
decade VARCHAR
) | How many family friendly games are in the 1990s? | SELECT COUNT(family_friendly) FROM table_14160327_4 WHERE decade = "1990s" | sql_create_context |
CREATE TABLE table_name_59 (
height VARCHAR,
year VARCHAR,
name VARCHAR
) | What is the Height of Junior Meghan Austin? | SELECT height FROM table_name_59 WHERE year = "junior" AND name = "meghan austin" | sql_create_context |
CREATE TABLE table_name_32 (
position VARCHAR,
player VARCHAR
) | What position is Sal Martinez? | SELECT position FROM table_name_32 WHERE player = "sal martinez" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | provide the number of patients whose admission year is less than 2167 and procedure icd9 code is 3532? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2167" AND procedures.icd9_code = "3532" | mimicsql_data |
CREATE TABLE table_55269 (
"Round" text,
"Date" text,
"Matches" real,
"Clubs" text,
"New entries this round" text,
"Prize money" text
) | How many matches were there in the round with 1,000,000 in prize money? | SELECT COUNT("Matches") FROM table_55269 WHERE "Prize money" = '£1,000,000' | wikisql |
CREATE TABLE table_name_89 (
grid INTEGER,
laps VARCHAR,
rank VARCHAR
) | Name the highest grid for Laps more than 137 and rank is less than 8 | SELECT MAX(grid) FROM table_name_89 WHERE laps > 137 AND rank < 8 | sql_create_context |
CREATE TABLE table_name_56 (
role VARCHAR,
festival_organization VARCHAR
) | What role was nominated at the Sydney Film Festival? | SELECT role FROM table_name_56 WHERE festival_organization = "sydney film festival" | sql_create_context |
CREATE TABLE table_26688 (
"Episode number Production number" text,
"Title" text,
"Original airdate" text,
"Time of airing" text,
"Total viewers on Hallmark" real,
"Total viewers on Hallmark+1" real,
"Total viewers" real,
"Rank on channel" text
) | Name the rank on channel for pilot | SELECT "Rank on channel" FROM table_26688 WHERE "Title" = 'Pilot' | wikisql |
CREATE TABLE table_name_64 (
opponent VARCHAR,
time VARCHAR,
ground VARCHAR
) | Who is the Opponent playing at 20:00 GMT at Camp Nou? | SELECT opponent FROM table_name_64 WHERE time = "20:00 gmt" AND ground = "camp nou" | 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... | 患者苗星河从00年7月11日到17年6月2日这段时间,在医疗机构0680435开的西药为多少? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '苗星河' AND t_kc22.STA_DATE BETWEEN '2000-07-11' AND '2017-06-02' AND t_kc22.t_kc21_MED_SER_ORG_NO = '0680435' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
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,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm... | how many patients died after being diagnosed with dmii wo cmp nt st uncntr during the same hospital encounter since 6 years ago? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO... | mimic_iii |
CREATE TABLE table_name_94 (
blackpool INTEGER,
draw VARCHAR,
preston_north_end VARCHAR,
competition VARCHAR
) | Which Blackpool has a Preston North End smaller than 46, and a Competition of other, and a Draw larger than 1? | SELECT SUM(blackpool) FROM table_name_94 WHERE preston_north_end < 46 AND competition = "other" AND draw > 1 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | what is patient 006-36108's first urine catheter output time on last month/30? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE wdmzjzjlb (
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... | 门诊就诊51309268056的治病结束时间是啥时候? | SELECT wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '51309268056' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '51309268056' | css |
CREATE TABLE table_name_25 (
record VARCHAR,
home VARCHAR,
decision VARCHAR,
visitor VARCHAR
) | What is the team's record when the NY rangers are at home with atlanta visting and lehtonen getting the decision? | SELECT record FROM table_name_25 WHERE decision = "lehtonen" AND visitor = "atlanta" AND home = "ny rangers" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | when was last the heartrate of patient 030-52327 measured today? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
... | what was the average systemicmean on the last icu visit for patient 031-4987. | SELECT AVG(vitalperiodic.systemicmean) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987') AND NOT patient.unitdischargetime IS N... | eicu |
CREATE TABLE table_16081 (
"Headstamp ID" text,
"Primer Annulus Color" text,
"Bullet Tip Color" text,
"Other Features" text,
"Functional Type" text
) | For the headstamp id of h2, what was the color of the bullet tip? | SELECT "Bullet Tip Color" FROM table_16081 WHERE "Headstamp ID" = 'H2' | wikisql |
CREATE TABLE table_54456 (
"Episode" text,
"Rating" real,
"Share" real,
"Rating/Share (18-49)" text,
"Viewers (millions)" real,
"Rank (timeslot)" real,
"Rank (night)" real,
"Rank (week)" text
) | what is the rank (night) when the rating is more than 4.3 and the viewers (millions) is more than 10.72? | SELECT AVG("Rank (night)") FROM table_54456 WHERE "Rating" > '4.3' AND "Viewers (millions)" > '10.72' | wikisql |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_... | What are the different card types, and how many cards are there of each, I want to order total number in descending order. | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_13766 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College/junior/club team" text
) | Which College/junior/club team has a Round of 4? | SELECT "College/junior/club team" FROM table_13766 WHERE "Round" = '4' | wikisql |
CREATE TABLE table_name_52 (
opponent VARCHAR,
result VARCHAR
) | Tell mem the opponent for result of w 31-21 | SELECT opponent FROM table_name_52 WHERE result = "w 31-21" | sql_create_context |
CREATE TABLE table_24859 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | How many viewers in millions watched the episode with the production code 6acx16? | SELECT "U.S. viewers (million)" FROM table_24859 WHERE "Production code" = '6ACX16' | wikisql |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 在2007年12月2日到2008年6月25日这段时间,罗列出患者号码83925055所有检验报告单中的标本收集部位是那一部分? | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '83925055' AND jybgb.BGRQ BETWEEN '2007-12-02' AND '2008-06-25' UNI... | css |
CREATE TABLE table_name_67 (
pick VARCHAR,
round VARCHAR,
position VARCHAR
) | What is the pick number for the tight end who was picked after round 6? | SELECT COUNT(pick) FROM table_name_67 WHERE round > 6 AND position = "tight end" | 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 patient (
uniquep... | when did patient 035-6788 receive the last test of a lab? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-6788')) ORDER BY lab.labresulttime DESC LIMIT 1 | eicu |
CREATE TABLE table_30166 (
"Series episode" real,
"Season episode" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in million)" text
) | What was the episode number for the episode viewed by 5.68 million viewers? | SELECT "Season episode" FROM table_30166 WHERE "U.S. viewers (in million)" = '5.68' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
... | what's the name of the diagnosis that patient 006-80884 was given for the last time since 2105? | 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 = '006-80884')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105... | eicu |
CREATE TABLE table_3283 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | What is the smallest number of extra points? | SELECT MIN("Extra points") FROM table_3283 | wikisql |
CREATE TABLE table_name_68 (
winner VARCHAR,
season VARCHAR
) | Who had the women's win when Norway was the winner overall in season 2001/02? | SELECT winner AS Women FROM table_name_68 WHERE winner = "norway" AND season = "2001/02" | sql_create_context |
CREATE TABLE driverstandings (
driverstandingsid number,
raceid number,
driverid number,
points number,
position number,
positiontext text,
wins number
)
CREATE TABLE qualifying (
qualifyid number,
raceid number,
driverid number,
constructorid number,
number number,
... | Find the names of all races held in 2017. | SELECT name FROM races WHERE year = 2017 | spider |
CREATE TABLE table_name_44 (
males VARCHAR,
percentage___percentage_ VARCHAR
) | Which language do 87.5% of males speak? | SELECT males FROM table_name_44 WHERE percentage___percentage_ = "87.5" | sql_create_context |
CREATE TABLE table_77980 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | Which height is associated with Franklin High School? | SELECT "Height" FROM table_77980 WHERE "School" = 'franklin high school' | wikisql |
CREATE TABLE table_3260 (
"Date" text,
"Time (ET)" text,
"Event #" real,
"Event" text,
"Winner" text,
"Prize" text,
"Entries" text,
"Prize Pool" text,
"Elapsed Time" text
) | Name the prize pool for 706 (481 r, 346 a) | SELECT "Prize Pool" FROM table_3260 WHERE "Entries" = '706 (481 R, 346 A)' | wikisql |
CREATE TABLE table_1969634_1 (
enrollment VARCHAR,
location VARCHAR
) | What is the total enrollment for the school in garden city, new york? | SELECT enrollment FROM table_1969634_1 WHERE location = "Garden City, New York" | sql_create_context |
CREATE TABLE table_20494 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Bills points" real,
"Opponents" real,
"Bills first downs" real,
"Record" text
) | How many points did the bills score when their opponent had 14 | SELECT "Bills points" FROM table_20494 WHERE "Opponents" = '14' | wikisql |
CREATE TABLE table_26758262_1 (
judges_residence VARCHAR,
municipalities_served VARCHAR
) | Where does the judge who serves Beacon Falls , Naugatuck , Middlebury , Prospect reside? | SELECT judges_residence FROM table_26758262_1 WHERE municipalities_served = "Beacon Falls , Naugatuck , Middlebury , Prospect" | sql_create_context |
CREATE TABLE table_14606 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Who did the Blue Jays lose to on July 16? | SELECT "Loss" FROM table_14606 WHERE "Date" = 'july 16' | wikisql |
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Address_Types (
... | Draw a bar chart about the distribution of date_address_from and the sum of monthly_rental bin date_address_from by time. | SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_79810 (
"Club" text,
"Manager" text,
"Captain" text,
"Manufacturer" text,
"Sponsor" text
) | Who is the captain of Middlesbrough? | SELECT "Captain" FROM table_79810 WHERE "Club" = 'middlesbrough' | 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... | 哪一天结束34024998197这个门诊的就诊呢 | SELECT zzmzjzjlb.JZJSSJ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '34024998197' UNION SELECT fzzmzjzjlb.JZJSSJ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '34024998197' | css |
CREATE TABLE table_75857 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | What is the Date with a Home that is hamilton wildcats? | SELECT "Date" FROM table_75857 WHERE "Home" = 'hamilton wildcats' | wikisql |
CREATE TABLE table_name_46 (
venue VARCHAR,
home_team VARCHAR
) | What venue is the home field of Richmond? | SELECT venue FROM table_name_46 WHERE home_team = "richmond" | sql_create_context |
CREATE TABLE table_57423 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What Venue has an Away Team Score of 9.12 (66)? | SELECT "Venue" FROM table_57423 WHERE "Away team score" = '9.12 (66)' | wikisql |
CREATE TABLE table_9969 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the sum of March, when Score is '2 - 2', and when Game is greater than 67? | SELECT SUM("March") FROM table_9969 WHERE "Score" = '2 - 2' AND "Game" > '67' | wikisql |
CREATE TABLE table_79861 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
) | yankee stadium (i), and a Time of 3:00 has what attendance for this location? | SELECT "Attendance" FROM table_79861 WHERE "Location" = 'yankee stadium (i)' AND "Time" = '3:00' | wikisql |
CREATE TABLE table_67021 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Entrant" text
) | What Engine had a Finish of 27? | SELECT "Engine" FROM table_67021 WHERE "Finish" = '27' | wikisql |
CREATE TABLE table_70364 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Name the average total for gold less than 1 and rank less than 5 | SELECT AVG("Total") FROM table_70364 WHERE "Gold" < '1' AND "Rank" < '5' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.