context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
what are the top three most common drugs prescribed to patients within 2 months after antihypertensives - labetalol?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antihypertensives - labetalol') AS t1 JOIN (SELECT...
eicu
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE sta...
Show the number of games for each home team in a bar chart, sort by the y-axis in desc please.
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY COUNT(Home_team) DESC
nvbench
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
Is there an MCDB 680 section on any day other than Monday next semester ?
SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'MCDB' AND course.number = 680 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.y...
advising
CREATE TABLE table_9752 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Quantity made" text, "Quantity preserved" text )
What is Fleet Number(s), when Wheel Arrangement is '2-6-0', and when Class is 'Z'?
SELECT "Fleet number(s)" FROM table_9752 WHERE "Wheel arrangement" = '2-6-0' AND "Class" = 'z'
wikisql
CREATE TABLE table_47551 ( "Episode" real, "Original airdate" text, "Timeslot (approx.)" text, "Viewers (millions)" real, "Nightly rank" text )
What is the lowest episode number with an original airdate on 8 June 2008?
SELECT MIN("Episode") FROM table_47551 WHERE "Original airdate" = '8 june 2008'
wikisql
CREATE TABLE table_203_413 ( id number, "rank" text, "city" text, "population" number, "area\n(km2)" number, "density\n(inhabitants/km2)" number, "altitude\n(mslm)" number )
which communes have a population above 30,000 ?
SELECT "city" FROM table_203_413 WHERE "population" > 30000
squall
CREATE TABLE table_63927 ( "Call sign" text, "Broadcast channel" real, "Digital PSIP" real, "Cable channel" real, "Network" text )
How many cable channels have callsign CBFT-DT?
SELECT COUNT("Cable channel") FROM table_63927 WHERE "Call sign" = 'cbft-dt'
wikisql
CREATE TABLE table_name_86 ( top_10 INTEGER, winnings VARCHAR, avg_start VARCHAR )
Which Top 10 is the lowest one that has Winnings of $405,300, and an Avg Start smaller than 30?
SELECT MIN(top_10) FROM table_name_86 WHERE winnings = "$405,300" AND avg_start < 30
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
how many days have elapsed since the last time patient 022-187132 had an intake of po reg diet on the current icu visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
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...
麻醉科在07年12月19日至19年8月10日这段时间药品7623总共开掉了多少
SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_NM = '麻醉科' AND STA_DATE BETWEEN '2007-12-19' AND '2019-08-10' AND SOC_SRT_DIRE_CD = '7623'
css
CREATE TABLE research_staff ( staff_id number, employer_organisation_id number, staff_details text ) CREATE TABLE organisation_types ( organisation_type text, organisation_type_description text ) CREATE TABLE project_staff ( staff_id number, project_id number, role_code text, date_...
What are the details of all organizations that are described as Sponsors and sort the results in ascending order?
SELECT organisation_details FROM organisations AS T1 JOIN organisation_types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details
spider
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) 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, flight_id...
all right do you have a flight from WASHINGTON to BOSTON that stops in PHILADELPHIA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND CITY_2.cit...
atis
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
what is the drug code and route for the drug propafenone hcl?
SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Propafenone HCl"
mimicsql_data
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
医疗就诊45039080737在治疗时花费的所有费用明细项目是否都已结算结束?
SELECT (SELECT SUM(t_kc22.STA_FLG) FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '45039080737') = (SELECT COUNT(*) FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID = '45039080737')
css
CREATE TABLE table_28788 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Patient Portrayer" text, "Original air date" text, "Production code" text )
The episode with the no. 54, directed by Charles Haid, is written by who?
SELECT "Written by" FROM table_28788 WHERE "Directed by" = 'Charles Haid' AND "No." = '54'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
On what dates were employees without the letter M in their first names hired, and count them by a bar chart
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT FIRST_NAME LIKE '%M%'
nvbench
CREATE TABLE table_name_46 ( record VARCHAR, game_site VARCHAR )
What is the record when the game was played at raymond james stadium?
SELECT record FROM table_name_46 WHERE game_site = "raymond james stadium"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
most reputation user from sri lanka.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%sri lanka%' ORDER BY Reputation DESC
sede
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 ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
specify the total number of male patients having incisional ventral hernia with obstruction.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Incisional ventral hernia with obstruction"
mimicsql_data
CREATE TABLE table_17814838_1 ( new_entries_this_round VARCHAR, round VARCHAR )
How many categories of new entries this round are there for the fourth round proper?
SELECT COUNT(new_entries_this_round) FROM table_17814838_1 WHERE round = "Fourth round Proper"
sql_create_context
CREATE TABLE table_22766 ( "Entities" text, "Country" text, "Supply point" text, "Voltage (kV)" real, "Power (MW)" real )
What are the electric companies drawing power from Itaipu?
SELECT "Entities" FROM table_22766 WHERE "Supply point" = 'Itaipu'
wikisql
CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_birth time ) CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_bookings ( apt_booking...
Show the average room count of the apartments that have booking status code 'Provisional'.
SELECT AVG(room_count) FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional"
spider
CREATE TABLE table_55737 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What week was October 9, 1938?
SELECT COUNT("Week") FROM table_55737 WHERE "Date" = 'october 9, 1938'
wikisql
CREATE TABLE table_11011 ( "Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text )
What is the episode number of the episode titled 'Threshold of Pain'?
SELECT "Episode #" FROM table_11011 WHERE "Title" = 'threshold of pain'
wikisql
CREATE TABLE table_76655 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which Laps have a Time/Retired of +23.215, and a Grid larger than 11?
SELECT MIN("Laps") FROM table_76655 WHERE "Time/Retired" = '+23.215' AND "Grid" > '11'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Find All_Home and Team_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and order in desc by the x axis.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE visits_restaurant ( stuid number, resid number, time time, spent number ) CREATE TABLE restaurant_type ( restypeid number, restypename text, restypedescription text ) CREATE TABLE type_of_restaurant ( resid number, restypeid number ) CREATE TABLE restaurant ( resi...
Which city does student Linda Smith live in?
SELECT city_code FROM student WHERE fname = "Linda" AND lname = "Smith"
spider
CREATE TABLE table_name_8 ( mpg_uk_urban__cold_ VARCHAR, l_100km_urban__cold_ VARCHAR, engine_capacity VARCHAR, fuel_type VARCHAR, mpg_uk_extra_urban VARCHAR )
What is the mpg-UK urban (cold) for a fuel type of diesel, extraurban MPG in the UK over 68.9, engine capacity of 1422, and L/100km urban (cold) over 5.1?
SELECT mpg_uk_urban__cold_ FROM table_name_8 WHERE fuel_type = "diesel" AND mpg_uk_extra_urban > 68.9 AND engine_capacity = 1422 AND l_100km_urban__cold_ > 5.1
sql_create_context
CREATE TABLE table_20952 ( "Year" real, "Edmonton Hundred" real, "Elthorne Hundred" real, "Gore Hundred" real, "Isleworth Hundred" real, "Holborn Division" real, "Finsbury Division" real, "Kensington Division" real, "Tower Division" real, "Spelthorne Hundred" real, "Within th...
When 1546 is inns of court and chancery what is the finsbury division?
SELECT "Finsbury Division" FROM table_20952 WHERE "Inns of Court and Chancery" = '1546'
wikisql
CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Musi...
A bar chart for what are the number of the category of music festivals with result 'Awarded'?, and I want to order by the X-axis from high to low.
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category DESC
nvbench
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
how many patients was given endo polpectomy lrge int since 2 years ago for two times?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'endo polpectomy lrge ...
mimic_iii
CREATE TABLE table_11735 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the date that the away team scored 4.7 (31)?
SELECT "Date" FROM table_11735 WHERE "Away team score" = '4.7 (31)'
wikisql
CREATE TABLE table_203_165 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the total number of nations that participated in the beach games of 2012 ?
SELECT COUNT("nation") FROM table_203_165
squall
CREATE TABLE table_name_57 ( rank INTEGER, bronze VARCHAR, silver VARCHAR )
What rank was the country with no bronze but at least 1 silver medals?
SELECT AVG(rank) FROM table_name_57 WHERE bronze < 1 AND silver > 1
sql_create_context
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, ...
what was the last ward id that patient 27739 went since 3 years ago?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27739) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
count the number of patients whose diagnosis long title is phlebitis and thrombophlebitis of superficial veins of upper extremities 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 = "Phlebitis and thrombophlebitis of superficial veins of upper extremities" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
Is there a list for next semester of 300 -level courses being offered ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester...
advising
CREATE TABLE table_35480 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "FCC info" text )
Which Frequency MHz has an ERP W larger than 4, and a Call sign of w218ap?
SELECT "Frequency MHz" FROM table_35480 WHERE "ERP W" > '4' AND "Call sign" = 'w218ap'
wikisql
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Employees ( Employee_ID INTEGER, ...
Give me a pie to show the total number from different location code.
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code
nvbench
CREATE TABLE table_77663 ( "Rank by average" real, "Place" real, "Couple" text, "Total" real, "Number of dances" real, "Average" real )
What is the rank by average where the total was larger than 245 and the average was 27.1 with fewer than 15 dances?
SELECT AVG("Rank by average") FROM table_77663 WHERE "Total" > '245' AND "Average" = '27.1' AND "Number of dances" < '15'
wikisql
CREATE TABLE table_name_44 ( Id VARCHAR )
What is the 1993 finish for the event that had a 1990 of QF and 1995 of 2R?
SELECT 1993 FROM table_name_44 WHERE 1990 = "qf" AND 1995 = "2r"
sql_create_context
CREATE TABLE table_name_88 ( margin VARCHAR, year VARCHAR, championship VARCHAR )
What was the margin in 2001 at the McDonald's LPGA Championship?
SELECT margin FROM table_name_88 WHERE year = 2001 AND championship = "mcdonald's lpga championship"
sql_create_context
CREATE TABLE table_10940 ( "Date" text, "Track" text, "Race" text, "Distance" text, "Purse ( US$ )" text, "Surface track" text, "Winning horse" text, "Winning jockey" text )
What Winning Jockey ran in the Tampa Bay Downs Track on Winning Horse Barkley Sound?
SELECT "Winning jockey" FROM table_10940 WHERE "Track" = 'tampa bay downs' AND "Winning horse" = 'barkley sound'
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...
医院6010828的科室中,有多少最长医疗住院时长少于24天的科室
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6010828' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING MAX(gwyjzb.IN_HOSP_DAYS) < 24 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6010828' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING MAX(fgwyjzb.IN_H...
css
CREATE TABLE table_68365 ( "Year" real, "Population (Region total)" real, "Population (Maryborough)" real, "Population (Hervey Bay)" real, "Population (Woocoo)" real, "Population (Tiaro)" real )
Name the average population hervey bay with population maryborough more than 11,415 and population region total less than 48,308 and population tiaro less than 2,066 and population woocoo of 491
SELECT AVG("Population (Hervey Bay)") FROM table_68365 WHERE "Population (Maryborough)" > '11,415' AND "Population (Region total)" < '48,308' AND "Population (Tiaro)" < '2,066' AND "Population (Woocoo)" = '491'
wikisql
CREATE TABLE table_28430 ( "Specimen weight/size" text, "Calculated activity ( Bq )" real, "Calculated activity ( Ci )" text, "Estimated activity GR(api)" text, "Estimated exposure ( mRem )/hr*" text )
if the estimated exposure ( mrem )/hr* is 0.28, what is the specimen weight/size?
SELECT COUNT("Specimen weight/size") FROM table_28430 WHERE "Estimated exposure ( mRem )/hr*" = '0.28'
wikisql
CREATE TABLE table_name_43 ( outcome VARCHAR, opponent_in_the_final VARCHAR )
Which Outcome has an Opponent in the final of simone colombo?
SELECT outcome FROM table_name_43 WHERE opponent_in_the_final = "simone colombo"
sql_create_context
CREATE TABLE playlisttrack ( playlistid number, trackid number ) CREATE TABLE invoice ( invoiceid number, customerid number, invoicedate time, billingaddress text, billingcity text, billingstate text, billingcountry text, billingpostalcode text, total number ) CREATE TABLE ...
Find the name of the genre that is most frequent across all tracks.
SELECT T1.name FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid GROUP BY T2.genreid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
Who attracted the most people into the system.
WITH FirstQuestions AS (SELECT OwnerUserId, RANK() OVER (PARTITION BY OwnerUserId ORDER BY Id) AS Rank, PostTypeId, AcceptedAnswerId FROM Posts WHERE NOT OwnerUserId IS NULL), AttractedUsers AS (SELECT A.OwnerUserId, COUNT(*) AS Count FROM FirstQuestions, Posts AS A WHERE FirstQuestions.Rank = 1 AND FirstQuestions.Acce...
sede
CREATE TABLE table_41296 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Place, when the Player is Chris Dimarco?
SELECT "Place" FROM table_41296 WHERE "Player" = 'chris dimarco'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, pati...
what are the average daily number of patients diagnosed with s/p vascular bypass since 5 years ago?
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 's/p vascular bypass' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
住院治疗编号94773706571的门诊诊断主要的编码类型、序列号码列表、名字列表都有啥呢?
SELECT wdmzjzjlb.MZBMLX, wdmzjzjlb.MZZDBM, wdmzjzjlb.MZZDMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '94773706571' UNION SELECT bdmzjzjlb.MZBMLX, bdmzjzjlb.MZZDBM, bdmzjzjlb.MZZDMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '94773706571'
css
CREATE TABLE table_13822 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the highest lane for the poland swimmer who ranked under 6?
SELECT MAX("Lane") FROM table_13822 WHERE "Rank" < '6' AND "Nationality" = 'poland'
wikisql
CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE volume ( Volume_ID int, V...
What are the category of music festivals with result 'Awarded', and count them by a bar chart, and show by the Y-axis from high to low.
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) DESC
nvbench
CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE staff ( staff_id numbe...
When did the staff member named Janessa Sawayn join the company?
SELECT date_joined_staff FROM staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
spider
CREATE TABLE table_22888 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text )
What is the finale number ranked at number 7?
SELECT "Finale" FROM table_22888 WHERE "Rank" = '7'
wikisql
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 decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and manager_id , and show from low to high by the x-axis.
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
nvbench
CREATE TABLE 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 admission location is emergency room admit and procedure icd9 code is 14.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.icd9_code = "14"
mimicsql_data
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, E...
Most popular StackOverflow tags in 2013.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank2013, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId A...
sede
CREATE TABLE table_33055 ( "Season" real, "Division" real, "Tms." real, "Pos." real, "FA Cup" text )
What is the division in the season with 13 tms and pos smaller than 8?
SELECT COUNT("Division") FROM table_33055 WHERE "Tms." = '13' AND "Pos." < '8'
wikisql
CREATE TABLE table_27057 ( "Branding" text, "Callsign" text, "Ch. #" text, "Power kW" text, "Station Type" text, "Location (Transmitter site)" text )
What is the power in KW that has a station type of relay and a callsign of DXCL-TV?
SELECT "Power kW" FROM table_27057 WHERE "Station Type" = 'Relay' AND "Callsign" = 'DXCL-TV'
wikisql
CREATE TABLE table_2783 ( "Release" text, "Oricon Albums Chart" text, "Peak Position" real, "Debut Sales (copies)" real, "Sales Total (copies)" real, "Chart Run" text )
Which charts had debut sales of of more than 339333.011497678?
SELECT "Oricon Albums Chart" FROM table_2783 WHERE "Debut Sales (copies)" > '339333.011497678'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
how many hours had it been since the first procedure patient 032-21820 received on the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-21820...
eicu
CREATE TABLE table_32012 ( "Name" text, "Circuit" text, "Date" text, "Winning drivers" text, "Winning constructor" text, "Report" text )
What race was won by Tazio Nuvolari?
SELECT "Name" FROM table_32012 WHERE "Winning drivers" = 'tazio nuvolari'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients whose ethnicity is white and item id is 51078?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.itemid = "51078"
mimicsql_data
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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, ...
从2014年2月27日到2014年5月23日,列出病人60960957这期间所有检验报告单中的标本采集部位
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '60960957' AND jybgb.BGRQ BETWEEN '2014-02-27' AND '2014-05-23' UNI...
css
CREATE TABLE table_80300 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What was the rank with the qual of 115.095?
SELECT "Rank" FROM table_80300 WHERE "Qual" = '115.095'
wikisql
CREATE TABLE table_19542477_9 ( song_s__—_weeks VARCHAR, issue_years VARCHAR, artist_s_ VARCHAR )
What is the title of every song, and how many weeks was each song at #1 for Rihanna in 2012?
SELECT song_s__—_weeks FROM table_19542477_9 WHERE issue_years = 2012 AND artist_s_ = "Rihanna"
sql_create_context
CREATE TABLE table_50496 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text )
What is the highest to par of the player from the United States with a t3 place and a 74-73-72-69=288 place?
SELECT MAX("To par") FROM table_50496 WHERE "Country" = 'united states' AND "Place" = 't3' AND "Score" = '74-73-72-69=288'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what was the first value of the anion gap lab test of patient 30525 during the last hospital visit.
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30525 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '...
mimic_iii
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of first_name and manager_id .
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
what was the last hospital admission time in which patient 006-57924 was admitted via the emergency department?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-57924' AND patient.hospitaladmitsource = 'emergency department' ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE table_13266 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What's the record that had an opponent of Krzysztof Soszynski and a time of 4:00?
SELECT "Record" FROM table_13266 WHERE "Time" = '4:00' AND "Opponent" = 'krzysztof soszynski'
wikisql
CREATE TABLE table_name_63 ( release_date INTEGER, sampling_rate VARCHAR )
Around what time frame release a Sampling Rate of 12-bit 40khz?
SELECT SUM(release_date) FROM table_name_63 WHERE sampling_rate = "12-bit 40khz"
sql_create_context
CREATE TABLE table_32319 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the highest crowd at arden street oval?
SELECT MAX("Crowd") FROM table_32319 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID ...
A bar chart shows how many locations, list by the the number of location from high to low.
SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY COUNT(Location) DESC
nvbench
CREATE TABLE table_7003 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What kind of IATA has an Airport of hamburg airport?
SELECT "IATA" FROM table_7003 WHERE "Airport" = 'hamburg airport'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, m...
i need to fly from ST. LOUIS to MILWAUKEE on wednesday afternoon
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYalias0.year = 1991)) AND to...
atis
CREATE TABLE table_54552 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the Home team with Away team score of 15.9 (99)?
SELECT "Home team score" FROM table_54552 WHERE "Away team score" = '15.9 (99)'
wikisql
CREATE TABLE table_14962287_2 ( other_a VARCHAR, name VARCHAR )
How many values of Other A correspond to Tommy Johnson Category:Articles with hCards?
SELECT COUNT(other_a) FROM table_14962287_2 WHERE name = "Tommy Johnson Category:Articles with hCards"
sql_create_context
CREATE TABLE table_19744915_15 ( couple VARCHAR, vote_percentage VARCHAR )
What couple had a vote percentage of 7.691%
SELECT couple FROM table_19744915_15 WHERE vote_percentage = "7.691%"
sql_create_context
CREATE TABLE table_53001 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who is the home team that played at MCG?
SELECT "Home team" FROM table_53001 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_1557974_1 ( debut VARCHAR, birthplace VARCHAR )
What are the debut year for wrestlers born in Nara?
SELECT debut FROM table_1557974_1 WHERE birthplace = "Nara"
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...
how has patient 27177 last visited the hospital since 2 years ago?
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 27177 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
is there a microbiology test result in this month for patient 13054's sputum?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13054) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 m...
mimic_iii
CREATE TABLE table_name_12 ( season VARCHAR, episode_count VARCHAR, time_length VARCHAR )
Which season has more than 5 episodes each 159 minutes in length?
SELECT season FROM table_name_12 WHERE episode_count > 5 AND time_length = "159 minutes"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by weekday, sort by the Y-axis in desc.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state tex...
Show average of budget in each year and bin creation time by year in a line chart, and could you display by the X-axis in asc?
SELECT Creation, AVG(Budget_in_Billions) FROM department ORDER BY Creation
nvbench
CREATE TABLE table_60784 ( "Year" real, "First member" text, "First party" text, "Second member" text, "Second party" text )
What is the first party for Lord John Hay earlier than 1857?
SELECT "First party" FROM table_60784 WHERE "Year" < '1857' AND "First member" = 'lord john hay'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
郎永逸患者在编号为7422800的这家医院中被开过什么单价最高的药?还需要这个药的编码,还有药品的单价
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郎永逸' AND gwyjzb.MED_SER_ORG_NO = '7422800' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '郎永逸' AND fgwyjzb.MED_...
css
CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
从一一年五月十一日到一六年六月九日,医疗机构9088702的外地住院就诊记录具体是多少
SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZYBMLX = '9088702' AND bdmzjzjlb.RYDJSJ BETWEEN '2011-05-11' AND '2016-06-09'
css
CREATE TABLE table_name_55 ( champion VARCHAR, tournament_location VARCHAR )
Which champion has sentosa golf club as the tournament location?
SELECT champion FROM table_name_55 WHERE tournament_location = "sentosa golf club"
sql_create_context
CREATE TABLE table_34509 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Name the most attendance for november 17, 1946 and week more than 8
SELECT MAX("Attendance") FROM table_34509 WHERE "Date" = 'november 17, 1946' AND "Week" > '8'
wikisql
CREATE TABLE table_41757 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
What is the nationality of the School/Club team of Louisville?
SELECT "Nationality" FROM table_41757 WHERE "School/Club Team" = 'louisville'
wikisql
CREATE TABLE table_24969 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
How many u.s. views were there for the epidosde titled, 'now you lift your eyes to the sun'?
SELECT "U.S. viewers (millions)" FROM table_24969 WHERE "Title" = 'Now You Lift Your Eyes to the Sun'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
For those employees who was hired before 2002-06-21, a scatter chart shows the correlation between employee_id and salary .
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
give me the number of patients diagnosed with morbid obesity/sda and the lab test fluid is pleural.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_2668393_18 ( party VARCHAR, candidates VARCHAR )
What is the party for the candidates edwin gray (dr)?
SELECT party FROM table_2668393_18 WHERE candidates = "Edwin Gray (DR)"
sql_create_context
CREATE TABLE table_68045 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the record after the January 18 game?
SELECT "Record" FROM table_68045 WHERE "Date" = 'january 18'
wikisql