context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_76893 (
"Mode" text,
"D\u00e9part de la main gauche" text,
"Accord du 1st string" text,
"2nd string" text,
"3rd string" text
) | What is the mode of the Depart de la main gauche of 1st case and a la or mi 3rd string? | SELECT "Mode" FROM table_76893 WHERE "D\u00e9part de la main gauche" = '1st case' AND "3rd string" = 'la or mi' | wikisql |
CREATE TABLE table_33442 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the attendance in the game against the Detroit Lions? | SELECT "Attendance" FROM table_33442 WHERE "Opponent" = 'detroit lions' | wikisql |
CREATE TABLE table_73142 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the incumbent for alabama 6 | SELECT "Incumbent" FROM table_73142 WHERE "District" = 'Alabama 6' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | Longest Post for Amal Murali. | SELECT Id AS "post_link", LENGTH(Body) - (PATINDEX('%</code></pre>%', Body) - PATINDEX('%<pre><code>%', Body)) AS lenwithoutcode FROM Posts ORDER BY 2 DESC LIMIT 20 | sede |
CREATE TABLE table_2818164_2 (
title VARCHAR,
original_air_date VARCHAR
) | How many different titles does the episode originally aired on September 27, 1984 have? | SELECT COUNT(title) FROM table_2818164_2 WHERE original_air_date = "September 27, 1984" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varc... | For all employees who have the letters D or S in their first name, give me the comparison about the average of employee_id over the job_id , and group by attribute job_id by a bar chart, and list JOB_ID from low to high order. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 患者79511852被诊断为前列腺增生,查一下检测指标812812的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 自零三年二月十六日起,截止到一一年五月二十二日,医院6771925在门诊就诊中开了6张以上的检验报告单的科室有多少 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '6771925' AND jybgb.BGRQ BETWEEN '2003-02-16' AND '2011-05-22' GROUP BY jybgb.KSBM HAVING COUNT(*) > 6 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb J... | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and manufacturer , and group by attribute headquarter. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name | 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,
... | since 2105, how many patients were prescribed famotidine within the same hospital visit after they were diagnosed with coagulopathy? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coagulopathy' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t... | eicu |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
other_customer_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,... | What is the customer id with most number of cards, and how many does he have? | SELECT customer_id, COUNT(*) FROM customers_cards GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_12 (
share VARCHAR,
weekly_rank VARCHAR,
date VARCHAR
) | Which Share has a weekly Rank of 8 and is dated 15 June? | SELECT share FROM table_name_12 WHERE weekly_rank = "8" AND date = "15 june" | sql_create_context |
CREATE TABLE table_1140076_2 (
constructor VARCHAR,
date VARCHAR
) | What is the constructor for 9 May? | SELECT constructor FROM table_1140076_2 WHERE date = "9 May" | sql_create_context |
CREATE TABLE table_27132791_3 (
pro_team VARCHAR,
position VARCHAR,
nfl_team VARCHAR
) | If the NFL team is the Houston Oilers and the position is DT, who is the Pro team? | SELECT pro_team FROM table_27132791_3 WHERE position = "DT" AND nfl_team = "Houston Oilers" | sql_create_context |
CREATE TABLE table_name_33 (
country VARCHAR,
place VARCHAR
) | What is the country of the player with a t6 place? | SELECT country FROM table_name_33 WHERE place = "t6" | 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,
... | 列出患者朱斯伯就诊科室名称不包含正骨科的在医院0905366中所有门诊就诊记录是什么流水号? | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '朱斯伯' AND hz_info.YLJGDM = '0905366' AND NOT mzjzjlb.JZKSMC LIKE '%正骨科%' | css |
CREATE TABLE table_20227 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | On what deate was the centerfold featured Luci Victoria? | SELECT "Date" FROM table_20227 WHERE "Centerfold model" = 'Luci Victoria' | wikisql |
CREATE TABLE scientists (
name VARCHAR,
SSN VARCHAR
)
CREATE TABLE projects (
name VARCHAR,
code VARCHAR,
hours INTEGER
)
CREATE TABLE assignedto (
project VARCHAR,
scientist VARCHAR
) | Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it. | SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects) | sql_create_context |
CREATE TABLE table_name_40 (
caps VARCHAR,
position VARCHAR,
player VARCHAR
) | What is the total number of Caps Aca Ratuva, a flanker, has? | SELECT COUNT(caps) FROM table_name_40 WHERE position = "flanker" AND player = "aca ratuva" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | 根据测验结果指标记录34375185892显示的本次检测项目名字、检测指标代号以及名字、检验方式都有什么? | SELECT JCXMMC, JCZBDM, JCZBMC, JCFF FROM jyjgzbb WHERE JYZBLSH = '34375185892' | css |
CREATE TABLE table_11509 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | What is the highest round in the Wec 25 match in Las Vegas, Nevada, United States? | SELECT MAX("Round") FROM table_11509 WHERE "Location" = 'las vegas, nevada, united states' AND "Event" = 'wec 25' | wikisql |
CREATE TABLE table_69572 (
"Arena/Venue" text,
"Home Campus" text,
"Location" text,
"Province/Region" text,
"Maximum Seating Capacity" text,
"Year Opened" text
) | What year did the San Agustin gym open? | SELECT "Year Opened" FROM table_69572 WHERE "Arena/Venue" = 'san agustin gym' | wikisql |
CREATE TABLE table_24922 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Drivers" text,
"Winning Team" text
) | On how many different dates was the race at the Silverstone circuit? | SELECT COUNT("Date") FROM table_24922 WHERE "Circuit" = 'Silverstone' | wikisql |
CREATE TABLE table_74653 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team's score when the venue is princes park? | SELECT "Home team score" FROM table_74653 WHERE "Venue" = 'princes park' | wikisql |
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... | what does patient 594 age be during their last hospital encounter? | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_35529 (
"Season" text,
"Tier" real,
"Division" text,
"Pos." real,
"Cup Competitions" text
) | What is the pos with more than 1 tier during Pokal Slovenije 1. round? | SELECT "Pos." FROM table_35529 WHERE "Tier" > '1' AND "Cup Competitions" = 'pokal slovenije 1. round' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END... | For those employees who do not work in departments with managers that have ids between 100 and 200, what is the relationship between salary and manager_id ? | SELECT SALARY, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_54 (
bills_points INTEGER,
date VARCHAR
) | What were the Bills points on Nov. 11? | SELECT SUM(bills_points) FROM table_name_54 WHERE date = "nov. 11" | sql_create_context |
CREATE TABLE Procedures (
Code INTEGER,
Name VARCHAR(30),
Cost REAL
)
CREATE TABLE Prescribes (
Physician INTEGER,
Patient INTEGER,
Medication INTEGER,
Date DATETIME,
Appointment INTEGER,
Dose VARCHAR(30)
)
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
Block... | What are the names of all the physicians who took appointments, and count them by a bar chart, and show X-axis in ascending order. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE table_name_14 (
date VARCHAR,
game_site VARCHAR
) | What was the date of the game at Joe Robbie Stadium? | SELECT date FROM table_name_14 WHERE game_site = "joe robbie stadium" | sql_create_context |
CREATE TABLE table_name_10 (
président VARCHAR,
départment__or_collectivity_ VARCHAR
) | Who is the president representing the Creuse department? | SELECT président FROM table_name_10 WHERE départment__or_collectivity_ = "creuse" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | count the number of patients who had taken a mode test. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'mode') | eicu |
CREATE TABLE table_name_46 (
date VARCHAR,
athlete VARCHAR
) | On what Date of the race was Nesta Carter the Athlete? | SELECT date FROM table_name_46 WHERE athlete = "nesta carter" | sql_create_context |
CREATE TABLE table_2175 (
"Pitcher" text,
"Stats" real,
"Wins" real,
"Losses" real,
"No decisions" real,
"Winning %" text,
"Seasons" text
) | List the pitchers for the 1970 season | SELECT "Pitcher" FROM table_2175 WHERE "Seasons" = '1970' | 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 labevents (
row_id number,
subje... | when was for the last time during the last hospital encounter patient 31696 prescribed a medication via po/ng route? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31696 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.route = 'po/ng' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_64 (
wickets INTEGER,
runs VARCHAR,
matches VARCHAR
) | What is the total number of wickets that have runs under 4600 and matches under 44? | SELECT SUM(wickets) FROM table_name_64 WHERE runs < 4600 AND matches < 44 | sql_create_context |
CREATE TABLE table_24484 (
"Day" text,
"Stage" text,
"Time (EET)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
) | What is the time when time is 10:46? | SELECT "Time" FROM table_24484 WHERE "Time (EET)" = '10:46' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id ... | Highest question to view ratio by user. | SELECT p.OwnerUserId AS "user_link", SUM(p.ViewCount) AS "total_views", COUNT(p.Id) AS "total_questions", SUM(p.ViewCount) / COUNT(p.Id) AS "view_count_ratio", (SELECT Id FROM Posts WHERE ViewCount = MAX(p.ViewCount) LIMIT 1) AS "post_link" FROM Posts AS p WHERE p.PostTypeId = 1 GROUP BY p.OwnerUserId ORDER BY SUM(p.Vi... | sede |
CREATE TABLE table_1703 (
"Episode #" real,
"Title" text,
"Director" text,
"Screenwriter" text,
"Original airdate" text,
"English airdate" text
) | What is the number of theWhat is the number of the chapter that is called 'breakthrough' 'bur ku sur ' ( )? | SELECT MIN("Episode #") FROM table_1703 WHERE "Title" = 'Breakthrough" "Burēku surū" (ブレーク·スルー)' | wikisql |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name... | A bar chart showing the number of start date of the apartment bookings made by female guests (gender code 'Female') for each weekday, and could you show total number in asc order? | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_60212 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What was John Fought's score? | SELECT "Score" FROM table_60212 WHERE "Player" = 'john fought' | wikisql |
CREATE TABLE table_76619 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
) | What grid has 24 points? | SELECT "Grid" FROM table_76619 WHERE "Points" = '24' | wikisql |
CREATE TABLE table_53127 (
"Year" real,
"Award Ceremony" text,
"Category" text,
"Nominee" text,
"Result" text
) | Which Nominee has a Category of outstanding musical? | SELECT "Nominee" FROM table_53127 WHERE "Category" = 'outstanding musical' | 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 allergy (
allergy... | how many hours have passed since patient 032-21820 stayed in the ward 1063 for the last time in their current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '032-21820' AND patient.wardid = 1063 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_79630 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | What is the Attendance of the game with a Score of 3 2? | SELECT COUNT("Attendance") FROM table_79630 WHERE "Score" = '3–2' | wikisql |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | Show different nominees and the number of musicals they have been nominated Plot them as bar chart, and list Y-axis in ascending order. | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_34065 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Which Margin of victory has a Runner(s)-up of jos maria ca izares? | SELECT "Margin of victory" FROM table_34065 WHERE "Runner(s)-up" = 'josé maria cañizares' | wikisql |
CREATE TABLE table_65613 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | Which Losses have an Against smaller than 1018, and Wins smaller than 14? | SELECT AVG("Losses") FROM table_65613 WHERE "Against" < '1018' AND "Wins" < '14' | wikisql |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | How many companies without a gas station in each main industry? Draw a bar chart. | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry | nvbench |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 从00年4月19日到20年11月4日医院6853242的住院医疗记录的数目统共有多少? | SELECT COUNT(*) FROM zyb WHERE zyb.MED_TYPE = '6853242' AND zyb.IN_HOSP_DAYS BETWEEN '2000-04-19' AND '2020-11-04' | css |
CREATE TABLE table_name_29 (
score INTEGER,
venue VARCHAR,
year VARCHAR
) | What was the sum of the scores before the year 2002, that had the venue of Halmstad? | SELECT SUM(score) FROM table_name_29 WHERE venue = "halmstad" AND year < 2002 | sql_create_context |
CREATE TABLE table_19978 (
"No." real,
"English name" text,
"Bulgarian name" text,
"Bulgarian name ( Transliteration )" text,
"Old Bulgarian Names" text,
"Old Bulgarian name (Transliteration)" text,
"Old Bulgarian name - Meaning" text
) | Name the bulgarian name for mart | SELECT "Bulgarian name" FROM table_19978 WHERE "Bulgarian name ( Transliteration )" = 'Mart' | wikisql |
CREATE TABLE table_71040 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Which record has an Opponent of orioles and a Date of april 14? | SELECT "Record" FROM table_71040 WHERE "Opponent" = 'orioles' AND "Date" = 'april 14' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 在医院2837438中,最长医疗住院时长少于25天的科室有多少 | SELECT COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '2837438' GROUP BY MED_ORG_DEPT_CD HAVING MAX(IN_HOSP_DAYS) < 25) AS T | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | Next Winter , who is teaching PreMajor classes ? | SELECT DISTINCT instructor.name 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 INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_79170 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which player scored 76-68=144? | SELECT "Player" FROM table_79170 WHERE "Score" = '76-68=144' | wikisql |
CREATE TABLE table_3112 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What was the title of the episode written by Bob Rosenfarb and directed by Richard Correll? | SELECT "Title" FROM table_3112 WHERE "Written by" = 'Bob Rosenfarb' AND "Directed by" = 'Richard Correll' | wikisql |
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE buildings (
id int,
name text,
City text,
Height int,
Stories int,
Status text
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_... | Return a bar chart showing the number of companies in each building, display in asc by the Y. | SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name ORDER BY COUNT(T2.name) | nvbench |
CREATE TABLE table_204_536 (
id number,
"event" text,
"bowling center" text,
"city" text,
"dates" text,
"winner" text
) | what were the dates of the last event of the year ? | SELECT "dates" FROM table_204_536 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | list currrent or all databases. | SELECT name FROM master.sys.databases | sede |
CREATE TABLE table_1184344_1 (
type VARCHAR,
name VARCHAR
) | What was the type of sussex? | SELECT type FROM table_1184344_1 WHERE name = "Sussex" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | what was patient 005-87465's last output time of the stool on the current icu visit? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465') AND patient.unitdischargetime IS NULL) AN... | eicu |
CREATE TABLE table_name_47 (
chassis VARCHAR,
points VARCHAR
) | Which chassis was used when over 6 points were earned? | SELECT chassis FROM table_name_47 WHERE points = 6 | sql_create_context |
CREATE TABLE table_name_13 (
artist VARCHAR,
spoofed_title VARCHAR
) | What is the name of the Artist for the Spoofed Title of the moron downer jr. show? | SELECT artist FROM table_name_13 WHERE spoofed_title = "the moron downer jr. show" | sql_create_context |
CREATE TABLE table_32454 (
"Rank" text,
"Name" text,
"City" text,
"Height in m (ft)" text,
"Floors" real,
"Year built" real
) | What is the name of a building in Courbevoie built before 1973? | SELECT "Name" FROM table_32454 WHERE "Year built" < '1973' AND "City" = 'courbevoie' | wikisql |
CREATE TABLE table_79642 (
"School" text,
"Location" text,
"Mascot" text,
"County" text,
"Enrollment" real,
"IHSAA Class / Football / Soccer" text,
"Year Joined" real,
"Previous Conference" text
) | what is the school with the location of alexandria? | SELECT "School" FROM table_79642 WHERE "Location" = 'alexandria' | wikisql |
CREATE TABLE table_29159 (
"Chambering" text,
"P1 diameter (mm)" text,
"A external (cm 2 )" text,
"P max ( bar )" real,
"F bolt ( kgf )" real,
"F bolt" text
) | What is the p1 diameter (mm) when .300 lapua magnum is the chambering? | SELECT "P1 diameter (mm)" FROM table_29159 WHERE "Chambering" = '.300 Lapua Magnum' | wikisql |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 门诊诊断的患者为疾病G14.222的检测指标872554数值的平均值以及最值都分别有多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'G14.222' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE table_2876467_3 (
first_place INTEGER,
third_place VARCHAR
) | What is the maximum number of 1st places for the country with exactly 1 third place? | SELECT MAX(first_place) FROM table_2876467_3 WHERE third_place = 1 | sql_create_context |
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | what's the last time patient 2498 has had a procedure until 1 year ago? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2498) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_70976 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What Argentina country is in t10 place? | SELECT "Score" FROM table_70976 WHERE "Place" = 't10' AND "Country" = 'argentina' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 自二零一零年八月七日到二零一五年二月三日,挂医生26801950的号看门诊的病人是多少 | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.ZZYSGH = '26801950' AND txmzjzjlb.JZKSRQ BETWEEN '2010-08-07' AND '2015-02-03' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN ftxmzjzjlb ON hz_inf... | css |
CREATE TABLE table_48772 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is Player, when Score is less than 69, and when Country is 'United States'? | SELECT "Player" FROM table_48772 WHERE "Score" < '69' AND "Country" = 'united states' | wikisql |
CREATE TABLE table_name_82 (
number_of_votes VARCHAR,
candidate VARCHAR,
share_of_votes VARCHAR
) | What is the number of votes of candidate edward mahama, who had 0.9% share of votes? | SELECT number_of_votes FROM table_name_82 WHERE candidate = "edward mahama" AND share_of_votes = "0.9%" | sql_create_context |
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 did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by time. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_18576 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the party for new york 20? | SELECT "Party" FROM table_18576 WHERE "District" = 'New York 20' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients whose item id is 51221? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51221" | mimicsql_data |
CREATE TABLE table_15326 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
) | Which entrant had fewer than 33 points in 1999? | SELECT "Entrant" FROM table_15326 WHERE "Points" < '33' AND "Year" = '1999' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CRE... | obsolete accept my answer comments on accepted questions. | SELECT c.Id AS "comment_link" FROM Comments AS c INNER JOIN Posts AS p ON p.Id = c.PostId WHERE 'text' LIKE '%accept my answer%' AND NOT p.AcceptedAnswerId IS NULL | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeo... | how many patients since 2 years ago were diagnosed with cardiac arrest - witnessed, < 15 minutes cpr in the same hospital encounter after the first diagnosis with chronic respiratory failure? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardiac arrest - witnessed, < 15 minutes cpr' AND DATETIME(diagnosis.diag... | eicu |
CREATE TABLE table_13608 (
"Year" real,
"Finish position" text,
"1st day" text,
"2nd day" text,
"3rd day" text,
"4th Day" text
) | Which 3rd day has a 4th Day of rowed-over, and a Finish position of 55th? | SELECT "3rd day" FROM table_13608 WHERE "4th Day" = 'rowed-over' AND "Finish position" = '55th' | wikisql |
CREATE TABLE table_name_40 (
championship_game VARCHAR,
_number_of_bids VARCHAR,
win__percentage VARCHAR
) | What is the Championship Game that has 4 Bids and a .600 Win %? | SELECT championship_game FROM table_name_40 WHERE _number_of_bids = 4 AND win__percentage = ".600" | sql_create_context |
CREATE TABLE table_35439 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" real,
"Song" text,
"Artist" text
) | What was the issue date for the single with a Volume:Issue of 47:8-9? | SELECT "Issue Date(s)" FROM table_35439 WHERE "Volume:Issue" = '47:8-9' | wikisql |
CREATE TABLE table_21723 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | What is part 1 of the verb in class 4 | SELECT "Part 3" FROM table_21723 WHERE "Class" = '4' | wikisql |
CREATE TABLE table_22937 (
"Tie no" real,
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | How many tie no have team 1 as borac banja luka? | SELECT "Tie no" FROM table_22937 WHERE "Team 1" = 'Borac Banja Luka' | wikisql |
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 ... | what was the last value of patient 45612's laboratory test for potassium in 05/2101? | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 45612) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND STRFTIME('%y-%m', labevents.charttime) = '2101-05' ORDER BY labe... | mimic_iii |
CREATE TABLE room (
roomnumber number,
roomtype text,
blockfloor number,
blockcode number,
unavailable boolean
)
CREATE TABLE trained_in (
physician number,
treatment number,
certificationdate time,
certificationexpires time
)
CREATE TABLE department (
departmentid number,
... | How many medications are prescribed for each brand? | SELECT COUNT(*), T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand | spider |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAd... | Query answers by PostTypeId, Score and keyword. | SELECT Body FROM Posts WHERE PostTypeId = 2 AND Score >= 25 AND Body LIKE ('%##param##%') | sede |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId nu... | I have never' in answers.. | SELECT p.Id AS "post_link" FROM Posts AS p WHERE p.PostTypeId = 2 AND (p.Body LIKE '%I have never%' OR p.Body LIKE '%I''ve never%' OR p.Body LIKE '%never tried%') | sede |
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,
... | 二零零三年七月一日到二零二一年三月二十九日,医疗机构3916890处理异地就诊的次数有多少 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3916890' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2' | css |
CREATE TABLE table_name_19 (
dates_administered VARCHAR,
poll_source VARCHAR,
lead_margin VARCHAR
) | What was the date administered from a source of Rasmussen Reports and a lead margin over 32? | SELECT dates_administered FROM table_name_19 WHERE poll_source = "rasmussen reports" AND lead_margin > 32 | sql_create_context |
CREATE TABLE procedures (
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 ... | what is the number of patients whose year of birth is less than 2138 and drug code is fent75p? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2138" AND prescriptions.formulary_drug_cd = "FENT75P" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 疾病S14.067的病号郑思源在门诊诊断时的氨基末端B型利钠肽的结果定量及其单位分别是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name by a bar chart, and I want to display Y-axis from low to high order. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code | nvbench |
CREATE TABLE table_1046170_5 (
us_open_cup VARCHAR,
playoffs VARCHAR
) | which round is u.s. open cup division semifinals | SELECT us_open_cup FROM table_1046170_5 WHERE playoffs = "division Semifinals" | sql_create_context |
CREATE TABLE table_17778417_1 (
record VARCHAR,
opponent VARCHAR
) | How many times did the Denver Broncos face the Dallas Texans this season? | SELECT COUNT(record) FROM table_17778417_1 WHERE opponent = "Dallas Texans" | 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... | count the number of patients whose gender is m and diagnoses icd9 code is 591? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "591" | mimicsql_data |
CREATE TABLE table_16403890_1 (
location VARCHAR,
institution VARCHAR
) | How many locations does Elon University have? | SELECT COUNT(location) FROM table_16403890_1 WHERE institution = "Elon University" | sql_create_context |
CREATE TABLE table_6769 (
"SANSKRT" text,
"CHINESE" text,
"VIETNAMESE" text,
"JAPANESE" text,
"KOREAN" text
) | Which VIETNAMESE has a CHINESE of / p x m ? | SELECT "VIETNAMESE" FROM table_6769 WHERE "CHINESE" = '婆須密 / póxūmì' | wikisql |
CREATE TABLE table_28659 (
"Name / designation" text,
"Year of introduction" text,
"Country of origin" text,
"Primary cartridge" text,
"primary user" text
) | If the country of origin is switzerland, what is the name/ designation? | SELECT "Name / designation" FROM table_28659 WHERE "Country of origin" = 'Switzerland' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.