context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_29583818_3 ( place VARCHAR, rank_by_average VARCHAR )
How many times is the rank by average 4?
SELECT COUNT(place) FROM table_29583818_3 WHERE rank_by_average = 4
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 tex...
患者83706671的030972指标是什么情况在17年的10月30号到11月23号期间
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE table_name_61 ( high_assists VARCHAR, game INTEGER )
What high assists have a game greater than 46?
SELECT high_assists FROM table_name_61 WHERE game > 46
sql_create_context
CREATE TABLE table_80422 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Which record is dated April 8?
SELECT "Record" FROM table_80422 WHERE "Date" = 'april 8'
wikisql
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 diagnoses icd9 code is 769 and drug type is additive?
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.icd9_code = "769" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
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...
look for the number of patients on dwell route of drug administration who are diagnosed with chronic diastolic heart failure.
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 = "Chronic diastolic heart failure" AND prescriptions.route = "DWELL"
mimicsql_data
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId n...
Questions by Number of Answers.
SELECT COALESCE(AnswerCount, 0), COUNT(*) AS PostCount FROM Posts WHERE PostTypeId = 1 AND ClosedDate IS NULL GROUP BY COALESCE(AnswerCount, 0) ORDER BY COALESCE(AnswerCount, 0) DESC
sede
CREATE TABLE table_13453 ( "Name" text, "Party" text, "Member of" text, "First elected" text, "Constiuency" text )
What is the Party of the council member for the Fifth District?
SELECT "Party" FROM table_13453 WHERE "Constiuency" = 'council member for the fifth district'
wikisql
CREATE TABLE table_12311 ( "Date" text, "Location" text, "Score" text, "Result" text, "Competition" text )
What was the score when the result was win, in Helsinki, competition was friendly?
SELECT "Score" FROM table_12311 WHERE "Result" = 'win' AND "Location" = 'helsinki' AND "Competition" = 'friendly'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
从外地来医疗机构3091243就诊的人数总共有多少
SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3091243' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3091243' AND fgwyjzb.REMOTE_SETTLE_FLG = '异地1' OR fgwyjzb.REMOTE_SETTLE_FLG = '异地...
css
CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE ref_budget_codes ( budget_type_code text, budget_t...
What are the statement ids, statement details, and account details, for all accounts?
SELECT T1.statement_id, T2.statement_details, T1.account_details FROM accounts AS T1 JOIN statements AS T2 ON T1.statement_id = T2.statement_id
spider
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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...
what is the three most common lab test performed?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 3)
mimic_iii
CREATE TABLE table_name_50 ( super_g VARCHAR, overall VARCHAR )
Which Super Ghas a missed season due to injury?
SELECT super_g FROM table_name_50 WHERE overall = "missed season due to injury"
sql_create_context
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...
看一下患者67008716被门诊诊断为疾病W21.X35的检测指标724361的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
How many students have each different allergy Show bar chart, could you list by the X-axis in asc please?
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY Allergy
nvbench
CREATE TABLE table_name_38 ( surface VARCHAR, mountain VARCHAR )
What is the surface of the mountain range that contains the Elk Garden Mountain?
SELECT surface FROM table_name_38 WHERE mountain = "elk garden"
sql_create_context
CREATE TABLE table_name_3 ( away_team VARCHAR, crowd VARCHAR )
Name the Away team score which has an Away team of st kilda, and a Crowd of 8157?
SELECT away_team AS score FROM table_name_3 WHERE away_team = "st kilda" AND crowd = 8157
sql_create_context
CREATE TABLE table_62214 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many medals were won total for the country that won 1 silver and was ranked 2 or lower?
SELECT COUNT("Total") FROM table_62214 WHERE "Silver" = '1' AND "Rank" < '2'
wikisql
CREATE TABLE table_name_44 ( challenge_winner VARCHAR, challenge_loser VARCHAR )
Which winner has a Challenge Loser of alexcy?
SELECT challenge_winner FROM table_name_44 WHERE challenge_loser = "alexcy"
sql_create_context
CREATE TABLE table_24196 ( "Chinese industrial designation" text, "Export type designation" text, "NATO reporting name" text, "NATO/U.S DOD code" text, "Remarks" text )
Name the remarks for sawhouse
SELECT "Remarks" FROM table_24196 WHERE "NATO reporting name" = 'SAWHOUSE'
wikisql
CREATE TABLE table_name_28 ( date VARCHAR, series VARCHAR )
What Date had a Series of ATCC Round 6?
SELECT date FROM table_name_28 WHERE series = "atcc round 6"
sql_create_context
CREATE TABLE table_59389 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What country placed t3 with a score of 70-65=135?
SELECT "Country" FROM table_59389 WHERE "Place" = 't3' AND "Score" = '70-65=135'
wikisql
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...
在2010年5月30日到2014年3月23日内患者08033471有多少检测结果指标记录的检验人为88248924的检测指标流水号?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE table_14308895_2 ( former_pageant VARCHAR, new_pageant VARCHAR )
which is the former pageant in the country where the new pageant is miss bahamas?
SELECT former_pageant FROM table_14308895_2 WHERE new_pageant = "Miss Bahamas"
sql_create_context
CREATE TABLE table_21185 ( "Episode number" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (Overall)" text )
What was the rating of the episode with an overall ranking of 190?
SELECT "Rating" FROM table_21185 WHERE "Rank (Overall)" = '190'
wikisql
CREATE TABLE table_442 ( "Overall Pick #" real, "AFL Team" text, "Player" text, "Position" text, "College" text )
What is the largest pick number of the new york jets?
SELECT MAX("Overall Pick #") FROM table_442 WHERE "AFL Team" = 'New York Jets'
wikisql
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 Display Names on Stack Overflow starting with 'Michael'.
SELECT DisplayName, COUNT(DisplayName) FROM Users WHERE DisplayName LIKE 'Michael P%' GROUP BY DisplayName ORDER BY COUNT(DisplayName) DESC LIMIT 100
sede
CREATE TABLE table_name_62 ( lane VARCHAR, time VARCHAR )
How many lanes have 1:53.70 as the time?
SELECT COUNT(lane) FROM table_name_62 WHERE time = "1:53.70"
sql_create_context
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 ...
Top SO users From Tanur.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%mumbai%' OR UPPER(Location) LIKE '%mumbai%' OR Location LIKE '%mumbai%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_name_24 ( venue VARCHAR, goal VARCHAR )
What is the Venue for Goal number 1?
SELECT venue FROM table_name_24 WHERE goal = 1
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...
Find comments with specified text.
SELECT c.Text AS "Comment", c.CreationDate AS "Comment Date", u.Id AS "User ID", u.DisplayName AS "User Name", c.PostId AS "post_link" FROM Comments AS c JOIN Users AS u ON u.Id = c.UserId WHERE c.Text LIKE '%##SpecifiedText##%' LIMIT 100
sede
CREATE TABLE table_name_63 ( scores VARCHAR, grand_finalist VARCHAR )
What scores did grand finalist hawthorn have?
SELECT scores FROM table_name_63 WHERE grand_finalist = "hawthorn"
sql_create_context
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 whose year of birth is less than 2110 and diagnoses short title is dehydration?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2110" AND diagnoses.short_title = "Dehydration"
mimicsql_data
CREATE TABLE table_59135 ( "Station Name" text, "Opening Year" text, "Municipality" text, "Park and Ride Lot" text, "Free Fare Zone" text )
Where is the free fare zone for the Arena station?
SELECT "Free Fare Zone" FROM table_59135 WHERE "Station Name" = 'arena'
wikisql
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 prescription...
what is the number of patients whose lab test abnormal status is delta and lab test name is thyroxine (t4), free?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "Thyroxine (T4), Free"
mimicsql_data
CREATE TABLE table_21823 ( "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 name of eipsode 618?
SELECT "Title" FROM table_21823 WHERE "Production code" = '618'
wikisql
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, ...
how many patients were treated with alteplase (for catheter clearance)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Alteplase (Catheter Clearance)"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
what is the total amount of neo given to patient 030-47098 until 300 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 = '030-47098')) AND intakeoutput.celllabel = 'neo' ...
eicu
CREATE TABLE table_1979619_3 ( district VARCHAR, representative VARCHAR )
Name the total number of districts for rob teplitz
SELECT COUNT(district) FROM table_1979619_3 WHERE representative = "Rob Teplitz"
sql_create_context
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
Please return a scatter chart with two attributes: the average age and experience working length of journalists working on different role type.
SELECT AVG(t1.Age), AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type
nvbench
CREATE TABLE table_4186 ( "#" text, "Project" text, "Shipyard" text, "Laid down" text, "Launched" text, "Commissioned" text, "Status" text )
when was the first start date that actually began on august 6, 1969
SELECT "Launched" FROM table_4186 WHERE "Commissioned" = 'August 6, 1969'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number,...
Altruistic Bounties Offered Rank by User.
WITH RankedUsers AS (SELECT RANK() OVER (ORDER BY SUM(v.BountyAmount) DESC) AS Rank, v.UserId, SUM(v.BountyAmount) AS BountySum FROM Votes AS v JOIN Posts AS p ON v.PostId = p.Id AND v.UserId != p.OwnerUserId WHERE VoteTypeId = 8 AND UserId != -1 GROUP BY v.UserId) SELECT Rank, UserId AS "user_link", BountySum FROM Ran...
sede
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 Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VAR...
Show the number of services for each service type description with a bar chart, I want to display by the the total number from low to high.
SELECT Service_Type_Description, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_27375 ( "Core" text, "Processor" text, "Model" text, "Clock Speed" text, "L2 Cache" text, "Voltage" text, "TDP" text, "Clock Speed to TDP ratio (MHz/W)" text )
how many l2 cache has a clock speed to tdp ratio of 46.7?
SELECT COUNT("L2 Cache") FROM table_27375 WHERE "Clock Speed to TDP ratio (MHz/W)" = '46.7'
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...
门诊诊断为患有疾病M79.046的病人的籍贯名称叫什么?籍贯代码是什么?相应人数有多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.JZZDBM = 'M79.046' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE products ( product_id number, parent_product_id number, production_type_code text, unit_price number, product_name text, product_color text, product_size text ) CREATE TABLE customers ( customer_id number, customer_first_name text, customer_middle_initial text, ...
Return the order ids and details for orderes with two or more invoices.
SELECT T2.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING COUNT(*) > 2
spider
CREATE TABLE table_203_695 ( id number, "draw" number, "artist" text, "song" text, "points" number, "place" text )
which artist scored the most points ?
SELECT "artist" FROM table_203_695 ORDER BY "points" DESC LIMIT 1
squall
CREATE TABLE table_name_20 ( res VARCHAR, record VARCHAR )
What was the resolution of the fight when Nate Mohr's record was 8-6?
SELECT res FROM table_name_20 WHERE record = "8-6"
sql_create_context
CREATE TABLE Trained_In ( Physician INTEGER, Treatment INTEGER, CertificationDate DATETIME, CertificationExpires DATETIME ) CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Description VARCHAR(30) ) CREATE TABLE Department ( DepartmentID INTEGER, Nam...
List the name of physicians who took some appointment, and count them by a pie chart
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name
nvbench
CREATE TABLE table_name_47 ( opponent VARCHAR, date VARCHAR )
Who is the opponent for the game played on august 20, 2006?
SELECT opponent FROM table_name_47 WHERE date = "august 20, 2006"
sql_create_context
CREATE TABLE table_name_11 ( pos VARCHAR, postseason VARCHAR, tier VARCHAR )
How many positions have a Postseason of relegation playoffs and a tier of 3?
SELECT COUNT(pos) FROM table_name_11 WHERE postseason = "relegation playoffs" AND tier = 3
sql_create_context
CREATE TABLE table_14177 ( "Year" real, "Class" text, "Vehicle" text, "Position" text, "Stages won" text )
Which class had a vehicle of Nissan in 2007?
SELECT "Class" FROM table_14177 WHERE "Vehicle" = 'nissan' AND "Year" = '2007'
wikisql
CREATE TABLE table_12719 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the To par for Robert Allenby from Australia
SELECT "To par" FROM table_12719 WHERE "Country" = 'australia' AND "Player" = 'robert allenby'
wikisql
CREATE TABLE table_name_56 ( date VARCHAR, crowd INTEGER )
What date is the crowd larger than 20,000?
SELECT date FROM table_name_56 WHERE crowd > 20 OFFSET 000
sql_create_context
CREATE TABLE teachers ( LastName TEXT, FirstName TEXT, Classroom INTEGER ) CREATE TABLE list ( LastName TEXT, FirstName TEXT, Grade INTEGER, Classroom INTEGER )
For each classroom, show the classroom number and find how many students are using it. Plot them as scatter chart.
SELECT Classroom, COUNT(*) FROM list GROUP BY Classroom
nvbench
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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, X...
检验报告单的编码为44927016411在住院就诊中的对应的患者是谁?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN zyjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjzjlb_jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB AND zy...
css
CREATE TABLE table_21584646_10 ( runner_up VARCHAR, champion VARCHAR )
Who is the runner up for the champion of john mcenroe 6 2, 6 3?
SELECT runner_up FROM table_21584646_10 WHERE champion = "John McEnroe 6–2, 6–3"
sql_create_context
CREATE TABLE table_57307 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text )
What is the Chinese Title Premiering 32 with 2.07 million HK viewers?
SELECT "Chinese title" FROM table_57307 WHERE "HK viewers" = '2.07 million' AND "Premiere" = '32'
wikisql
CREATE TABLE table_23311 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text )
Who was game number 8 played against?
SELECT "Opponent" FROM table_23311 WHERE "Game" = '8'
wikisql
CREATE TABLE table_4139 ( "Country" text, "MotoGP/500cc" real, "350cc" real, "Moto2/250cc" real, "Moto3/125cc" real, "80cc/50cc" real, "Total" real )
how many minimum 350cc has
SELECT MIN("350cc") FROM table_4139
wikisql
CREATE TABLE table_19303 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Who was the incumbent in the Ohio 16 district?
SELECT "Incumbent" FROM table_19303 WHERE "District" = 'Ohio 16'
wikisql
CREATE TABLE table_name_94 ( attendance VARCHAR, away_team VARCHAR )
What is the Attendance at the Hereford United Away game?
SELECT attendance FROM table_name_94 WHERE away_team = "hereford united"
sql_create_context
CREATE TABLE bdmzjzjlb ( 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, MZZYZDZ...
在编号为3373155的医院中,55748768病患在科室名有推拿的科室的就诊记录流水号有哪些
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '55748768' AND hz_info.YLJGDM = '3373155' AND wdmzjzjlb.JZKSMC LIKE '%推拿%' UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
看一看编号为39298720035的门诊的就诊日期
SELECT wdmzjzjlb.JZKSRQ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '39298720035' UNION SELECT bdmzjzjlb.JZKSRQ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '39298720035'
css
CREATE TABLE table_10144 ( "Season" text, "Club" text, "League" text, "Apps" real, "Goals" real )
Which league has less than 15 apps and 0 goals with sparta prague?
SELECT "League" FROM table_10144 WHERE "Apps" < '15' AND "Goals" = '0' AND "Club" = 'sparta prague'
wikisql
CREATE TABLE table_71929 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
What event was Donald Ouimet involved?
SELECT "Event" FROM table_71929 WHERE "Opponent" = 'donald ouimet'
wikisql
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
How many eliminations did each team have. Visualize by bar chart.
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide me with the long title of diagnoses and location of discharge for patient james sloan.
SELECT demographic.discharge_location, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "James Sloan"
mimicsql_data
CREATE TABLE table_19478 ( "Date Released" text, "Polling institute" text, "Socialist" text, "Social Democratic" text, "Peoples Party" text, "Green-Communist" text, "Left Bloc" text, "Lead" text )
If Socialist is at 46.1%, what are all percentages for social democratic?
SELECT "Social Democratic" FROM table_19478 WHERE "Socialist" = '46.1%'
wikisql
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 ...
Return the booking start date for the apartments that have type code 'Duplex' and bin the year into weekday interval with a bar chart, and show by the Y in descending.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date) DESC
nvbench
CREATE TABLE pilot ( Pilot_ID int, Pilot_name text, Rank int, Age int, Nationality text, Position text, Join_Year int, Team text ) CREATE TABLE aircraft ( Aircraft_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertrain text, Fuel...
Can you draw a bar chart to show the number of positions of the pilots?, rank in descending by the total number please.
SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY COUNT(Position) DESC
nvbench
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
what was the three most frequently taken test since 6 years ago for patients with age 20s?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND DATETIME(labevents.chartti...
mimic_iii
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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, ...
在患者陶歌韵的诊疗记录里,从02年8月1日到10年6月21日这期间,为其检测游离甲状腺素(三代)的医务人员有哪几位,报一下工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Elite Users: Those who hold > X% of all Reputation. Find the highest-rep users whose combined reputation is more than X% of the total user reputation. Let's make Pareto proud.
SELECT AVG(RepRatio), COUNT(*) FROM (SELECT (SUM(CASE WHEN Q.AcceptedAnswerId IS NULL THEN 0 ELSE 1 END) * 15 + COUNT(*) * 10.0) / MAX(t1.Reputation) AS RepRatio, t1.Id FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId AND Votes.VoteTypeId = 2 AND Posts.PostTypeId = 2 INNER JOIN (SELECT Id, Reputation FROM Users W...
sede
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
For each room, find its name and the number of times reservations were made for it, you can use the data to draw a bar chart, could you sort by the bar in desc?
SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY roomName DESC
nvbench
CREATE TABLE table_8863 ( "Wrestler" text, "Reign" real, "Date" text, "Days held" text, "Location" text, "Event" text, "Successful defenses" real )
What's the highest reign on march 10, 2007?
SELECT MAX("Reign") FROM table_8863 WHERE "Date" = 'march 10, 2007'
wikisql
CREATE TABLE table_1272844_2 ( vote VARCHAR, finish VARCHAR )
What was the vote on the episode where the finish was '10th voted out 3rd jury member day 30'?
SELECT vote FROM table_1272844_2 WHERE finish = "10th voted Out 3rd Jury Member Day 30"
sql_create_context
CREATE TABLE table_9447 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
/What is Tie No, when Date is 18 February 1956, and when Away Team is Tottenham Hotspur?
SELECT "Tie no" FROM table_9447 WHERE "Date" = '18 february 1956' AND "Away team" = 'tottenham hotspur'
wikisql
CREATE TABLE table_41359 ( "Round" real, "Pick" text, "Player" text, "Position" text, "Team" text )
What was the earliest Round for Central Florida?
SELECT MIN("Round") FROM table_41359 WHERE "Team" = 'central florida'
wikisql
CREATE TABLE table_name_25 ( draws INTEGER, played INTEGER )
What is the average draws with more than 38 played?
SELECT AVG(draws) FROM table_name_25 WHERE played > 38
sql_create_context
CREATE TABLE table_name_90 ( week INTEGER, attendance INTEGER )
Which Week has an Attendance larger than 63,369?
SELECT MIN(week) FROM table_name_90 WHERE attendance > 63 OFFSET 369
sql_create_context
CREATE TABLE table_24225238_1 ( film VARCHAR, supporting_actor VARCHAR )
Which film had Charles Bickford as supporting actor?
SELECT film FROM table_24225238_1 WHERE supporting_actor = "Charles Bickford"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Give me the comparison about meter_100 over the meter_600 by a bar chart, and list from low to high by the x-axis please.
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600
nvbench
CREATE TABLE table_50846 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the attendance during the match that took place after week 11 against the washington redskins?
SELECT MAX("Attendance") FROM table_50846 WHERE "Week" > '11' AND "Opponent" = 'washington redskins'
wikisql
CREATE TABLE table_35091 ( "Year" text, "Best Film" text, "Best Director" text, "Best Actor" text, "Best Actress" text, "Best Supporting Actress" text )
Which Best Actor has a Best Director of takeshi kitano for outrage beyond?
SELECT "Best Actor" FROM table_35091 WHERE "Best Director" = 'takeshi kitano for outrage beyond'
wikisql
CREATE TABLE table_53035 ( "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text )
What was the aggregate for a team #2 of Okk Beograd?
SELECT "Agg." FROM table_53035 WHERE "Team #2" = 'okk beograd'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
Last site access by a Mathematics moderator.
SELECT u.Id AS "user_link", u.LastAccessDate FROM Users AS u WHERE u.Id IN (622, 9754, 12952, 13854, 21674, 23350, 44121, 59234, 83702, 85306)
sede
CREATE TABLE table_13220 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the To par of the Player with a Score of 71-69-68=208?
SELECT "To par" FROM table_13220 WHERE "Score" = '71-69-68=208'
wikisql
CREATE TABLE table_62750 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What time has a lane less than 5, with Poland as the nationality?
SELECT "Time" FROM table_62750 WHERE "Lane" < '5' AND "Nationality" = 'poland'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
what was the total amount of tube feeding residual discarded (ml) that patient 021-80293 had in the previous day.
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 = '021-80293')) AND intakeoutput.celllabel = 'tube ...
eicu
CREATE TABLE table_75614 ( "State" text, "Literacy Rate (%) - [2013 Estimate]" real, "Literacy Rate (%) - 2001 Census" real, "Literacy Rate (%) - 2011 Census" real, "% Increase" text )
What is the average increase in literacy for the states that had a rate higher than 73.2% in 2011, less than 68.81% in 2001, and an estimate of 76.8% for 2013?
SELECT "% Increase" FROM table_75614 WHERE "Literacy Rate (%) - 2011 Census" > '73.2' AND "Literacy Rate (%) - 2001 Census" < '68.81' AND "Literacy Rate (%) - [2013 Estimate]" = '76.8'
wikisql
CREATE TABLE table_name_91 ( pos VARCHAR, play_offs VARCHAR, pts VARCHAR )
During the play-off quarter-final which team scored position was the team that scored 56 points?
SELECT pos FROM table_name_91 WHERE play_offs = "quarter-final" AND pts = "56"
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 posts with the most comments with low views.
SELECT Posts.Id AS "post_link", CommentCount, ViewCount FROM Posts WHERE ViewCount < '##howManyViews?100##' AND NOT AcceptedAnswerId IS NULL ORDER BY CommentCount DESC LIMIT 100
sede
CREATE TABLE table_52643 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
Tell me the least Grid with points more than 11 and drivers being s bastien bourdais with laps less than 67
SELECT MIN("Grid") FROM table_52643 WHERE "Points" > '11' AND "Driver" = 'sébastien bourdais' AND "Laps" < '67'
wikisql
CREATE TABLE table_name_70 ( tries_against VARCHAR, points_for VARCHAR )
What is the tries against when the points are 475?
SELECT tries_against FROM table_name_70 WHERE points_for = "475"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
let me know the time of discharge and primary disease for the patient heather vineyard.
SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.name = "Heather Vineyard"
mimicsql_data
CREATE TABLE table_22326 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Canadian air date" text, "U.S. air date" text, "Production code" real, "Canadian viewers (million)" text )
What is the smallest number?
SELECT MIN("#") FROM table_22326
wikisql
CREATE TABLE table_7259 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
What is the 2011 when the 2007 is a, and the 2012 is sf?
SELECT "2011" FROM table_7259 WHERE "2007" = 'a' AND "2012" = 'sf'
wikisql
CREATE TABLE table_name_13 ( date VARCHAR, region VARCHAR, catalog VARCHAR )
What's the Date with the Region of Europe and has a Catalog of 28765 22392 8?
SELECT date FROM table_name_13 WHERE region = "europe" AND catalog = "28765 22392 8"
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 patient ( uniquep...
what is the name of the allergy patient 021-83942 has had in 12/2102?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-83942')) AND STRFTIME('%y-%m', allergy.allergytime) = '2102-12'
eicu