context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_32121 ( "Heat Rank" real, "Lane" real, "Swimmer" text, "Country" text, "Time" real, "Overall Rank" real )
Which lane is Goksu Bicer in?
SELECT "Lane" FROM table_32121 WHERE "Swimmer" = 'goksu bicer'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTasks ( Id num...
median comment count on all questions.
SELECT ((SELECT MAX(CommentCount) FROM (SELECT PERCENT AS CommentCount FROM Posts WHERE PostTypeId = 1 ORDER BY CommentCount LIMIT 50) AS BottomHalf) + (SELECT MIN(CommentCount) FROM (SELECT PERCENT AS CommentCount FROM Posts WHERE PostTypeId = 1 ORDER BY CommentCount DESC LIMIT 50) AS TopHalf)) / 2 AS Median
sede
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, ...
For each party, return the name of the party and the number of delegates from that party.
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party
nvbench
CREATE TABLE table_22607062_1 ( comptroller VARCHAR, ticket___office VARCHAR )
Name the comptroller for republican
SELECT comptroller FROM table_22607062_1 WHERE ticket___office = "Republican"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
从03年11月14日到07年8月9日这个期间里医院2893713购药医疗记录的数量总共是多少呢?
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2893713' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-11-14' AND '2007-08-09' AND t_kc21.CLINIC_TYPE = '购药'
css
CREATE TABLE table_name_41 ( rank VARCHAR, bronze VARCHAR, silver VARCHAR )
How much Rank has a Bronze of 21, and a Silver larger than 10?
SELECT COUNT(rank) FROM table_name_41 WHERE bronze = 21 AND silver > 10
sql_create_context
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
Plot the total number by grouped by carrier as a bar graph
SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
许文德这位参保人从00年五月二十二日到0七年九月六日,门诊开出的检查项目总共有多少金额
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '许文德' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-05-22' AND '2007-09-06' AND t_kc22.MED_INV_IT...
css
CREATE TABLE table_198175_2 ( finnish_name VARCHAR, english_name VARCHAR )
What is every Finnish name for the English name of Province of Viborg and Nyslott?
SELECT finnish_name FROM table_198175_2 WHERE english_name = "Province of Viborg and Nyslott"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
how many patients underwent the surgical procedure open right hemicolectomy nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Opn rt hemicolectomy NEC"
mimicsql_data
CREATE TABLE table_name_97 ( attendance VARCHAR, record VARCHAR )
What is the attendance of the match with a record 20-11?
SELECT attendance FROM table_name_97 WHERE record = "20-11"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
参与了04488736077这次医疗就诊的人有哪些?他们叫什么名字?性别、年龄、公民身份号码分别是什么
SELECT gwyjzb.PERSON_NM, gwyjzb.PERSON_SEX, gwyjzb.PERSON_AGE, gwyjzb.IDENTITY_CARD FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '96681951393' UNION SELECT fgwyjzb.PERSON_NM, fgwyjzb.PERSON_SEX, fgwyjzb.PERSON_AGE, fgwyjzb.IDENTITY_CARD FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '96681951393'
css
CREATE TABLE table_name_44 ( notes VARCHAR, time VARCHAR )
what is the notes when the time is 7:58.71?
SELECT notes FROM table_name_44 WHERE time = "7:58.71"
sql_create_context
CREATE TABLE table_35798 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the total of all against values for the Corinthians with less than 3 lost?
SELECT COUNT("Against") FROM table_35798 WHERE "Team" = 'corinthians' AND "Lost" < '3'
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...
A bar chart shows the distribution of Sex and the sum of Height , and group by attribute Sex, and list from high to low by the X-axis.
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is minimum age of patients whose admission type is urgent and admission year is greater than or equal to 2178?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear >= "2178"
mimicsql_data
CREATE TABLE table_204_475 ( id number, "home team" text, "score" text, "away team" text, "date" text, "agg" text )
which team scored higher as the home team , ayr united or morton ?
SELECT "home team" FROM table_204_475 WHERE "home team" IN ('ayr united', 'morton') ORDER BY "score" DESC LIMIT 1
squall
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
show me all flights from DENVER to PITTSBURGH which serve a meal for the day after tomorrow
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight, food_service WHERE ((date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight....
atis
CREATE TABLE table_1507806_1 ( year VARCHAR, winning_score VARCHAR )
HOW MANY YEARS WAS IT FOR THE SCORE (76-73-79-72=300)?
SELECT COUNT(year) FROM table_1507806_1 WHERE winning_score = (76 - 73 - 79 - 72 = 300)
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of patients whose insurance is government and lab test name is hematocrit, other fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Hematocrit, Other Fluid"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
how many patients are discharged to rehab/distinct part hosp and diagnosed with other specified disorders of skin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND diagnoses.long_title = "Other specified disorders of skin"
mimicsql_data
CREATE TABLE table_name_89 ( lost INTEGER, drawn VARCHAR, points VARCHAR, name VARCHAR )
Which Lost has Points smaller than 15, and a Name of sc forst, and Drawn smaller than 0?
SELECT AVG(lost) FROM table_name_89 WHERE points < 15 AND name = "sc forst" AND drawn < 0
sql_create_context
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...
How many classes will LAW be offering next semester ?
SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LAW' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_25 ( date VARCHAR, venue VARCHAR, opponent VARCHAR )
When did the peterborough phantoms play at a venue of home?
SELECT date FROM table_name_25 WHERE venue = "home" AND opponent = "peterborough phantoms"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( c...
what is patient 030-21071's height for the first time the previous month?
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-21071') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ...
eicu
CREATE TABLE table_name_21 ( director_s_ VARCHAR, prize VARCHAR, film VARCHAR )
Which Director(s) made the film hanzubon no ojisan and received a prize of 300,000?
SELECT director_s_ FROM table_name_21 WHERE prize = "¥300,000" AND film = "hanzubon no ojisan"
sql_create_context
CREATE TABLE table_name_80 ( year INTEGER, pageant VARCHAR, result VARCHAR )
What's the latest year the miss internet www pageant had a result of second runner-up?
SELECT MAX(year) FROM table_name_80 WHERE pageant = "miss internet www" AND result = "second runner-up"
sql_create_context
CREATE TABLE table_24962 ( "Institution" text, "Date of report" text, "s Risk-weighted asset , \u20ac million" real, "Tier 1 Capital, \u20ac million" real, "Tier 1 ratio" text )
Name the total number of tier 1 capital for allied irish banks
SELECT COUNT("Tier 1 Capital, \u20ac million") FROM table_24962 WHERE "Institution" = 'Allied Irish Banks'
wikisql
CREATE TABLE table_76091 ( "Season" real, "Episodes" real, "Season Premiere" text, "Season Finale" text, "DVD Release Date" text )
On what date was the DVD released for the season with fewer than 13 episodes that aired before season 8?
SELECT "DVD Release Date" FROM table_76091 WHERE "Season" < '8' AND "Episodes" < '13'
wikisql
CREATE TABLE table_56563 ( "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text )
Tell me the 1st leg for antwerp bc
SELECT "1st leg" FROM table_56563 WHERE "Team #2" = 'antwerp bc'
wikisql
CREATE TABLE table_name_32 ( rank INTEGER, prominence__m_ VARCHAR, col__m_ VARCHAR, peak VARCHAR )
Which Rank has a Col (m) of 0, and a Peak of aoraki/mount cook, and a Prominence (m) larger than 3,755?
SELECT SUM(rank) FROM table_name_32 WHERE col__m_ = 0 AND peak = "aoraki/mount cook" AND prominence__m_ > 3 OFFSET 755
sql_create_context
CREATE TABLE table_1408397_3 ( malayalam_മലയാളം VARCHAR, _number VARCHAR )
What is the Malayalam word that is listed as #10 in the table?
SELECT malayalam_മലയാളം FROM table_1408397_3 WHERE _number = 10
sql_create_context
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 the number of patients whose admission type is emergency and diagnoses long title is chronic pancreatitis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Chronic pancreatitis"
mimicsql_data
CREATE TABLE table_4752 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the home team in the game played at arden street oval?
SELECT "Home team score" FROM table_4752 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id num...
M dia de reputa o por usu rios.
SELECT AVG(Reputation) FROM Users
sede
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...
在11-12-13到19-01-19期间内,患者凤飞尘被开出的所有检验报告单中的标本采集部位需要列出来
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ...
css
CREATE TABLE table_1341423_21 ( district VARCHAR, incumbent VARCHAR )
Which district is Joe Moakley?
SELECT district FROM table_1341423_21 WHERE incumbent = "Joe Moakley"
sql_create_context
CREATE TABLE table_51215 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many people were at the game where the home team was South Melbourne?
SELECT "Crowd" FROM table_51215 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_name_7 ( claimant VARCHAR, rank VARCHAR )
Which claimant's rank is 200?
SELECT claimant FROM table_name_7 WHERE rank = 200
sql_create_context
CREATE TABLE table_31796 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Name the position of pick 234
SELECT "Position" FROM table_31796 WHERE "Pick" = '234'
wikisql
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 procedures ( ...
what is admission type and admission location of subject id 25543?
SELECT demographic.admission_type, demographic.admission_location FROM demographic WHERE demographic.subject_id = "25543"
mimicsql_data
CREATE TABLE table_45368 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text, "Team(s)" text )
Name the average Wins which has a Top 10 smaller than 0?
SELECT AVG("Wins") FROM table_45368 WHERE "Top 10" < '0'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the number of patients less than 43 years who have transplant self medication program?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "43" AND prescriptions.drug = "Transplant Self Medication Program"
mimicsql_data
CREATE TABLE table_57711 ( "Year" text, "Division" text, "League" text, "Reg. Season" text, "Playoffs" text, "Open Cup" text )
Tell me the league with a regular 1st season
SELECT "League" FROM table_57711 WHERE "Reg. Season" = '1st'
wikisql
CREATE TABLE table_name_35 ( type VARCHAR, name VARCHAR )
What is the film type for the movie Sanctuary?
SELECT type FROM table_name_35 WHERE name = "sanctuary"
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...
Calculate the number of patients with item id 50811 who died in or before 2155
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2155.0" AND lab.itemid = "50811"
mimicsql_data
CREATE TABLE table_name_26 ( venue VARCHAR, score VARCHAR, competition VARCHAR )
What venue has a score of 4-0 with the 2002 Tiger Cup listed as the competition?
SELECT venue FROM table_name_26 WHERE score = "4-0" AND competition = "2002 tiger cup"
sql_create_context
CREATE TABLE table_76767 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Result of the Competition at MBPJ Stadium with a Score of 4 0?
SELECT "Result" FROM table_76767 WHERE "Score" = '4–0' AND "Venue" = 'mbpj stadium'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
had there been some organisms in patient 031-3355's first blood, venipuncture microbiology test on their current hospital encounter?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite...
eicu
CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) C...
Give me a pie chart to show the proportion of each type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'.
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' GROUP BY Type_of_Thing_Code
nvbench
CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text ) CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real )
What are the dates of publications in descending order of price, and count them by a bar chart
SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY Price DESC
nvbench
CREATE TABLE table_29644931_1 ( participants_recipients VARCHAR, film_festival VARCHAR )
Which films participated in the 30th Hawaii International Film Festival?
SELECT participants_recipients FROM table_29644931_1 WHERE film_festival = "30th Hawaii International film_festival"
sql_create_context
CREATE TABLE table_name_4 ( date_of_death VARCHAR, name VARCHAR )
When did Charles III die?
SELECT date_of_death FROM table_name_4 WHERE name = "charles iii"
sql_create_context
CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category tex...
Show the number of movies for each year in a bar chart and ordered by budget.
SELECT Year, COUNT(Year) FROM movie GROUP BY Year ORDER BY Budget_million
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday, and rank Y-axis in desc order.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) DESC
nvbench
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,...
日期均在2021-05-03之后的患者王向卉的哪些门诊就诊记录对应的检验报告单的报告?列出门诊就诊流水号是什么?
SELECT txmzjzjlb.JZLSH 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 person_info.XM = '王向卉' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2021-05-0...
css
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 StackOverflow Rockers from Bangladesh.
SELECT * FROM Users WHERE Location LIKE '%Bangladesh%' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_14209245_9 ( college_junior_club_team__league_ VARCHAR, pick__number VARCHAR )
What is the college/junior/club team (league) of the player who was pick number 130?
SELECT college_junior_club_team__league_ FROM table_14209245_9 WHERE pick__number = "130"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
从08年1月2日到09年6月16日小儿肛肠外科的住院量是多少?
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSMC = '小儿肛肠外科' AND wdmzjzjlb.RYDJSJ BETWEEN '2008-01-02' AND '2009-06-16' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSMC = '小儿肛肠外科' AND bdmzjzjlb.RYDJSJ BETWEEN '2008-01-02' AND '2009-06-16'
css
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
看看医疗就诊04488736077的人员信息,需要包括姓名、性别、年龄和公民身份号码
SELECT gwyjzb.PERSON_NM, gwyjzb.PERSON_SEX, gwyjzb.PERSON_AGE, gwyjzb.IDENTITY_CARD FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '87710436501' UNION SELECT fgwyjzb.PERSON_NM, fgwyjzb.PERSON_SEX, fgwyjzb.PERSON_AGE, fgwyjzb.IDENTITY_CARD FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '87710436501'
css
CREATE TABLE table_204_888 ( id number, "location" text, "mile" number, "destinations" text, "notes" text )
which location has the most destinations ?
SELECT "location" FROM table_204_888 GROUP BY "location" ORDER BY COUNT("destinations") DESC LIMIT 1
squall
CREATE TABLE table_203_371 ( id number, "round" number, "opponent" text, "result" text, "bro." number, "opp." number, "date" text, "venue" text, "crowd" number, "position" text )
who won by the least ?
SELECT "opponent" FROM table_203_371 ORDER BY "bro." DESC LIMIT 1
squall
CREATE TABLE txmzjzjlb ( 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...
检验报告单92482714366对应的患者姓名在门诊就诊中叫什么?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '9...
css
CREATE TABLE table_68660 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term in office" text )
Which Electorate has a State of qld, a Party of national, and a Member of hon evan adermann?
SELECT "Electorate" FROM table_68660 WHERE "State" = 'qld' AND "Party" = 'national' AND "Member" = 'hon evan adermann'
wikisql
CREATE TABLE table_name_65 ( entrant VARCHAR, chassis VARCHAR )
What is the name of the entrant with a chassis of m185b m186?
SELECT entrant FROM table_name_65 WHERE chassis = "m185b m186"
sql_create_context
CREATE TABLE table_name_54 ( nationality VARCHAR, years_for_grizzlies VARCHAR )
What is the Nationality of the 1998-2000 Years for Grizzlies?
SELECT nationality FROM table_name_54 WHERE years_for_grizzlies = "1998-2000"
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...
把针灸这个科室从零三年四月六日到零三年十二月二十一日因疾病E76.026需要住院治疗的平均费用给查看一下
SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '中医针灸科' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-04-06' AND '2003-12-21' AND t_kc21.IN_DIAG_DIS_CD = 'E76.026' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_204_751 ( id number, "date" text, "train" text, "location" text, "present location" text, "comments" text, "top speed (km/h)" text )
tell me the number of versions that are scrapped .
SELECT COUNT("train") FROM table_204_751 WHERE "present location" = 'scrapped'
squall
CREATE TABLE table_name_55 ( first_elected VARCHAR, district VARCHAR )
What is the First elected of california 3?
SELECT first_elected FROM table_name_55 WHERE district = "california 3"
sql_create_context
CREATE TABLE table_31159 ( "No." real, "#" real, "Episode title" text, "Director" text, "Writer(s)" text, "U.S. original airdate" text, "Prod. code" real )
When nicole dubuc duane capizzi is the writer who is the director?
SELECT "Director" FROM table_31159 WHERE "Writer(s)" = 'Nicole Dubuc Duane Capizzi'
wikisql
CREATE TABLE table_2700 ( "Constituency" text, "Winner" text, "Party" text, "Margin" real, "Runner-up a" text, "Party a" text )
How many times did M. Gounder win for Party A?
SELECT COUNT("Party a") FROM table_2700 WHERE "Winner" = 'M. Gounder'
wikisql
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 ...
What are the nationalities and their average ages of journalists Show me a bar chart, and order by the Y from low to high please.
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY AVG(Age)
nvbench
CREATE TABLE table_53501 ( "Location" text, "Londonborough" text, "Post town" text, "Postcodedistrict" text, "Dialcode" text )
What is the Dialcode of whitechapel?
SELECT "Dialcode" FROM table_53501 WHERE "Location" = 'whitechapel'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Questions with the highest number of bounties.
SELECT RANK() OVER (ORDER BY COUNT(bs.Id) DESC) AS Rank, COUNT(bs.Id) AS "number_of_bounties", SUM(bs.BountyAmount) AS "total_amount", p.Id AS "post_link", p.Score, p.AnswerCount, p.OwnerUserId AS "user_link", p.Tags FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId WHERE bs.VoteTypeId = 8 GROUP BY p.Id, p.Sco...
sede
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
把2005年1月7日到2016年10月5日期间患者18154604在4531182的医疗机构一共看检查过多少次查看一下
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '18154604' AND t_kc22.STA_DATE BETWEEN '2005-01-07' AND '2016-10-05' AND t_kc21.MED_SER_ORG_NO = '4531182' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_34061 ( "Pos." real, "Matches" real, "Wins" real, "Loses" real, "Results" text, "Points" real, "Diff." text )
Matches larger than 5 is the sum of what position?
SELECT SUM("Pos.") FROM table_34061 WHERE "Matches" > '5'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
how many days elapsed since the last time patient 87232 received a pt lab test during this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87232 AND admissions.disch...
mimic_iii
CREATE TABLE table_49653 ( "Stop no." text, "Platform" text, "Line" text, "Stopping pattern" text, "Destination" text )
What is Stop No., when Destination is Perth, and when Line is Midland?
SELECT "Stop no." FROM table_49653 WHERE "Destination" = 'perth' AND "Line" = 'midland'
wikisql
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, ...
provide the primary disease and discharge time of the subject named robert hyden.
SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.name = "Robert Hyden"
mimicsql_data
CREATE TABLE table_203_287 ( id number, "rank" number, "area" text, "date" text, "presenter" text, "seven wonders covered" text )
which area has the river severn and the exmoor as two of the seven wonders ?
SELECT "area" FROM table_203_287 WHERE "seven wonders covered" = 'river severn'
squall
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
Name the courses taught by Prof. Bradley Moore .
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Bradley Moore%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id =...
advising
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 CloseAsOffTopicReasonTypes ( Id number, IsUniversal bool...
Top 5000 users from guajrat.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%gujarat%' OR UPPER(Location) LIKE '%GUJARAT' ORDER BY Reputation DESC LIMIT 5000
sede
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...
在医院8408539就诊编码是19233432的人其检查的科室名称包含呼吸科的所有医疗就诊记录都是啥?
SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '19233432' AND gwyjzb.MED_SER_ORG_NO = '8408539' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%呼吸科%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '19233432' AND fgwyjzb.MED_SER_ORG_NO = '8408539' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%呼吸科%'
css
CREATE TABLE party ( party_id number, minister text, took_office text, left_office text, region_id number, party_name text ) CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE region ( region_id number, ...
Count the number of party events.
SELECT COUNT(*) FROM party_events
spider
CREATE TABLE table_1341690_18 ( first_elected INTEGER, candidates VARCHAR )
What year was Otto Passman (d) unopposed first elected?
SELECT MAX(first_elected) FROM table_1341690_18 WHERE candidates = "Otto Passman (D) Unopposed"
sql_create_context
CREATE TABLE table_68985 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Name the opponent with record of 52-58
SELECT "Opponent" FROM table_68985 WHERE "Record" = '52-58'
wikisql
CREATE TABLE table_46804 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
The draft pick that was taken before round 4 went to what college?
SELECT "College" FROM table_46804 WHERE "Round" < '4'
wikisql
CREATE TABLE table_70060 ( "Rank" real, "Circuit" text, "Headquarters" text, "Screens" real, "Sites" real )
what is the number of sites when the number of screens is 687 and rank is more than 7?
SELECT AVG("Sites") FROM table_70060 WHERE "Screens" = '687' AND "Rank" > '7'
wikisql
CREATE TABLE table_72091 ( "District" text, "Total amount of trees" real, "Prevailing types, %" text, "Amount of old trees" text, "Amount of trees, that require replacement" text )
What is the district when the total amount of trees is smaller than 150817.6878461314 and amount of old trees is 1,928 (1.89%)?
SELECT "District" FROM table_72091 WHERE "Total amount of trees" < '150817.6878461314' AND "Amount of old trees" = '1,928 (1.89%)'
wikisql
CREATE TABLE table_26250145_1 ( theme VARCHAR, order__number VARCHAR )
WHat is the them for the order #2?
SELECT theme FROM table_26250145_1 WHERE order__number = "2"
sql_create_context
CREATE TABLE table_name_73 ( constituency_number VARCHAR, name VARCHAR )
What is the Constituency Number of Total:?
SELECT constituency_number FROM table_name_73 WHERE name = "total:"
sql_create_context
CREATE TABLE table_34075 ( "Track number" real, "Song title" text, "Songwriter(s)" text, "Orchestra" text, "Time" text )
Name the orchestra for ted varnick
SELECT "Orchestra" FROM table_34075 WHERE "Songwriter(s)" = 'ted varnick'
wikisql
CREATE TABLE table_79416 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Series" text, "Arena" text )
What was the attendance on may 21?
SELECT MAX("Attendance") FROM table_79416 WHERE "Date" = 'may 21'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
Provide the number of patients with diagnoses icd9 code 78830 who died in or before 2154.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2154.0" AND diagnoses.icd9_code = "78830"
mimicsql_data
CREATE TABLE table_19743 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
What is the result of the game against the Chicago Bears?
SELECT "Result" FROM table_19743 WHERE "Opponent" = 'Chicago Bears'
wikisql
CREATE TABLE table_15463188_17 ( school_club_team VARCHAR, season VARCHAR, acquisition_via VARCHAR )
What was the school/club team whose season was in 2012 and were acquired via trade?
SELECT school_club_team FROM table_15463188_17 WHERE season = "2012" AND acquisition_via = "Trade"
sql_create_context
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...
how many patients iwere admitted before the year 2178 operated for continous intra-arterial blood gas monitoring?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2178" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring"
mimicsql_data
CREATE TABLE table_name_87 ( player VARCHAR, points INTEGER )
Who is the player who had more than 1,052 points?
SELECT player FROM table_name_87 WHERE points > 1 OFFSET 052
sql_create_context
CREATE TABLE table_64282 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
When the Altrincham was the home team what was the tie no?
SELECT "Tie no" FROM table_64282 WHERE "Home team" = 'altrincham'
wikisql
CREATE TABLE invoiceline ( invoicelineid number, invoiceid number, trackid number, unitprice number, quantity number ) CREATE TABLE genre ( genreid number, name text ) CREATE TABLE customer ( customerid number, firstname text, lastname text, company text, address text, ...
Find the cities corresponding to employees who help customers with the postal code 70174.
SELECT T2.city FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid WHERE T1.postalcode = "70174"
spider