context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | Give me a bar chart for the average of team id of each acc road, and sort in ascending by the x-axis. | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_17937 (
"Year" text,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | What was the margin of the Masters Tournament? | SELECT "Margin" FROM table_17937 WHERE "Championship" = 'Masters Tournament' | wikisql |
CREATE TABLE table_204_337 (
id number,
"festival" text,
"year" number,
"award" text,
"nominee" text,
"result" text
) | what was their award at the janison short sharp film festival ? | SELECT "award" FROM table_204_337 WHERE "festival" = 'janison short sharp film festival' | squall |
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... | how many patients whose admission type is urgent and lab test name is amylase, body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Amylase, Body Fluid" | mimicsql_data |
CREATE TABLE table_65228 (
"[ 3 H]CFT" real,
"[ 3 H]Nisoxetine" text,
"[ 3 H]Paroxetine" text,
"N \u00f7 D" real,
"S \u00f7 D" real
) | What is the sum of the [3 H]CFT with an N D less than 393.8 and a [3H] paroxetine of 1045 (45)? | SELECT SUM("[ 3 H]CFT") FROM table_65228 WHERE "N \u00f7 D" < '393.8' AND "[ 3 H]Paroxetine" = '1045 (45)' | wikisql |
CREATE TABLE table_name_46 (
wednesday VARCHAR,
monday VARCHAR
) | Which Wednesday has a Monday of getsuy bi? | SELECT wednesday FROM table_name_46 WHERE monday = "月曜日 getsuyōbi" | sql_create_context |
CREATE TABLE table_name_26 (
home_team VARCHAR,
tie_no VARCHAR
) | Who was the home team for tie number 11? | SELECT home_team FROM table_name_26 WHERE tie_no = "11" | sql_create_context |
CREATE TABLE table_name_63 (
position INTEGER,
wins VARCHAR,
goals_against VARCHAR,
points VARCHAR
) | Which lowest position has goals against smaller than 78, Points of 42-2, and Wins larger than 15? | SELECT MIN(position) FROM table_name_63 WHERE goals_against < 78 AND points = "42-2" AND wins > 15 | sql_create_context |
CREATE TABLE table_name_26 (
cbs_airdate VARCHAR,
episode VARCHAR,
airdate__usa_ VARCHAR
) | What is the CBS airdate of the episode with a number under 70 with a USA airdate of 1 April 2005? | SELECT cbs_airdate FROM table_name_26 WHERE episode < 70 AND airdate__usa_ = "1 april 2005" | sql_create_context |
CREATE TABLE table_23670057_6 (
height__m_ VARCHAR,
year_born VARCHAR
) | Name the height for the player born in 1981 | SELECT height__m_ FROM table_23670057_6 WHERE year_born = 1981 | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | count the number of patients who had received a microbiological test of the bronchoalveolar lavage since 2100. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'bronchoalveolar lavage' AND STRFTIME('%y', microbiologyevents.charttime) >= '2100') | mimic_iii |
CREATE TABLE table_name_23 (
competition VARCHAR,
year VARCHAR,
snatch VARCHAR
) | Which competition had a year of 2010 with Snatch weight of 185kg? | SELECT competition FROM table_name_23 WHERE year = 2010 AND snatch = "185kg" | sql_create_context |
CREATE TABLE table_name_66 (
rank INTEGER,
name VARCHAR,
out_of VARCHAR
) | What is the lowest Rank for the Name, 'area of permanent crops', Out of a number smaller than 181? | SELECT MIN(rank) FROM table_name_66 WHERE name = "area of permanent crops" AND out_of < 181 | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,... | 5000 newest answers to bad questions. | SELECT CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END AS "accepted", a.Score AS "score", a.Id AS "post_link", q.ClosedDate AS "date_closed", a.CreationDate AS "date_posted" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE NOT q.ClosedDate IS NULL AND NOT EXISTS(SELECT 1 FROM PostHistory WHERE Pos... | sede |
CREATE TABLE table_171356_2 (
census_ranking VARCHAR,
area_km_2 VARCHAR
) | What rank is the parish with 482.81 km^2? | SELECT census_ranking FROM table_171356_2 WHERE area_km_2 = "482.81" | sql_create_context |
CREATE TABLE table_35695 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | What's the highest grid of Ronnie Bremer, who had more than 18 points? | SELECT MAX("Grid") FROM table_35695 WHERE "Driver" = 'ronnie bremer' AND "Points" > '18' | 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 diagnosis (
diagn... | what was the first s/p cabg < 7 days diagnosis time of patient 015-16479 on their first hospital encounter? | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-16479' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE table_name_5 (
city VARCHAR,
home_team_s_ VARCHAR
) | What city was the home team Tigre? | SELECT city FROM table_name_5 WHERE home_team_s_ = "tigre" | sql_create_context |
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
review_count bigint,
is_open tinyint,
rating float,
state varchar
)
CREATE TABLE tip (
tip_id int,
business_id varchar,
te... | List all the reviews by Michelle for Italian restaurant | SELECT review.text FROM business, category AS CATEGORY_0, category AS CATEGORY_1, review, user WHERE CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'Italian' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'restaurant' AND review.business_id = business.busi... | yelp |
CREATE TABLE festival_detail (
Num_of_Audience INTEGER
) | What is the average number of audience for festivals? | SELECT AVG(Num_of_Audience) FROM festival_detail | sql_create_context |
CREATE TABLE table_name_54 (
argon VARCHAR,
helium VARCHAR
) | Wha argon has helium of 1.0000684? | SELECT argon FROM table_name_54 WHERE helium = "1.0000684" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | How many pateints younger than 74 years of age are tested with drug code neut? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "74" AND prescriptions.formulary_drug_cd = "NEUT" | mimicsql_data |
CREATE TABLE table_61145 (
"Golden Rivers" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the lowest Draws, when Against is '1547', and when Wins is greater than 3? | SELECT MIN("Draws") FROM table_61145 WHERE "Against" = '1547' AND "Wins" > '3' | wikisql |
CREATE TABLE table_4751 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What home team scored 20.15 (135)? | SELECT "Home team" FROM table_4751 WHERE "Home team score" = '20.15 (135)' | wikisql |
CREATE TABLE table_26427 (
"Profile" text,
"Bandwidth ( MHz )" text,
"Number of carriers" real,
"Carrier bandwidth (kHz)" text,
"Power ( dBm )" text,
"Max. downstream throughput ( Mbit/s )" real
) | List all mbit/s with profiles of 8b. | SELECT "Max. downstream throughput ( Mbit/s )" FROM table_26427 WHERE "Profile" = '8b' | 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... | A scatter chart shows the correlation between Team_ID and All_Games_Percent . | SELECT Team_ID, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
... | What are the distinct years in which the competitions type is not 'Tournament'? | SELECT DISTINCT year FROM competition WHERE competition_type <> "Tournament" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | give me the number of patients whose diagnoses icd9 code is 42789? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "42789" | mimicsql_data |
CREATE TABLE table_name_3 (
singapore_gross VARCHAR,
title VARCHAR
) | For the film titled 1997, what was the gross in Singapore? | SELECT singapore_gross FROM table_name_3 WHERE title = "1997" | sql_create_context |
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 flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
... | How many flights for each origin city? Return a bar chart. | SELECT origin, COUNT(origin) FROM flight GROUP BY origin ORDER BY origin | nvbench |
CREATE TABLE table_27913160_3 (
pole_position VARCHAR,
race VARCHAR
) | Who had the pole position in Detroit? | SELECT pole_position FROM table_27913160_3 WHERE race = "Detroit" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
lan... | has patient 83466 undergone any excise lg intestine les last year? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'excise lg intestine les') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83466) AND DATETIME(pro... | mimic_iii |
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... | tell me the top five most common output events until 2100? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2100' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_22781 (
"Name" text,
"Home or representative town or province" text,
"Age" real,
"Edition" text,
"Total days in PBB House" real,
"Duration" text,
"Status" text
) | WHen joaqui mendoza is the name how long is the duration? | SELECT "Duration" FROM table_22781 WHERE "Name" = 'Joaqui Mendoza' | wikisql |
CREATE TABLE table_11622496_1 (
location VARCHAR
) | What is the prize money for Virginia? | SELECT 1 AS st_prize__$__ FROM table_11622496_1 WHERE location = "Virginia" | sql_create_context |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Can I take 400 -level classes in the Fall or Winter term ? | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM... | advising |
CREATE TABLE table_name_15 (
rank VARCHAR,
total VARCHAR,
nation VARCHAR
) | Spain with a total of more than 4 medals is in what rank? | SELECT rank FROM table_name_15 WHERE total > 4 AND nation = "spain" | sql_create_context |
CREATE TABLE table_204_575 (
id number,
"place" number,
"position" text,
"number" number,
"name" text,
"league one" number,
"fa cup" number,
"league cup" number,
"football league trophy" number,
"total" number
) | how many assists did the top three have in total ? | SELECT SUM("total") FROM table_204_575 WHERE "place" <= 3 | squall |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | i would like to get the top four diagnosis that has the highest three year mortality rate. | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
CREATE TABLE table_34848 (
"Tournament" text,
"1981" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text
) | Which 1988 has a 1982 of 104? | SELECT "1988" FROM table_34848 WHERE "1982" = '104' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id... | in this year, what are the five most frequent drugs prescribed to male patients 40s within 2 months after having been diagnosed with crnry athrscl natve vssl? | SELECT t3.drug FROM (SELECT t2.drug, 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.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE documents_to_be_destroyed (
document_id number,
destruction_authorised_by_employee_id number,
destroyed_by_employee_id number,
planned_destruction_date time,
actual_destruction_date time,
other_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
docume... | Give me the name and description of the location with code x. | SELECT location_name, location_description FROM ref_locations WHERE location_code = "x" | spider |
CREATE TABLE table_204_476 (
id number,
"name" text,
"date built" number,
"builder" text,
"works no." number,
"wheels" text,
"cylinders" text,
"notes" text,
"withdrawn" number
) | what name comes next fairfield ? | SELECT "name" FROM table_204_476 WHERE id = (SELECT id FROM table_204_476 WHERE "name" = 'fairfield') + 1 | squall |
CREATE TABLE table_53693 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the average crowd size for Richmond home games? | SELECT AVG("Crowd") FROM table_53693 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE table_name_4 (
team VARCHAR,
location_attendance VARCHAR
) | Which Team has a Location Attendance of fedexforum 11,731? | SELECT team FROM table_name_4 WHERE location_attendance = "fedexforum 11,731" | sql_create_context |
CREATE TABLE table_name_10 (
week_5 VARCHAR,
week_1 VARCHAR
) | What Week 5 has a Week 1 of mysti sherwood? | SELECT week_5 FROM table_name_10 WHERE week_1 = "mysti sherwood" | sql_create_context |
CREATE TABLE table_name_96 (
game_time VARCHAR,
record VARCHAR
) | What time was the game with a record of 7-3? | SELECT game_time FROM table_name_96 WHERE record = "7-3" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId numb... | Users by the number of answers since a given date. | SELECT p.OwnerUserId, COUNT(p.Id) AS "number_of_answers" FROM Posts AS p WHERE DATEDIFF(day, p.CreationDate, GETDATE()) <= 90 GROUP BY p.OwnerUserId ORDER BY COUNT(p.Id) DESC | sede |
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,
... | 患者28022050的医疗记录中,有过哪些医疗费总额不小于7272.12元的信息,看看入院诊断疾病名和编码 | SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '28022050' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 7272.12) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '28022050' AND fg... | css |
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex... | What is the first and last name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in. | SELECT T1.fname, T1.lname, COUNT(*), T1.facid FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid GROUP BY T1.facid | spider |
CREATE TABLE table_204_636 (
id number,
"season" text,
"tier" number,
"division" text,
"pos." text,
"notes" text
) | tell me the number of times they were in the division of honor . | SELECT COUNT(*) FROM table_204_636 WHERE "division" = 'division de honor' | squall |
CREATE TABLE table_name_76 (
works_number VARCHAR,
date VARCHAR,
number VARCHAR,
builder VARCHAR,
type VARCHAR
) | Which Works number has a Builder of avonside engine company, and a Type of 4-6-0, and a Number smaller than 12, and a Date of december 1871? | SELECT works_number FROM table_name_76 WHERE builder = "avonside engine company" AND type = "4-6-0" AND number < 12 AND date = "december 1871" | 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY... | For those employees who was hired before 2002-06-21, visualize a line chart about the change of employee_id over hire_date , and could you display in asc by the HIRE_DATE? | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE available_policies (
policy_id number,
policy_type_code text,
customer_phone text
)
CREATE TABLE first_notification_of_loss (
fnol_id number,
customer_id number,
policy_id number,
service_id number
)
CREATE TABLE services (
service_id number,
service_name text
)
CREAT... | Which policy type appears most frequently in the available policies? | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_30 (
country VARCHAR,
director_s_ VARCHAR
) | What country did Jonas Geirnaert direct a film in? | SELECT country FROM table_name_30 WHERE director_s_ = "jonas geirnaert" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varch... | For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the sum of manager_id , and group by attribute job_id in a bar chart, list by the y axis in descending. | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_35026 (
"Round" text,
"Pick" text,
"Player" text,
"Position" text,
"College" text
) | Which round's position is according to official website? | SELECT "Round" FROM table_35026 WHERE "Position" = 'according to official website' | 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 medication (
medi... | on the current hospital encounter did patient 016-18575 excret any chest tube output: l lateral? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575' AND patient.hospitaldischargetime IS NULL)) AND intakeoutpu... | eicu |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
... | A bar chart about how many different professors are there for the different schools?, and list y axis from high to low order. | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | whats the last height of patient 013-33898 this month? | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ... | eicu |
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
) | Which classes have more than two captains? | SELECT class FROM captain GROUP BY class HAVING COUNT(*) > 2 | spider |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE T... | Anonymous feedback for a certain question and its answers. | SELECT COUNT(P.Id) AS VoteCount, VT.Name AS VoteType, P.Id AS "post_link", P.Id, U.DisplayName, P.Score, P.CreationDate, P.LastActivityDate FROM PostFeedback AS PF JOIN Posts AS P ON P.Id = PF.PostId JOIN Users AS U ON U.Id = P.OwnerUserId JOIN VoteTypes AS VT ON PF.VoteTypeId = VT.Id WHERE PF.IsAnonymous = 1 AND (P.Id... | sede |
CREATE TABLE table_1974782_1 (
joined INTEGER,
institution VARCHAR
) | When has Clark University joined the Conference? | SELECT MAX(joined) FROM table_1974782_1 WHERE institution = "Clark University" | sql_create_context |
CREATE TABLE table_train_199 (
"id" int,
"t2dm" bool,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"diabetic" string,
"hypoglycemia" bool,
"diabetes" bool,
"seizure_disorder" bool,
"glaucoma" bool,
"hypertension" bool,
"age" float,
"NOUSE" float
) | history of severe hypoglycemia ( seizure ) | SELECT * FROM table_train_199 WHERE hypoglycemia = 1 OR seizure_disorder = 1 | criteria2sql |
CREATE TABLE table_train_158 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"moca_score" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | bmi > 25 kg / m2 | SELECT * FROM table_train_158 WHERE body_mass_index_bmi > 25 | criteria2sql |
CREATE TABLE table_1942683_1 (
house_colour VARCHAR,
house_name VARCHAR
) | What is the house colour associated with the house name of Kupe? | SELECT house_colour FROM table_1942683_1 WHERE house_name = "Kupe" | 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... | 门诊诊断患者吕华美患有复发性抑郁障碍,548921检测指标的结果定量是什么?对应的单位是什么 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transact... | A bar chart for what are the number of the dates of transactions with at least 100 share count or amount bigger than 100?, and sort by the Y from high to low. | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY COUNT(date_of_transaction) DESC | nvbench |
CREATE TABLE table_name_58 (
games_played VARCHAR,
wins VARCHAR,
goals_conceded VARCHAR
) | How many games have been played when there are 13 wins and 45 goals were conceded? | SELECT games_played FROM table_name_58 WHERE wins = 13 AND goals_conceded = 45 | sql_create_context |
CREATE TABLE table_name_72 (
attendance VARCHAR,
date VARCHAR
) | Name the attendance for 4 january 2004 | SELECT attendance FROM table_name_72 WHERE date = "4 january 2004" | sql_create_context |
CREATE TABLE table_name_11 (
nationality VARCHAR,
elector VARCHAR
) | When Anchero Pantaleone was the elector what is under nationality? | SELECT nationality FROM table_name_11 WHERE elector = "anchero pantaleone" | sql_create_context |
CREATE TABLE table_name_36 (
bronze INTEGER,
total VARCHAR,
silver VARCHAR
) | What is the average Bronze, when Total is 4, and when Silver is less than 2? | SELECT AVG(bronze) FROM table_name_36 WHERE total = 4 AND silver < 2 | sql_create_context |
CREATE TABLE table_203_573 (
id number,
"name" text,
"rank - 2000" number,
"number" number,
"country of origin" text,
"england - 2001" text
) | what is the english american name that the most people have ? | SELECT "name" FROM table_203_573 ORDER BY "number" DESC LIMIT 1 | squall |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
... | what was patient 95986 diagnosed with last time on the last hospital visit. | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime D... | mimic_iii |
CREATE TABLE table_1710 (
"Episode #" real,
"US air date" text,
"Rating" text,
"Share" text,
"Rating/Share (18\u201349)" text,
"Viewers (millions)" text
) | What is the rating of the episode with a rating/share of 0.9/4? | SELECT "Rating" FROM table_1710 WHERE "Rating/Share (18\u201349)" = '0.9/4' | wikisql |
CREATE TABLE table_1160660_1 (
acronym VARCHAR,
university_name VARCHAR
) | What is the acronym used for Beirut Arab University? | SELECT acronym FROM table_1160660_1 WHERE university_name = "Beirut Arab University" | sql_create_context |
CREATE TABLE table_57913 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | At what race does jim clark has a Pole position on the Circuit of monaco? | SELECT "Race" FROM table_57913 WHERE "Pole position" = 'jim clark' AND "Circuit" = 'monaco' | wikisql |
CREATE TABLE Locations (
Location_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location_ID INTEGER
)
CREATE TABLE Parties_in_Events (
Party_ID INTEGER,
Even... | Compare the total number of different product type codes, and I want to sort how many product type code from high to low order. | SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(Product_Type_Code) DESC | nvbench |
CREATE TABLE table_21996 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Country" text,
"Project" text,
"Status at production" text,
"Original air date" text
) | What is the status of the London Aquatics Centre project at the time of production? | SELECT "Status at production" FROM table_21996 WHERE "Project" = 'London Aquatics Centre' | wikisql |
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
... | How many players are from each country Visualize by bar chart, list by the Y in asc. | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY COUNT(*) | nvbench |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | show me the yearly minimum drain out #1 t tube of patient 72107 until 03/29/2102. | SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72107)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra... | mimic_iii |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | is the arterial bp [systolic] of patient 31854's body second measured on the current icu visit less than the value first measured on the current icu visit? | SELECT (SELECT chartevents.valuenum 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 = 31854) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | mimic_iii |
CREATE TABLE table_name_69 (
opponent_in_the_final VARCHAR,
score VARCHAR
) | What was the opponent in the final when the score was 6 3, 2 6, 7 5? | SELECT opponent_in_the_final FROM table_name_69 WHERE score = "6–3, 2–6, 7–5" | sql_create_context |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
) | Please tell me the total star ratings of each movie title using a bar chart, and order bar in ascending order. | SELECT title, SUM(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title | nvbench |
CREATE TABLE table_29628 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
) | What is the location and attendance total from the game on December 1? | SELECT "Location/Attendance" FROM table_29628 WHERE "December" = '1' | wikisql |
CREATE TABLE table_75473 (
"Rank" real,
"Player" text,
"Year" real,
"Game" text,
"Points" real
) | Which Rank is the lowest one that has Points larger than 52, and a Year larger than 1970? | SELECT MIN("Rank") FROM table_75473 WHERE "Points" > '52' AND "Year" > '1970' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart, and show by the mean employee id from high to low. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute name by a bar chart, and sort from low to high by the Code. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code | 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... | provide the drug type and drug code for hydrocerin? | SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Hydrocerin" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | when was patient 028-7951 admitted for the first time to the hospital until 2104? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '028-7951' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_22206 (
"No." real,
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text,
"Winners share ( $ )" real
) | List the total numbers of Evian Masters tournaments. | SELECT MAX("No.") FROM table_22206 WHERE "Tournament" = 'Evian Masters' | wikisql |
CREATE TABLE table_name_76 (
entrant VARCHAR,
year VARCHAR
) | What is the entrant for 1967? | SELECT entrant FROM table_name_76 WHERE year = 1967 | sql_create_context |
CREATE TABLE table_name_46 (
interview INTEGER,
state VARCHAR,
swimsuit VARCHAR
) | Tell me the lowest interview for oklahoma and swimsuit less than 8.8 | SELECT MIN(interview) FROM table_name_46 WHERE state = "oklahoma" AND swimsuit < 8.8 | sql_create_context |
CREATE TABLE table_dev_51 (
"id" int,
"gender" string,
"antihypertensive_agents" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"obesity" bool,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"prehypertension" bool,
... | uncontrolled hypertension ( i.e., systolic blood pressure > 160 mm hg, or a diastolic blood pressure > 95 mmhg based on an average of 3 readings sitting ) | SELECT * FROM table_dev_51 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 95 | criteria2sql |
CREATE TABLE table_45205 (
"Name" text,
"Location" text,
"Height (m)" real,
"Stories" real,
"Year of completion" real
) | How many stories have a height less than 138 meters with a completion date in 1971? | SELECT "Stories" FROM table_45205 WHERE "Height (m)" < '138' AND "Year of completion" = '1971' | wikisql |
CREATE TABLE table_14003 (
"Date" text,
"Time (CET)" text,
"Res." text,
"Round" text,
"Attendance" real
) | What is the highest attendance among Group E games? | SELECT MAX("Attendance") FROM table_14003 WHERE "Round" = 'group e' | wikisql |
CREATE TABLE table_name_92 (
player VARCHAR,
team VARCHAR
) | Who plays for the chicago bulls? | SELECT player FROM table_name_92 WHERE team = "chicago bulls" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryT... | (EXAMPLE #3) Time to First Answer (Link to Q using 3rd join to [Posts]). | SELECT q.Id AS "qid", t.Title AS "link", q.CreationDate AS "question_date", MIN(a.CreationDate) AS "1st_answer_date", DATEDIFF(n, q.CreationDate, MIN(a.CreationDate)) AS "min_to_1st_answer" FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId LEFT OUTER JOIN Posts AS t ON q.Id = t.Id WHERE q.PostTypeId = 1 A... | sede |
CREATE TABLE table_48410 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/g" real
) | Can you tell me the total number of Gain that has the Name of williams, jonathan, and the Loss larger than 3? | SELECT COUNT("Gain") FROM table_48410 WHERE "Name" = 'williams, jonathan' AND "Loss" > '3' | wikisql |
CREATE TABLE table_29055 (
"District" real,
"Region" text,
"Communes" text,
"Population (2002 census)" real,
"% of total population" text,
"VAP" real,
"Enrolled" real,
"Total votes" real,
"Valid votes" real,
"Turnout" text,
"E/VAP" text,
"T/VAP" text,
"V/VAP" text
) | How many vap values are associated with 140469 valid votes? | SELECT COUNT("VAP") FROM table_29055 WHERE "Valid votes" = '140469' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.