context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_76 ( performer_4 VARCHAR, performer_1 VARCHAR, date VARCHAR )
Performer 1 of greg proops, and a Date of 25 august 1995 is what performer 4?
SELECT performer_4 FROM table_name_76 WHERE performer_1 = "greg proops" AND date = "25 august 1995"
sql_create_context
CREATE TABLE table_name_68 ( total INTEGER, league_cup_goals VARCHAR, club VARCHAR, league_goals VARCHAR )
Which Total has a Club of darlington, and a League goals of 13, and a League Cup goals of 1?
SELECT SUM(total) FROM table_name_68 WHERE club = "darlington" AND league_goals = "13" AND league_cup_goals = "1"
sql_create_context
CREATE TABLE table_11677100_8 ( mlb_draft VARCHAR, hometown VARCHAR )
What pick was the player from Apopka, FL in the 2002 MLB draft
SELECT mlb_draft FROM table_11677100_8 WHERE hometown = "Apopka, FL"
sql_create_context
CREATE TABLE table_59236 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
Which club has 101 tries for?
SELECT "Club" FROM table_59236 WHERE "Tries for" = '101'
wikisql
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 the average of revenue over the headquarter , and group by attribute headquarter, sort by the total number in asc please.
SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue)
nvbench
CREATE TABLE table_13957 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in final" text, "Score" text, "Prize Money" text )
What is the Score of the Pingguo Tournament?
SELECT "Score" FROM table_13957 WHERE "Tournament" = 'pingguo'
wikisql
CREATE TABLE table_9548 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the result from the game played on week 7?
SELECT "Result" FROM table_9548 WHERE "Week" = '7'
wikisql
CREATE TABLE table_78208 ( "Date(s) conducted" text, "Polling organisation/client" text, "Cons" text, "Plaid Cymru" text, "Lib Dem" text, "Others" text, "Lead" text )
Name the others for cons of 21% and lead of 24%
SELECT "Others" FROM table_78208 WHERE "Cons" = '21%' AND "Lead" = '24%'
wikisql
CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATETIME, asset_disposed_date DATETIME, other_asset_details VARCHAR(255) ) CREATE TA...
How many assets can each parts be used in? List the part name and the number, display X in descending order.
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY part_name DESC
nvbench
CREATE TABLE table_name_52 ( interview INTEGER, state VARCHAR, evening_gown VARCHAR )
Who had the lowest interview score from South Dakota with an evening gown less than 8.513?
SELECT MIN(interview) FROM table_name_52 WHERE state = "south dakota" AND evening_gown < 8.513
sql_create_context
CREATE TABLE table_name_84 ( points INTEGER, nation VARCHAR, places VARCHAR )
What is the number of points for east germany, and a Places of 88?
SELECT SUM(points) FROM table_name_84 WHERE nation = "east germany" AND places = "88"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
牙隐裂的患者一共有多少
SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '牙隐裂' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '牙隐裂'
css
CREATE TABLE table_26917 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "School" text )
How many players attended SE missouri state?
SELECT COUNT("Position") FROM table_26917 WHERE "School" = 'SE Missouri State'
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,...
沈安娜这位病人在05年2月20日到10年8月10号所开出的检验报告单的全部科室编码以及名称各是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJL...
css
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Do...
what are the different statement ids on accounts, and the number of accounts for each?
SELECT Statement_ID, COUNT(*) FROM Accounts GROUP BY Statement_ID
nvbench
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 diagnoses ( ...
count the number of patients whose admission year is less than 2105?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2105"
mimicsql_data
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
Is DHYGRACK 685 required to take the course DHYGRACK 689 ?
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'DHYGRACK' AND COURSE_0.number = 685 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'DHYGRACK' AND COURSE_1.number...
advising
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
Ignore movies whose director is NULL For each director, what are the titles and the highest rating among all of their movies they reviewed? Draw the result by a bar chart, order from low to high by the y-axis.
SELECT title, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY title ORDER BY MAX(T1.stars)
nvbench
CREATE TABLE table_23285761_8 ( high_points VARCHAR, location_attendance VARCHAR )
Name the high points for pepsi center 19,155
SELECT high_points FROM table_23285761_8 WHERE location_attendance = "Pepsi Center 19,155"
sql_create_context
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, ...
看看患者窦飞双在医院9762101出院诊断中,没有神经衰弱的疾病名的医疗就诊记录编码
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '窦飞双' AND t_kc21.MED_SER_ORG_NO = '9762101' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%神经衰弱%'
css
CREATE TABLE table_name_51 ( result VARCHAR, box_scores VARCHAR, date VARCHAR )
What was the result of the game on September 25 with a box score of box?
SELECT result FROM table_name_51 WHERE box_scores = "box" AND date = "september 25"
sql_create_context
CREATE TABLE table_15453 ( "Date" text, "Location" text, "Nature of incident" text, "Circumstances" text, "Casualties" text )
Name the location on 2006-04-07 for direct fire
SELECT "Location" FROM table_15453 WHERE "Date" = '2006-04-07' AND "Circumstances" = 'direct fire'
wikisql
CREATE TABLE table_31944 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Tell me the surface for november 28, 2010
SELECT "Surface" FROM table_31944 WHERE "Date" = 'november 28, 2010'
wikisql
CREATE TABLE table_20287 ( "Kansas State vs." text, "Games played" real, "Overall Record" text, "Last 5 Meetings" text, "Last 10 Meetings" text, "Current Streak" text, "Last Meeting" text )
if they played last on 12/5/1987 what is their record
SELECT "Current Streak" FROM table_20287 WHERE "Last Meeting" = '12/5/1987'
wikisql
CREATE TABLE table_48873 ( "Model" text, "Length Over All" text, "Beam" text, "Sail Area" text, "Crew" text, "Comments" text )
Which Comments has a Model of 18sq?
SELECT "Comments" FROM table_48873 WHERE "Model" = '18sq'
wikisql
CREATE TABLE table_name_95 ( top_25 VARCHAR, top_10 VARCHAR )
What is the total number of top-25s for the major that has 11 top-10s?
SELECT COUNT(top_25) FROM table_name_95 WHERE top_10 = 11
sql_create_context
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...
Top 100 most viewed questions on a site.
SELECT p.Id, p.ViewCount, p.Title, p.Score FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id WHERE pt.Name = 'Question' ORDER BY ViewCount DESC LIMIT 100
sede
CREATE TABLE table_name_96 ( mar_17 VARCHAR, april_21 VARCHAR )
What is the rank for Mar 17 when the April 21 rank is 10?
SELECT mar_17 FROM table_name_96 WHERE april_21 = "10"
sql_create_context
CREATE TABLE table_name_13 ( period VARCHAR, built VARCHAR )
In what time period were 354 built?
SELECT period FROM table_name_13 WHERE built = "354"
sql_create_context
CREATE TABLE customers ( customer_name VARCHAR, payment_method VARCHAR )
What are the names of customers who use payment method 'Cash'?
SELECT customer_name FROM customers WHERE payment_method = "Cash"
sql_create_context
CREATE TABLE table_24973 ( "#" text, "Spacecraft" text, "Spacewalkers" text, "Start ( UTC )" text, "End (UTC)" text, "Duration" text )
If the end (UTC) is January 31, 2007 23:09, what is the name of the spacewalkers?
SELECT "Spacewalkers" FROM table_24973 WHERE "End (UTC)" = 'January 31, 2007 23:09'
wikisql
CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255), Order_Item_ID INTEGER ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region...
List the distinct payment method codes with the number of orders mad by a pie chart.
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code
nvbench
CREATE TABLE table_name_35 ( score VARCHAR, opponent VARCHAR, record VARCHAR )
What is Score, when Opponent is Portland Trail Blazers, and when Record is 12-58?
SELECT score FROM table_name_35 WHERE opponent = "portland trail blazers" AND record = "12-58"
sql_create_context
CREATE TABLE table_58893 ( "Year" real, "Film" text, "Result" text, "Category" text, "Actor" text )
What actor was nominated for best actress?
SELECT "Actor" FROM table_58893 WHERE "Result" = 'nominated' AND "Category" = 'best actress'
wikisql
CREATE TABLE table_name_41 ( mkhedruli VARCHAR, asomtavruli VARCHAR )
What is the Mkhedruli symbol for the Asomtavruli ?
SELECT mkhedruli FROM table_name_41 WHERE asomtavruli = "ⴒ"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give the number of patients whose primary disease is morbid obesity/sda and were admitted before the year 2184.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.admityear < "2184"
mimicsql_data
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...
病患何嘉悦在02年4月18日到2020年5月25日内所有的检验结果指标记录中检测人是冯婉娜时检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_i...
css
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, ...
unanswered bounties that about to end.
SELECT Title FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id
sede
CREATE TABLE table_name_85 ( draws INTEGER, lexton_plains VARCHAR, against VARCHAR )
Which Draws have a Lexton Plains of skipton, and an Against larger than 1212?
SELECT MAX(draws) FROM table_name_85 WHERE lexton_plains = "skipton" AND against > 1212
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, cha...
when did patient 9801 have a minimum mcv for the first time during the first hospital encounter?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9801 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv')...
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
report the number of patients on ivpca route of drug administration who have been diagnosed with other specified procedures as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time of procedure.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other specified procedures as the cause of abnormal reaction of patient, or of later compli...
mimicsql_data
CREATE TABLE table_1886589_1 ( socialist VARCHAR, lead VARCHAR )
How many socialist have a lead of 12.6%?
SELECT COUNT(socialist) FROM table_1886589_1 WHERE lead = "12.6%"
sql_create_context
CREATE TABLE table_name_46 ( bronze INTEGER, rank INTEGER )
What is the highest amount of bronze medals when the rank was larger than 9?
SELECT MAX(bronze) FROM table_name_46 WHERE rank > 9
sql_create_context
CREATE TABLE table_21154679_1 ( top_speed VARCHAR, max_power VARCHAR )
What is top speed of a petrol engine at ps (kw; bhp)@5250-6250?
SELECT top_speed FROM table_21154679_1 WHERE max_power = "PS (kW; bhp)@5250-6250"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Suggested Edits - Percentage of 'correct' votes.
WITH CTE AS (SELECT UserId, CASE WHEN NOT ApprovalDate IS NULL AND VoteTypeId = 2 THEN 1 WHEN NOT RejectionDate IS NULL AND VoteTypeId = 3 THEN 1 ELSE 0 END AS Correct FROM SuggestedEditVotes AS sev INNER JOIN SuggestedEdits AS se ON sev.SuggestedEditId = se.Id WHERE sev.UserId = '##UserID##') SELECT UserId, COUNT(Corr...
sede
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在病人27439695的医疗记录中,给他开出的药品金额小于8781.25元的医疗就诊有哪几次?编号是什么
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '27439695' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 8781.25) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '27439695' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_...
css
CREATE TABLE artist ( artist_id number, name text, country text, year_join number, age number ) CREATE TABLE exhibition ( exhibition_id number, year number, theme text, artist_id number, ticket_price number ) CREATE TABLE exhibition_record ( exhibition_id number, date t...
Return the name and country corresponding to the artist who has had the most exhibitions.
SELECT T2.name, T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_35949 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
Who was the lead when Ritvars Gulbis was the skip?
SELECT "Lead" FROM table_35949 WHERE "Skip" = 'ritvars gulbis'
wikisql
CREATE TABLE table_38400 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the 1st leg of team 1 Liverpool?
SELECT "1st leg" FROM table_38400 WHERE "Team 1" = 'liverpool'
wikisql
CREATE TABLE table_name_15 ( home_team VARCHAR, away_team VARCHAR )
Name the home team score when the away team is south melbourne
SELECT home_team AS score FROM table_name_15 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_name_95 ( population VARCHAR, rank VARCHAR )
What is the population for Rank 11?
SELECT population FROM table_name_95 WHERE rank = 11
sql_create_context
CREATE TABLE table_name_42 ( player_name VARCHAR, position VARCHAR, year VARCHAR )
What is the name of the cornerback from 1997?
SELECT player_name FROM table_name_42 WHERE position = "cornerback" AND year = 1997
sql_create_context
CREATE TABLE table_30781 ( "Player" text, "Matches" real, "Overs" text, "Wickets" real, "Average" text, "Economy" text, "BBI" text, "4wi" real )
What is the economy of the player with BBI of 3/33?
SELECT "Economy" FROM table_30781 WHERE "BBI" = '3/33'
wikisql
CREATE TABLE table_25337 ( "County" text, "Population" real, "Unemployment Rate" text, "Market Income Per Capita" text, "Poverty Rate" text, "Status" text )
What is the povery rate of the county with market income per capita of $20,518?
SELECT "Poverty Rate" FROM table_25337 WHERE "Market Income Per Capita" = '$20,518'
wikisql
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, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of department_id bin hire_date by time in a bar chart.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
count the number of patients whose item id is 50803 and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50803" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE news_report ( journalist_id number, event_id number, work_type text ) CREATE TABLE event ( event_id number, date text, venue text, name text, event_attendance number ) CREATE TABLE journalist ( journalist_id number, name text, nationality text, age text, ...
List the event venues and names that have the top 2 most number of people attended.
SELECT venue, name FROM event ORDER BY event_attendance DESC LIMIT 2
spider
CREATE TABLE table_61380 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the result of the game at kyiv, ukraine?
SELECT "Result" FROM table_61380 WHERE "Venue" = 'kyiv, ukraine'
wikisql
CREATE TABLE table_39190 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
When did woking compete?
SELECT "Date" FROM table_39190 WHERE "Opponent" = 'woking'
wikisql
CREATE TABLE table_22498 ( "Athlete" text, "Class" text, "Event" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text, "Final/ Bronze medal match" text )
What is the round of 16 result for Jiske Griffioen Esther Vergeer?
SELECT "Round of 16" FROM table_22498 WHERE "Athlete" = 'Jiske Griffioen Esther Vergeer'
wikisql
CREATE TABLE table_56441 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When did an away team score 12.14 (86) at Windy Hill?
SELECT "Date" FROM table_56441 WHERE "Away team score" = '12.14 (86)' AND "Venue" = 'windy hill'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
What classes will count as Other next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program...
advising
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
calculate the number of people who had a total protein lab test the last year.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'total protein' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
eicu
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is maximum age of patients whose admission type is emergency and year of death is less than 2183?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2183.0"
mimicsql_data
CREATE TABLE table_80019 ( "Sport" text, "League" text, "Tier" text, "Club" text, "Stadium" text )
Which tier is for football at Tianhe Stadium?
SELECT "Tier" FROM table_80019 WHERE "Sport" = 'football' AND "Stadium" = 'tianhe stadium'
wikisql
CREATE TABLE table_10399701_2 ( class_aAAAA VARCHAR, school_year VARCHAR )
Who was Class AAAAA during the school year of 1995-96?
SELECT class_aAAAA FROM table_10399701_2 WHERE school_year = "1995-96"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
What are the programs that require EARTH 423 ?
SELECT DISTINCT program.name FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN program ON program.program_id = program_course.program_id WHERE course.department = 'EARTH' AND course.number = 423
advising
CREATE TABLE table_31045 ( "Rnd" real, "Circuit" text, "Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Most laps led" text, "Winning driver" text, "Winning team" text, "Supporting" text )
Where was the race with Luke Ellery as fastest lap and Wayne Boyd as winning driver?
SELECT "Location" FROM table_31045 WHERE "Fastest lap" = 'Luke Ellery' AND "Winning driver" = 'Wayne Boyd'
wikisql
CREATE TABLE table_name_81 ( age_on_mission INTEGER, name VARCHAR )
What is the lowest age of an astronaut named Stu Roosa?
SELECT MIN(age_on_mission) FROM table_name_81 WHERE name = "stu roosa"
sql_create_context
CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR...
Show the average of price supplied by supplier id 3 for different product type code in a bar chart, and order by the y axis in ascending.
SELECT product_type_code, AVG(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY AVG(product_price)
nvbench
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 products with a price between 60 and 120, give me the comparison about price over the name by a bar chart, order by the x axis in ascending.
SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name
nvbench
CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) ) CREATE...
Return a bar chart on how many customers use each payment method?, could you display by the total number in descending please?
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_test_31 ( "id" int, "ejection_fraction_ef" int, "macular_disease" bool, "systemic" bool, "alt" float, "iud" bool, "condom_with_spermicide" bool, "gender" string, "meropenem" bool, "non_q_wave_myocardial_infarction" bool, "hbcab" bool, "unstable_angina" ...
ejection fraction <= 35 % and at least one of the following criteria: intervention on the last patent coronary conduit, or intervention on an unprotected left main coronary artery
SELECT * FROM table_test_31 WHERE ejection_fraction_ef <= 35 AND (coronary_conduit = 1 OR unprotected_left_main_coronary_artery = 1)
criteria2sql
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...
医疗机构2488172使用次数top20的是哪些项目
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2488172' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 20
css
CREATE TABLE table_1266602_2 ( rounds INTEGER, crew_chief VARCHAR )
What is the largest number of rounds for the team that hired Donnie Wingo as crew chief?
SELECT MAX(rounds) FROM table_1266602_2 WHERE crew_chief = "Donnie Wingo"
sql_create_context
CREATE TABLE table_48323 ( "Year" real, "Venue" text, "Winner" text, "Runner Up" text, "Third Place" text )
Who took third place in 2012?
SELECT "Third Place" FROM table_48323 WHERE "Year" = '2012'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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, insuranc...
during the last year, what were the top four most frequent specimen tests given to a patient in the same month after the diagnosis of mal neo pyloric antrum?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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_...
mimic_iii
CREATE TABLE table_25129482_1 ( stadium VARCHAR, location VARCHAR )
What is the stadium in Kuopio?
SELECT stadium FROM table_25129482_1 WHERE location = "Kuopio"
sql_create_context
CREATE TABLE table_2475 ( "Source" text, "Dates Administered" text, "Terry McAuliffe" text, "Brian Moran" text, "Creigh Deeds" text )
What was Brian Moran's share of the votes when Creigh Deeds had 30%?
SELECT "Brian Moran" FROM table_2475 WHERE "Creigh Deeds" = '30%'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the last_name , order bar from low to high order.
SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME
nvbench
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Top 100 SO Users from Pakistan.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pakistan%' OR UPPER(Location) LIKE '%PK' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE PostHistoryTypes ( Id number, Name text ) 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 with no wiki excerpt.
SELECT Tags.*, Posts.Body, Posts.PostTypeId, Posts.CreationDate, Posts.DeletionDate, Posts.LastEditDate, Posts.LastActivityDate FROM Tags JOIN Posts ON Tags.ExcerptPostId = Posts.Id WHERE LENGTH(Posts.Body) = 0
sede
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address ...
What are the number of start date of the apartment bookings made by female guests (gender code 'Female') for each year? Plot a bar chart.
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"
nvbench
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text )
Plot the id and the number of journal committees they are on in a scatter chart.
SELECT T1.Editor_ID, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Editor_ID
nvbench
CREATE TABLE table_54176 ( "Date" text, "Result" text, "Opponent" text, "Location" text, "Method" text )
What is the method against Paula Mataele?
SELECT "Method" FROM table_54176 WHERE "Opponent" = 'paula mataele'
wikisql
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_DIRE_CD text, MED_DIRE_NM text,...
这个医疗就诊15040416444入院时诊断的编号是什么?疾病名称是什么?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '15040416444'
css
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...
从2007年8月29日开始,截止到2013年5月22日,请把彭飞沉的这位病人总共被开出的检验报告单的审核日期时间给列出来
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.person_info_XM = '彭飞沉' AND jybgb.BGRQ BETWEEN '2007-08-29' AND '2013-05-22' ...
css
CREATE TABLE table_55772 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which team had a game of 82?
SELECT "Team" FROM table_55772 WHERE "Game" = '82'
wikisql
CREATE TABLE table_24687 ( "Position" real, "Club" text, "Played" real, "H-Win" real, "H-Draw" real, "A-Win" real, "A-Draw" real, "Lost" real, "Def." real, "Pts For" real, "Pts Agst" real, "Pair" real, "Long" real, "Points" real, "Average" text )
What is the maximum number of points scored against?
SELECT MAX("Pts Agst") FROM table_24687
wikisql
CREATE TABLE table_name_35 ( competition VARCHAR, result VARCHAR, venue VARCHAR )
what is the competition when the result is 1-1 and venue is gwangju?
SELECT competition FROM table_name_35 WHERE result = "1-1" AND venue = "gwangju"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
这家医院6975310的科室中有多少是在04年10月23日到18年10月29日期间的医疗费总额不低于448.65元的?
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '6975310' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-10-23' AND '2018-10-29' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 448.65 UNION SELECT fgwyjzb....
css
CREATE TABLE table_name_14 ( label VARCHAR, format VARCHAR, region VARCHAR )
What label is in CD format in Australia?
SELECT label FROM table_name_14 WHERE format = "cd" AND region = "australia"
sql_create_context
CREATE TABLE table_56529 ( "Year" text, "Starts" real, "Cuts made" real, "Wins" real, "Top 10" real, "Top 25" real, "Earnings ($)" real, "Money list rank" text )
What is the highest Top 25 with a Money list rank of 232 and Cuts smaller than 2?
SELECT MAX("Top 25") FROM table_56529 WHERE "Money list rank" = '232' AND "Cuts made" < '2'
wikisql
CREATE TABLE table_15007 ( "Film" text, "Year" real, "Score composer" text, "U.K. peak position" text, "U.S. peak position" text )
Which film was released in 1983?
SELECT "Film" FROM table_15007 WHERE "Year" = '1983'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
calculate the length of stay of patient 4269's last stay in the intensive care unit for.
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4269) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
mimic_iii
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, what is the relationship between employee_id and department_id ?
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_2226817_8 ( no_in_series VARCHAR, production_code VARCHAR )
Which series number has the production code 7.07?
SELECT COUNT(no_in_series) FROM table_2226817_8 WHERE production_code = "7.07"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, C...
Search posts by UserId, comment text.
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##UserId##' ORDER BY Score DESC
sede
CREATE TABLE table_name_13 ( name VARCHAR, sport VARCHAR, notes VARCHAR )
Which name has notes b and the game of tennis?
SELECT name FROM table_name_13 WHERE sport = "tennis" AND notes = "b"
sql_create_context
CREATE TABLE table_77259 ( "Rank" real, "Surname" text, "Number of bearers 2008" real, "Type" text, "Etymology" text )
What is the highest Number of Bearers 2008, when Surname is Hansen, and when Rank is less than 1?
SELECT MAX("Number of bearers 2008") FROM table_77259 WHERE "Surname" = 'hansen' AND "Rank" < '1'
wikisql