context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_95 ( first_member VARCHAR, election VARCHAR )
What is First Member, when Election is '1871 by-election'?
SELECT first_member FROM table_name_95 WHERE election = "1871 by-election"
sql_create_context
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
Find the last name and age of the student who has allergy to both milk and cat Show a bar chart, I want to order in desc by the X.
SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") ORDER BY LName DESC
nvbench
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 who have government insurance are diagnosed for other vitamin b12 anemia deficiency ?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Other vitamin B12 deficiency anemia"
mimicsql_data
CREATE TABLE table_50241 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text )
What was the name when the state was wey?
SELECT "Name" FROM table_50241 WHERE "State" = 'wey'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose admission year is less than 2164 and drug route is ih?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2164" AND prescriptions.route = "IH"
mimicsql_data
CREATE TABLE table_name_19 ( date_of_birth__age_ VARCHAR, player VARCHAR )
When was nese malifa born?
SELECT date_of_birth__age_ FROM table_name_19 WHERE player = "nese malifa"
sql_create_context
CREATE TABLE table_22722 ( "Rank" real, "Metropolitan Statistical Area" text, "Total Population (2010)" real, "Indian American Population (2010)" real, "% Indian American" text, "Asian American Population (2010)" real, "% Asian American" text, "Combined Statistical Area" text )
Name the % indian american for asian population 126965
SELECT "% Indian American" FROM table_22722 WHERE "Asian American Population (2010)" = '126965'
wikisql
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Show weight from each date of birth, and I want to order X-axis from low to high order.
SELECT Date_of_Birth, Weight FROM people ORDER BY Date_of_Birth
nvbench
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, ...
患者46318635的医疗记录中,有过哪些医疗费总额超过2893.35元的信息,把入院诊断疾病编码和名称说一下
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '46318635' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2893.35) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '46318635' AND...
css
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREA...
Gold tag Badge per location.
SELECT u.Id, u.DisplayName, b.Name, MAX(b.Date) FROM Users AS u INNER JOIN Badges AS b ON u.Id = b.UserId WHERE b.Name = '##Tag##' AND LOWER(u.Location) LIKE '%##Location##%' GROUP BY u.Id, u.DisplayName, b.Name HAVING COUNT(*) = 3
sede
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, ...
Top Java Developers in South Africa.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##CountryName##%') AND LOWER(AboutMe) LIKE LOWER('%Java%') ORDER BY Reputation DESC
sede
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machin...
Show different teams of technicians and the number of technicians in each team with a bar chart.
SELECT Team, COUNT(*) FROM technician GROUP BY Team
nvbench
CREATE TABLE table_name_58 ( sign_of_zodiac VARCHAR, in_malayalam VARCHAR )
WHAT IS THE SIGN OF ZODIAC OF ?
SELECT sign_of_zodiac FROM table_name_58 WHERE in_malayalam = "മീനം"
sql_create_context
CREATE TABLE table_203_38 ( id number, "#" number, "title" text, "producer(s)" text, "performer(s)" text, "length" text )
what song was performed before fire ?
SELECT "title" FROM table_203_38 WHERE "#" = (SELECT "#" FROM table_203_38 WHERE "title" = '"fire"') - 1
squall
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Who is GREEKMOD 399 usually taught by ?
SELECT COUNT(instructor.name), instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'GREEKMOD' AND course.number = 399 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id ...
advising
CREATE TABLE table_name_2 ( finish VARCHAR, laps VARCHAR, qual VARCHAR )
What is the finish when there was more than 192 laps and a qual of 135.736?
SELECT finish FROM table_name_2 WHERE laps > 192 AND qual = "135.736"
sql_create_context
CREATE TABLE table_name_13 ( sprint_points VARCHAR, extra_laps VARCHAR, rank VARCHAR )
How many sprint points have 0 extra laps for rank 19?
SELECT sprint_points FROM table_name_13 WHERE extra_laps = "0" AND rank = "19"
sql_create_context
CREATE TABLE table_name_23 ( pick VARCHAR, position VARCHAR, round VARCHAR )
How many picks are there for defensive back for rounds larger than 11?
SELECT COUNT(pick) FROM table_name_23 WHERE position = "defensive back" AND round > 11
sql_create_context
CREATE TABLE table_27721131_6 ( team VARCHAR, date VARCHAR )
What is the team they played on november 25?
SELECT team FROM table_27721131_6 WHERE date = "November 25"
sql_create_context
CREATE TABLE table_40654 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score for the tournament with a margin of victory of 7 strokes?
SELECT "Winning score" FROM table_40654 WHERE "Margin of victory" = '7 strokes'
wikisql
CREATE TABLE table_70816 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the highest lane for nisha millet?
SELECT MAX("Lane") FROM table_70816 WHERE "Name" = 'nisha millet'
wikisql
CREATE TABLE table_29141354_2 ( first_broadcast VARCHAR, episode VARCHAR )
When was episode 02x02 first broadcast?
SELECT first_broadcast FROM table_29141354_2 WHERE episode = "02x02"
sql_create_context
CREATE TABLE table_77378 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is High Assists, when High Points is 'Kobe Bryant (27)', and when High Rebounds is 'Pau Gasol (11)'?
SELECT "High assists" FROM table_77378 WHERE "High points" = 'kobe bryant (27)' AND "High rebounds" = 'pau gasol (11)'
wikisql
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, ...
哪个项目在医疗机构7821897的使用次数排第二?
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 = '7821897' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 2
css
CREATE TABLE table_7149 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text )
What is Volume:Issue, when Artist is Elton John, and when Weeks on Top is 4?
SELECT "Volume:Issue" FROM table_7149 WHERE "Artist" = 'elton john' AND "Weeks on Top" = '4'
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...
患者华俊誉之前得过什么病
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '华俊誉'
css
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase...
what year had the most NIPS papers ?
SELECT DISTINCT COUNT(paper.paperid), paper.year FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'NIPS' GROUP BY paper.year ORDER BY COUNT(paper.paperid) DESC
scholar
CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_c...
How many employees live in Georgia?
SELECT COUNT(*) FROM addresses WHERE state_province_county = "Georgia"
spider
CREATE TABLE table_36493 ( "Year" real, "Edition" text, "Course" text, "Location" text, "Dates" text )
What was the earliest year that had a location of Brookline, Massachusetts?
SELECT MIN("Year") FROM table_36493 WHERE "Location" = 'brookline, massachusetts'
wikisql
CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE club ( Club_ID int, name tex...
Bar chart x axis position y axis how many position
SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20
nvbench
CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fn...
Show all sport name and the number of students. Show bar chart.
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName
nvbench
CREATE TABLE table_11170 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was Carlton's away team opponent?
SELECT "Away team" FROM table_11170 WHERE "Home team" = 'carlton'
wikisql
CREATE TABLE table_name_85 ( party VARCHAR, minister VARCHAR )
Which party was Andrea Ronchi from?
SELECT party FROM table_name_85 WHERE minister = "andrea ronchi"
sql_create_context
CREATE TABLE table_24564 ( "Country" text, "% of imports from Russia" text, "% cut" text, "Diversification" text, "Gas storage" text, "Alternative fuel" text )
What wast the percent cut for the nation with an 80% full gas storage?
SELECT "% cut" FROM table_24564 WHERE "Gas storage" = '80% full'
wikisql
CREATE TABLE table_57717 ( "Rd #" real, "Pick #" real, "Player" text, "Reg GP" real, "Pl GP" real )
What is the sum number of Pl GP when the Reg GP was 0, the Rd number was bigger than 8, and the pick number was bigger than 146?
SELECT COUNT("Pl GP") FROM table_57717 WHERE "Reg GP" = '0' AND "Rd #" > '8' AND "Pick #" > '146'
wikisql
CREATE TABLE table_2886617_8 ( player VARCHAR, nhl_team VARCHAR )
Who did Edmonton Oilers get for their draft pick?
SELECT player FROM table_2886617_8 WHERE nhl_team = "Edmonton Oilers"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
药品963819在哪几家医院患者27333560被开出过?
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '27333560' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '963819')
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
when patient 031-23724 first had a blood, venipuncture microbiology test since 78 months ago?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND microlab.culturesite = 'blood, venipuncture' AND...
eicu
CREATE TABLE table_train_47 ( "id" int, "bone_marrow_transplant" bool, "organ_transplantation" bool, "allergy_to_calcitriol" bool, "serum_calcium" float, "taking_vitamin_d" bool, "intention_to_central_venous_catheter" bool, "sarcoidosis" bool, "metabolic_bone_disease" bool, "prim...
central venous catheter ( for blood drawing )
SELECT * FROM table_train_47 WHERE intention_to_central_venous_catheter = 1
criteria2sql
CREATE TABLE TRANSACTIONS ( date_of_transaction VARCHAR, share_count VARCHAR, amount_of_transaction VARCHAR )
What are the dates of transactions with at least 100 share count or amount bigger than 100?
SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPriv...
SOru - Number of active posts last month per mod.
SELECT COUNT(*) AS PostsLastMonth, 3 AS Moderators, (COUNT(*) / 3) AS PostsLastMonthPerMod FROM Posts WHERE LastActivityDate >= DATEADD(month, -1, (SELECT MAX(LastActivityDate) FROM Posts))
sede
CREATE TABLE team_franchise ( franchise_id TEXT, franchise_name TEXT, active TEXT, na_assoc TEXT ) CREATE TABLE postseason ( year INTEGER, round TEXT, team_id_winner TEXT, league_id_winner TEXT, team_id_loser TEXT, league_id_loser TEXT, wins INTEGER, losses INTEGER, ...
Can you draw the trend of mean attendance over the year? and bin year into Year interval.
SELECT year, AVG(attendance) FROM home_game
nvbench
CREATE TABLE company ( company_id number, name text, headquarters text, industry text, sales_in_billion number, profits_in_billion number, assets_in_billion number, market_value_in_billion number ) CREATE TABLE people ( people_id number, age number, name text, nationalit...
Show the names of companies and the number of employees they have
SELECT T3.name, COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id JOIN company AS T3 ON T1.company_id = T3.company_id GROUP BY T3.name
spider
CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE T...
What is the name of the technician whose team is not 'NYY', and count them by a bar chart, order by the X-axis in desc.
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_19188562_2 ( tv_season VARCHAR, rating__adults_18_49_ VARCHAR )
How many tv series had an adult rating of 1.2?
SELECT COUNT(tv_season) FROM table_19188562_2 WHERE rating__adults_18_49_ = "1.2"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id num...
what was the total amount of pe 24 fs po that patient 18866 had taken today?
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
what change was in patient 3229's arterial bp [systolic] last measured on the first intensive care unit visit compared to the second to last value measured on the first intensive care unit visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3229) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi...
mimic_iii
CREATE TABLE table_9651 ( "Season" text, "Premiere" text, "Finale" text, "Episodes" real, "Timeslot" text, "Rank" text, "Viewers (in households)" real )
When was the premiere of the show that had a rank of #7?
SELECT "Premiere" FROM table_9651 WHERE "Rank" = '#7'
wikisql
CREATE TABLE table_203_707 ( id number, "rank" number, "npc" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country won the least amount of bronze medals ?
SELECT "npc" FROM table_203_707 ORDER BY "bronze" LIMIT 1
squall
CREATE TABLE table_56106 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text )
Which week has a Kickoff time of 1:00 with a record of 4-5-1?
SELECT "Week" FROM table_56106 WHERE "Kickoff [a ]" = '1:00' AND "Record" = '4-5-1'
wikisql
CREATE TABLE table_204_226 ( id number, "municipality/communes" text, "coalition for the citizen" text, "coalition for the future" text, "other/independent" text, "winning party/coalition" text, "voter turnout" text )
what is the difference between percentages of votes between allkaji and cela ?
SELECT ABS((SELECT "coalition for the citizen" FROM table_204_226 WHERE "coalition for the citizen" = 'dallandyshe allkaj') - (SELECT "coalition for the future" FROM table_204_226 WHERE "coalition for the future" = 'ilir cela'))
squall
CREATE TABLE table_73515 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
When was the game number 3 played?
SELECT "Date" FROM table_73515 WHERE "Game" = '3'
wikisql
CREATE TABLE table_name_12 ( Id VARCHAR )
Name the 1901 with 1851 of 1961
SELECT 1901 FROM table_name_12 WHERE 1851 = "1961"
sql_create_context
CREATE TABLE table_name_28 ( mountain_range VARCHAR, mountain_peak VARCHAR, state VARCHAR, rank VARCHAR )
what is the mountain range when the state is colorado, rank is higher than 90 and mountain peak is whetstone mountain?
SELECT mountain_range FROM table_name_28 WHERE state = "colorado" AND rank > 90 AND mountain_peak = "whetstone mountain"
sql_create_context
CREATE TABLE table_2602958_4 ( _number VARCHAR, prod_code VARCHAR )
Which episodein season 3 had 175020 for a production code?
SELECT _number FROM table_2602958_4 WHERE prod_code = 175020
sql_create_context
CREATE TABLE table_204_946 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many points did the top 3 finishers of the 1999 miller lite 225 earn ?
SELECT SUM("points") FROM table_204_946 WHERE "pos" <= 3
squall
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...
Comment Score Frequency (whole site).
SELECT Score, COUNT(Score) AS "count" FROM Comments GROUP BY Score ORDER BY Score
sede
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTy...
Get the number of posts there are..
SELECT COUNT(Body) FROM Posts WHERE AnswerCount = 0 AND Tags LIKE '%javascript%'
sede
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, ...
需要住院就诊66237331464的住院中医诊断编码和名称的详细信息
SELECT wdmzjzjlb.ZYZYZDZZBM, wdmzjzjlb.ZYZYZDZZMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '66237331464' UNION SELECT bdmzjzjlb.ZYZYZDZZBM, bdmzjzjlb.ZYZYZDZZMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '66237331464'
css
CREATE TABLE table_22368322_2 ( tier_1_ratio VARCHAR, institution VARCHAR )
Name the tier 1 ratio for irish life and permanent
SELECT tier_1_ratio FROM table_22368322_2 WHERE institution = "Irish Life and Permanent"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
the respiratory rate of patient 8098 had been less than 24.0 until 02/09/2104?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8098)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate' ...
mimic_iii
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int )
Give me a histogram for what are the names of projects that require more than 300 hours, and how many scientists are assigned to each?, and list by the Name in desc.
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY Name DESC
nvbench
CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) CREATE TABLE station_company ( station_id number, company_id number, ran...
Show gas station id, location, and manager_name for all gas stations ordered by open year.
SELECT station_id, location, manager_name FROM gas_station ORDER BY open_year
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
柳芳林患者以前有都有哪个门诊诊断的结果?
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '柳芳林'
css
CREATE TABLE customer_orders ( customer_id VARCHAR ) CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR )
Show the name of the customer who has the most orders.
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_91 ( type VARCHAR, colour VARCHAR )
Which type has a color of Dark Blue?
SELECT type FROM table_name_91 WHERE colour = "dark blue"
sql_create_context
CREATE TABLE table_27303975_3 ( studio VARCHAR, title VARCHAR )
How many times is the title am/pm callanetics?
SELECT COUNT(studio) FROM table_27303975_3 WHERE title = "AM/PM Callanetics"
sql_create_context
CREATE TABLE wdmzjzjlb ( 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...
在15年8月6日到16年2月8日这段时间,患者37516141一共有多少检验报告单,把这些检验报告单的标本采集部位列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN wdmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '37516141' AND jybgb.BGRQ BETWEEN '2015-08-06' AND '201...
css
CREATE TABLE table_35386 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall WC points (Rank)" text )
Which Rank that a Name of thomas morgenstern, and Points larger than 288.7?
SELECT SUM("Rank") FROM table_35386 WHERE "Name" = 'thomas morgenstern' AND "Points" > '288.7'
wikisql
CREATE TABLE table_name_49 ( tournament VARCHAR, runner_s__up VARCHAR )
Which Tournament has a Runner(s)-up of bob charles?
SELECT tournament FROM table_name_49 WHERE runner_s__up = "bob charles"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
病人编号为16815496在06年9月29日到2016年1月16日这段时间,病人被开出的所有检验报告单的科室编码以及名称分别是多少?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info...
css
CREATE TABLE table_name_45 ( venue VARCHAR, score VARCHAR )
What is the venue of the match with a score of 33-22?
SELECT venue FROM table_name_45 WHERE score = "33-22"
sql_create_context
CREATE TABLE table_48685 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What is the Outcome of the game against Frederic Jeanclaude?
SELECT "Outcome" FROM table_48685 WHERE "Opponent" = 'frederic jeanclaude'
wikisql
CREATE TABLE table_79674 ( "Rank" real, "Name" text, "Tenure" text, "Leagues" text, "Attempts" real, "Completions" real, "Comp %" real, "Touchdowns" real, "Interceptions" real, "Yardage" real, "QB Rating" real )
What is the rank when there are more than 4,123 completion and the comp percentage is more than 65.6?
SELECT SUM("Rank") FROM table_79674 WHERE "Completions" > '4,123' AND "Comp %" > '65.6'
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_CLINIC_ID text, MED_DIRE_CD tex...
在医院3915237就诊的患者潘永逸,医院给他开的单价最贵的药品名是什么?编码和单价呢
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '潘永逸' AND t_kc22.t_kc21_MED_SER_ORG_NO = '3915237') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( ...
was patient 25869 underwent a pco2 test in 2105?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pco2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25869) AND STRFTIME('%y', labevents.charttime) = '2105'
mimic_iii
CREATE TABLE table_name_53 ( week_1 VARCHAR, week_3 VARCHAR )
What is the week 1 with candice hunnicutt in week 3?
SELECT week_1 FROM table_name_53 WHERE week_3 = "candice hunnicutt"
sql_create_context
CREATE TABLE table_77695 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game site" text )
What's the record for October 8, 2000 before week 13?
SELECT "Record" FROM table_77695 WHERE "Week" < '13' AND "Date" = 'october 8, 2000'
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, visualize a bar chart about the distribution of name and code , and group by attribute headquarter, I want to show by the X-axis in asc.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Tags ( Id number, TagName text, Count number, Ex...
Search all posts for a string of characters.
SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate FROM Posts WHERE Body LIKE '%##text##%' ORDER BY CreationDate DESC
sede
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Find All_Road and All_Games_Percent , and visualize them by a bar chart.
SELECT All_Road, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE reviewer ( rid number, name text )
What are names of the movies that are either made before 1980 or directed by James Cameron?
SELECT title FROM movie WHERE director = "James Cameron" OR year < 1980
spider
CREATE TABLE table_name_94 ( grid INTEGER, laps VARCHAR )
I want the highest grid for Laps of 38
SELECT MAX(grid) FROM table_name_94 WHERE laps = 38
sql_create_context
CREATE TABLE table_name_2 ( quantity_made VARCHAR, class VARCHAR )
How many CLASS P14 trains were made?
SELECT quantity_made FROM table_name_2 WHERE class = "p14"
sql_create_context
CREATE TABLE table_204_814 ( id number, "date" text, "opposition" text, "result" text, "score" text, "brazil scorers" text, "competition" text )
who was this team 's next opponent after facing the soviet union on june 14 ?
SELECT "opposition" FROM table_204_814 WHERE "date" > (SELECT "date" FROM table_204_814 WHERE "opposition" = 'soviet union') ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_20799905_1 ( county VARCHAR, mccain_percentage VARCHAR )
In what county did McCain get 57.8%?
SELECT county FROM table_20799905_1 WHERE mccain_percentage = "57.8%"
sql_create_context
CREATE TABLE table_2668352_14 ( incumbent VARCHAR, result VARCHAR )
Name the incumbent for lost re-election democratic-republican hold
SELECT incumbent FROM table_2668352_14 WHERE result = "Lost re-election Democratic-Republican hold"
sql_create_context
CREATE TABLE table_name_29 ( points VARCHAR, country VARCHAR, place VARCHAR )
What points has united kingdom as the country, and 10 as the place?
SELECT points FROM table_name_29 WHERE country = "united kingdom" AND place = 10
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
what is the number of patients whose days of hospital stay is greater than 5 and diagnoses long title is phlebitis and thrombophlebitis of superficial veins of upper extremities?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.long_title = "Phlebitis and thrombophlebitis of superficial veins of upper extremities"
mimicsql_data
CREATE TABLE table_name_75 ( party VARCHAR, residence VARCHAR )
What political party does the person from San Diego belong to?
SELECT party FROM table_name_75 WHERE residence = "san diego"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 ( row_id number, ...
for the bile duct incision nec what does it cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'bile duct incision nec'))
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
就诊状态的代码及名称是什么?在43796484911这次门诊就诊中
SELECT JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '43796484911'
css
CREATE TABLE table_77786 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the date of the game between Melbourne and Footscray?
SELECT "Date" FROM table_77786 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_70304 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text )
What was the surface for the game that was played on 12-Apr-2005?
SELECT "Surface" FROM table_70304 WHERE "Date" = '12-apr-2005'
wikisql
CREATE TABLE table_name_34 ( total INTEGER, country VARCHAR )
What's spain's highest total?
SELECT MAX(total) FROM table_name_34 WHERE country = "spain"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
calculate the total quantity of output of patient 027-144847 on last month/24.
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 = '027-144847')) AND intakeoutput.cellpath LIKE '%o...
eicu
CREATE TABLE table_20556 ( "#" real, "Date" text, "at/vs." text, "Opponent" text, "Score" text, "Attendance" real, "Record" text )
What was the lowest no. of attendance on record?
SELECT MIN("Attendance") FROM table_20556
wikisql
CREATE TABLE table_57352 ( "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text )
What's the engine used for rounds 5-6?
SELECT "Engine" FROM table_57352 WHERE "Rounds" = '5-6'
wikisql
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...
医疗就诊25237614940具体负责的是哪个医疗机构的科室,这个科室的编码和名称是什么
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '25237614940' UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.MED_ORG_DEPT_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '25237614940'
css
CREATE TABLE table_298883_5 ( dimensions VARCHAR, reverse VARCHAR )
What are the dimensions of the coin with western sea barrage and locks at taedong gang on the reverse side?
SELECT dimensions FROM table_298883_5 WHERE reverse = "Western sea barrage and locks at Taedong Gang"
sql_create_context