context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_21734764_1 ( population_density___km²_2010_ VARCHAR, administrative_division VARCHAR )
What is the population density of bandung regency?
SELECT population_density___km²_2010_ FROM table_21734764_1 WHERE administrative_division = "Bandung Regency"
sql_create_context
CREATE TABLE table_name_74 ( date VARCHAR, loss VARCHAR )
What was the date of the game that had a loss of Rojas (9 8)?
SELECT date FROM table_name_74 WHERE loss = "rojas (9–8)"
sql_create_context
CREATE TABLE table_12000 ( "Date" text, "Round" text, "Attendance" text, "Opposition" text, "Stadium" text )
What round has an attendance of 12,127?
SELECT "Round" FROM table_12000 WHERE "Attendance" = '12,127'
wikisql
CREATE TABLE invoices ( id INTEGER, customer_id INTEGER, invoice_date TIMESTAMP, billing_address VARCHAR(70), billing_city VARCHAR(40), billing_state VARCHAR(40), billing_country VARCHAR(40), billing_postal_code VARCHAR(10), total NUMERIC(10,2) ) CREATE TABLE albums ( id INTEGER...
what are the top 5 countries by number of invoices and how many do they have?
SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5
nvbench
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 diagnoses long title is benign neoplasm of spinal meninges and drug route is sl?
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 = "Benign neoplasm of spinal meninges" AND prescriptions.route = "SL"
mimicsql_data
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...
以前患者07290816有过什么异常情况吗?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb....
css
CREATE TABLE table_name_54 ( viewers__m_ INTEGER, rating VARCHAR, episode VARCHAR )
What Viewers (m) has a Rating of 1.7, and an Episode of the game of life?
SELECT MAX(viewers__m_) FROM table_name_54 WHERE rating = "1.7" AND episode = "the game of life"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( c...
how many days have it been since patient 006-172277 was diagnosed with a hypernatremia on the current hospital visit for the first time?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '006-172277...
eicu
CREATE TABLE table_name_30 ( record VARCHAR, date VARCHAR )
What is Record, when Date is Oct 19?
SELECT record FROM table_name_30 WHERE date = "oct 19"
sql_create_context
CREATE TABLE table_40659 ( "Match" real, "Date" text, "Tournament" text, "Location" text, "Opponent team" text, "Score" text )
Who was the opponent at Pasir Gudang, Malaysia with a match larger than 2?
SELECT "Opponent team" FROM table_40659 WHERE "Match" > '2' AND "Location" = 'pasir gudang, malaysia'
wikisql
CREATE TABLE table_48989 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
Can you tell me the average Total that has the To par of 15?
SELECT AVG("Total") FROM table_48989 WHERE "To par" = '15'
wikisql
CREATE TABLE table_1341690_9 ( incumbent VARCHAR, candidates VARCHAR )
How many incumbent candidates in the election featuring sam m. gibbons (d) unopposed?
SELECT COUNT(incumbent) FROM table_1341690_9 WHERE candidates = "Sam M. Gibbons (D) Unopposed"
sql_create_context
CREATE TABLE table_16251 ( "Season" text, "Series" text, "Team Name" text, "Races" real, "Poles" real, "Wins" real, "Points" real, "Position" text )
how many positions in 2009?
SELECT COUNT("Position") FROM table_16251 WHERE "Season" = '2009'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Breakdown of questions by a user by score.
SELECT Score, COUNT(Id) FROM Posts WHERE PostTypeId = 1 AND OwnerUserId = '##uid?28111##' GROUP BY Score ORDER BY Score DESC
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, ...
How many patients were admitted in a year less than 2200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2200"
mimicsql_data
CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE faculty ( campus number...
What campus has the most faculties in 2003?
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1
spider
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 d_labitems ( row_id number, itemid number, label te...
tell me the top four most common output events since 2102?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) >= '2102' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4)
mimic_iii
CREATE TABLE mzb ( CLINIC_ID 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, INSU_TYPE text, IN...
把团伙成员喻星海最常开的几种药品排序查看一下
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '喻星海' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLI...
css
CREATE TABLE customers ( id INTEGER, first_name VARCHAR(40), last_name VARCHAR(20), company VARCHAR(80), address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), phone VARCHAR(24), fax VARCHAR(24), email VARCHAR(60), supp...
List the name of all playlist, and count them by a bar chart, and sort in desc by the X.
SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY name DESC
nvbench
CREATE TABLE table_name_25 ( stadium VARCHAR, result VARCHAR )
What Stadium had a Result of w 20 16?
SELECT stadium FROM table_name_25 WHERE result = "w 20–16"
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 (...
what is the maximum days of hospital stay for female patients ?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.gender = "F"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
give me the number of patients whose days of hospital stay is greater than 11 and diagnoses long title is antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "11" AND diagnoses.long_title = "Antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use"
mimicsql_data
CREATE TABLE table_name_18 ( production_number INTEGER, title VARCHAR, director VARCHAR, series VARCHAR )
What is the production number directed by Robert McKimson in series mm titled People Are Bunny?
SELECT SUM(production_number) FROM table_name_18 WHERE director = "robert mckimson" AND series = "mm" AND title = "people are bunny"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide the number of patients whose diagnoses long title is diverticulosis of colon with hemorrhage and lab test abnormal status is abnormal?
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 = "Diverticulosis of colon with hemorrhage" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_15 ( date VARCHAR, catalog VARCHAR )
What is the date for catalog RCD 10160?
SELECT date FROM table_name_15 WHERE catalog = "rcd 10160"
sql_create_context
CREATE TABLE table_49193 ( "Event" text, "Time" text, "Name" text, "Nation" text, "Games" text, "Date" text )
What was the record setting time in the team pursuit (8 laps) event?
SELECT "Time" FROM table_49193 WHERE "Event" = 'team pursuit (8 laps)'
wikisql
CREATE TABLE table_28026 ( "January\u2013September 2013" text, "Birth/2013" real, "Birth/2012" real, "Death/2013" real, "Death/2012" text )
What is the highest birth/2013 when the death/2012 is 14,1?
SELECT MAX("Birth/2013") FROM table_28026 WHERE "Death/2012" = '14,1'
wikisql
CREATE TABLE table_51588 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
I want the condition that has a prolonged bleeding time and a platelet count of decreased or unaffected
SELECT "Condition" FROM table_51588 WHERE "Bleeding time" = 'prolonged' AND "Platelet count" = 'decreased or unaffected'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, ...
Rust questions asked before 1.0.
SELECT Posts.Id AS "post_link", Tags, CreationDate FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE CreationDate <= '2015-05-15' AND TagName = 'rust' ORDER BY CreationDate
sede
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, ...
when did patient 022-100453 receive the first diphenhydramine and lipitor prescription at the same time in 05/last year?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'diphenhydramine' AND patient.uniquepid = '022-100453' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(...
eicu
CREATE TABLE table_732 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the district that has a republican?
SELECT "District" FROM table_732 WHERE "Party" = 'Republican'
wikisql
CREATE TABLE table_name_63 ( attendance VARCHAR, date VARCHAR )
Can you tell me the Attendance that has the Date of april 12?
SELECT attendance FROM table_name_63 WHERE date = "april 12"
sql_create_context
CREATE TABLE table_name_63 ( place VARCHAR, score VARCHAR, player VARCHAR )
Which Place has a Score larger than 68, and a Player of david ogrin?
SELECT place FROM table_name_63 WHERE score > 68 AND player = "david ogrin"
sql_create_context
CREATE TABLE table_name_59 ( event VARCHAR, date VARCHAR )
What event is on 18 December 2009?
SELECT event FROM table_name_59 WHERE date = "18 december 2009"
sql_create_context
CREATE TABLE table_70282 ( "Year" text, "Record [a ]" text, "Win %" real, "League [b ]" text, "Division [c ]" text, "GB [d ]" text, "Post-season record [e ]" text, "Post-season win %" text, "MLB affiliate [f ]" text )
What is the average win percentage of a season with a GB of 5?
SELECT AVG("Win %") FROM table_70282 WHERE "GB [d ]" = '5'
wikisql
CREATE TABLE table_name_59 ( crowd VARCHAR, away_team VARCHAR )
What was the crowd size for the away team footscray?
SELECT crowd FROM table_name_59 WHERE away_team = "footscray"
sql_create_context
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...
患者08045413检验的脸部的各项指标结果怎么样?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_2376 ( "Title/Subject" text, "Public Office" text, "Artist" text, "Date Painted/Created" text, "Medium" text )
What was the public office of the subject whose sculpture was created in 1954?
SELECT "Public Office" FROM table_2376 WHERE "Date Painted/Created" = '1954'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
okay that one 's great too now we're going to go on 4 22 DALLAS to WASHINGTON the latest nighttime departure one way
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (((((DATE_DAY_0.day_number = 22 AND DATE_DAY_0.mon...
atis
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
what was the number of times patient 030-3372 visited the icu in 2101?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-3372') AND STRFTIME('%y', patient.unitadmittime) = '2101'
eicu
CREATE TABLE table_11447995_2 ( haydon VARCHAR, larter VARCHAR, libweshya VARCHAR )
What is Haydon when Larter is 11 and Libweshya is 4?
SELECT haydon FROM table_11447995_2 WHERE larter = "11" AND libweshya = "4"
sql_create_context
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
Please use a bar chart to show the average price of the rooms in a different decor, list bars in descending order please.
SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor ORDER BY decor DESC
nvbench
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, ...
flights that go from OAKLAND to PHILADELPHIA on friday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 25 AND date_day.month_number = 6 ...
atis
CREATE TABLE table_name_16 ( grid INTEGER, laps VARCHAR, constructor VARCHAR, driver VARCHAR )
What is the average grid that has a Constructor of brm, tony maggs, and a Laps larger than 102?
SELECT AVG(grid) FROM table_name_16 WHERE constructor = "brm" AND driver = "tony maggs" AND laps > 102
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
what is the three most frequent drug that was prescribed during the same hospital visit to the female patients aged 60 or above after they had been diagnosed with chf nos, since 1 year ago?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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_...
mimic_iii
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
Give me the first name and last name for all the female members of the club 'Bootup Baltimore'.
SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.sex = "F"
spider
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE charte...
how much do the wbc, ascites actually cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'wbc, ascites'))
mimic_iii
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
count the number of times that divalproex (extended release) has been prescribed to patient 70267 since 2105.
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267) AND prescriptions.drug = 'divalproex (extended release)' AND STRFTIME('%y', prescriptions.startdate) >= '2105'
mimic_iii
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
users with amazon wishlist or patreon links. https://meta.stackexchange.com/questions/315146/donation-button-or-giving-rewards-instead-of-bounty
SELECT Id AS "user_link" FROM Users WHERE AboutMe LIKE '%wishlist%' OR AboutMe LIKE '%patron%'
sede
CREATE TABLE table_28100 ( "Season #" real, "Episode #" real, "Title" text, "Director(s)" text, "Writer(s)" text, "Original Air Date" text )
Name the least episode number for anne brooksbank and vicki madden
SELECT MIN("Episode #") FROM table_28100 WHERE "Writer(s)" = 'Anne Brooksbank and Vicki Madden'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, ...
What Caribbean Literature classes fulfill the PreMajor requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Caribbean Literature%' OR course.description LIKE '%Caribbean Literature%' OR course.name LIKE '...
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 ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
What classes should I enroll in in order to declare a major in SAC ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%SAC%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARC...
Return the number of the completion date for all the tests that have 'Fail' result.
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail"
nvbench
CREATE TABLE table_19614 ( "Hand" text, "1 credit" real, "2 credits" real, "3 credits" real, "4 credits" real, "5 credits" real )
Name the most 1 credit for three of a kind
SELECT MAX("1 credit") FROM table_19614 WHERE "Hand" = 'Three of a Kind'
wikisql
CREATE TABLE table_11734041_10 ( school_club_team_country VARCHAR, player VARCHAR )
Kimball, toby toby kimball is a player; How many times at school/ club team/country was the player present?
SELECT COUNT(school_club_team_country) FROM table_11734041_10 WHERE player = "Kimball, Toby Toby Kimball"
sql_create_context
CREATE TABLE table_train_117 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "total_serum_protein" int, "diastolic_blood_pressure_dbp" int, "geriatric_depression_scale_gds" int, "serum_creatinine" float, "uncontrolled_blo...
total serum protein > 9 g / dl
SELECT * FROM table_train_117 WHERE total_serum_protein > 9
criteria2sql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedb...
Questions tagged 'unclear...' AND 'too broad'.
SELECT * FROM VoteTypes
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, ...
花古香这位患者都去哪些医院开了971102-f这个药?
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '花古香' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '971102-f') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '花古香' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_...
css
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number...
Evolution of the time between the question and the question.
SELECT CAST(q.CreationDate AS DATE) AS "Date", DATEDIFF(DAY, q.CreationDate, CreationDate) AS "Delay to answer" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 ORDER BY 'Date' DESC
sede
CREATE TABLE table_name_74 ( constructor VARCHAR, grid VARCHAR )
Who was the constructor when the grid was 11?
SELECT constructor FROM table_name_74 WHERE grid = 11
sql_create_context
CREATE TABLE table_68963 ( "Episode" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
In what order were the Bee Gees as the artist when it was a result of bottom 3?
SELECT "Order #" FROM table_68963 WHERE "Result" = 'bottom 3' AND "Original artist" = 'bee gees'
wikisql
CREATE TABLE table_26593762_3 ( manner_of_departure VARCHAR, incoming_manager VARCHAR )
What was the manner of departure for the team whose incoming manager was George Burley?
SELECT manner_of_departure FROM table_26593762_3 WHERE incoming_manager = "George Burley"
sql_create_context
CREATE TABLE table_64511 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "# / County" text )
What school has rebels as their mascot?
SELECT "School" FROM table_64511 WHERE "Mascot" = 'rebels'
wikisql
CREATE TABLE table_68017 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
Which Sydney has a Perth of no, a Melbourne of yes, and a Gold Coast of no?
SELECT "Sydney" FROM table_68017 WHERE "Perth" = 'no' AND "Melbourne" = 'yes' AND "Gold Coast" = 'no'
wikisql
CREATE TABLE district ( district_id number, district_name text, headquartered_city text, city_population number, city_area number ) CREATE TABLE store ( store_id number, store_name text, type text, area_size number, number_of_product_category number, ranking number ) CREATE...
Find the number of stores in each city.
SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city
spider
CREATE TABLE table_35663 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "Career W/L" text )
Name the 2008 with 1998 of a and 2002 of 1r with 2004 of 2r
SELECT "2008" FROM table_35663 WHERE "1998" = 'a' AND "2002" = '1r' AND "2004" = '2r'
wikisql
CREATE TABLE table_61689 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many Bronze medals did the team ranked 1 win?
SELECT "Bronze" FROM table_61689 WHERE "Rank" = '1'
wikisql
CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_i...
How many artists are there?
SELECT COUNT(*) FROM artist
spider
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the amount of hire_date bin hire_date by weekday, and visualize them by a bar chart, and I want to display in descending by the y-axis.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE table_78165 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the score on January 12?
SELECT "Score" FROM table_78165 WHERE "Date" = 'january 12'
wikisql
CREATE TABLE table_203_717 ( id number, "number" number, "year built" number, "livery" text, "current status" text, "notes" text )
which is the only pink car ?
SELECT "number" FROM table_203_717 WHERE "livery" = 'pink'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is drug type and drug code of drug name lansoprazole oral disintegrating tab?
SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Lansoprazole Oral Disintegrating Tab"
mimicsql_data
CREATE TABLE table_name_58 ( aggregate VARCHAR, club VARCHAR )
The Crvena Zvezda club has what aggregate?
SELECT aggregate FROM table_name_58 WHERE club = "crvena zvezda"
sql_create_context
CREATE TABLE table_dev_22 ( "id" int, "gender" string, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "cardiovascular_disease" bool, "esophageal_varices" bool, "liver_disease" bool, "diabetes" bool, "serum_creatinine" float, "hypertension" bool, "portal_hypertension" boo...
have had diabetes for at least 1 year, and in good control ( hba1c less than 8.5 % )
SELECT * FROM table_dev_22 WHERE diabetes = 1 AND hemoglobin_a1c_hba1c < 8.5
criteria2sql
CREATE TABLE table_name_84 ( total VARCHAR, tally VARCHAR, matches VARCHAR )
What are the total number of matches smaller than 2 with a tally of 1-19?
SELECT COUNT(total) FROM table_name_84 WHERE tally = "1-19" AND matches < 2
sql_create_context
CREATE TABLE table_204_600 ( id number, "name" text, "status" text, "population" number, "district" text, "former local authority" text )
how many areas are unparished areas ?
SELECT COUNT("name") FROM table_204_600 WHERE "status" = 'unparished area'
squall
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
患有慢性根尖周炎的那些人确诊时同型半胱氨酸的参考值范畴下限和上限是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '慢性根尖周炎' AND jyjgzbb.JCZBMC = '同型半胱氨酸' UNION SELECT jyjgzbb.CKZFWXX...
css
CREATE TABLE table_203_854 ( id number, "position" number, "driver" text, "no." text, "car" text, "entrant" text, "rd 1" number, "rd 2" number, "rd 3" number, "rd 4" number, "rd 5" number, "rd 6" number, "rd 7" number, "rd 8" number, "total" number )
what car was driven by the top ranked driver ?
SELECT "car" FROM table_203_854 WHERE "position" = 1
squall
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 ...
编号41791564165的检验报告单与编号24394363437的检验报告单中是否有检测指标的名称是一样的?一一列出这些检测指标名称、检测指标结果定量及其单位、对应的检验报告单号
SELECT JCZBMC, JCZBJGDL, JCZBJGDW, BGDH FROM jyjgzbb WHERE (BGDH = '41791564165' OR BGDH = '24394363437') AND JCZBMC IN ((SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '41791564165') INTERSECT (SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '24394363437'))
css
CREATE TABLE table_79498 ( "Country" text, "Airport" text, "City" text, "2011" real, "Change (11/10)" text )
Which 2011 has an Airport of bole international airport?
SELECT MAX("2011") FROM table_79498 WHERE "Airport" = 'bole international airport'
wikisql
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients with lab test item id 50802 who were admitted before the year 2120.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2120" AND lab.itemid = "50802"
mimicsql_data
CREATE TABLE table_78612 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the attendance for the game against the Kansas City Chiefs earlier than week 13?
SELECT AVG("Attendance") FROM table_78612 WHERE "Opponent" = 'kansas city chiefs' AND "Week" < '13'
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and commission_pct , and visualize them by a bar chart, and sort y axis from high to low order.
SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC
nvbench
CREATE TABLE table_name_55 ( semi_finalists VARCHAR, runner_up VARCHAR )
What is the Semi finalists when the Runner-up was katrina adams zina garrison-jackson?
SELECT semi_finalists FROM table_name_55 WHERE runner_up = "katrina adams zina garrison-jackson"
sql_create_context
CREATE TABLE table_77110 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What is Year(s) Won, when Total is less than 285?
SELECT "Year(s) won" FROM table_77110 WHERE "Total" < '285'
wikisql
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) )
What are the names of all students who tried out in alphabetical order, and count them by a bar chart
SELECT pName, COUNT(pName) FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID GROUP BY pName ORDER BY T1.pName
nvbench
CREATE TABLE table_27086 ( "Name" text, "Nation" text, "Seasons" text, "Championship titles" text, "Races (Starts)" text, "Poles" real, "Wins" real, "Podiums" real, "Fastest Laps" real, "Points" text )
How many points for the driver who raced in seasons 2006 2007 , 2009?
SELECT "Points" FROM table_27086 WHERE "Seasons" = '2006 – 2007 , 2009'
wikisql
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rati...
where are some good arabic -s in mountain view ?
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_train_43 ( "id" int, "anemia" bool, "cystinuria" bool, "hyperoxaluria" bool, "acute_gout_attack" bool, "NOUSE" float )
known cystinuria
SELECT * FROM table_train_43 WHERE cystinuria = 1
criteria2sql
CREATE TABLE table_74654 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team when north melbourne is at home?
SELECT "Away team" FROM table_74654 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_48803 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
What is the total of attendance at Venue h when Auxerre were playing?
SELECT SUM("Attendance") FROM table_48803 WHERE "Venue" = 'h' AND "Opponent" = 'auxerre'
wikisql
CREATE TABLE table_76643 ( "Target/Approach" text, "Candidate Name" text, "Trial Phase" text, "Trial Start Date" text, "Expected End Date" text )
What is Trial Start Date, when Candidate Name is Notes?
SELECT "Trial Start Date" FROM table_76643 WHERE "Candidate Name" = 'notes'
wikisql
CREATE TABLE table_name_78 ( home_town VARCHAR, senator VARCHAR )
Which Home Town has a Senator of dan shelley?
SELECT home_town FROM table_name_78 WHERE senator = "dan shelley"
sql_create_context
CREATE TABLE table_78339 ( "Candidate" text, "Money Raised, 2Q" text, "Loans Received, 2Q" text, "Money Spent, 2Q" text, "Total Receipts" text, "Cash On Hand" text )
Tell me the total receipts for tom tancredo
SELECT "Total Receipts" FROM table_78339 WHERE "Candidate" = 'tom tancredo'
wikisql
CREATE TABLE table_33304 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
What is the sum of all the rounds when a Florida State player was drafted?
SELECT COUNT("Round") FROM table_33304 WHERE "College" = 'florida state'
wikisql
CREATE TABLE table_name_31 ( loss INTEGER, game INTEGER )
What is the highest loss before game 14?
SELECT MAX(loss) FROM table_name_31 WHERE game < 14
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId nu...
Top 1000 people that use their name in their post..
SELECT p.Id AS "post_link" FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.Body LIKE '%' + u.DisplayName + '%' ORDER BY p.ViewCount DESC LIMIT 1000
sede
CREATE TABLE table_48734 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which Date has a Record of 29 47?
SELECT "Date" FROM table_48734 WHERE "Record" = '29–47'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
what are the methods of consumption of ascorbic acid 500 mg tab?
SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'ascorbic acid 500 mg tab'
eicu
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 prescriptions...
calculate the maximum age of unmarried patients who have unknown/not specified ethnic background.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "UNKNOWN/NOT SPECIFIED"
mimicsql_data