instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what is the number of patients whose drug code is meth10sy and lab test fluid is cerebrospinal fluid (csf)?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
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.formulary_drug_cd = "METH10SY" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
Find all cities in which there is a restaurant called ' MGM Grand Buffet
CREATE TABLE review (rid int,business_id varchar,user_id varchar,rating float,text longtext,year int,month varchar)CREATE TABLE checkin (cid int,business_id varchar,count int,day varchar)CREATE TABLE category (id int,business_id varchar,category_name varchar)CREATE TABLE neighborhood (id int,business_id varchar,neighbo...
SELECT business.city FROM business, category WHERE business.name = 'MGM Grand Buffet' AND category.business_id = business.business_id AND category.category_name = 'restaurant'
tell me the top five most frequent diagnoses for patients of age 40s in the previous year?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE procedures_icd (row_id ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
Before I take AAS 385 , what other courses do I need to complete ?
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE stude...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
who was the last celebrity guest in the 2010 season ?
CREATE TABLE table_204_997 (id number,"#" text,"title" text,"celebrity guest(s)" text,"directed by" text,"written by" text,"original airdate" text)
SELECT "celebrity guest(s)" FROM table_204_997 WHERE NOT "celebrity guest(s)" IS NULL ORDER BY id DESC LIMIT 1
Find all the stage positions of the musicians with first name 'Solveig
CREATE TABLE Band (id VARCHAR)CREATE TABLE Performance (stageposition VARCHAR,bandmate VARCHAR)
SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = "Solveig"
What is the density when simplified shows ?
CREATE TABLE table_name_33 (density VARCHAR,simplified VARCHAR)
SELECT density FROM table_name_33 WHERE simplified = "南山区"
how many points does the artist rita have ?
CREATE TABLE table_203_862 (id number,"draw" number,"artist" text,"song" text,"points" number,"place" text)
SELECT "points" FROM table_203_862 WHERE "artist" = 'rita'
What was the date in which Chic won at CHS?
CREATE TABLE table_35559 ("Date" text,"Placing" text,"Beat by" text,"Location" text,"Distance" text)
SELECT "Date" FROM table_35559 WHERE "Beat by" = 'won' AND "Location" = 'chs'
left ventricular ejection fraction less than 40 %
CREATE TABLE table_test_16 ("id" int,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"severe_hypertension" bool,"adrenaline" bool,"stroke" bool,"renal_disease" bool,"severe_uncontrolled_arterial_hypertension" bool,"hepatic_disease" bool,"dobutamine" bool,"temperature" float,"creatinine_c...
SELECT * FROM table_test_16 WHERE left_ventricular_ejection_fraction_lvef < 40
What was the result of the game from 10 October 2009?
CREATE TABLE table_name_47 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_47 WHERE date = "10 october 2009"
WHAT IS THE APPOINTMENT DATE WITH A PRE-SEASON POSITION, AND REPLACED BY THOMAS THOMASBERG?
CREATE TABLE table_45976 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text)
SELECT "Date of appointment" FROM table_45976 WHERE "Position in table" = 'pre-season' AND "Replaced by" = 'thomas thomasberg'
Return a histogram on what are the different transaction types, and how many transactions of each have taken place?, display total number from low to high order.
CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),other_account_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(20),customer_last_name VARCHAR(20),customer_address VARCHAR(255),customer_phone VARCHAR(255),customer_email VARCHAR(255),other...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY COUNT(*)
how many female patients use the drug code thor25?
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,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "THOR25"
How many years had a total earnings amount of 2254598?
CREATE TABLE table_25413 ("Year" real,"Majors" real,"ATP wins" real,"Total wins" real,"Earnings ($)" real,"Money list rank" real)
SELECT COUNT("Year") FROM table_25413 WHERE "Earnings ($)" = '2254598'
What is the home team of the game where New Jersey was the visitor team and the record was 11-35-12?
CREATE TABLE table_55389 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Home" FROM table_55389 WHERE "Visitor" = 'new jersey' AND "Record" = '11-35-12'
Show the names and heights of buildings with at least two institutions founded after 1880 Plot them as bar chart, and order by the bar from low to high.
CREATE TABLE Institution (Institution_id text,Institution text,Location text,Founded real,Type text,Enrollment int,Team text,Primary_Conference text,building_id text)CREATE TABLE protein (common_name text,protein_name text,divergence_from_human_lineage real,accession_number text,sequence_length real,sequence_identity_t...
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 ORDER BY Name
Frequency of 100.1 has what on-air id?
CREATE TABLE table_5963 ("Callsign" text,"Area served" text,"Frequency" text,"Band" text,"On-air ID" text,"Purpose" text)
SELECT "On-air ID" FROM table_5963 WHERE "Frequency" = '100.1'
acl papers in 2016 about Semantic Parsing
CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE paperdataset (paperid int,dataset...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'acl'
Name the Winning constructor on 31 may and a Circuit of madonie?
CREATE TABLE table_59455 ("Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Winning constructor" text,"Report" text)
SELECT "Winning constructor" FROM table_59455 WHERE "Date" = '31 may' AND "Circuit" = 'madonie'
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the trend about employee_id over hire_date , rank by the x axis in asc.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY dec...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
What is the result for partial thromboplastin time when prothrombin time and bleeding time are prolonged?
CREATE TABLE table_221653_1 (partial_thromboplastin_time VARCHAR,prothrombin_time VARCHAR,bleeding_time VARCHAR)
SELECT partial_thromboplastin_time FROM table_221653_1 WHERE prothrombin_time = "Prolonged" AND bleeding_time = "Prolonged"
What is the first elected for south carolina 4?
CREATE TABLE table_1342256_40 (first_elected VARCHAR,district VARCHAR)
SELECT first_elected FROM table_1342256_40 WHERE district = "South Carolina 4"
What general classification has levi leipheimer as points classification?
CREATE TABLE table_58689 ("Stage" text,"Winner" text,"General classification" text,"Mountains classification" text,"Points classification" text,"Team Classification" text)
SELECT "General classification" FROM table_58689 WHERE "Points classification" = 'levi leipheimer'
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of manager_id over the job_id , and group by attribute job_id by a bar chart, could you show in desc by the x axis please?
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID d...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
What opponent has a Result of w 31 0?
CREATE TABLE table_name_25 (opponent VARCHAR,result VARCHAR)
SELECT opponent FROM table_name_25 WHERE result = "w 31–0"
Which team after 2008, with less than 2 podium finished and more than 0 FLAPS, had the lowest numberof races?
CREATE TABLE table_49671 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"FLaps" real,"Podiums" real,"Points" real,"Position" text)
SELECT MIN("Races") FROM table_49671 WHERE "Podiums" < '2' AND "FLaps" > '0' AND "Season" > '2008'
Questions answered by me without an accepted answer, with only one answer.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score nu...
SELECT q.Id AS "post_link", a.CreationDate FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##UserId##' AND q.AnswerCount = 1 AND q.AcceptedAnswerId IS NULL
What is the to par for Gene Littler?
CREATE TABLE table_name_42 (to_par VARCHAR,player VARCHAR)
SELECT to_par FROM table_name_42 WHERE player = "gene littler"
Show all payment method codes and the number of orders for each code Show bar chart, display in ascending by the names.
CREATE TABLE Bookings (Booking_ID INTEGER,Customer_ID INTEGER,Workshop_Group_ID VARCHAR(100),Status_Code CHAR(15),Store_ID INTEGER,Order_Date DATETIME,Planned_Delivery_Date DATETIME,Actual_Delivery_Date DATETIME,Other_Order_Details VARCHAR(255))CREATE TABLE Invoices (Invoice_ID INTEGER,Order_ID INTEGER,payment_method_c...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code
I want the fastest lap for round of 16
CREATE TABLE table_57052 ("Round" real,"Grand Prix" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Constructor" text,"Report" text)
SELECT "Fastest Lap" FROM table_57052 WHERE "Round" = '16'
what is the daily average of sao2 for patient 17694?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE patients (row_id number,subject_id number,g...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17694)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2...
What is the highest population in the millions that has an influence of 1.02?
CREATE TABLE table_name_55 (population_millions INTEGER,influence VARCHAR)
SELECT MAX(population_millions) FROM table_name_55 WHERE influence = 1.02
on 10/25/this year, when was the last time that patient 433 had a arterial bp [systolic] measured?
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_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numbe...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b...
when was patient 025-5271 last having the minimum hct level since 108 months ago?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid nu...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-5271')) AND lab.labname = 'hct' AND DATETIME(lab.labresulttime) >= DATETIME(CUR...
Who was the opponent on carpet in a final?
CREATE TABLE table_name_55 (opponent_in_final VARCHAR,surface VARCHAR)
SELECT opponent_in_final FROM table_name_55 WHERE surface = "carpet"
What studio did Paul Greengrass direct in 2007?
CREATE TABLE table_64248 ("Year" real,"Title" text,"Director" text,"Studio(s)" text,"Notes" text)
SELECT "Studio(s)" FROM table_64248 WHERE "Year" = '2007' AND "Director" = 'paul greengrass'
What is the result of a round greater than 3?
CREATE TABLE table_name_55 (result VARCHAR,round INTEGER)
SELECT result FROM table_name_55 WHERE round > 3
Who many votes did E. Greenberg receive in Morris County?
CREATE TABLE table_21931 ("County" text,"Precincts" text,"E. Greenberg" text,"G. Hager" text,"T. Wyka" text)
SELECT COUNT("E. Greenberg") FROM table_21931 WHERE "County" = 'Morris'
Name the air date for alex taub
CREATE TABLE table_27504682_1 (original_air_date VARCHAR,written_by VARCHAR)
SELECT original_air_date FROM table_27504682_1 WHERE written_by = "Alex Taub"
What is the name of the boat that was built by Chatham and Laid down of 25 april 1887?
CREATE TABLE table_75742 ("Name" text,"Builder" text,"Laid down" text,"Launched" text,"Completed" real)
SELECT "Name" FROM table_75742 WHERE "Builder" = 'chatham' AND "Laid down" = '25 april 1887'
number of papers in sigir conference
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE field (fieldid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE pape...
SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'sigir'
Return the name of rooms and the number of reservations made for each of the rooms to draw a bar chart, and rank in descending by the X-axis.
CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)
SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY roomName DESC
how many days have there been since patient 57050's last sec mal neo brain/spine diagnosis during this hospital encounter?
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 d_labitems (row_id number,itemid number,label text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,sp...
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 = 'sec mal neo brain/spine') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admi...
Bar chart of the number of course name from each course name, and I want to rank by the X in desc.
CREATE TABLE Courses (course_id VARCHAR(100),course_name VARCHAR(120),course_description VARCHAR(255),other_details VARCHAR(255))CREATE TABLE People (person_id INTEGER,first_name VARCHAR(255),middle_name VARCHAR(255),last_name VARCHAR(255),cell_mobile_number VARCHAR(40),email_address VARCHAR(40),login_name VARCHAR(40),...
SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY course_name DESC
When was an average speed of 81.388 mph recorded?
CREATE TABLE table_25214 ("Year" text,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" text,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text,"Report" text)
SELECT "Date" FROM table_25214 WHERE "Average Speed (mph)" = '81.388'
What is Years Exp, when Height is '7-2'?
CREATE TABLE table_50818 ("Number" real,"Player" text,"Position" text,"Height" text,"Weight" real,"Years Exp" text,"College" text)
SELECT "Years Exp" FROM table_50818 WHERE "Height" = '7-2'
What is the july average low associated with a january average high of 30.4?
CREATE TABLE table_name_28 (july__avg_low_ VARCHAR,january__avg_high_°f_ VARCHAR)
SELECT COUNT(july__avg_low_) AS °f_ FROM table_name_28 WHERE january__avg_high_°f_ = "30.4"
What college did the player whose position was RB go to?
CREATE TABLE table_28059992_6 (college VARCHAR,position VARCHAR)
SELECT college FROM table_28059992_6 WHERE position = "RB"
Draw a bar chart for how many storms occured in each region?, could you rank in desc by the bars?
CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int)CREATE TABLE region (Region_id int,Region_code text,Region_name text)
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name DESC
how many patients were prescribed losartan potassium 50 mg po tabs in the same hospital visit after the diagnosis of pain, in the previous year?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyst...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pain' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(C...
List the number of invoices from the US, grouped by state. Visualize by bar chart.
CREATE TABLE artists (id INTEGER,name VARCHAR(120))CREATE TABLE tracks (id INTEGER,name VARCHAR(200),album_id INTEGER,media_type_id INTEGER,genre_id INTEGER,composer VARCHAR(220),milliseconds INTEGER,bytes INTEGER,unit_price NUMERIC(10,2))CREATE TABLE albums (id INTEGER,title VARCHAR(160),artist_id INTEGER)CREATE TABLE...
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state
Which Median family income has a Median household income of $43,125?
CREATE TABLE table_5755 ("County" text,"Per capita income" text,"Median household income" text,"Median family income" text,"Population" real,"Number of households" real)
SELECT "Median family income" FROM table_5755 WHERE "Median household income" = '$43,125'
what was the earliest time this game played during the season ?
CREATE TABLE table_204_718 (id number,"date" text,"opponent" text,"time" text,"score" text,"record" text)
SELECT MIN("time") FROM table_204_718
For each manufacturer's name, what are the prices of their most expensive product?
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
What is the make of the vehicle for driver Hisashi Wada?
CREATE TABLE table_name_24 (make VARCHAR,drivers VARCHAR)
SELECT make FROM table_name_24 WHERE drivers = "hisashi wada"
Who are the instructors for upper-level classes ?
CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_...
did patient 021-69410 get his diagnosis since 2102?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyste...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-69410')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2102'
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the amount of job_id , and group by attribute job_id, I want to show in ascending by the JOB_ID.
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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCAT...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
Who directed the episode with production code ca303?
CREATE TABLE table_25740548_4 (directed_by VARCHAR,production_code VARCHAR)
SELECT directed_by FROM table_25740548_4 WHERE production_code = "CA303"
what is the daily maximum value of o2 sat (%) of patient 032-1755 since 03/2103?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh...
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-1755')) AND lab.labname = 'o2 sat (%)' AND STRFTIME('%y-%m', lab.labresulttime...
For TURKISH 102 which are the prerequisites courses ?
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_tests int,heavy_papers int,cares_for_students int,heavy_assignments ...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'TURKISH' AND COURSE_0.numb...
Get the number of patients with coronary artery disease or coronary artery bypass graft myomectomy/sda primary disease who had a urine lab test.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Urine"
Most controversial users on the site.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Posts (Id nu...
WITH UserVotes AS (SELECT Users.Id AS UserId, Votes.VoteTypeId, COUNT(*) AS N FROM Votes LEFT JOIN Posts ON Votes.PostId = Posts.Id LEFT JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Votes.VoteTypeId IN (2, 3) GROUP BY Users.Id, Votes.VoteTypeId HAVING COUNT(*) > 20), MAIN AS (SELECT Up.UserId AS "user_link", CASE W...
PHOENIX to NEWARK wednesday
CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE days (days_code varchar,day_name varcha...
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 = 'NEWARK' AND date_day.day_number = 23 AND date_day.month_number = 4 AND da...
What's the total number that had a rank larger than 17 and a gold greater than 0?
CREATE TABLE table_68251 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Total") FROM table_68251 WHERE "Rank" > '17' AND "Gold" > '0'
What episode was written by Matt Maclennan?
CREATE TABLE table_3709 ("Total #" real,"Episode #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT MAX("Episode #") FROM table_3709 WHERE "Written by" = 'Matt MacLennan'
Scatterplot of school_id vs team id by ACC_Home
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 (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Home
What's the highest year than hawthorn won with a season result of preliminary finalist and a crowd smaller than 27,407?
CREATE TABLE table_53155 ("Year" real,"Winners" text,"Grand Finalist" text,"Scores" text,"Venue" text,"Crowd" real,"Margin" real,"Season Result" text)
SELECT MAX("Year") FROM table_53155 WHERE "Winners" = 'hawthorn' AND "Season Result" = 'preliminary finalist' AND "Crowd" < '27,407'
Who was the winner in the Tournament of Graz-Seiersberg?
CREATE TABLE table_55859 ("Tournament" text,"Winner" text,"Runner-up" text,"Score" text,"Third Place" text)
SELECT "Winner" FROM table_55859 WHERE "Tournament" = 'graz-seiersberg'
Which member of the National Party is from the Hinkler electorate?
CREATE TABLE table_33583 ("Member" text,"Party" text,"Electorate" text,"State" text,"In office" text)
SELECT "Member" FROM table_33583 WHERE "Party" = 'national' AND "Electorate" = 'hinkler'
When 17 is the number in series who is the director?
CREATE TABLE table_2409041_2 (directed_by VARCHAR,no_in_series VARCHAR)
SELECT directed_by FROM table_2409041_2 WHERE no_in_series = 17
What was the QB rating for Neil lomax?
CREATE TABLE table_23997 ("Name" text,"Completions" real,"Attempts" real,"Completion %" text,"Yards" real,"Touchdowns" real,"Interceptions" real,"QB Rating" text)
SELECT "QB Rating" FROM table_23997 WHERE "Name" = 'Neil Lomax'
How many people vacated to successor Dave E. Satterfield, Jr. (d)?
CREATE TABLE table_24502 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text)
SELECT COUNT("Vacator") FROM table_24502 WHERE "Successor" = 'Dave E. Satterfield, Jr. (D)'
What is the name where p is mf?
CREATE TABLE table_17240 ("N" real,"P" text,"Name" text,"EU" text,"Country" text,"Age" real,"Type" text,"Moving from" text,"Transfer window" text,"Ends" real,"Transfer fee" text,"Source" text)
SELECT "Name" FROM table_17240 WHERE "P" = 'MF'
What is the highest number of goals associated with 39 caps?
CREATE TABLE table_38043 ("Name" text,"Goals" real,"Caps" real,"First cap" text,"Latest cap" text)
SELECT MAX("Goals") FROM table_38043 WHERE "Caps" = '39'
What is the rated power for the reactor that ended construction on May 10, 1978?
CREATE TABLE table_14315 ("Reactor Unit" text,"Type" text,"Average Output" text,"Rated Power" text,"Began construction" text,"Finish construction" text,"Commercial operation" text,"Close of reactor" text)
SELECT "Rated Power" FROM table_14315 WHERE "Finish construction" = 'may 10, 1978'
What is 1st Round, when Team 1 is Sporting Toulon Var (D2)?
CREATE TABLE table_46806 ("Team 1" text,"Score" text,"Team 2" text,"1st round" text,"2nd round" text)
SELECT "1st round" FROM table_46806 WHERE "Team 1" = 'sporting toulon var (d2)'
What venue has Scotland as the opposing teams?
CREATE TABLE table_name_95 (venue VARCHAR,opposing_teams VARCHAR)
SELECT venue FROM table_name_95 WHERE opposing_teams = "scotland"
What is the result for November 25, 2001?
CREATE TABLE table_name_45 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_45 WHERE date = "november 25, 2001"
when patient 18866 got an intake of .9% normal saline for the last time during a day before?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CRE...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label...
How many capital cities does Australia have?
CREATE TABLE table_1008653_1 (capital___endonym__ VARCHAR,country___endonym__ VARCHAR)
SELECT COUNT(capital___endonym__) FROM table_1008653_1 WHERE country___endonym__ = "Australia"
What is the average attendance that has 83-52 as the record?
CREATE TABLE table_5562 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT AVG("Attendance") FROM table_5562 WHERE "Record" = '83-52'
how many female patients had the diagnosis long title 35-36 completed weeks of gestation?
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,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "35-36 completed weeks of gestation"
What Score has an Opponent of @ Blue Jays with a Date of June 7?
CREATE TABLE table_5530 ("Date" text,"Time" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Score" FROM table_5530 WHERE "Opponent" = '@ blue jays' AND "Date" = 'june 7'
How many combination classifications have the winner as Erik Zabel and a points classification as Alessandro Petacchi
CREATE TABLE table_15059783_1 (combination_classification VARCHAR,points_classification VARCHAR,winner VARCHAR)
SELECT COUNT(combination_classification) FROM table_15059783_1 WHERE points_classification = "Alessandro Petacchi" AND winner = "Erik Zabel"
What is the price of the internet provider that has an upstream rate of 256 kbit and a downstream rate of 512 kbit?
CREATE TABLE table_name_24 (price VARCHAR,upstream VARCHAR,downstream VARCHAR)
SELECT price FROM table_name_24 WHERE upstream = "256 kbit" AND downstream = "512 kbit"
Comments that Mention Software Engineering Stack Exchange.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostHistoryTypes (Id number,Nam...
SELECT Id AS "comment_link", CreationDate FROM Comments WHERE (DATEDIFF(dd, CreationDate, 2016 - 10 - 21) < 0) AND (Text LIKE '%software%engineering%' OR Text LIKE '%programmers%') ORDER BY CreationDate DESC
What was the record setting time in the 800m freestyle?
CREATE TABLE table_name_76 (time VARCHAR,event VARCHAR)
SELECT time FROM table_name_76 WHERE event = "800m freestyle"
How many rounds was the match against Jason Fairn?
CREATE TABLE table_name_78 (round VARCHAR,opponent VARCHAR)
SELECT round FROM table_name_78 WHERE opponent = "jason fairn"
count the number of patients whose diagnosis long title is unspecified septicemia and lab test category is blood gas.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
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 = "Unspecified septicemia" AND lab."CATEGORY" = "Blood Gas"
What is Position, when Points is greater than 7, and when Series is Toyota Racing Series?
CREATE TABLE table_50948 ("Season" text,"Series" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text)
SELECT "Position" FROM table_50948 WHERE "Points" > '7' AND "Series" = 'toyota racing series'
which hand is the top hand in the card game super aces ?
CREATE TABLE table_203_564 (id number,"hand" text,"1 credit" number,"2 credits" number,"3 credits" number,"4 credits" number,"5 credits" number)
SELECT "hand" FROM table_203_564 WHERE id = 1
WHICH Vietnamese name has a Chinese name of ( ) m ngzh ng?
CREATE TABLE table_75543 ("Longi- tude" text,"Usual translation" text,"Chinese name \u00b9" text,"Japanese name" text,"Korean name \u00b2" text,"Vietnamese name" text,"Date \u00b3" text)
SELECT "Vietnamese name" FROM table_75543 WHERE "Chinese name \u00b9" = '芒種 (芒种) mángzhòng'
Find out the number of clinic referred patients who had premature admission and have other anomalies of larynx trachea and bronchus diagnoses.
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)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Laryngotrach anomaly NEC"
What party established in 1797 won an election in 2007?
CREATE TABLE table_name_17 (party VARCHAR,established VARCHAR,election VARCHAR)
SELECT party FROM table_name_17 WHERE established > 1797 AND election = 2007
give me the number of patients whose diagnoses short title is stevens-johnson-ten syn and drug route is iv bolus?
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 (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
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.short_title = "Stevens-Johnson-TEN syn" AND prescriptions.route = "IV BOLUS"
how many different clubs have won ?
CREATE TABLE table_204_99 (id number,"#" number,"club" text,"winner" number,"last win" number,"runner-up" number,"last losing final" number)
SELECT COUNT(DISTINCT "club") FROM table_204_99 WHERE "winner" > 0
What venue features carlton as an away team?
CREATE TABLE table_name_34 (venue VARCHAR,away_team VARCHAR)
SELECT venue FROM table_name_34 WHERE away_team = "carlton"
Of the ORTHO classes offered this Fall , which are upper level ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE student (student_id int,lastname va...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ORTHO' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall'...