context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_90 (
score VARCHAR,
decision VARCHAR,
home VARCHAR
) | What was the score in the game where Carolina was the home team and Niittymaki received the decision? | SELECT score FROM table_name_90 WHERE decision = "niittymaki" AND home = "carolina" | sql_create_context |
CREATE TABLE table_name_28 (
test_standard VARCHAR,
usage VARCHAR,
class VARCHAR
) | Which Test Standard has a Usage of secondary filters, and a Class of f5? Question 4 | SELECT test_standard FROM table_name_28 WHERE usage = "secondary filters" AND class = "f5" | sql_create_context |
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE broadcast (
channel_id number,
program_id number,
time_of... | find the number of different programs that are broadcast during night time. | SELECT COUNT(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night' | spider |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | Show all cities and corresponding number of students Plot them as bar chart, I want to display in ascending by the total number. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_269920_17 (
turbo_boost VARCHAR,
model VARCHAR
) | Does the model e5504 have a turbo boost? | SELECT turbo_boost FROM table_269920_17 WHERE model = "E5504" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
... | show me the flights from BOSTON to PHILADELPHIA | 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 = 'PHILADE... | atis |
CREATE TABLE table_2224 (
"Team" text,
"Location" text,
"Head Coach" text,
"Team Captain" text,
"Venue" text,
"Capacity" real,
"Position in 2008" text
) | What is the location of the team who's captain is Miodrag D udovi ? | SELECT "Location" FROM table_2224 WHERE "Team Captain" = 'Miodrag Džudović' | wikisql |
CREATE TABLE table_8659 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | What is the date for week 15? | SELECT "Date" FROM table_8659 WHERE "Week" = '15' | wikisql |
CREATE TABLE table_204_771 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which nation won the same number of bronze medals as peru ? | SELECT "nation" FROM table_204_771 WHERE "nation" <> 'peru' AND "bronze" = (SELECT "bronze" FROM table_204_771 WHERE "nation" = 'peru') | squall |
CREATE TABLE party_host (
party_id number,
host_id number,
is_main_in_charge others
)
CREATE TABLE party (
party_id number,
party_theme text,
location text,
first_year text,
last_year text,
number_of_hosts number
)
CREATE TABLE host (
host_id number,
name text,
national... | Give me the theme and location of each party. | SELECT party_theme, location FROM party | spider |
CREATE TABLE t_kc21 (
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,
... | 9683754医疗机构在2004年6月18到2005年4月20的这段时间共计多少医疗费 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '9683754' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-18' AND '2005-04-20' | css |
CREATE TABLE table_24079 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Golden Bears points" real,
"Opponents" real,
"Record" text
) | What opponent was playing against the Golden Bears when they scored 3 points? | SELECT "Opponent" FROM table_24079 WHERE "Golden Bears points" = '3' | wikisql |
CREATE TABLE table_name_56 (
driver VARCHAR,
part_1 VARCHAR
) | Which driver had a Part 1 time of 1:13.306? | SELECT driver FROM table_name_56 WHERE part_1 = "1:13.306" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the first_name , rank from high to low by the X please. | SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC | nvbench |
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
) | Which allergy type is the least common? | SELECT allergytype FROM allergy_type GROUP BY allergytype ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | until 2100 what are the top five most commonly prescribed drugs? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) <= '2100' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_22871316_6 (
record VARCHAR,
high_points VARCHAR
) | What's the record of the game in which Carlos Delfino (17) did the most high points? | SELECT record FROM table_22871316_6 WHERE high_points = "Carlos Delfino (17)" | sql_create_context |
CREATE TABLE table_29836557_2 (
pick__number INTEGER,
mls_team VARCHAR
) | What pick number did Real Salt Lake get? | SELECT MIN(pick__number) FROM table_29836557_2 WHERE mls_team = "Real Salt Lake" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | what is the minimum age of patients with admission type elective and the year of death before 2115? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dod_year < "2115.0" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 给病患33250252开出均价不足3095.33元的药品在哪几次医疗记录中?分别列出医疗就诊编号分别是多少? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '33250252' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3095.33) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '33250252' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CL... | css |
CREATE TABLE table_name_94 (
latitude VARCHAR,
diameter__km_ VARCHAR,
longitude VARCHAR
) | What is the Latitude when the Diameter (km) is 13km, and the Longitude is 72.9 e? | SELECT latitude FROM table_name_94 WHERE diameter__km_ = "13km" AND longitude = "72.9° e" | sql_create_context |
CREATE TABLE financial_transactions (
transaction_id number,
account_id number,
invoice_number number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE product_categories (
production_typ... | How many order items correspond to each order id? | SELECT order_id, COUNT(*) FROM order_items GROUP BY order_id | spider |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | How many regions were affected by each storm Visualize by bar chart, and order bars from high to low order. | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY Name DESC | nvbench |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE person_info_hz_info (
RYBH text,
... | 检验报告单24571107359是哪个患者门诊就诊中开出的 | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_MZJZ... | css |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | Return a bar chart about the distribution of meter_700 and ID , sort by the y-axis in desc. | SELECT meter_700, ID FROM swimmer ORDER BY ID DESC | nvbench |
CREATE TABLE table_name_79 (
grid VARCHAR,
driver VARCHAR
) | What's the total grid of Bruce Mclaren? | SELECT COUNT(grid) FROM table_name_79 WHERE driver = "bruce mclaren" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
med... | what is patient 006-21143's last ward id since 3 years ago? | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-21143') AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_68877 (
"Digital channel" text,
"Digital PSIP" real,
"Rogers Cable (Ottawa)" real,
"Vid\u00e9otron (Gatineau)" real,
"Call sign" text,
"Network" text
) | What is the Call sign of the Omni television network with a Digitial PSIP of 14.1? | SELECT "Call sign" FROM table_68877 WHERE "Network" = 'omni television' AND "Digital PSIP" = '14.1' | wikisql |
CREATE TABLE table_name_84 (
Id VARCHAR
) | Which 2009 has a 2008 of A, and a 2010 of 4r? | SELECT 2009 FROM table_name_84 WHERE 2008 = "a" AND 2010 = "4r" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | select * where tags='python'. | SELECT * FROM Posts WHERE Tags = 'python' | sede |
CREATE TABLE table_name_11 (
pts INTEGER,
pct INTEGER
) | What is the sum of PTS when there is a PCT smaller than 0.1? | SELECT SUM(pts) FROM table_name_11 WHERE pct < 0.1 | sql_create_context |
CREATE TABLE table_name_48 (
label VARCHAR,
catalog VARCHAR
) | Which label had a catalog designation of ch-9196? | SELECT label FROM table_name_48 WHERE catalog = "ch-9196" | sql_create_context |
CREATE TABLE table_name_84 (
decile INTEGER,
name VARCHAR
) | What is the average decile for te puru school? | SELECT AVG(decile) FROM table_name_84 WHERE name = "te puru school" | sql_create_context |
CREATE TABLE table_79132 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text
) | born on 1983-03-14, what is the cb's name? | SELECT "Name" FROM table_79132 WHERE "Pos." = 'cb' AND "Date of Birth" = '1983-03-14' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
... | What Core classes are provided next Winter ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE table_name_29 (
land_area__hectares_ INTEGER,
density__inh_km²_ VARCHAR,
population VARCHAR
) | What is the average land area with a density of 815.48, and a Population larger than 411? | SELECT AVG(land_area__hectares_) FROM table_name_29 WHERE density__inh_km²_ = 815.48 AND population > 411 | sql_create_context |
CREATE TABLE table_name_11 (
race VARCHAR,
pole_position VARCHAR
) | What Canadian Grand Prix race winner had Didier Pironi in Pole Position? | SELECT race AS Winner FROM table_name_11 WHERE pole_position = "didier pironi" AND race = "canadian grand prix" | sql_create_context |
CREATE TABLE table_name_95 (
result VARCHAR,
game VARCHAR
) | What was the result of Game 3 of this searson? | SELECT result FROM table_name_95 WHERE game = "game 3" | 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... | 个人自费在医疗就诊33531671277中的金额为多少? | SELECT PER_EXP FROM t_kc24 WHERE MED_CLINIC_ID = '33531671277' | css |
CREATE TABLE table_42162 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | Which Team #2 has a Team #1 of gambrinus sika brno? | SELECT "Team #2" FROM table_42162 WHERE "Team #1" = 'gambrinus sika brno' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients posses private insurance and followed the procedure continous intra-arterial blood gas monitoring? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring" | mimicsql_data |
CREATE TABLE table_72334 (
"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
) | Name the losing bonus for 27 | SELECT "Losing bonus" FROM table_72334 WHERE "Tries for" = '27' | wikisql |
CREATE TABLE table_54733 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Home team has an Away team score of 12.19 (91)? | SELECT "Home team" FROM table_54733 WHERE "Away team score" = '12.19 (91)' | wikisql |
CREATE TABLE table_10002 (
"Line name" text,
"Opened" real,
"Last extension" real,
"Stations served" real,
"Length" text,
"Average Interstation" text,
"Journeys made (per annum)" real
) | What is the average opened year of line e, which had their last extension before 2003? | SELECT AVG("Opened") FROM table_10002 WHERE "Line name" = 'line e' AND "Last extension" < '2003' | wikisql |
CREATE TABLE table_1341522_41 (
incumbent VARCHAR,
party VARCHAR,
first_elected VARCHAR
) | How many republican incumbents first elected in 1974? | SELECT COUNT(incumbent) FROM table_1341522_41 WHERE party = "Republican" AND first_elected = 1974 | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length in... | when is the earliest flight from BOSTON to DENVER | SELECT DISTINCT flight.departure_time 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 = 'D... | atis |
CREATE TABLE table_name_51 (
year INTEGER,
gold VARCHAR
) | What is the earliest year that kim hyun-soo won the gold? | SELECT MIN(year) FROM table_name_51 WHERE gold = "kim hyun-soo" | sql_create_context |
CREATE TABLE Vehicles (
vehicle_id INTEGER,
vehicle_details VARCHAR(255)
)
CREATE TABLE Lessons (
lesson_id INTEGER,
customer_id INTEGER,
lesson_status_code VARCHAR(15),
staff_id INTEGER,
vehicle_id INTEGER,
lesson_date DATETIME,
lesson_time VARCHAR(10),
price DOUBLE
)
CREATE T... | List all customer status codes and the number of customers having each status code in a bar chart, and order from high to low by the y-axis. | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_58279 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What home team has an Away team score of 11.12 (78)? | SELECT "Home team score" FROM table_58279 WHERE "Away team score" = '11.12 (78)' | wikisql |
CREATE TABLE table_23308178_7 (
points INTEGER,
record VARCHAR
) | Calculate the highest points where the win,loss, tie ratio is 28-12-6 | SELECT MAX(points) FROM table_23308178_7 WHERE record = "28-12-6" | 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... | 编码为94379213的患者的检验报告单对应的检验结果指标均异常有哪些?列出检验报告单号分别是什么? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info... | css |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
... | what were the top four frequently performed lab tests for a patient during the same hospital encounter after being diagnosed with fem pelvic periton adhes until 2103? | 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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | how many hours elapsed since the first time patient 010-16572 received a vancomycin - trough lab test in the current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '010-16572' AND patient.hosp... | eicu |
CREATE TABLE table_42861 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | What country has Tematico Content, and a package with sky TV and the Lei television service? | SELECT "Country" FROM table_42861 WHERE "Content" = 'tematico' AND "Package/Option" = 'sky tv' AND "Television service" = 'lei' | wikisql |
CREATE TABLE table_51882 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | How many wins did SD Eibar, which played less than 38 games, have? | SELECT SUM("Wins") FROM table_51882 WHERE "Club" = 'sd eibar' AND "Played" < '38' | wikisql |
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
) | Show the number of the dates of performances with attending members whose roles are 'Violin', I want to rank from high to low by the bar. | SELECT Date, COUNT(Date) FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin" GROUP BY Date ORDER BY Date DESC | nvbench |
CREATE TABLE table_2886617_2 (
player VARCHAR,
nhl_team VARCHAR
) | What player was picked by the New York Rangers? | SELECT player FROM table_2886617_2 WHERE nhl_team = "New York Rangers" | sql_create_context |
CREATE TABLE table_40570 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 2nd leg result when team 2 is Morocco? | SELECT "2nd leg" FROM table_40570 WHERE "Team 2" = 'morocco' | 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 (... | provide the number of patients whose age is less than 55 and drug code is syr60ml? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "55" AND prescriptions.formulary_drug_cd = "SYR60ML" | mimicsql_data |
CREATE TABLE table_76413 (
"Name" text,
"Championship" real,
"FA Cup" real,
"League Cup" real,
"Total" real
) | What is the championship of Jem Karacan that has a total of 2 and a league cup more than 0? | SELECT "Championship" FROM table_76413 WHERE "Total" = '2' AND "League Cup" > '0' AND "Name" = 'jem karacan' | wikisql |
CREATE TABLE table_73225 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real
) | For Gem County, what was the Obama vote percentage? | SELECT "Obama%" FROM table_73225 WHERE "County" = 'Gem' | wikisql |
CREATE TABLE Rating (
rID VARCHAR
)
CREATE TABLE Reviewer (
name VARCHAR,
rID VARCHAR
) | Find the names of all reviewers who have contributed three or more ratings. | SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3 | sql_create_context |
CREATE TABLE table_name_40 (
performer_3 VARCHAR,
performer_2 VARCHAR
) | Performer 2 of chip esten has what performer 3? | SELECT performer_3 FROM table_name_40 WHERE performer_2 = "chip esten" | sql_create_context |
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
) | Find the classroom that the most students use. | SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_16 (
score VARCHAR,
visitor VARCHAR,
date VARCHAR
) | Name the score for pacers visitor on 14 april 2008 | SELECT score FROM table_name_16 WHERE visitor = "pacers" AND date = "14 april 2008" | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,... | what flights are available friday afternoon from ATLANTA to DALLAS | 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND date_day.day_number = 25 AND date_day.month_number = 6 AND d... | atis |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose primary disease is pneumonia and age is less than 82? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA" AND demographic.age < "82" | mimicsql_data |
CREATE TABLE table_24715 (
"Rank" real,
"Team Name" text,
"Basic Elements" text,
"Tumbling" text,
"Stunts" text,
"Tosses/Pyramids" text,
"Deductions" text,
"Total" text
) | How many deductions have 56.5 as tosses/pyramids? | SELECT "Deductions" FROM table_24715 WHERE "Tosses/Pyramids" = '56.5' | wikisql |
CREATE TABLE table_204_245 (
id number,
"#" number,
"wrestlers" text,
"reign" number,
"date" text,
"days\nheld" number,
"location" text,
"event" text,
"notes" text
) | who held the championship title longest ? | SELECT "wrestlers" FROM table_204_245 ORDER BY "days\nheld" DESC LIMIT 1 | squall |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 项目334225104-r检查在这家9593364的医疗机构里,共有多少记录 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '9593364' AND t_kc22.SOC_SRT_DIRE_CD = '334225104-r' | css |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 列一下患者22859306在8775191这家医院的就诊记录中,在零七年十一月八号到一三年十月二十六这段时间里开出的全部药品名字和编号 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '22859306' AND MED_SER_ORG_NO = '8775191' AND IN_HOSP_DATE BETWEEN '2007-11-08' AND '2013-10-26') | css |
CREATE TABLE table_30666 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
) | Name the most for fl ysvik for 8 | SELECT MAX("Tor Fl\u00f8ysvik") FROM table_30666 WHERE "Karianne Gulliksen" = '8' | wikisql |
CREATE TABLE match (
round number,
location text,
country text,
date text,
fastest_qualifying text,
winning_pilot text,
winning_aircraft text
)
CREATE TABLE pilot (
pilot_id number,
name text,
age number
)
CREATE TABLE aircraft (
aircraft_id number,
aircraft text,
d... | What are the names of all pilots listed by descending age? | SELECT name FROM pilot ORDER BY age DESC | spider |
CREATE TABLE table_name_71 (
years_in_assembly VARCHAR,
name VARCHAR
) | During what years was Christine Kehoe in Assembly? | SELECT years_in_assembly FROM table_name_71 WHERE name = "christine kehoe" | sql_create_context |
CREATE TABLE table_14425454_1 (
home_team VARCHAR,
time VARCHAR
) | How many home team scores have a time of 4:40 PM? | SELECT COUNT(home_team) AS score FROM table_14425454_1 WHERE time = "4:40 PM" | sql_create_context |
CREATE TABLE table_name_69 (
pl_gp VARCHAR,
pick__number VARCHAR,
reg_gp VARCHAR
) | What is the total PI GP of the player with a pick number 49 and a reg gp less than 0? | SELECT COUNT(pl_gp) FROM table_name_69 WHERE pick__number = 49 AND reg_gp < 0 | sql_create_context |
CREATE TABLE table_40517 (
"Year" text,
"Team" text,
"GP/GS" text,
"Goals" text,
"Assists" text,
"Total Points" text
) | What are the goals of the assists of 5? | SELECT "Goals" FROM table_40517 WHERE "Assists" = '5' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | Which upper level classes don 't require 353 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours... | advising |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CR... | what is a name for a drug that patient 25523 was prescribed during the same hospital encounter after having been diagnosed with family hx-breast malig in 06/last year? | SELECT t2.drug 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 admissions.subject_id = 25523 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s... | mimic_iii |
CREATE TABLE table_46902 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | What is the Home Team on April 13 with a Road Team of St. Louis? | SELECT "Home Team" FROM table_46902 WHERE "Road Team" = 'st. louis' AND "Date" = 'april 13' | wikisql |
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... | how many hours is it since patient 030-44598 first stayed in the ward 1034 on their current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '030-44598' AND patient.wardid = 1034 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_19504 (
"Week" real,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
) | type the attendance for playing with tampa bay buccaneers? | SELECT "Attendance" FROM table_19504 WHERE "Opponent" = 'Tampa Bay Buccaneers' | wikisql |
CREATE TABLE artist (
age INTEGER,
country VARCHAR
) | What is the average and minimum age of all artists from United States. | SELECT AVG(age), MIN(age) FROM artist WHERE country = 'United States' | sql_create_context |
CREATE TABLE table_name_40 (
date_of_vacancy VARCHAR,
manner_of_departure VARCHAR,
outgoing_manager VARCHAR
) | What was the date of vacancy of svetozar apuri who departed with mutual consent? | SELECT date_of_vacancy FROM table_name_40 WHERE manner_of_departure = "mutual consent" AND outgoing_manager = "svetozar šapurić" | sql_create_context |
CREATE TABLE table_203_424 (
id number,
"year" number,
"starts" number,
"wins" number,
"top 5" number,
"top 10" number,
"poles" number,
"avg. start" number,
"avg. finish" number,
"winnings" text,
"position" text,
"team(s)" text
) | how many times was his average start below 20 ? | SELECT COUNT(*) FROM table_203_424 WHERE "avg. start" < 20 | squall |
CREATE TABLE table_name_97 (
date_of_death VARCHAR,
date_of_birth VARCHAR
) | What was the Date of Death of the person whose Date of Birth was 28 May 1371? | SELECT date_of_death FROM table_name_97 WHERE date_of_birth = "28 may 1371" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | details of top users from india and japan. | SELECT * FROM Users WHERE UPPER(Location) LIKE '%IND' OR UPPER(Location) LIKE '%JPN' ORDER BY Reputation DESC LIMIT 500 | sede |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId numb... | How many Python questions are there?. | SELECT COUNT(1) FROM Posts WHERE PostTypeId = 1 AND STR_POSITION(Tags, 'R') > 0 | sede |
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... | Visualize a bar chart about the distribution of Team_Name and School_ID . | SELECT Team_Name, School_ID FROM basketball_match | nvbench |
CREATE TABLE table_name_63 (
name VARCHAR,
street_address VARCHAR
) | WHAT IS THE NAME WITH 01.0 10 light street? | SELECT name FROM table_name_63 WHERE street_address = "01.0 10 light street" | sql_create_context |
CREATE TABLE table_15700367_2 (
wickets VARCHAR,
overs_bowled VARCHAR
) | Name the wickets for overs bowled being 15 | SELECT wickets FROM table_15700367_2 WHERE overs_bowled = "15" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
... | how many patients received a flexible sigmoidoscopy two or more times? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'flexible sigmoidoscop... | mimic_iii |
CREATE TABLE table_52258 (
"Location" text,
"Abb." text,
"Enzyme" text,
"Disorder" text,
"Measurements" text
) | What is the abbreviation of the enzyme involved in carbamoyl phosphate synthetase i deficiency? | SELECT "Abb." FROM table_52258 WHERE "Disorder" = 'carbamoyl phosphate synthetase i deficiency' | wikisql |
CREATE TABLE t_kc21 (
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,
... | 在医疗就诊20552303781中负责开具费用明细项目37322993985的医师编码和姓名都是什么呀? | SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '37322993985' | css |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
O... | How many questions are here?. | SELECT COUNT(Q.Id) FROM Posts AS Q WHERE Q.PostTypeId = 1 | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 找出与医疗就诊编号47989923435相同医疗费的人,列出他们的医疗就诊记录中的公民身份号码、ID、人员ID、人员的名字、性别以及他们的人员年龄是几岁? | SELECT t_kc24.MED_CLINIC_ID, t_kc24.t_kc21_PERSON_ID, t_kc24.t_kc21_PERSON_NM, t_kc24.t_kc21_IDENTITY_CARD, t_kc24.t_kc21_PERSON_SEX, t_kc24.t_kc21_PERSON_AGE FROM t_kc24 WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '47989923435') | css |
CREATE TABLE table_name_31 (
home_team VARCHAR,
venue VARCHAR
) | What is the Home team score for the Venue named Glenferrie Oval? | SELECT home_team AS score FROM table_name_31 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE table_67328 (
"Outcome" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What surface was the citt di caltanissetta played on? | SELECT "Surface" FROM table_67328 WHERE "Tournament" = 'città di caltanissetta' | wikisql |
CREATE TABLE table_name_89 (
country VARCHAR,
player VARCHAR,
score VARCHAR
) | From what Country is player K. J. Choi with a Score of 68-71=139? | SELECT country FROM table_name_89 WHERE score = 68 - 71 = 139 AND player = "k. j. choi" | sql_create_context |
CREATE TABLE table_20726262_6 (
no_in_season INTEGER,
directedby VARCHAR
) | What episode was directed by Karen Gaviola? | SELECT MIN(no_in_season) FROM table_20726262_6 WHERE directedby = "Karen Gaviola" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.