context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, ...
list the morning flights between ATLANTA and DALLAS
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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLA...
atis
CREATE TABLE table_16441561_5 ( pick__number INTEGER, position VARCHAR )
Who was the lowest picked LB
SELECT MIN(pick__number) FROM table_16441561_5 WHERE position = "LB"
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 female patient with drug code adva250ih?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "ADVA250IH"
mimicsql_data
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
which patients were ordered cd3 cells, percent lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "CD3 Cells, Percent"
mimicsql_data
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 whose death status is 1 and drug name is metolazone?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Metolazone"
mimicsql_data
CREATE TABLE table_70697 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What School is in the kio kio area?
SELECT "Name" FROM table_70697 WHERE "Area" = 'kio kio'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistory ( Id number, PostHistoryT...
the most number of comments on a single post.
SELECT p.Id AS post_id, COUNT(c.Id) AS comments_count FROM Posts AS p JOIN Comments AS c ON p.Id = c.PostId GROUP BY p.Id ORDER BY 2 DESC LIMIT 1
sede
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport ( ...
i want to fly from DALLAS FORT WORTH to PHILADELPHIA
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT WORTH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name...
atis
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of founder and the sum of price , and group by attribute founder, and order by the x-axis in asc.
SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
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...
which type of drug is olanzapine (disintegrating tablet)?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Olanzapine (Disintegrating Tablet)"
mimicsql_data
CREATE TABLE table_41283 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
What is the Season when the Lead was don bartlett, and the third was don walchuk, and a Second of carter rycroft?
SELECT "Season" FROM table_41283 WHERE "Lead" = 'don bartlett' AND "Third" = 'don walchuk' AND "Second" = 'carter rycroft'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
Site ranking by tag score and distance behind those ranked just above.
SELECT u.DisplayName, SUM(p.Score) AS total_score FROM Posts AS p JOIN Posts AS q ON q.Id = p.ParentId AND q.Tags LIKE '%<##tag##>%' JOIN Users AS u ON u.Id = p.OwnerUserId GROUP BY u.DisplayName HAVING SUM(p.Score) > 1000 ORDER BY SUM(p.Score) DESC
sede
CREATE TABLE table_name_90 ( publication_date VARCHAR, person_s_ VARCHAR, reported_price VARCHAR, publisher_s_ VARCHAR )
What was the publication date of the photos of Sean Preston Federline that cost $500,000 and were published by People?
SELECT publication_date FROM table_name_90 WHERE reported_price = "$500,000" AND publisher_s_ = "people" AND person_s_ = "sean preston federline"
sql_create_context
CREATE TABLE table_name_37 ( car INTEGER, yards INTEGER )
What is the lowest car with more than 122 yards?
SELECT MIN(car) FROM table_name_37 WHERE yards > 122
sql_create_context
CREATE TABLE table_78743 ( "Name" text, "Bodyweight" real, "Snatch" real, "Clean & Jerk" real, "Total (kg)" real )
Which Total (kg) has a Clean & Jerk smaller than 153, and a Snatch smaller than 100?
SELECT MIN("Total (kg)") FROM table_78743 WHERE "Clean & Jerk" < '153' AND "Snatch" < '100'
wikisql
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 SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, ...
Ratio Answers Accepted Withtin 30 Minutes Over Questions With Accepted Answers.
SELECT (SELECT COUNT(Posts.Id) FROM Posts INNER JOIN Posts AS Ans ON Ans.Id = Posts.AcceptedAnswerId WHERE DATEDIFF_BIG(minute, Posts.CreationDate, Ans.CreationDate) < 30), (SELECT COUNT(Posts.Id) FROM Posts INNER JOIN Posts AS Ans ON Ans.Id = Posts.AcceptedAnswerId WHERE DATEDIFF_BIG(minute, Posts.CreationDate, Ans.Cr...
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose admission location is clinic referral/premature and admission year is less than 2114?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2114"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of phone_number and salary in a bar chart, order by the bars in asc.
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
nvbench
CREATE TABLE table_20282 ( "Name" text, "Overs Bowled" text, "Maidens" real, "Runs Conceded" real, "Wickets" real, "Extras" real, "E.R." text )
What was the ER average for the player that conceded 368 runs?
SELECT "E.R." FROM table_20282 WHERE "Runs Conceded" = '368'
wikisql
CREATE TABLE table_name_28 ( reg_gp INTEGER, player VARCHAR, pick__number VARCHAR )
What is the sum of every REG GP that Peter Andersson played as a pick# less than 143?
SELECT SUM(reg_gp) FROM table_name_28 WHERE player = "peter andersson" AND pick__number < 143
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
哪些医师为病患48794653在医疗就诊43987098526中开具医疗项目的,提供所有的编号及姓名
SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '43987098526'
css
CREATE TABLE table_name_69 ( points INTEGER, difference VARCHAR )
What is the largest points number where the difference is 12?
SELECT MAX(points) FROM table_name_69 WHERE difference = "12"
sql_create_context
CREATE TABLE table_44709 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
Which team had a second qualifying time of 58.539?
SELECT "Team" FROM table_44709 WHERE "Qual 2" = '58.539'
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...
患者36425103在门诊诊断为由于使用阿片类药引起的精神病性障碍的触珠蛋白的结果定量还有单位都是多少呢?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '由于使用阿片类药引起的精神病性障碍' AND h...
css
CREATE TABLE table_78498 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the average crowd attendance for Collingwood?
SELECT AVG("Crowd") FROM table_78498 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_name_28 ( tournament VARCHAR )
What did the Tournament of Australian Championships, with an A in 1969, get in 1954?
SELECT 1954 FROM table_name_28 WHERE 1969 = "a" AND tournament = "australian championships"
sql_create_context
CREATE TABLE table_51401 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What's the lowest amount of laps with a start of 21?
SELECT MIN("Laps") FROM table_51401 WHERE "Start" = '21'
wikisql
CREATE TABLE table_32811 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was Melbourne's score as the home team?
SELECT "Home team score" FROM table_32811 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_33751 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many games is collingwood the home side?
SELECT COUNT("Crowd") FROM table_33751 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_55726 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
If the Home team was north melbourne and the Crowd was larger than 10,000, what was the Home team's score?
SELECT "Home team score" FROM table_55726 WHERE "Crowd" > '10,000' AND "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_23449363_1 ( leagues_entering_at_this_round VARCHAR, winners_from_previous_round VARCHAR )
Which leagues entered in rounds where there were 16 winners from the previous round?
SELECT leagues_entering_at_this_round FROM table_23449363_1 WHERE winners_from_previous_round = "16"
sql_create_context
CREATE TABLE table_name_71 ( year_s__won VARCHAR, total VARCHAR )
Which Year(s) won has a Total of 289?
SELECT year_s__won FROM table_name_71 WHERE total = 289
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
List of Users in a given location fragment sorted location. This query lists all users in a given location sorted by location.
SELECT Id AS "user_link", Location, Reputation FROM Users WHERE UPPER(LEFT(Location, 5)) = 'INDIA' AND Reputation >= '##minimumReputation##' ORDER BY Location
sede
CREATE TABLE table_name_79 ( lost INTEGER, name VARCHAR, played VARCHAR )
Which Lost is the lowest one that has a Name of esc holzkirchen, and Played smaller than 14?
SELECT MIN(lost) FROM table_name_79 WHERE name = "esc holzkirchen" AND played < 14
sql_create_context
CREATE TABLE table_name_87 ( japanese_voice_actor VARCHAR, battle_of_the_planets VARCHAR )
Who is the Japanese voice actor of the Battle of the Planets of Keyop?
SELECT japanese_voice_actor FROM table_name_87 WHERE battle_of_the_planets = "keyop"
sql_create_context
CREATE TABLE table_name_64 ( finish VARCHAR, record VARCHAR )
Name the finish for a 39-31 record
SELECT finish FROM table_name_64 WHERE record = "39-31"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
门诊诊断患者为慢性胃溃疡的抗环瓜氨酸肽抗体数值的平均值是多少?最值是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '慢性胃溃疡' AND jyjgzbb.JCZBMC = '抗环...
css
CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, company_...
A stacked bar chart showing the number of faults for different fault short name and skills required to fix them The x-axis is skill description and group by fault short name, show by the skill_description in desc.
SELECT skill_description, COUNT(skill_description) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY fault_short_name, skill_description ORDER BY skill_description DESC
nvbench
CREATE TABLE table_18629 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What district is incumbent robert l. mouton from?
SELECT "District" FROM table_18629 WHERE "Incumbent" = 'Robert L. Mouton'
wikisql
CREATE TABLE table_23292220_17 ( jons_team VARCHAR, episode VARCHAR )
Name the number of jons team for 15x10
SELECT COUNT(jons_team) FROM table_23292220_17 WHERE episode = "15x10"
sql_create_context
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
does flight UA 281 from BOSTON to DENVER leave on TUESDAY
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, days, flight WHERE (((days.day_name = 'TUESDAY' AND flight.flight_days = days.days_code AND flight.flight_number = 281) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
atis
CREATE TABLE table_44704 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
What away team scored 107-104?
SELECT "Away team" FROM table_44704 WHERE "Score" = '107-104'
wikisql
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...
find the number of patients who underwent drug detoxification.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Drug detoxification"
mimicsql_data
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int,...
lowest fare from SAN FRANCISCO to ORLANDO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_...
atis
CREATE TABLE table_204_282 ( id number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text, "#" number )
where was the last game of the season held ?
SELECT "venue" FROM table_204_282 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_1982739_2 ( pinyin VARCHAR, english_name VARCHAR )
What is the Pinyin name for Dingyuan County?
SELECT pinyin FROM table_1982739_2 WHERE english_name = "Dingyuan County"
sql_create_context
CREATE TABLE table_61053 ( "Phoen. value" text, "Phoen. name" text, "Hebrew" text, "Greek" text, "Latin" text, "Cyrillic" text, "Arabic" text )
What is the Latin term for the Greek symbol ?
SELECT "Latin" FROM table_61053 WHERE "Greek" = 'μ'
wikisql
CREATE TABLE table_56554 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Crowd has a Home team score of 15.20 (110), and a Home team of carlton?
SELECT MIN("Crowd") FROM table_56554 WHERE "Home team score" = '15.20 (110)' AND "Home team" = 'carlton'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
Show me some easy 300 -level classes .
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND program_course.course_id = course.course_id AND program_course.workload < 3 ORDER BY program_course.workload
advising
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( ...
what is the ingesting method of heparin flush crrt (5000 units/ml)?
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'heparin flush crrt (5000 units/ml)'
mimic_iii
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 ...
病人在门诊被诊断为躁狂型精神病时,其检测指标503506数值的平均值是多少,最值是多少
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl...
css
CREATE TABLE table_30120619_1 ( townland VARCHAR, civil_parish VARCHAR )
In which townlands is the civil parish Monkstown?
SELECT townland FROM table_30120619_1 WHERE civil_parish = "Monkstown"
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 ) ...
provide the number of patients whose insurance is self pay and days of hospital stay is greater than 27?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "27"
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...
give me the number of patients whose admission type is elective and procedure short title is ureteral catheterization?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Ureteral catheterization"
mimicsql_data
CREATE TABLE table_7628 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real )
What is the lowest number of games with a rank less than 1?
SELECT MIN("Games") FROM table_7628 WHERE "Rank" < '1'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, and list in descending by the Y-axis.
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) DESC
nvbench
CREATE TABLE table_name_64 ( fcc_info VARCHAR, frequency_mhz VARCHAR, call_sign VARCHAR )
What is the FCC info of the w214ba call sign with a frequency below 96.3?
SELECT fcc_info FROM table_name_64 WHERE frequency_mhz < 96.3 AND call_sign = "w214ba"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is date of birth and death status of subject name dominga garvin?
SELECT demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Dominga Garvin"
mimicsql_data
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
what was the average rdw value for patient 58932?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 58932) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw')
mimic_iii
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 products with a price between 60 and 120, draw a scatter chart about the correlation between code and manufacturer .
SELECT Code, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
tell me the maximum age of patients who are widowed and have medicare insurance.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.insurance = "Medicare"
mimicsql_data
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, ...
calculate the total number of patients admitted to emergency with major depressive affective disorder, recurrent episode, severe, specified as with psychotic behavior
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 = "Major depressive affective disorder, recurrent episode, severe, specified as with psychotic behavior"
mimicsql_data
CREATE TABLE table_203_43 ( id number, "polling firm" text, "month" text, "link" text, "favor" number, "oppose" number )
which was the only polling firm to show more than 50 percent in favor of same sex marriage in 2006 ?
SELECT "polling firm" FROM table_203_43 WHERE "favor" > 50 AND "month" = 2006
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
how many patients are diagnosed with icd9code 78820 and have lab test results showing abnormal status delta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "78820" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_54659 ( "Name" text, "Scotland career" text, "Caps" real, "Goals" real, "Average" real )
What is the goal top with caps of 38 and an average less than 0.579?
SELECT MAX("Goals") FROM table_54659 WHERE "Caps" = '38' AND "Average" < '0.579'
wikisql
CREATE TABLE table_29142 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Incoming manager" text, "Date of appointment" text, "Position in Table" text )
What is the team when the date of appointment is 23 march 2011?
SELECT "Team" FROM table_29142 WHERE "Date of appointment" = '23 March 2011'
wikisql
CREATE TABLE table_name_4 ( team_2 VARCHAR )
What was the 2nd leg where the team 2 was budoni (sardinia)?
SELECT 2 AS nd_leg FROM table_name_4 WHERE team_2 = "budoni (sardinia)"
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...
统计出院诊断为腔隙性脑梗死的在医院6694892的医疗记录中最低和最高医疗费总额有多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '6694892' AND t_kc24.t_kc21_OUT_DIAG_DIS_NM = '腔隙性脑梗死')
css
CREATE TABLE table_13285 ( "Vessel:" text, "Type:" text, "Built:" real, "Owned since:" real, "Responsible:" text, "Status:" text )
Which Type has a Responsible of stavangerske?
SELECT "Type:" FROM table_13285 WHERE "Responsible:" = 'stavangerske'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
is patient 006-2586's level of heartrate second measured on the current icu visit less than it was first measured on the current icu visit?
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586') AND patient.unitdischargetime IS NULL)...
eicu
CREATE TABLE table_61880 ( "Tie no" text, "Home team" text, "Score 1" text, "Away team" text, "Attendance" text )
What is the Score 1 of Tie no 6?
SELECT "Score 1" FROM table_61880 WHERE "Tie no" = '6'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCAT...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of manager_id over hire_date , and show from low to high by the HIRE_DATE.
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_62296 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the Overall of the pick less than 20?
SELECT "Overall" FROM table_62296 WHERE "Pick #" < '20'
wikisql
CREATE TABLE table_21373 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
What are that status(es) of saint-jacques?
SELECT "Status" FROM table_21373 WHERE "Official Name" = 'Saint-Jacques'
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...
Upvotes from users with reputation 101.
SELECT Users.Id AS "user_link", UpVotes, CreationDate, LastAccessDate FROM Users WHERE (Reputation < 102) AND (UpVotes > 0) ORDER BY UpVotes DESC
sede
CREATE TABLE table_75289 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is the Netflix number having a segment of C of pills?
SELECT "Netflix" FROM table_75289 WHERE "Segment C" = 'pills'
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 whose insurance is private and diagnoses icd9 code is 58089?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.icd9_code = "58089"
mimicsql_data
CREATE TABLE table_name_51 ( site VARCHAR, date VARCHAR )
I want the site for september 29, 2013
SELECT site FROM table_name_51 WHERE date = "september 29, 2013"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description ...
Top badge holders compared to reputation. Find users with the highest badge score compared to reputation. Badge score is calculated as: Score = gold weight * no. gold badges + silver weight * no. silver badges + bronze weight + no. bronze badges
SELECT u.Id, u.Reputation, CAST(SUM(CASE b.Class WHEN @GoldClass THEN 1 WHEN @SilverClass THEN 0 WHEN @BronzeClass THEN 0 ELSE 0 END) / CAST(u.Reputation AS FLOAT(10, 2)) AS FLOAT(5, 5)) AS "RATIO", SUM(CASE b.Class WHEN @GoldClass THEN 1 ELSE 0 END) AS "Gold badges" FROM Users AS u INNER JOIN Badges AS b ON u.Id = b.U...
sede
CREATE TABLE table_70009 ( "Date" text, "City" text, "Country" text, "Venue" text, "Attendance" text )
Which City has mandalay bay resort
SELECT "City" FROM table_70009 WHERE "Venue" = 'mandalay bay resort'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
what are the four most frequent specimen tests that patients had within 2 months after having been diagnosed with hypoxemia until 3 years ago?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypoxemia' AND DATETIME(diagnosis.diagnosist...
eicu
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,...
检验报告单26254830519是哪个报告人报告的,工号是多少,把姓名也查一下
SELECT zyjybgb.BGRGH, zyjybgb.BGRXM FROM zyjybgb WHERE zyjybgb.BGDH = '26254830519' UNION SELECT mzjybgb.BGRGH, mzjybgb.BGRXM FROM mzjybgb WHERE mzjybgb.BGDH = '26254830519'
css
CREATE TABLE table_64760 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text )
Which opponent has a 26-12 record?
SELECT "Opponent" FROM table_64760 WHERE "Record" = '26-12'
wikisql
CREATE TABLE table_1746 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
What is the census ranking of the Perth parish?
SELECT "Census Ranking" FROM table_1746 WHERE "Official Name" = 'Perth'
wikisql
CREATE TABLE table_16734640_1 ( nickname VARCHAR, institution VARCHAR )
Name the total number of nicknames for andrew college
SELECT COUNT(nickname) FROM table_16734640_1 WHERE institution = "Andrew College"
sql_create_context
CREATE TABLE qualifying ( qualifyid number, raceid number, driverid number, constructorid number, number number, position number, q1 text, q2 text, q3 text ) CREATE TABLE constructors ( constructorid number, constructorref text, name text, nationality text, url t...
What is the id and last name of the driver with the longest laptime?
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
spider
CREATE TABLE table_42476 ( "Year" real, "Winner (Male)" text, "Winner (Female)" text, "Talent (Male)" text, "Talent (Female)" text )
Who is the female talent in 1999?
SELECT "Talent (Female)" FROM table_42476 WHERE "Year" = '1999'
wikisql
CREATE TABLE table_name_51 ( attendance VARCHAR, home_team VARCHAR )
What was the attendance at the Billericay Town home game?
SELECT attendance FROM table_name_51 WHERE home_team = "billericay town"
sql_create_context
CREATE TABLE table_76023 ( "Country" text, "Total Freshwater Withdrawal (km 3 /yr)" real, "Per Capita Withdrawal (m 3 /p/yr)" real, "Domestic Use (m 3 /p/yr)(in %)" text, "Industrial Use (m 3 /p/yr)(in %)" text, "Agricultural Use (m 3 /p/yr)(in %)" text )
What is the highest Per Capita Withdrawal (m 3 /p/yr), when Agricultural Use (m 3 /p/yr)(in %) is 1363(92%), and when Total Freshwater Withdrawal (km 3 /yr) is less than 42.7?
SELECT MAX("Per Capita Withdrawal (m 3 /p/yr)") FROM table_76023 WHERE "Agricultural Use (m 3 /p/yr)(in %)" = '1363(92%)' AND "Total Freshwater Withdrawal (km 3 /yr)" < '42.7'
wikisql
CREATE TABLE table_70871 ( "Name" text, "Population (2009 estimate)" text, "Largest City" text, "Largest Metropolitan Area" text, "Number of States" text )
How many states has a 2009 estimate population of 27,3 million?
SELECT "Number of States" FROM table_70871 WHERE "Population (2009 estimate)" = '27,3 million'
wikisql
CREATE TABLE table_201_10 ( id number, "#" number, "name" text, "office" text, "political party" text, "occupation" text )
who was the first mayor of austevoll ?
SELECT "name" FROM table_201_10 ORDER BY "office" LIMIT 1
squall
CREATE TABLE table_71420 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23?
SELECT "Entrant" FROM table_71420 WHERE "Year" > '1961' AND "Engine" = 'ferrari v8' AND "Points" < '23'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
what were the five most frequently taken lab tests since 2100 in patients of age 40s?
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 40 AND 49) AND STRFTIME('%y', labevents.c...
mimic_iii
CREATE TABLE table_72459 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many games were played when the record was 26-21?
SELECT COUNT("Game") FROM table_72459 WHERE "Record" = '26-21'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
what are the top three most common diagnoses that patients have had within the same month after receiving vasopressors - phenylephrine (neosynephrine) since 2105.
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasopressors - phenylephrine (neosynephr...
eicu
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
how much clonazepam was last prescribed in the last hospital visit to patient 88404?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88404 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'clonazepam' ORDER BY prescriptions.startdate DESC L...
mimic_iii
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname va...
the papers on semantic parsing by li dong at acl in 2016
SELECT DISTINCT paper.paperid FROM author, keyphrase, paper, paperkeyphrase, venue, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND venue.venueid = pape...
scholar
CREATE TABLE table_name_63 ( displacement VARCHAR, year VARCHAR )
Tell me the displacement for 1935-45
SELECT displacement FROM table_name_63 WHERE year = "1935-45"
sql_create_context
CREATE TABLE table_26499 ( "Administrative division" text, "Area (km\u00b2) 2011**" text, "Population 2001 Census (Adjusted)" real, "Population 2011 Census (Adjusted)" real, "Population density (/km\u00b2 2011)" text )
In what division was there a population density in km2 of 4,491.8 in 2011?
SELECT "Administrative division" FROM table_26499 WHERE "Population density (/km\u00b2 2011)" = '4,491.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 diagnoses ( ...
specify the time of admission of patient id 29961
SELECT demographic.admittime FROM demographic WHERE demographic.subject_id = "29961"
mimicsql_data