context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_3890 ( "Model - Computer name" text, "CPU type" text, "No. of processors" text, "Period of operation" text, "Maximum peak performance ( Teraflops )" text, "Use" text )
Name the use for amd opteron dual-core 2.6ghz
SELECT "Use" FROM table_3890 WHERE "CPU type" = 'AMD Opteron dual-core 2.6GHz'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
在2018年4月25日到2019年7月26日期间7983940这个医疗机构处理过多少次异地就诊?
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '7983940' AND IN_HOSP_DATE BETWEEN '2018-04-25' AND '2019-07-26' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
CREATE TABLE table_name_64 ( Id VARCHAR )
What is the 2006 value of the 2011 grand slam tournaments?
SELECT 2006 FROM table_name_64 WHERE 2011 = "grand slam tournaments"
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 ) ...
how many patients with admission location as phys referral/normal deli were diagnosed for copd excerbation.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "COPD EXACERBATION"
mimicsql_data
CREATE TABLE table_name_89 ( heat INTEGER, athlete VARCHAR )
what is the heat when the athlete is anita pistone?
SELECT SUM(heat) FROM table_name_89 WHERE athlete = "anita pistone"
sql_create_context
CREATE TABLE table_68176 ( "Party" text, "Party List votes" real, "Vote percentage" text, "Total Seats" text, "Seat percentage" text )
What seat has a vote percentage of 100.0%
SELECT "Seat percentage" FROM table_68176 WHERE "Vote percentage" = '100.0%'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
how many patients were diagnosed with diabetes mellitus - type ii during the same hospital visit after having undergone a allopurinol until 2 years ago?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'allopurinol' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TI...
eicu
CREATE TABLE table_name_51 ( market_value___usd_million_ VARCHAR, headquarters VARCHAR )
What is the total market value of all corporations headquartered in Germany?
SELECT COUNT(market_value___usd_million_) FROM table_name_51 WHERE headquarters = "germany"
sql_create_context
CREATE TABLE table_2120 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" real, "Left" real, "Current Conference" text )
What is the latest founded year?
SELECT MAX("Founded") FROM table_2120
wikisql
CREATE TABLE driverStandings ( driverStandingsId INTEGER, raceId INTEGER, driverId INTEGER, points REAL, position INTEGER, positionText TEXT, wins INTEGER ) CREATE TABLE constructorStandings ( constructorStandingsId INTEGER, raceId INTEGER, constructorId INTEGER, points REAL...
What are the names of all the Japanese constructors that have earned more than 5 points, and count them by a pie chart
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name
nvbench
CREATE TABLE table_31168 ( "District" real, "Representative" text, "Party" text, "Residence" text, "First Elected" text, "Term Limited" real )
who is beavercreek's representative
SELECT "Representative" FROM table_31168 WHERE "Residence" = 'Beavercreek'
wikisql
CREATE TABLE table_26996293_7 ( position VARCHAR, pick__number VARCHAR )
What position was pick # 54?
SELECT position FROM table_26996293_7 WHERE pick__number = 54
sql_create_context
CREATE TABLE Student_Course_Attendance ( student_id INTEGER, course_id INTEGER, date_of_attendance DATETIME ) CREATE TABLE Candidates ( candidate_id INTEGER, candidate_details VARCHAR(255) ) CREATE TABLE Candidate_Assessments ( candidate_id INTEGER, qualification CHAR(15), assessment_d...
Bar chart of the number of course name from each course name, and I want to order by the Y-axis in desc.
SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY COUNT(course_name) DESC
nvbench
CREATE TABLE table_42416 ( "Season" text, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "Podiums" real, "Points" text, "Position" text )
What Series had 14 races and 12th position?
SELECT "Series" FROM table_42416 WHERE "Races" = '14' AND "Position" = '12th'
wikisql
CREATE TABLE table_76977 ( "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" real )
What is Gold, when Total is 6?
SELECT "Gold" FROM table_76977 WHERE "Total" = '6'
wikisql
CREATE TABLE table_204_553 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents in the final" text, "score in the final" text )
the match on november 12 , 1978 was on a hard surface . what was the surface of the previous match ?
SELECT "surface" FROM table_204_553 WHERE "date" < (SELECT "date" FROM table_204_553 WHERE "date" = '12 november 1978') ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Posts with many 'thank you' answers, ordered by views. Looking at posts shorter than 200 with the text `thank` somewhere in it, ordered by views
SELECT a.ParentId AS "post_link", COUNT(a.Id), SUM(q.ViewCount) / COUNT(a.Id) FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND LENGTH(a.Body) <= 200 AND (a.Body LIKE '%thank%') GROUP BY a.ParentId HAVING COUNT(a.Id) > 1 ORDER BY COUNT(a.Id) DESC, SUM(q.ViewCount...
sede
CREATE TABLE table_15463188_17 ( name VARCHAR, school_club_team VARCHAR )
How many players are listed for the school/club team Washington?
SELECT COUNT(name) FROM table_15463188_17 WHERE school_club_team = "Washington"
sql_create_context
CREATE TABLE table_9524 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
How much is the money ($) when the country is united states, to par is e and the score is 72-75-70-71=288?
SELECT SUM("Money ( $ )") FROM table_9524 WHERE "Country" = 'united states' AND "To par" = 'e' AND "Score" = '72-75-70-71=288'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
what is the new prescription of patient 015-59552 today vs. the one yesterday?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '015-59552') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
CREATE TABLE table_24943 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
What is the nation who won 1 bronze in the Olympics during 1924 1928?
SELECT "Nation" FROM table_24943 WHERE "Olympics" = '1924–1928' AND "Bronze" = '1'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDe...
Posts (Questions and Answers) based on a given tag and duration.
SELECT TIME_TO_STR(p.LastActivityDate, '%Y') AS YEAR, TIME_TO_STR(p.LastActivityDate, '%B') AS MONTH, MONTH(p.LastActivityDate) AS MONTH_NUM, COUNT(*) AS Total FROM Posts AS p, PostTags AS ptags, Tags AS t, PostTypes AS ptypes WHERE p.PostTypeId = ptypes.Id AND ptypes.Id IN (1, 2) AND p.Id = ptags.PostId AND ptags.TagI...
sede
CREATE TABLE table_35250 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many Gold does the Nation in Rank 12 with less than 2 Total medals have?
SELECT MAX("Gold") FROM table_35250 WHERE "Rank" = '12' AND "Total" < '2'
wikisql
CREATE TABLE nomination ( artwork_id number, festival_id number, result text ) CREATE TABLE festival_detail ( festival_id number, festival_name text, chair_name text, location text, year number, num_of_audience number ) CREATE TABLE artwork ( artwork_id number, type text, ...
What are the names of festivals held in year 2007?
SELECT festival_name FROM festival_detail WHERE year = 2007
spider
CREATE TABLE table_45374 ( "Channel" text, "Play-by-play" text, "Color commentator(s)" text, "Studio host" text, "Studio analysts" text )
Which channel has Joel Meyers as the Play by play commentator?
SELECT "Channel" FROM table_45374 WHERE "Play-by-play" = 'joel meyers'
wikisql
CREATE TABLE table_name_69 ( pick__number VARCHAR, nhl_team VARCHAR )
Which Pick # has an NHL team of detroit red wings?
SELECT pick__number FROM table_name_69 WHERE nhl_team = "detroit red wings"
sql_create_context
CREATE TABLE table_name_98 ( wins VARCHAR, second VARCHAR, races VARCHAR )
How many wins did the driver with 1 second and more than 12 races have?
SELECT wins FROM table_name_98 WHERE second = "1" AND races > 12
sql_create_context
CREATE TABLE table_203_408 ( id number, "rd." number, "grand prix" text, "date" text, "location" text, "pole position" text, "fastest lap" text, "winning driver" text, "constructor" text, "report" text )
how many times has nigel mansell been the winning driver ?
SELECT COUNT(*) FROM table_203_408 WHERE "winning driver" = 'nigel mansell'
squall
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 hz_info ( KH text, KLX number...
从2017年8月1日开始直到2020年3月1日内患者苏秀艾被开出的所有检验报告单的科室序列号以及名称?
SELECT jybgb.KSBM, jybgb.KSMC 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 person_...
css
CREATE TABLE table_1601792_3 ( language VARCHAR, station VARCHAR )
What is the language of the malacca fm station?
SELECT language FROM table_1601792_3 WHERE station = "Malacca FM"
sql_create_context
CREATE TABLE table_203_215 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
which competition was in tokyo , japan but came in 2nd position ?
SELECT "competition" FROM table_203_215 WHERE "venue" = 'tokyo, japan' AND "position" = 2
squall
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...
count the number of patients whose primary disease is hypertension;rule out coronary artery disease/cardiac cath and drug route is sc.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND prescriptions.route = "SC"
mimicsql_data
CREATE TABLE table_5210 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Venue" text, "Attendance" text )
Opponent of at new york giants had what venue?
SELECT "Venue" FROM table_5210 WHERE "Opponent" = 'at new york giants'
wikisql
CREATE TABLE table_5932 ( "Country" text, "Project Name" text, "Year startup" text, "Operator" text, "Peak" text )
What country did the project, Bonga SW; Aparo with a shell operator take place?
SELECT "Country" FROM table_5932 WHERE "Operator" = 'shell' AND "Project Name" = 'bonga sw; aparo'
wikisql
CREATE TABLE table_44821 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
Who was the 1999-2002 Years for Grizzlies small forward Player who was from the United States?
SELECT "Player" FROM table_44821 WHERE "Nationality" = 'united states' AND "Position" = 'small forward' AND "Years for Grizzlies" = '1999-2002'
wikisql
CREATE TABLE table_name_54 ( leading_scorer VARCHAR, home VARCHAR )
Who was the leading score in the game at the Warriors?
SELECT leading_scorer FROM table_name_54 WHERE home = "warriors"
sql_create_context
CREATE TABLE table_name_82 ( wins INTEGER, played VARCHAR, goal_difference VARCHAR, club VARCHAR )
What is the highest number of wins with a goal difference less than 4 at the Villarreal CF and more than 38 played?
SELECT MAX(wins) FROM table_name_82 WHERE goal_difference < 4 AND club = "villarreal cf" AND played > 38
sql_create_context
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 hz_info ( KH text, KLX number...
患者63825529的842142指标在06年12月24日到11年5月11日期间是怎样的
SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf...
css
CREATE TABLE table_21236 ( "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 was game 43?
SELECT COUNT("Record") FROM table_21236 WHERE "Game" = '43'
wikisql
CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant_id INTEGER, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Projects ( project_id INTEGER, organisation_id INTEGER, project_details VARCHAR(255) ) CREA...
When do all the researcher role staff stop working? Bin the time into weekday interval and count them with a bar chart, order by the the number of date to in asc.
SELECT date_to, COUNT(date_to) FROM Project_Staff ORDER BY COUNT(date_to)
nvbench
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
出院日期是哪一天?就是57313257288的那个医疗就诊
SELECT t_kc21.OUT_HOSP_DATE FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '57313257288'
css
CREATE TABLE table_name_46 ( player VARCHAR, total VARCHAR )
Who has a total of 272?
SELECT player FROM table_name_46 WHERE total = 272
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
患者56570950在二零零七年十月九日之后有哪些门诊就诊的检验报告单?列出门诊就诊流水号
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '56570950' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2007-10-09') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
css
CREATE TABLE table_name_54 ( year INTEGER, position VARCHAR, wnba_team VARCHAR )
What is the earliest year that includes a Seattle Storm guard?
SELECT MIN(year) FROM table_name_54 WHERE position = "guard" AND wnba_team = "seattle storm"
sql_create_context
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred...
Find the name and budget of departments whose budgets are more than the average budget Visualize by bar chart, and display names in descending order.
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY dept_name DESC
nvbench
CREATE TABLE table_18600760_18 ( township VARCHAR, land___sqmi__ VARCHAR )
What township is 34.781 square miles?
SELECT township FROM table_18600760_18 WHERE land___sqmi__ = "34.781"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id num...
what were the five most frequent drugs prescribed to male patients of the 20s in the same month after they had been diagnosed with other lung disease nec, this year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_name_82 ( international_mail INTEGER, total_freight_and_mail VARCHAR, year VARCHAR, domestic_freight VARCHAR, domestic_mail VARCHAR )
What is the international mail with the lowest number to have less than 72 domestic freight, 0 domestic mail later than 2012 with total freight and mail more than 4,695?
SELECT MIN(international_mail) FROM table_name_82 WHERE domestic_freight < 72 AND domestic_mail = 0 AND year < 2012 AND total_freight_and_mail > 4 OFFSET 695
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 death status and admission location of subject id 42067?
SELECT demographic.expire_flag, demographic.admission_location FROM demographic WHERE demographic.subject_id = "42067"
mimicsql_data
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, draw a line chart about the change of employee_id over hire_date , could you sort by the X-axis in desc?
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_name_37 ( frequency_mhz INTEGER, city_of_license VARCHAR )
What is the frequency for the city of Lamar, Colorado?
SELECT AVG(frequency_mhz) FROM table_name_37 WHERE city_of_license = "lamar, colorado"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
Are WRITING 220 and WRITING 303 available at the same time ?
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'WRITING' AND COUR...
advising
CREATE TABLE table_name_69 ( attendance VARCHAR, date VARCHAR )
How many people attended the game on December 2, 1951?
SELECT attendance FROM table_name_69 WHERE date = "december 2, 1951"
sql_create_context
CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE employee...
What is the last name of the student who received an A in the class with the code 10018?
SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018
spider
CREATE TABLE table_60862 ( "Year" real, "Award" text, "Category" text, "Nominated Work" text, "Result" text )
What was the nominated work, nominated for the drama league award before 2007?
SELECT "Nominated Work" FROM table_60862 WHERE "Result" = 'nominated' AND "Award" = 'drama league award' AND "Year" < '2007'
wikisql
CREATE TABLE table_name_64 ( years VARCHAR, engine_code VARCHAR, model VARCHAR )
During which years was the Model 318td (diesel) with the Engine code of m47d20 manufactured?
SELECT years FROM table_name_64 WHERE engine_code = "m47d20" AND model = "318td (diesel)"
sql_create_context
CREATE TABLE table_name_47 ( team VARCHAR, race_title VARCHAR )
What was the team that held the race title of Mallala?
SELECT team FROM table_name_47 WHERE race_title = "mallala"
sql_create_context
CREATE TABLE table_46597 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Who was the opponent in UFC 19?
SELECT "Opponent" FROM table_46597 WHERE "Event" = 'ufc 19'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod tim...
how many patients were prescribed iso-osmotic dextrose during the same hospital encounter after the diagnosis of chf nos, since 2102?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在07年4月13日到11年3月11日这段时间里,参保人61225965门诊检查费用是多少?
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '61225965' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2007-04-13' AND '2011-03-11' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg...
css
CREATE TABLE table_name_23 ( winner VARCHAR, tournament VARCHAR )
What is the winners name at the western open?
SELECT winner FROM table_name_23 WHERE tournament = "western open"
sql_create_context
CREATE TABLE table_name_83 ( home_team VARCHAR )
What was the home team score for the game where Hawthorn is the home team?
SELECT home_team AS score FROM table_name_83 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE table_name_22 ( wins VARCHAR, events INTEGER )
How many wins did he have when he played under 2 events?
SELECT COUNT(wins) FROM table_name_22 WHERE events < 2
sql_create_context
CREATE TABLE table_22307 ( "English" text, "German" text, "Dutch" text, "Latin" text, "Romanian" text, "Portuguese" text, "Spanish" text, "Italian" text, "French" text, "Greek (Modern)" text, "Bulgarian" text, "Macedonian" text, "Polish (extinct)" text )
Name the bulgarian for jullie hadden gehoord
SELECT "Bulgarian" FROM table_22307 WHERE "Dutch" = 'jullie hadden gehoord'
wikisql
CREATE TABLE table_70684 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
What was the final score when the Denver Broncos were the visiting team?
SELECT "Final Score" FROM table_70684 WHERE "Visiting Team" = 'denver broncos'
wikisql
CREATE TABLE table_204_362 ( id number, "episode" number, "airdate" text, "game 1" text, "game 2" text, "game 3" text, "viewers" text )
what was the air date of the first episode ?
SELECT "airdate" FROM table_204_362 WHERE "episode" = 1
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 prescriptions ( subject_id text, hadm_id...
give me the number of patients whose year of death is less than or equal to 2180 and procedure long title is local excision of lesion or tissue of bone, scapula, clavicle, and thorax [ribs and sternum]?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2180.0" AND procedures.long_title = "Local excision of lesion or tissue of bone, scapula, clavicle, and thorax [ribs and sternum]"
mimicsql_data
CREATE TABLE table_name_33 ( country VARCHAR, score VARCHAR )
Name the country with a score of 69-71=140.
SELECT country FROM table_name_33 WHERE score = 69 - 71 = 140
sql_create_context
CREATE TABLE table_214920_1 ( seat_of_rcm VARCHAR, density__pop_per_km2_ VARCHAR )
What is the seat of the county that has a density of 14.1?
SELECT seat_of_rcm FROM table_214920_1 WHERE density__pop_per_km2_ = "14.1"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose death status is 0 and diagnoses long title is atrial fibrillation?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Atrial fibrillation"
mimicsql_data
CREATE TABLE table_73010 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
Name the total number in the series written by john banas and directed by pino amenta
SELECT COUNT("No. in series") FROM table_73010 WHERE "Written by" = 'John Banas' AND "Directed by" = 'Pino Amenta'
wikisql
CREATE TABLE table_203_763 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
what was the lowest position ramon gonzalez came in ?
SELECT "position" FROM table_203_763 ORDER BY "position" DESC LIMIT 1
squall
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE aircraft ( ...
does AA fly from PITTSBURGH to ATLANTA
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'AA') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.to_airport = AIRPORT_SE...
atis
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
what is the top five of the frequent input event in 2105?
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) = '2105' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 5)
mimic_iii
CREATE TABLE table_11318462_29 ( location VARCHAR, school VARCHAR )
What is the location of the school named Brisbane Girls' Grammar School?
SELECT location FROM table_11318462_29 WHERE school = "Brisbane Girls' Grammar school"
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...
how many patients are diagnosed with shock unspecified and administered through buccal drug route?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Shock, unspecified" AND prescriptions.route = "BUCCAL"
mimicsql_data
CREATE TABLE table_name_21 ( first_appearance VARCHAR, character VARCHAR )
Where did the character of Aiden Burn csi detective first appear?
SELECT first_appearance FROM table_name_21 WHERE character = "aiden burn csi detective"
sql_create_context
CREATE TABLE table_38949 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the Bronze cumulative number for less than 0 gold?
SELECT SUM("Bronze") FROM table_38949 WHERE "Gold" < '0'
wikisql
CREATE TABLE table_8522 ( "Player" text, "Position" text, "Premier League" real, "FA Cup" real, "League Cup" real, "UEFA Cup" real, "Total" real )
What is the total when the league cup is less than 1, and the fa cup is less than 1?
SELECT SUM("Total") FROM table_8522 WHERE "League Cup" < '1' AND "FA Cup" < '1'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other,...
Number of Edits per Posts.
SELECT PostId, COUNT(*) FROM PostHistory WHERE NOT PostId IS NULL GROUP BY PostId ORDER BY PostId, NEWID()
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, ...
count the number of patients whose days of hospital stay is greater than 17 and lab test name is bilirubin, total?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "17" AND lab.label = "Bilirubin, Total"
mimicsql_data
CREATE TABLE table_59447 ( "Party" text, "% votes" real, "% change" real, "Seats" real, "Change" real )
What are the fewest seats with fewer than 5.4% seats and more than -1 change?
SELECT MIN("Seats") FROM table_59447 WHERE "% votes" < '5.4' AND "Change" > '-1'
wikisql
CREATE TABLE table_72933 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
How many results are listed for week 13?
SELECT COUNT("Result") FROM table_72933 WHERE "Week" = '13'
wikisql
CREATE TABLE table_4122 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What team did the New York Rangers recruit a player from?
SELECT "College/junior/club team" FROM table_4122 WHERE "NHL team" = 'New York Rangers'
wikisql
CREATE TABLE table_name_53 ( ergative VARCHAR, dative VARCHAR )
What is the ergative for the dative (i)mas?
SELECT ergative FROM table_name_53 WHERE dative = "(i)mas"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
Top 100 questions that are inactive for last six months. Top 100 questions that are inactive for last six months and still unanswered. This query helpful to achieve 'Archaeologist' badge in stack overflow.
SELECT * FROM Posts WHERE LastActivityDate < (CURRENT_TIMESTAMP() - 180) AND AcceptedAnswerId IS NULL AND Tags LIKE '%<java>%' ORDER BY LastActivityDate DESC LIMIT 100
sede
CREATE TABLE table_name_20 ( code__iata_ VARCHAR, total_cargo__metric_tonnes_ VARCHAR )
What is the IATA code of the airport that has a Total Cargo of 1,838,894 Metric Tonnes?
SELECT code__iata_ FROM table_name_20 WHERE total_cargo__metric_tonnes_ = "1,838,894"
sql_create_context
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, ...
look for the maximum age of patients whose ethnicity is white and hospital stay is 4 days.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay = "4"
mimicsql_data
CREATE TABLE table_25146455_1 ( winnings VARCHAR, driver VARCHAR )
How much did Jeff Burton win?
SELECT winnings FROM table_25146455_1 WHERE driver = "Jeff Burton"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
57735254801的医疗就诊记录里益心舒胶囊社保报销三目录的统一编码
SELECT SOC_SRT_DIRE_CD FROM t_kc22 WHERE MED_CLINIC_ID = '57735254801' AND SOC_SRT_DIRE_NM = '益心舒胶囊'
css
CREATE TABLE table_train_35 ( "id" int, "pregnancy_or_lactation" bool, "glucocorticoid_history" bool, "impaired_consciousness" bool, "hematologic_disease" bool, "glasgow_come_score_gcs" int, "liver_disease" bool, "NOUSE" float )
breast feeding female
SELECT * FROM table_train_35 WHERE pregnancy_or_lactation = 1
criteria2sql
CREATE TABLE table_38648 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Which 2009 has a 2008 of wta premier mandatory tournaments?
SELECT "2009" FROM table_38648 WHERE "2008" = 'wta premier mandatory tournaments'
wikisql
CREATE TABLE table_203_828 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number )
how many total wins were recorded on the table ?
SELECT COUNT(*) FROM table_203_828 WHERE "result" = 'w'
squall
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( c...
Does any course have MO 503 as an enforced prerequisite ?
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'MO' AND COURSE_0.number = 503 AND COURSE_1.course_id = course_prerequisite.course_id
advising
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
Week Five Homework Ordinal Three.
SELECT TagName, AVG(Score * 1.0) FROM Tags AS t JOIN PostTags AS tx ON t.Id = tx.TagId JOIN Posts AS p ON p.Id = tx.PostId WHERE DATEDIFF(month, p.CreationDate, GETDATE()) < 1 AND p.PostTypeId = 1 GROUP BY p.Id, TagName ORDER BY AVG(Score * 1.0)
sede
CREATE TABLE table_26375386_23 ( total VARCHAR, vote_percentage VARCHAR )
What was the total number when the vote percentage was 44.8%?
SELECT COUNT(total) FROM table_26375386_23 WHERE vote_percentage = "44.8%"
sql_create_context
CREATE TABLE table_204_807 ( id number, "date" text, "winner" text, "runner-up" text, "result" text, "site" text, "attendance" number )
which team , ranked first , also finished as winner in the 1985 acc women 's basketball tournament ?
SELECT "winner" FROM table_204_807 WHERE "date" = 1985
squall
CREATE TABLE table_2562572_19 ( type VARCHAR, settlement VARCHAR )
What type is the settlement of Lok?
SELECT type FROM table_2562572_19 WHERE settlement = "Lok"
sql_create_context
CREATE TABLE table_49568 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
What was the opponent of the game when the reocrd was 0-12?
SELECT "Opponent" FROM table_49568 WHERE "Record" = '0-12'
wikisql
CREATE TABLE table_name_2 ( tns_sofres_6_2_09 VARCHAR, ifop_5_30_09 VARCHAR )
What was the TNS-Sofres when the Iflop was 5%?
SELECT tns_sofres_6_2_09 FROM table_name_2 WHERE ifop_5_30_09 = "5%"
sql_create_context