context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE transactions ( transaction_id number, investor_id number, transaction_type_code text, date_of_transaction time, amount_of_transaction number, share_count text, other_details text ) CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_descrip...
Show the transaction type descriptions and dates if the share count is smaller than 10.
SELECT T1.transaction_type_description, T2.date_of_transaction FROM ref_transaction_types AS T1 JOIN transactions AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10
spider
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 ...
把2015年1月8日到2021年3月20日期间患者50498130一共在医院看过多少次病查看一下
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND p...
css
CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gender_mfu text, date_of_birth time, other_details text ) CREATE TABLE ref_calendar ( calendar_date time, day_number number ) CREATE TABLE documents_to_be_destroyed ( document_id number, destructio...
Show the location code, the starting date and ending data in that location for all the documents.
SELECT location_code, date_in_location_from, date_in_locaton_to FROM document_locations
spider
CREATE TABLE table_74089 ( "Year" real, "Title" text, "Format" text, "Studio" text, "Release Date" text, "Copyright Information" text, "Catalog Number" text )
Name the studio for catalog number 81063
SELECT "Studio" FROM table_74089 WHERE "Catalog Number" = '81063'
wikisql
CREATE TABLE table_75248 ( "common name" text, "protein name" text, "divergence from human lineage (MYA)" real, "accession number" text, "sequence length (aa)" real, "sequence identity to human protein" text )
What is the accession number of the protein with the common name Purple Sea Urchin?
SELECT "accession number" FROM table_75248 WHERE "common name" = 'purple sea urchin'
wikisql
CREATE TABLE table_name_23 ( overall INTEGER, round VARCHAR, pick VARCHAR, college VARCHAR )
WHAT IS THE OVERALL AVERAGE WITH A 22 PICK, FROM RICE COLLEGE, AND ROUND BIGGER THAN 10?
SELECT AVG(overall) FROM table_name_23 WHERE pick = 22 AND college = "rice" AND round > 10
sql_create_context
CREATE TABLE table_38995 ( "Jyutping" text, "Character" text, "Portuguese" text, "Relative value" text, "Metric value" text, "Imperial value" text )
what's the relative value that contains a jyutping of daam3?
SELECT "Relative value" FROM table_38995 WHERE "Jyutping" = 'daam3'
wikisql
CREATE TABLE table_56688 ( "Route Name" text, "Direction" text, "Termini" text, "Junctions" text, "Length" text, "Population Area" text )
What route has termini of fm 1472 sh 255?
SELECT "Route Name" FROM table_56688 WHERE "Termini" = 'fm 1472 sh 255'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
find the drug code and drug route of ferrous sulfate.
SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Ferrous Sulfate"
mimicsql_data
CREATE TABLE table_name_83 ( title VARCHAR, directed_by VARCHAR, season__number VARCHAR, series__number VARCHAR )
What is the Title of the episode after Season 10 Directed by Erik Wiese and Eddie Trigueros after Seres 35?
SELECT title FROM table_name_83 WHERE season__number > 10 AND series__number > 35 AND directed_by = "erik wiese and eddie trigueros"
sql_create_context
CREATE TABLE table_name_85 ( position VARCHAR, level VARCHAR, season VARCHAR )
What Position has a Level of tier 4 with a Season smaller than 2003?
SELECT position FROM table_name_85 WHERE level = "tier 4" AND season < 2003
sql_create_context
CREATE TABLE table_name_69 ( date VARCHAR, record VARCHAR )
On what date was the record 39 54?
SELECT date FROM table_name_69 WHERE record = "39–54"
sql_create_context
CREATE TABLE table_name_1 ( rank INTEGER, games VARCHAR, rebounds VARCHAR )
What's the lowest amount of 12 games and less than 48 rebounds?
SELECT MIN(rank) FROM table_name_1 WHERE games = 12 AND rebounds < 48
sql_create_context
CREATE TABLE table_name_50 ( title VARCHAR, weeks_on_chart__uk_ VARCHAR )
Which single was on the Charts for 23 weeks ?
SELECT title FROM table_name_50 WHERE weeks_on_chart__uk_ = 23
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name tex...
Mapping for database -> site URL.
SELECT name, LOWER('https://' + CASE WHEN PATINDEX('%.Mathoverflow%', name) > 0 THEN CASE WHEN PATINDEX('%.Meta', name) > 0 THEN 'meta.mathoverflow.net' ELSE 'mathoverflow.net' END ELSE CASE WHEN PATINDEX('StackExchange.%', name) > 0 THEN SUBSTRING(name, 15, 200) + '.stackexchange.com' ELSE CASE WHEN PATINDEX('StackOve...
sede
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, ...
列出患者98735350就诊科室名称包含脑外的在医院5087372中总共有哪些医疗就诊记录?
SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '98735350' AND gwyjzb.MED_SER_ORG_NO = '5087372' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%脑外%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '98735350' AND fgwyjzb.MED_SER_ORG_NO = '5087372' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%脑外%'
css
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, give me the comparison about the average of revenue over the name , and group by attribute name.
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
CREATE TABLE table_name_87 ( attendance INTEGER, game_site VARCHAR )
What's the highest attendance for a game the Texan's played at Arrowhead Stadium?
SELECT MAX(attendance) FROM table_name_87 WHERE game_site = "arrowhead stadium"
sql_create_context
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, ...
among patients that were prescribed with buminate, what are the three most frequently prescribed drugs at the same time a year before?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'buminate' AND DATETIME(medication.drugstarttime, 's...
eicu
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 me the number of patients on collagenase ointment prescription who stayed in the hospital for more than 6 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "6" AND prescriptions.drug = "Collagenase Ointment"
mimicsql_data
CREATE TABLE table_45544 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text )
Which Record has a Game of 61?
SELECT "Record" FROM table_45544 WHERE "Game" = '61'
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, ...
what number of patients were given neuromuscular blocking agent two or more times until 2103?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'neuromuscular blocking agent' AND STRFTIME('%y', treatment.treatmenttime) <= '2103') GROUP BY patient.uniq...
eicu
CREATE TABLE table_204_747 ( id number, "season" text, "skip" text, "third" text, "second" text, "lead" text, "events" text )
who had the most seasons in third ?
SELECT "third" FROM table_204_747 GROUP BY "third" ORDER BY COUNT("season") DESC LIMIT 1
squall
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, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
What is the easiest class I can take so that I can fulfill the MDE requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
CREATE TABLE table_62550 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What did South Africa place?
SELECT "Place" FROM table_62550 WHERE "Country" = 'south africa'
wikisql
CREATE TABLE table_name_13 ( Id VARCHAR )
Which car won the same award in 2000 that the ferrari f133 5.5l v12 456 / 550 won in 2001?
SELECT 2000 FROM table_name_13 WHERE 2001 = "ferrari f133 5.5l v12 456 / 550"
sql_create_context
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1...
Show me about the distribution of Days and the average of Instructor , and group by attribute Days in a bar chart.
SELECT Days, AVG(Instructor) FROM Course GROUP BY Days ORDER BY Credits
nvbench
CREATE TABLE table_21939 ( "Season" text, "The Mole" text, "Winner" text, "Runner-up" text, "International destination" text )
How many runner-ups were there when the show went to Japan?
SELECT COUNT("Runner-up") FROM table_21939 WHERE "International destination" = 'Japan'
wikisql
CREATE TABLE table_57437 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" real )
What is the decile for Westminster Christian School with a state integrated authority?
SELECT "Decile" FROM table_57437 WHERE "Authority" = 'state integrated' AND "Name" = 'westminster christian school'
wikisql
CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
List the name for storms and the number of affected regions for each storm, rank in ascending by the Y please.
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_203_777 ( id number, "years" text, "building" text, "city" text, "height (ctbuh)" text, "floors" number )
what was the tallest building in canada after the toronto dominion center ?
SELECT "building" FROM table_203_777 WHERE "years" > (SELECT "years" FROM table_203_777 WHERE "building" = 'toronto-dominion centre') ORDER BY "years" LIMIT 1
squall
CREATE TABLE table_73698 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
When winner is the outcome what is the score?
SELECT "Score" FROM table_73698 WHERE "Outcome" = 'Winner'
wikisql
CREATE TABLE table_79505 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What is the time of frida svensson's race that had sa/b under the notes?
SELECT "Time" FROM table_79505 WHERE "Notes" = 'sa/b' AND "Athlete" = 'frida svensson'
wikisql
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
这个患者吕秀艳以前的门诊诊断都有什么?
SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM 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 = '吕秀艳' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM person_info JO...
css
CREATE TABLE table_61358 ( "Rank by average" real, "Place" real, "Couple" text, "Total points" real, "Number of dances" real, "Average" real )
What is the total average with 54 total points and a rank less than 10?
SELECT COUNT("Average") FROM table_61358 WHERE "Total points" = '54' AND "Rank by average" < '10'
wikisql
CREATE TABLE club ( club_id VARCHAR, club_name VARCHAR ) CREATE TABLE coach ( club_id VARCHAR )
How many coaches does each club has? List the club id, name and the number of coaches.
SELECT T1.club_id, T1.club_name, COUNT(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id
sql_create_context
CREATE TABLE table_78957 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the number of goals with less than 14 wins and a goal difference less than -4?
SELECT "Goals for" FROM table_78957 WHERE "Wins" < '14' AND "Goal Difference" < '-4'
wikisql
CREATE TABLE table_50640 ( "Rank" real, "Company" text, "Country" text, "Industry" text, "Revenue in USD" text )
What is the rank of the company who has a revenue of $428.2 billion?
SELECT COUNT("Rank") FROM table_50640 WHERE "Revenue in USD" = '$428.2 billion'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
what the last height of patient 4368 on the first hospital encounter.
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 = 4368 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.item...
mimic_iii
CREATE TABLE table_name_4 ( classification VARCHAR, current_conference VARCHAR, location VARCHAR )
What is the classification for the school in the NEC Conference located in New Britain, Connecticut?
SELECT classification FROM table_name_4 WHERE current_conference = "nec" AND location = "new britain, connecticut"
sql_create_context
CREATE TABLE table_38075 ( "Rank" text, "Scorer" text, "Club" text, "Goals" real, "Matches" text )
Which Goals is the lowest one that has Matches of 16, and a Scorer of park sang-in?
SELECT MIN("Goals") FROM table_38075 WHERE "Matches" = '16' AND "Scorer" = 'park sang-in'
wikisql
CREATE TABLE table_name_45 ( record VARCHAR, streak VARCHAR, score VARCHAR )
Name the record that has a stream of l1 and score of l 95 111
SELECT record FROM table_name_45 WHERE streak = "l1" AND score = "l 95–111"
sql_create_context
CREATE TABLE table_name_50 ( end_date VARCHAR, minister VARCHAR )
Name the end date for robert goebbels
SELECT end_date FROM table_name_50 WHERE minister = "robert goebbels"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text )
Show the number of companies each investor has invested with a bar chart, and I want to show by the x axis in descending.
SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
nvbench
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 ...
从二00二年四月二十五日到二0二0年十二月二十一日这段时间,患者沈宾鸿检测超敏肌钙蛋白T找的哪些医务人员做的,这些医务人员的工号和姓名报一下
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB W...
css
CREATE TABLE table_2076608_1 ( type VARCHAR, school VARCHAR )
What type of school is Stratford University?
SELECT type FROM table_2076608_1 WHERE school = "Stratford University"
sql_create_context
CREATE TABLE table_203_253 ( id number, "model" text, "frame" text, "years mfg'd" text, "caliber(s)" text, "production" text, "barrel" text, "notes" text )
which model had the most production during the years of manufacture ?
SELECT "model" FROM table_203_253 ORDER BY "production" DESC LIMIT 1
squall
CREATE TABLE table_15781 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What was the final score (result) for the game where 51,100 attended?
SELECT "Result" FROM table_15781 WHERE "Attendance" = '51,100'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, C...
Highest scored comments per site.
SELECT PostId AS "post_link", Score, Text FROM Comments WHERE Score >= 5 ORDER BY Score DESC LIMIT 50
sede
CREATE TABLE table_4070 ( "Category" text, "Player" text, "Team" text, "Games played" real, "Totals" text, "Average" text )
Who is the player when the category is steals per game?
SELECT "Player" FROM table_4070 WHERE "Category" = 'Steals per game'
wikisql
CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE songs ( songid number, title text ) C...
What are the first and last names of the artist who perfomed the song 'Badlands'?
SELECT T2.firstname, T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.title = "Badlands"
spider
CREATE TABLE table_name_2 ( player VARCHAR, year_born VARCHAR, height VARCHAR )
Who is the player born before 1985 who is less than 2.02 tall?
SELECT player FROM table_name_2 WHERE year_born < 1985 AND height < 2.02
sql_create_context
CREATE TABLE procedures ( 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 ) ...
what is minimum age of patients whose primary disease is ruq pain and year of death is less than 2133?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dod_year < "2133.0"
mimicsql_data
CREATE TABLE table_19072602_3 ( progressive_total VARCHAR, team_usa VARCHAR )
When tim mack is on team usa what is the progressive total?
SELECT progressive_total FROM table_19072602_3 WHERE team_usa = "Tim Mack"
sql_create_context
CREATE TABLE table_203_510 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n(/mi2)" number, "population\ndensity\n(/km2)" number, "land area\n(mi2)" number, "land area\n(km2)" number, "water area\n(mi2)" number, ...
what is the total population of burnett township ?
SELECT "population" FROM table_203_510 WHERE "township" = 'burnett'
squall
CREATE TABLE table_8240 ( "Team" text, "Gold" real, "Silver" real, "Bronze" real, "Overall" real )
How many gold when silver is less than 32, bronze is 25, and overall is less than 67?
SELECT SUM("Gold") FROM table_8240 WHERE "Silver" < '32' AND "Bronze" = '25' AND "Overall" < '67'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTME...
For all employees who have the letters D or S in their first name, give me the comparison about the sum of department_id over the hire_date bin hire_date by time by a bar chart.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_name_51 ( to_par VARCHAR, score VARCHAR, country VARCHAR )
What country of argentina has the To par of 68?
SELECT to_par FROM table_name_51 WHERE score = 68 AND country = "argentina"
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, ...
How many patients born before the year 1837 were admitted to trsf within this facility?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "1837"
mimicsql_data
CREATE TABLE zzmzjzjlb ( 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...
从08年5月20到21年3月15的这几年里,共有多少患者在医疗机构7227046的转诊门诊看病
SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '7227046' AND fzzmzjzjlb.JZKSRQ BETWEEN '2008-05-20' AND '2021-03-15'
css
CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other...
For the dates of transactions with amount smaller than 3000, bin the date into year interval, and draw a line chart to show the trend of the number of records in each bin, list by the x axis in ascending please.
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 ORDER BY date_of_transaction
nvbench
CREATE TABLE table_33076 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text )
Which general service in India is a part of the zee variasi network?
SELECT "Service" FROM table_33076 WHERE "Origin of Programming" = 'india' AND "Genre" = 'general' AND "Network" = 'zee variasi'
wikisql
CREATE TABLE table_40146 ( "Value" text, "\u20ac equiv." text, "Diameter" text, "Weight" text, "Composition" text )
What is the coin with a equivalency of 0.30 made of?
SELECT "Composition" FROM table_40146 WHERE "\u20ac equiv." = '0.30'
wikisql
CREATE TABLE phone ( Name VARCHAR, Price VARCHAR )
List the names of phones in ascending order of price.
SELECT Name FROM phone ORDER BY Price
sql_create_context
CREATE TABLE table_2583036_1 ( camera VARCHAR, exposures VARCHAR )
how many times was the exposures 53?
SELECT COUNT(camera) FROM table_2583036_1 WHERE exposures = 53
sql_create_context
CREATE TABLE table_62253 ( "Draw" real, "Televotes" text, "Televote Points" text, "Jury Points" text, "Total" text, "Final Points" text )
What is the televote points for 0 jury points and 23 draws?
SELECT "Televote Points" FROM table_62253 WHERE "Jury Points" = '0' AND "Draw" = '23'
wikisql
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, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Next semester are their any upper level elective classes that do not meet on Friday ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ...
advising
CREATE TABLE table_204_794 ( id number, "iec\nworld plugs\nType" text, "standard" text, "power\nrating" text, "earthed" text, "polarised" text, "fused" text, "insulated\npins" text, "europlug\ncompatible" text )
what is the number of power rating for type a , b and c
SELECT COUNT(DISTINCT "power\nrating") FROM table_204_794 WHERE "iec\nworld plugs\nType" IN ('a', 'b', 'c')
squall
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...
医院编号为5498370里有多少个科室的平均医疗住院时长多于3天?
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5498370' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING AVG(gwyjzb.IN_HOSP_DAYS) > 3 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '5498370' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING AVG(fgwyjzb.IN_HO...
css
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, ...
before 1000 o'clock on tuesday is there a 747 that flies from BALTIMORE to SAN FRANCISCO
SELECT DISTINCT flight.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, equipment_sequence, flight WHERE (((aircraft.basic_type = '747' AND equipment_sequence.aircraft_code = aircraft.aircraft_code AND flight.aircraft_co...
atis
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...
查查医疗就诊85730231541中盐酸金霉素眼膏的外涂方法,每天的频次及每次的用量
SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE 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 = '85730231541' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸金霉素眼膏'
css
CREATE TABLE zzmzjzjlb ( 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...
查一下病人韦德润在1777463这家医院门诊被诊断出的病情不含有失眠的就诊记录
SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '韦德润' AND hz_info.YLJGDM = '1777463' AND NOT zzmzjzjlb.JZZDSM LIKE '%失眠%' UNION SELECT * FROM person_info JO...
css
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE bdmzjzjlb ( HXPLC number, HZX...
查查检测指标280143数值的平均值以及最值,是针对门诊诊断为牙龈出血的患者的
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.JCZBDM = '280...
css
CREATE TABLE table_12506 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
In what place did Bob Tway finish?
SELECT "Finish" FROM table_12506 WHERE "Player" = 'bob tway'
wikisql
CREATE TABLE table_name_23 ( interview VARCHAR, state VARCHAR, evening_gown VARCHAR )
What is the total interviews of Iowa, and with an evening gown smaller than 9.625?
SELECT COUNT(interview) FROM table_name_23 WHERE state = "iowa" AND evening_gown < 9.625
sql_create_context
CREATE TABLE table_50569 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What's the score of New Zealand?
SELECT "Score" FROM table_50569 WHERE "Country" = 'new zealand'
wikisql
CREATE TABLE table_23134 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
When sault ste. marie greyhounds (oha) is the college, junior, or club team how many nationalities are there?
SELECT COUNT("Nationality") FROM table_23134 WHERE "College/junior/club team" = 'Sault Ste. Marie Greyhounds (OHA)'
wikisql
CREATE TABLE table_name_60 ( Group VARCHAR, name VARCHAR )
What Group Song of Shine ?
SELECT Group AS song FROM table_name_60 WHERE name = "shine 王幸儿"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
Highest 50 average answer score.
SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) > 20...
sede
CREATE TABLE table_name_49 ( captain VARCHAR, manager VARCHAR )
Which captain's manager is Joe Royle?
SELECT captain FROM table_name_49 WHERE manager = "joe royle"
sql_create_context
CREATE TABLE table_40986 ( "Class" real, "Date" text, "Builder" text, "No. built" real, "1919 nos." text, "LMS Class" text, "LMS nos." text )
On which date was the class 157?
SELECT "Date" FROM table_40986 WHERE "Class" = '157'
wikisql
CREATE TABLE table_22839669_12 ( year INTEGER, money_list_rank VARCHAR )
In what year was his money list rank 3?
SELECT MIN(year) FROM table_22839669_12 WHERE money_list_rank = 3
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
编号为28349097的病患的检验报告单的报告日期在15年4月17日之后的是哪些住院就诊的?列出流水号
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '28349097' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2015-04-17')
css
CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VARCHAR(30), reports_to INTEGER, birth_date TIMESTAMP, hire_date TIMESTAMP, address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), ...
Show me a bar chart for how many invoices were billed from each state?, and show in ascending by the billing_state.
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY billing_state
nvbench
CREATE TABLE table_203_692 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text )
what is olle ahlunds club and his position ?
SELECT "club", "pos." FROM table_203_692 WHERE "name" = 'olle ahlund'
squall
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 demographic ...
provide the number of patients whose admission year is less than 2184 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2184" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_name_82 ( date VARCHAR, catalogue VARCHAR )
What date has a catalogue of 540 3622?
SELECT date FROM table_name_82 WHERE catalogue = "540 3622"
sql_create_context
CREATE TABLE table_21995420_6 ( school VARCHAR, basic_elements VARCHAR )
What is every school with basic elements of 52?
SELECT school FROM table_21995420_6 WHERE basic_elements = 52
sql_create_context
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 ( ...
give me the number of patients whose diagnoses long title is obesity, unspecified and lab test category is hematology?
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.long_title = "Obesity, unspecified" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_10979230_5 ( release_date VARCHAR, reference VARCHAR )
What release date is when kids-270 is a reference?
SELECT release_date FROM table_10979230_5 WHERE reference = "KIDS-270"
sql_create_context
CREATE TABLE table_28915 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
How many districts have John C. Calhoun as the incumbent?
SELECT COUNT("District") FROM table_28915 WHERE "Incumbent" = 'John C. Calhoun'
wikisql
CREATE TABLE table_64294 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
What is average ratings for Japanese title of , with episodes larger than 9?
SELECT "Average Ratings" FROM table_64294 WHERE "Episodes" > '9' AND "Japanese Title" = 'ホタルノヒカリ'
wikisql
CREATE TABLE table_17827271_1 ( actor_required VARCHAR, actor_in_original_production VARCHAR )
What were the requirements for the role played by Robert Austin in the original production?
SELECT actor_required FROM table_17827271_1 WHERE actor_in_original_production = "Robert Austin"
sql_create_context
CREATE TABLE table_14799 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Which team 2 had an aggregate score of 3-4 and a 2nd leg score of 0-2?
SELECT "Team 2" FROM table_14799 WHERE "Agg." = '3-4' AND "2nd leg" = '0-2'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
patient 80858 has made an admission until 2104?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 80858 AND STRFTIME('%y', admissions.admittime) <= '2104'
mimic_iii
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...
编号为02615390249的住院就诊中,入院途径是啥?代码呢
SELECT zyjzjlb.RYTJDM, zyjzjlb.RYTJMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '02615390249'
css
CREATE TABLE table_56941 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What team played at lake oval while away?
SELECT "Away team" FROM table_56941 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 ( row_id number, ...
what were the top four most frequent inputs event in 2104?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2104' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 4)
mimic_iii
CREATE TABLE table_68958 ( "Sport" text, "Competition name" text, "Competing entities" text, "Age groups" text, "Held every" text )
what is the competing entities when the age group is 18 or younger, held every is one year and the sport is table tennis?
SELECT "Competing entities" FROM table_68958 WHERE "Age groups" = '18 or younger' AND "Held every" = 'one year' AND "Sport" = 'table tennis'
wikisql
CREATE TABLE table_11734041_1 ( player VARCHAR, school_club_team_country VARCHAR )
What was the player name who came from Australia?
SELECT player FROM table_11734041_1 WHERE school_club_team_country = "Australia"
sql_create_context