context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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, good_feedback int, tough_...
For IOE courses in the 400 / 500 level , which have the least workload ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'IOE' AND program_course.workload = (SELECT MIN(PROGRA...
advising
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduct...
Comparing all of the courses I have taken what was the hardest one ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) ...
advising
CREATE TABLE table_name_1 ( location_attendance VARCHAR, date VARCHAR )
Where is the location of attendance for the Date of december 14?
SELECT location_attendance FROM table_name_1 WHERE date = "december 14"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
give me the four most common diagnoses until 2101?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2101' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_name_40 ( ashmolean VARCHAR, harrison VARCHAR, image VARCHAR )
What is the number of Ashmolean with 14s Harrison, and image less than 542?
SELECT COUNT(ashmolean) FROM table_name_40 WHERE harrison = "14s" AND image < 542
sql_create_context
CREATE TABLE table_20725 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
Name the most crowd for saturday 16 february
SELECT MAX("Crowd") FROM table_20725 WHERE "Date" = 'Saturday 16 February'
wikisql
CREATE TABLE table_23313 ( "Verbs" text, "Yo" text, "T\u00fa" text, "Vos (*)" text, "\u00c9l / Ella / Usted" text, "Nosotros / Nosotras" text, "Vosotros / Vosotras" text, "Ellos / Ellas / Ustedes" text )
What are all the conjugated forms of the verb where the el/ ella/usted verb is piense?
SELECT "Nosotros / Nosotras" FROM table_23313 WHERE "\u00c9l / Ella / Usted" = 'piense'
wikisql
CREATE TABLE table_76215 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real )
What Country is Player Sam Snead with a To par of less than 5 from?
SELECT "Country" FROM table_76215 WHERE "To par" < '5' AND "Player" = 'sam snead'
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...
when was the first time patient 002-21509 was until 4 years ago diagnosed with hyperglycemia?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-21509')) AND diagnosis.diagnosisname = 'hyperglycemia' AND DA...
eicu
CREATE TABLE table_21418 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
who did highest rebounds in the game with score w 105 88 (ot)
SELECT "High rebounds" FROM table_21418 WHERE "Score" = 'W 105–88 (OT)'
wikisql
CREATE TABLE table_name_2 ( date VARCHAR, edition VARCHAR, opponent VARCHAR )
When was the 1991 world group I with the opponent of Li Fang?
SELECT date FROM table_name_2 WHERE edition = "1991 world group i" AND opponent = "li fang"
sql_create_context
CREATE TABLE table_28125 ( "Stage" real, "Winner" text, "General Classification" text, "Points Classification" text, "Mountains Classification" text, "Young Riders Classification" text, "Team Classification" text )
What was the latest stage won by Mikhail Ignatiev?
SELECT MAX("Stage") FROM table_28125 WHERE "Winner" = 'Mikhail Ignatiev'
wikisql
CREATE TABLE table_50217 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text, "Competition" text, "Man of the Match" text )
Which Venue is listed under the Date of 21st?
SELECT "Venue" FROM table_50217 WHERE "Date" = '21st'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在1409186这个医院的患者戚鹏鲸,他的入院诊断疾病名称中包含分化的医疗就诊记录的编号是哪些
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '戚鹏鲸' AND qtb.MED_SER_ORG_NO = '1409186' AND qtb.IN_DIAG_DIS_NM LIKE '%分化%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '戚鹏鲸' AND gyb.MED_SER_ORG_NO = '1409186' AND gyb.IN_DIAG_DIS_NM LIKE '%分化%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb....
css
CREATE TABLE table_18365784_3 ( operator VARCHAR, departure VARCHAR )
Who was the train operator when the train departed at 11.02 in 1922?
SELECT operator FROM table_18365784_3 WHERE departure = "11.02"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
07088619663的检验报告单是什么标本代码和名称,状态怎样
SELECT jybgb.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '07088619663'
css
CREATE TABLE table_name_88 ( outcome VARCHAR, partner VARCHAR, year VARCHAR )
What was the outcome in 1982 with Kang Haeng-Suk as partner?
SELECT outcome FROM table_name_88 WHERE partner = "kang haeng-suk" AND year = "1982"
sql_create_context
CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text,...
Pie. how many books fall into each category?
SELECT Category, COUNT(*) FROM book_club GROUP BY Category
nvbench
CREATE TABLE table_48864 ( "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real )
Who has a react smaller than 0.149 and a lane smaller than 6?
SELECT "Name" FROM table_48864 WHERE "React" < '0.149' AND "Lane" < '6'
wikisql
CREATE TABLE table_name_71 ( name VARCHAR, construction_completed VARCHAR )
What name completed construction on 09/19/2008?
SELECT name FROM table_name_71 WHERE construction_completed = "09/19/2008"
sql_create_context
CREATE TABLE table_name_13 ( home_team VARCHAR, away_team VARCHAR )
Who was Geelong's home opponent?
SELECT home_team FROM table_name_13 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
在医院2339646中,查出患者33997628在科室名不包括化疗的就诊科室的门诊就诊记录的流水号有哪些
SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '33997628' AND hz_info.YLJGDM = '2339646' AND NOT zzmzjzjlb.JZKSMC LIKE '%化疗%' UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOIN fzzmzjzjlb ON hz_info....
css
CREATE TABLE table_17619 ( "Number in series" real, "Broadcast Order" text, "Title" text, "Villain/s" text, "U.S. Air Date" text, "Production Code" text )
What's the title of the episode with a broadcast order s04 e01?
SELECT "Title" FROM table_17619 WHERE "Broadcast Order" = 'S04 E01'
wikisql
CREATE TABLE table_204_193 ( id number, "year" number, "artist" text, "album" text, "chart position" text, "role" text )
how many albums made the charts in 1998 ?
SELECT COUNT("album") FROM table_204_193 WHERE "year" = 1998
squall
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 ) ...
which patients have item id 50971?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50971"
mimicsql_data
CREATE TABLE table_name_28 ( runs VARCHAR, batsmen VARCHAR )
Which runs had james bryant graeme welch as Batsmen?
SELECT runs FROM table_name_28 WHERE batsmen = "james bryant graeme welch"
sql_create_context
CREATE TABLE table_19112 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
how many points for with points against being 177
SELECT COUNT("Points for") FROM table_19112 WHERE "Points against" = '177'
wikisql
CREATE TABLE table_43939 ( "Rank" text, "Event" text, "Place" text, "Name" text, "Prize" text )
What is Rank, when Event is 'LAPT4 S o Paulo'?
SELECT "Rank" FROM table_43939 WHERE "Event" = 'lapt4 são paulo'
wikisql
CREATE TABLE table_38457 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What series episode has deli meats under segment B?
SELECT "Series Ep." FROM table_38457 WHERE "Segment B" = 'deli meats'
wikisql
CREATE TABLE table_8642 ( "Game" real, "Date" real, "Opponent" text, "Score" text, "Decision" text, "Location/Attendance" text, "Record" text )
Who is the opponent of the game with a game number less than 5 with a 2-0-0 record?
SELECT "Opponent" FROM table_8642 WHERE "Game" < '5' AND "Record" = '2-0-0'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
how many days have elapsed since the last diagnosis of subarachnoid hemorrhage on patient 80555 in this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'subarachnoid hemorrhage') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admi...
mimic_iii
CREATE TABLE table_name_8 ( kapampangan VARCHAR, malay VARCHAR )
What is the Kapampangan word for the Malay word aku?
SELECT kapampangan FROM table_name_8 WHERE malay = "aku"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
tell me, what were the three most common procedures a year before?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
在医疗就诊02340681793中,科室名里有手外科这几个字的科室开过的医疗费用明细项目
SELECT * FROM t_kc22 WHERE MED_CLINIC_ID = '02340681793' AND MED_ORG_DEPT_NM LIKE '%手外科%'
css
CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rating float, state varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, ...
How many neighborhoods have a business with rating 5 in Madison ?
SELECT COUNT(DISTINCT (neighborhood.neighborhood_name)) FROM business, neighborhood WHERE business.city = 'Madison' AND business.rating = 5 AND neighborhood.business_id = business.business_id
yelp
CREATE TABLE table_name_6 ( tournament VARCHAR, date VARCHAR )
Which Tournament has a Date of jul 14, 2013?
SELECT tournament FROM table_name_6 WHERE date = "jul 14, 2013"
sql_create_context
CREATE TABLE table_11533 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was Melbourne's away team score?
SELECT "Away team score" FROM table_11533 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
All Answers with some attributes.
SELECT a.Score, q.Id, q.OwnerUserId, a.Score, q.CreationDate, q.Tags, a.Score, a.Score, a.Id, a.OwnerUserId, a.Score, a.CreationDate FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE q.CreationDate >= '2013-01-01 00:00:00' AND a.CreationDate >= '2013-04-01 00:00:00' AND a.CreationDate < '2013-07-01 00:00:00'
sede
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE has_allergy ( stuid number, allergy text )
How many allergy entries are there?
SELECT COUNT(DISTINCT allergy) FROM allergy_type
spider
CREATE TABLE table_13857 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
From what catalog was the release from Sundazed label?
SELECT "Catalog" FROM table_13857 WHERE "Label" = 'sundazed'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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_labitems ( row_id number, itemid num...
were prednisone, lr or milk of magnesia prescribed to patient 6990 in their last hospital visit?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6990 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug IN ('prednisone', 'lr', 'milk of magnesia')
mimic_iii
CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, ...
What are the ids and names of the medicine that can interact with two or more enzymes.
SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id
nvbench
CREATE TABLE table_name_79 ( attendance INTEGER, match VARCHAR, opponent VARCHAR, result VARCHAR )
How many Attendance has a Opponent of west bromwich albion, and a Result of 3 3, and a Match larger than 20?
SELECT SUM(attendance) FROM table_name_79 WHERE opponent = "west bromwich albion" AND result = "3 – 3" AND match > 20
sql_create_context
CREATE TABLE table_26263322_1 ( hometown VARCHAR, result VARCHAR )
How many times was the result is hired by serepisos?
SELECT COUNT(hometown) FROM table_26263322_1 WHERE result = "Hired by Serepisos"
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 Students ( student_id INTEGER, student_details VARCHAR(255) ) CREATE TABLE Courses ( ...
Bar chart of the number of course name from each course name, and I want to show y axis from low to high order.
SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY COUNT(course_name)
nvbench
CREATE TABLE table_29624 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
Against what opponent did the game end 5-4?
SELECT "Opponent" FROM table_29624 WHERE "Score" = '5-4'
wikisql
CREATE TABLE table_1852 ( "Main contestant" text, "Co-contestant (Yaar vs. Pyaar)" text, "Date performed" text, "Scores by each individual judge" text, "Total score/week" text, "Position" text, "Status" text )
What were the scores by the individual judges for Karanvir Bohra on August 13?
SELECT "Scores by each individual judge" FROM table_1852 WHERE "Main contestant" = 'Karanvir Bohra' AND "Date performed" = 'August 13'
wikisql
CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHA...
What are the first names and ids for customers who have two or more accounts, and show by the y axis in asc please.
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.customer_id
nvbench
CREATE TABLE table_name_7 ( place_of_birth VARCHAR, elevator VARCHAR, elector VARCHAR )
What is the place of birth when the elevator is Nicholas IV, and elector is Napoleone Orsini Frangipani?
SELECT place_of_birth FROM table_name_7 WHERE elevator = "nicholas iv" AND elector = "napoleone orsini frangipani"
sql_create_context
CREATE TABLE table_63297 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real )
What's the smallest react of Zimbabwe, ranked after 1 in a lane after 3 and a time less than 20.3?
SELECT MIN("React") FROM table_63297 WHERE "Lane" > '3' AND "Time" < '20.3' AND "Nationality" = 'zimbabwe' AND "Rank" > '1'
wikisql
CREATE TABLE table_52436 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest total medals a team with less than 15 gold, less than 5 bronze, and a rank larger than 10 has?
SELECT MAX("Total") FROM table_52436 WHERE "Gold" < '15' AND "Bronze" < '5' AND "Rank" > '10'
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...
列出患者赵星波被开出的所有检验报告单在2011-11-25到2013-05-15期间的检验报告单号是什么?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '赵星波' AND jybg...
css
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...
what is the number of patients whose primary disease is upper gi bleed and year of death is less than or equal to 2179?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "UPPER GI BLEED" AND demographic.dod_year <= "2179.0"
mimicsql_data
CREATE TABLE table_54723 ( "Year" text, "Venue" text, "Winner" text, "Country" text, "Score" text )
who was the winner in 2003?
SELECT "Winner" FROM table_54723 WHERE "Year" = '2003'
wikisql
CREATE TABLE table_28787871_3 ( no_in_season VARCHAR, original_air_date VARCHAR )
How many numbers in the season have an air date of June 3, 2012?
SELECT COUNT(no_in_season) FROM table_28787871_3 WHERE original_air_date = "June 3, 2012"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
Find the diagnoses of Rafael Stewart.
SELECT diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Rafael Stewart"
mimicsql_data
CREATE TABLE table_55503 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real )
what is the rank when the total is 39 in the county of dublin and the matches is less than 4?
SELECT AVG("Rank") FROM table_55503 WHERE "Total" = '39' AND "County" = 'dublin' AND "Matches" < '4'
wikisql
CREATE TABLE table_71049 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What game score was there for the team with a record of 84-56?
SELECT "Score" FROM table_71049 WHERE "Record" = '84-56'
wikisql
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
what are some good restaurants in mountain view for arabic food ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_name_98 ( interview INTEGER, swimsuit INTEGER )
What is the greatest interview that has a swimsuit less than 8.838?
SELECT MAX(interview) FROM table_name_98 WHERE swimsuit < 8.838
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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
during the previous year what were the three most common diagnoses that patients were given in the same month after receiving insert endotracheal tube?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_55757 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What sport has a Gold larger than 0, and a Silver of 2?
SELECT "Sport" FROM table_55757 WHERE "Gold" > '0' AND "Silver" = '2'
wikisql
CREATE TABLE table_name_42 ( home_team VARCHAR, away_team VARCHAR )
When the Away team is footscray, what is the Home team playing?
SELECT home_team FROM table_name_42 WHERE away_team = "footscray"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, ...
how many times does patient 85895 receive a ph test the last month?
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start...
mimic_iii
CREATE TABLE table_name_81 ( year VARCHAR, game VARCHAR )
what is the year for borderlands 2?
SELECT year FROM table_name_81 WHERE game = "borderlands 2"
sql_create_context
CREATE TABLE table_44798 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Comp" text, "Attendance" text )
Which Comp is on 2004-10-17?
SELECT "Comp" FROM table_44798 WHERE "Date" = '2004-10-17'
wikisql
CREATE TABLE table_72871 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
When @ new orleans is the team who has the highest amount of rebounds?
SELECT "High rebounds" FROM table_72871 WHERE "Team" = '@ New Orleans'
wikisql
CREATE TABLE table_59752 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real )
What is the To par when Lanny Wadkins is the player?
SELECT "To par" FROM table_59752 WHERE "Player" = 'lanny wadkins'
wikisql
CREATE TABLE table_19534874_2 ( indoor VARCHAR, region VARCHAR )
What is the indoor number for the NER region?
SELECT COUNT(indoor) FROM table_19534874_2 WHERE region = "NER"
sql_create_context
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), ...
How many courses for each course description? Show me a stacked bar chart The x-axis is course description and group by instructor's first name, order in ascending by the Y-axis.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME, CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION)
nvbench
CREATE TABLE table_51990 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest amount of silver medals Iceland, who has less than 87 medals, has?
SELECT MIN("Silver") FROM table_51990 WHERE "Nation" = 'iceland' AND "Total" < '87'
wikisql
CREATE TABLE table_name_61 ( place VARCHAR, player VARCHAR )
What did Fred Couples place?
SELECT place FROM table_name_61 WHERE player = "fred couples"
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 the number of patients whose discharge location is snf and diagnoses short title is coagulat defect nec/nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.short_title = "Coagulat defect NEC/NOS"
mimicsql_data
CREATE TABLE table_6848 ( "Rank" real, "Country" text, "Claimant" text, "Highest point" text, "Height" text )
What is the most points for South Ossetia?
SELECT "Highest point" FROM table_6848 WHERE "Country" = 'south ossetia'
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...
give me the number of patients whose drug type is base and lab test name is red blood cells?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Red Blood Cells"
mimicsql_data
CREATE TABLE table_65076 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
What is the lowest prominence for a peak with elevation of 3,615 meters?
SELECT MIN("Prominence (m)") FROM table_65076 WHERE "Elevation (m)" = '3,615'
wikisql
CREATE TABLE table_1013129_3 ( pick VARCHAR, college_junior_club_team VARCHAR )
What's the pick number of the player from Springfield Olympics (Nejhl)?
SELECT pick FROM table_1013129_3 WHERE college_junior_club_team = "Springfield Olympics (NEJHL)"
sql_create_context
CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_or_boarding text, year_entered_competition number, school_colors text ) CREATE TABLE player ( player_id number, player text, ...
What is the school color of the school with the largest enrollment?
SELECT school_colors FROM school ORDER BY enrollment DESC LIMIT 1
spider
CREATE TABLE table_1341718_44 ( result VARCHAR, incumbent VARCHAR )
What was the result when Ray Roberts was elected?
SELECT result FROM table_1341718_44 WHERE incumbent = "Ray Roberts"
sql_create_context
CREATE TABLE table_27734769_9 ( score VARCHAR, date VARCHAR )
How many scores where achieved on January 19?
SELECT COUNT(score) FROM table_27734769_9 WHERE date = "January 19"
sql_create_context
CREATE TABLE table_name_24 ( time VARCHAR, news_freq VARCHAR, local_networked VARCHAR, ad_freq VARCHAR )
Which time has a local/networked value of Local, ad frequency of every 20 minutes, and news frequency of n/a after 7PM news?
SELECT time FROM table_name_24 WHERE local_networked = "local" AND ad_freq = "20 minutes" AND news_freq = "n/a after 7pm news"
sql_create_context
CREATE TABLE table_16238 ( "Province" text, "Population (2004 estimate)" real, "Area (km\u00b2)" real, "Density" text, "GDP (2003, PPS in mil. \u20ac )" real, "GDP per cap. (2003, in \u20ac)" real )
What is Friesland's gdp per capita?
SELECT MIN("GDP per cap. (2003, in \u20ac)") FROM table_16238 WHERE "Province" = 'Friesland'
wikisql
CREATE TABLE table_13789248_2 ( points INTEGER, highest_position VARCHAR )
what is the minimum points with highest position being 1
SELECT MIN(points) FROM table_13789248_2 WHERE highest_position = 1
sql_create_context
CREATE TABLE table_22862203_2 ( terps_points VARCHAR, date VARCHAR )
What are the terps points for the nov. 25/05 game?
SELECT terps_points FROM table_22862203_2 WHERE date = "Nov. 25/05"
sql_create_context
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...
患者周庆生自二零零二年二月十日开始,截止到二零二一年九月二十七日,由哪几位医务人员为其检测指标093591的,查查这些医务人员的工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, na...
On Monday and Wednesday is 399 offered ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
CREATE TABLE table_name_46 ( fsb_speed VARCHAR, model_number VARCHAR )
Which FSB Speed has a Model Number of c7-m 765?
SELECT fsb_speed FROM table_name_46 WHERE model_number = "c7-m 765"
sql_create_context
CREATE TABLE table_203_348 ( id number, "number" number, "name" text, "team" text, "position" text, "years with franchise" text, "note" text )
which of the listed teams has the most players elected to the hall of fame according to this table ?
SELECT "team" FROM table_203_348 GROUP BY "team" ORDER BY COUNT(*) DESC LIMIT 1
squall
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 drug name of the drug code mago140?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "MAGO140"
mimicsql_data
CREATE TABLE table_name_52 ( episode VARCHAR, result VARCHAR, nominee_s_ VARCHAR )
For what episode was the nominee (s) Walon Green, Joe Sachs nominated as a result?
SELECT episode FROM table_name_52 WHERE result = "nominated" AND nominee_s_ = "walon green, joe sachs"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
知不知道开出检验报告单41571015009的科室名称是啥?编码呢
SELECT KSBM, KSMC FROM jybgb WHERE BGDH = '41571015009'
css
CREATE TABLE table_19624708_1 ( number VARCHAR, sp VARCHAR, finishing_position VARCHAR )
How many numbers have sp of 20/1 and a finishing position of fence 19?
SELECT COUNT(number) FROM table_19624708_1 WHERE sp = "20/1" AND finishing_position = "Fence 19"
sql_create_context
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_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...
A bar chart for what are the number of the dates of transactions with at least 100 share count or amount bigger than 100?
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100
nvbench
CREATE TABLE table_23297 ( "#" real, "Player" text, "Age" real, "Australian Open" real, "French Open" real, "Wimbledon" real, "US Open" real )
Who won the US Open in 1937?
SELECT "Player" FROM table_23297 WHERE "US Open" = '1937'
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, rank y axis from low to high order please.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
能列举出患者编号87435774在2013年5月27日到2018年10月29日内所有检验报告单中的标本搜集部位吗?
SELECT jybgb.BBCJBW FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '87435774' AND jybgb.BGRQ BETWEEN '2013-05-27' AND '201...
css
CREATE TABLE table_8412 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real, "Record" text )
How many people attended the game on week 3?
SELECT AVG("Attendance") FROM table_8412 WHERE "Week" = '3'
wikisql
CREATE TABLE table_name_75 ( event VARCHAR )
What is the 2010 11 when the Event is colonial square ladies classic?
SELECT 2010 AS _11 FROM table_name_75 WHERE event = "colonial square ladies classic"
sql_create_context
CREATE TABLE table_31562 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
Tell me the winning driver for avusrennen
SELECT "Winning driver" FROM table_31562 WHERE "Name" = 'avusrennen'
wikisql
CREATE TABLE table_20780 ( "Model number" text, "sSpec number" text, "Frequency" text, "L2 cache" text, "FSB" text, "Mult." text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text )
What is the l2 cache for the model with a release price of $669?
SELECT "L2 cache" FROM table_20780 WHERE "Release price ( USD )" = '$669'
wikisql