context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | give me some restaurants in the bay area ? | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE restaurant.city_name IN (SELECT GEOGRAPHICalias0.city_name FROM geographic AS GEOGRAPHICalias0 WHERE GEOGRAPHICalias0.region = 'bay area') AND restaurant.id = location.restaurant_id | restaurants |
CREATE TABLE table_204_846 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"attendance" number
) | is ludvika ffl a d3 or a d2 ? | SELECT "away team" FROM table_204_846 WHERE "away team" = 'ludvika ffi' | squall |
CREATE TABLE table_57524 (
"Class" text,
"Type" text,
"Introduced" text,
"Fleet Size" real,
"Numbers" text
) | What is the fleet size of the Vanguard 0-6-0dh class? | SELECT "Fleet Size" FROM table_57524 WHERE "Class" = 'vanguard 0-6-0dh' | wikisql |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Eve... | List all the participant ids and their details using a bar chart, and I want to order in asc by the bar. | SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details | nvbench |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 从零六年八月三日到一九年十月五日科室7944的乌灵胶囊的开药量是多少? | SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_CD = '7944' AND STA_DATE BETWEEN '2006-08-03' AND '2019-10-05' AND SOC_SRT_DIRE_NM = '乌灵胶囊' | css |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | PostTypeId of C++ Tag Wiki and Excerpt. | SELECT 'Tag Wiki', PostTypeId FROM Posts WHERE Id = 3606997 UNION ALL SELECT 'Excerpt', PostTypeId FROM Posts WHERE Id = 3624963 | sede |
CREATE TABLE table_13314 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What date has wrexham as the home team? | SELECT "Date" FROM table_13314 WHERE "Home team" = 'wrexham' | wikisql |
CREATE TABLE table_name_17 (
score VARCHAR,
loss VARCHAR
) | Loss of lyon (5-4) had what score? | SELECT score FROM table_name_17 WHERE loss = "lyon (5-4)" | 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 diagnosis (
diagn... | among patients who were prescribed metoprolol tartrate 25 mg tablet after having been diagnosed with pancreatitis - with pseudocyst formation calculate the three year survival rate. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_name_50 (
tournament VARCHAR,
runner_s__up VARCHAR
) | What tournament was Laura Davies the runner-up? | SELECT tournament FROM table_name_50 WHERE runner_s__up = "laura davies" | sql_create_context |
CREATE TABLE table_name_36 (
rank INTEGER,
profits__billion_$_ VARCHAR,
industry VARCHAR,
company VARCHAR
) | What is the smallest rank for an industry of banking, a company of bank of america, and profits (billion $) larger than 16.47? | SELECT MIN(rank) FROM table_name_36 WHERE industry = "banking" AND company = "bank of america" AND profits__billion_$_ > 16.47 | sql_create_context |
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... | count the number of medicines that have been prescribed to patient 033-7332 since 32 months ago. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-7332')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(),... | eicu |
CREATE TABLE table_2741 (
"Rank" real,
"Census-designated place" text,
"Metropolitan area" text,
"State" text,
"Population (2000 census)" real,
"Land area (mi 2 )" text,
"Population density (people per mi 2 )" text
) | what is the total number of census designated places with a population of 10581? | SELECT COUNT("Census-designated place") FROM table_2741 WHERE "Population (2000 census)" = '10581' | wikisql |
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... | how many patients died after being diagnosed this year with chr osteomyelit-l/leg within 2 months? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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 d_icd_di... | mimic_iii |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | Please give me a pie chart to show the number of home cities of all drivers, show by the x axis from low to high. | SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY Home_city | nvbench |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | Draw a bar chart for what is minimum age for different job title?, and I want to rank in desc by the y axis. | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY MIN(age) DESC | nvbench |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank i... | Bar chart of the total number from each headquarters, order in asc by the Headquarters. | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters | nvbench |
CREATE TABLE table_11542 (
"Year" real,
"Date" text,
"Location" text,
"Score" text,
"Result" text
) | What day was the score 3-0 after 2011? | SELECT "Date" FROM table_11542 WHERE "Score" = '3-0' AND "Year" = '2011' | wikisql |
CREATE TABLE table_44748 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) | What is Date, when Team is Holden Racing Team, and when Circuit is Eastern Creek Raceway? | SELECT "Date" FROM table_44748 WHERE "Team" = 'holden racing team' AND "Circuit" = 'eastern creek raceway' | wikisql |
CREATE TABLE table_73945 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
) | What was the result for the total of 12? | SELECT "Result" FROM table_73945 WHERE "Total" = '12' | wikisql |
CREATE TABLE table_name_35 (
circuit VARCHAR,
winning_driver VARCHAR,
race_name VARCHAR
) | What circuit did Innes Ireland win at for the I lombank trophy? | SELECT circuit FROM table_name_35 WHERE winning_driver = "innes ireland" AND race_name = "i lombank trophy" | sql_create_context |
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 jybgb (
BBCJBW text,
BBDM tex... | 在门诊诊断奚晴岚患者患上疾病F05.776的检测指标134789的结果定量是什么?单位是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j... | css |
CREATE TABLE table_18207285_2 (
result VARCHAR,
attendance VARCHAR
) | What was the result of the game seen by 31095 people? | SELECT result FROM table_18207285_2 WHERE attendance = 31095 | sql_create_context |
CREATE TABLE table_8085 (
"Season" text,
"President" text,
"General Sec" text,
"Treasurer" text,
"Fixtures Sec" text,
"Social Sec Bradford" text,
"Social Sec Leeds" text,
"Media Officer" text
) | What kind of Social Sec Leeds has a Media Officer of jason james and a Treasurer of james davidson? | SELECT "Social Sec Leeds" FROM table_8085 WHERE "Media Officer" = 'jason james' AND "Treasurer" = 'james davidson' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | how many patients whose diagnoses icd9 code is 57450 and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "57450" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_34290 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the largest overall where the position was linebacker and the pick number was more than 9? | SELECT MAX("Overall") FROM table_34290 WHERE "Position" = 'linebacker' AND "Pick #" > '9' | wikisql |
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 trend about commission_pct over hire_date . | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 在医院1150862里根据不同的科室编码和入院诊断疾病名称列出所有医疗就诊记录中病人的平均年龄是多少? | SELECT MED_ORG_DEPT_CD, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '1150862' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_NM | css |
CREATE TABLE table_name_78 (
total INTEGER,
silver INTEGER
) | What is the smallest number of medals a country with more than 14 silver has? | SELECT MIN(total) FROM table_name_78 WHERE silver > 14 | sql_create_context |
CREATE TABLE table_10327 (
"Year" text,
"Builder and model name" text,
"Length (feet)" real,
"Width (inches)" real,
"Engine" text,
"Numbers" text,
"Retired" text
) | On buses ranging in numbr 401-484, what is the lowest width that one longer thna 25 feet can have? | SELECT MIN("Width (inches)") FROM table_10327 WHERE "Length (feet)" > '25' AND "Numbers" = '401-484' | wikisql |
CREATE TABLE table_77549 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | who had the high rebounds when the game number was 6? | SELECT "High rebounds" FROM table_77549 WHERE "Game" = '6' | wikisql |
CREATE TABLE table_41098 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Taoiseach" real,
... | What is the average total 0 are nominated by the Taoiseach and the agricultural panel is greater than 5? | SELECT AVG("Total") FROM table_41098 WHERE "Nominated by the Taoiseach" = '0' AND "Agricultural Panel" > '5' | wikisql |
CREATE TABLE table_7111 (
"Year" real,
"Conventional plans" text,
"HMOs" text,
"PPOs" text,
"POS plans" text
) | Which conventional plan has a POS of 13%? | SELECT "Conventional plans" FROM table_7111 WHERE "POS plans" = '13%' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | tell me the amount of output (ml)-icp/ventriculostomy ventricular drainage catheter with icp microsensor right frontal region patient 006-232560 had until 11 days ago. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-232560')) AND intakeoutput.celllabel = 'outp... | eicu |
CREATE TABLE table_56996 (
"Round" real,
"Overall" real,
"Player" text,
"Nationality" text,
"Club team" text
) | What was the overall pick for Doug Sproule of the United States? | SELECT "Overall" FROM table_56996 WHERE "Nationality" = 'united states' AND "Player" = 'doug sproule' | wikisql |
CREATE TABLE Ref_Detention_Type (
detention_type_code VARCHAR(10),
detention_type_description VARCHAR(80)
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county V... | Draw a bar chart about the distribution of other_details and the average of monthly_rental , and group by attribute other_details. | SELECT other_details, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_45518 (
"Rank" text,
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | Which Run 3 has a Run 1 of 2:20.10? | SELECT "Run 3" FROM table_45518 WHERE "Run 1" = '2:20.10' | wikisql |
CREATE TABLE table_name_8 (
source VARCHAR,
attack VARCHAR
) | What Source has an Attack of 9,77%? | SELECT source FROM table_name_8 WHERE attack = "9,77%" | sql_create_context |
CREATE TABLE table_39581 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s? | SELECT AVG("Cuts made") FROM table_39581 WHERE "Top-10" = '11' AND "Wins" < '1' | wikisql |
CREATE TABLE table_690 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Status" text,
"Opponent" text
) | what's the party with opponent being marcy kaptur (d) 75.3% randy whitman (r) 24.7% | SELECT "Party" FROM table_690 WHERE "Opponent" = 'Marcy Kaptur (D) 75.3% Randy Whitman (R) 24.7%' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
Ex... | late answers that were accepted and most likely have highest score. | SELECT COUNT(DISTINCT (q.Id)) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id INNER JOIN Posts AS aa ON aa.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND aa.PostTypeId = 2 AND q.AcceptedAnswerId = a.Id AND q.AnswerCount >= 2 AND DATEDIFF(DAY, q.CreationDate, CreationDate) <= 7 AND DATEDIFF(D... | sede |
CREATE TABLE table_name_31 (
president VARCHAR,
year VARCHAR,
date VARCHAR
) | What is the President with a Year larger than 2011, and a Date with 23 may? | SELECT president FROM table_name_31 WHERE year > 2011 AND date = "23 may" | sql_create_context |
CREATE TABLE table_name_67 (
draws INTEGER,
total VARCHAR,
goal_difference VARCHAR
) | What is the average number of draws that have a total of 1 and a goal difference of 2:0? | SELECT AVG(draws) FROM table_name_67 WHERE total = 1 AND goal_difference = "2:0" | sql_create_context |
CREATE TABLE table_37281 (
"Rocket" text,
"Country" text,
"Type" text,
"Launches" real,
"Successes" real,
"Failures" real,
"Partial failures" real
) | What are the fewest partial failures associated with 1 launch, India, gslv type, and a Rocket of gslv mk ii? | SELECT MIN("Partial failures") FROM table_37281 WHERE "Launches" = '1' AND "Country" = 'india' AND "Type" = 'gslv' AND "Rocket" = 'gslv mk ii' | wikisql |
CREATE TABLE table_name_41 (
first_year VARCHAR,
title VARCHAR
) | What is the first year for Popgun? | SELECT first_year FROM table_name_41 WHERE title = "popgun" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | For MKT 601 what are the course prerequisites ? | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'MKT' AND COURSE_0.number =... | advising |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | what is the maximum yearly number of patients who had s/p thoracotomy - decortication until 2104? | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 's/p thoracotomy - decortication' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_47182 (
"Name" text,
"Year Began" text,
"s Registered user" text,
"Updated in past 30 days" text,
"Registration" text,
"Ability to syndicate off-site feeds" text,
"Userpics Free" text,
"Userpics Paid" text,
"Monthly Cost for Paid Account" text,
"Yearly Cost for... | What is Updated In Past 30 Days, when Registration is 'Open to people 13 and over'? | SELECT "Updated in past 30 days" FROM table_47182 WHERE "Registration" = 'open to people 13 and over' | wikisql |
CREATE TABLE table_3378 (
"Episode #" real,
"The W\u00f8rd" text,
"Guest" text,
"Introductory phrase" text,
"Original airdate" text,
"Production code" real
) | What was the original airdate of episode #733? | SELECT "Original airdate" FROM table_3378 WHERE "Episode #" = '733' | wikisql |
CREATE TABLE table_18904831_6 (
date VARCHAR,
high_rebounds VARCHAR
) | When dydek (11) has the highest rebounds what is the date? | SELECT date FROM table_18904831_6 WHERE high_rebounds = "Dydek (11)" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
... | Top viewed posts with suck in the title. | SELECT Id AS "post_link", Score, ViewCount FROM Posts WHERE Title LIKE '%##Word##%' ORDER BY ViewCount DESC LIMIT 50 | sede |
CREATE TABLE table_name_83 (
venue VARCHAR,
score VARCHAR,
year VARCHAR
) | What venue has 3 & 2 as the score, and 1965 as the year? | SELECT venue FROM table_name_83 WHERE score = "3 & 2" AND year = "1965" | sql_create_context |
CREATE TABLE table_name_7 (
began_operation INTEGER,
length__km_ VARCHAR,
stations VARCHAR
) | When is the earliest began operation with a length of sultan ismail and over 27 stations? | SELECT MIN(began_operation) FROM table_name_7 WHERE length__km_ = "sultan ismail" AND stations > 27 | 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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | For all employees who have the letters D or S in their first name, return a scatter chart about the correlation between salary and manager_id . | SELECT SALARY, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_name_18 (
grid VARCHAR,
time_retired VARCHAR,
laps VARCHAR
) | what is the grid when the time/retired is +9 laps and the laps is larger than 91? | SELECT COUNT(grid) FROM table_name_18 WHERE time_retired = "+9 laps" AND laps > 91 | sql_create_context |
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 int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | i want to find the first flight from BALTIMORE to BOSTON that serves a meal | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_se... | atis |
CREATE TABLE table_name_48 (
year VARCHAR,
laps VARCHAR
) | What is the year with 116 laps? | SELECT year FROM table_name_48 WHERE laps = 116 | sql_create_context |
CREATE TABLE employees (
first_name VARCHAR,
department_id VARCHAR,
last_name VARCHAR
) | Display the first name, and department number for all employees whose last name is 'McEwen'. | SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen' | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
... | Find user with given email. | SELECT * FROM Users | sede |
CREATE TABLE table_name_7 (
position VARCHAR,
pick VARCHAR,
player VARCHAR
) | Which position had a pick larger than 80 and Walt Mainer as a player? | SELECT position FROM table_name_7 WHERE pick > 80 AND player = "walt mainer" | sql_create_context |
CREATE TABLE table_26301697_2 (
represents VARCHAR,
hometown VARCHAR
) | Name the represents for los alcarrizos | SELECT represents FROM table_26301697_2 WHERE hometown = "Los Alcarrizos" | sql_create_context |
CREATE TABLE table_255 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | During which years did player number 35 play for Jazz? | SELECT "Years for Jazz" FROM table_255 WHERE "No." = '35' | wikisql |
CREATE TABLE table_name_99 (
country VARCHAR,
date VARCHAR
) | What was the nationality of the winner on December 8, 1968? | SELECT country FROM table_name_99 WHERE date = "december 8, 1968" | sql_create_context |
CREATE TABLE table_77240 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What championship after 1997 was the score 1 6, 4 6, 7 5, 5 7? | SELECT "Championship" FROM table_77240 WHERE "Year" > '1997' AND "Score" = '1–6, 4–6, 7–5, 5–7' | wikisql |
CREATE TABLE fgwyjzb (
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,
... | 编号88417567835的医疗就诊出院时被诊断出来的是什么疾病,疾病的编号是什么 | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '88417567835' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '88417567835' | css |
CREATE TABLE Documents (
document_code VARCHAR(15),
document_structure_code VARCHAR(15),
document_type_code VARCHAR(15),
access_count INTEGER,
document_name VARCHAR(80)
)
CREATE TABLE Images (
image_id INTEGER,
image_alt_text VARCHAR(80),
image_name VARCHAR(40),
image_url VARCHAR(25... | Visualize a pie chart with what are the different role codes for users, and how many users have each? | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code | nvbench |
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 d_icd_diagnoses (
... | how did patient 26849 first enter the hospital a year before. | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 26849 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | what is the minimum age of patients who are diagnosed with primary disease aortic insufficiency\re-do sternotomy aortic valve replacement and stayed in hospital for 20 days? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "20" | mimicsql_data |
CREATE TABLE table_39868 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the highest number of points for a position less than 3 and less than 1 loss? | SELECT MAX("Points") FROM table_39868 WHERE "Position" < '3' AND "Lost" < '1' | wikisql |
CREATE TABLE table_name_83 (
hometown VARCHAR,
college VARCHAR
) | What is the hometown of the player who is headed to Duke? | SELECT hometown FROM table_name_83 WHERE college = "duke" | sql_create_context |
CREATE TABLE table_2941848_10 (
s_color_commentator VARCHAR,
pregame_hosts VARCHAR
) | Who is the s color commentator when the pregame host is jon sciambi? | SELECT s_color_commentator FROM table_2941848_10 WHERE pregame_hosts = "Jon Sciambi" | sql_create_context |
CREATE TABLE table_29423 (
"R" real,
"Player" text,
"Position" text,
"The Championship" real,
"FA Cup" real,
"League Cup" real,
"Total" real
) | What is the position for the player becchio? | SELECT "Position" FROM table_29423 WHERE "Player" = 'Becchio' | wikisql |
CREATE TABLE table_27877 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | How many entries are there for cyrillic name other names where settlement is idvor? | SELECT COUNT("Cyrillic Name Other Names") FROM table_27877 WHERE "Settlement" = 'Idvor' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 05037621患者的颈部的各项指标检验结果的数据是什么样子的? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | What is the item id of Paul Edwards? | SELECT lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE table_73399 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | How many vacators have October 22, 1808 as date successor seated? | SELECT COUNT("Vacator") FROM table_73399 WHERE "Date successor seated" = 'October 22, 1808' | wikisql |
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
) | Give me a histogram for how many climbers are from each country?, and could you rank in descending by the x axis? | SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY Country DESC | nvbench |
CREATE TABLE table_name_97 (
minister VARCHAR,
portfolio VARCHAR,
took_office VARCHAR
) | What is Minister, when Portfolio is 'Minister of Pubblic Administration', and when Took Office is '14 November 2002'? | SELECT minister FROM table_name_97 WHERE portfolio = "minister of pubblic administration" AND took_office = "14 november 2002" | sql_create_context |
CREATE TABLE table_name_97 (
capital VARCHAR,
hangul_chosongul VARCHAR
) | Which capital has a Hangul of ? | SELECT capital FROM table_name_97 WHERE hangul_chosongul = "경상남도" | sql_create_context |
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... | 根据出院诊断疾病编码,不同疾病的平均患者年龄在医院8485099中是多少岁啊? | SELECT t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8485099' GROUP BY t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | Visualize a bar chart for what is average age for different job title?, and display by the Y-axis from high to low. | SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) DESC | nvbench |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | How many enrolment students in each day? Return a bar chart binning date of enrolment by weekday, rank the number of date of enrolment from high to low order. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) 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... | what is maximum age of patients whose insurance is government and days of hospital stay is 3? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "3" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
r... | how long was the first hospital stay of patient 65883? | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 65883 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_24105 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
) | How many times did the Wildcats play a game 11 regardless of points scored? | SELECT COUNT("Wildcats points") FROM table_24105 WHERE "Game" = '11' | wikisql |
CREATE TABLE table_name_77 (
total INTEGER,
gold VARCHAR,
bronze VARCHAR,
silver VARCHAR
) | What is the lowest total medals when there were 0 gold medals, 0 silver medals, and more than 1 bronze medal? | SELECT MIN(total) FROM table_name_77 WHERE bronze > 1 AND silver = 0 AND gold < 0 | sql_create_context |
CREATE TABLE table_75663 (
"Rank" real,
"Municipality" text,
"Province" text,
"Status" text,
"Area (km 2 )" real
) | What is the listed Status that has the Province of Ontario and Rank of 86? | SELECT "Status" FROM table_75663 WHERE "Province" = 'ontario' AND "Rank" = '86' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Draw a bar chart about the distribution of Date_of_Birth and Height . | SELECT Date_of_Birth, Height FROM people | nvbench |
CREATE TABLE table_79302 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Chrome" text,
"Safari" text,
"Opera" text,
"Other" text
) | What opera has 19.87% as the firefox? | SELECT "Opera" FROM table_79302 WHERE "Firefox" = '19.87%' | wikisql |
CREATE TABLE table_25675509_1 (
depth VARCHAR,
longitude VARCHAR
) | If the longitude is 158.091 e, what is the depth? | SELECT depth FROM table_25675509_1 WHERE longitude = "158.091° E" | sql_create_context |
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 the comparison about School_ID over the Team_Name , order X-axis from high to low order. | SELECT Team_Name, School_ID FROM basketball_match ORDER BY Team_Name DESC | nvbench |
CREATE TABLE table_78577 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the time of Max Biaggi with more than 2 grids, 20 laps? | SELECT "Time" FROM table_78577 WHERE "Grid" > '2' AND "Laps" = '20' AND "Rider" = 'max biaggi' | wikisql |
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... | what is the number of patients who prefer spanish language? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" | mimicsql_data |
CREATE TABLE table_1360997_3 (
winner_2nd VARCHAR,
time VARCHAR
) | When the time is 1:36.30 what shows as winner? | SELECT winner_2nd FROM table_1360997_3 WHERE time = "1:36.30" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 罗列出从00年10月18日到2005年2月27日内患者04312120所有检验结果指标记录的检测人为孙幼安的检验指标流水序号是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is diagnoses short title and diagnoses long title of subject id 18077? | SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18077" | mimicsql_data |
CREATE TABLE table_name_5 (
accreditation_type VARCHAR,
accreditation_level VARCHAR,
company_name VARCHAR
) | When the Nokia corporation had an accreditation level of joyn, what was the accreditation type? | SELECT accreditation_type FROM table_name_5 WHERE accreditation_level = "joyn" AND company_name = "nokia corporation" | sql_create_context |
CREATE TABLE table_44981 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" real,
"Avg. Finish" real,
"Winnings" text,
"Position" text
) | How much average Finish has Starts of 9, and a Top 10 smaller than 0? | SELECT SUM("Avg. Finish") FROM table_44981 WHERE "Starts" = '9' AND "Top 10" < '0' | 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 medication (... | when did patient 022-87224 receive the last lab test? | 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 = '022-87224')) ORDER BY lab.labresulttime DESC LIMIT 1 | eicu |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 门诊诊断的患者为疾病G14.222的检测指标872554数值的平均值以及最值都分别有多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.