table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_69427 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What is the 8:00 feature with je at 7:00?
SELECT "8:00" FROM table_69427 WHERE "7:00" = 'je'
CREATE TABLE table_name_99 ( second_member VARCHAR, election VARCHAR )
What is Second Member, when Election is '1835'?
SELECT second_member FROM table_name_99 WHERE election = "1835"
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
Show the average age for male and female students Visualize by bar chart, and could you sort total number in descending order?
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
have patient 76327's received tests during their first hospital encounter for alanine aminotransferase (alt)?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'alanine aminotransferase (alt)') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327 AND NOT admissions.dischtime IS NULL ORDER BY admissio...
CREATE TABLE table_203_339 ( id number, "year" text, "car" number, "start" number, "qual" number, "rank" number, "finish" number, "laps" number, "led" number, "retired" text )
previous to 1965 , when did jones have a number 5 start at the indy 500 ?
SELECT "year" FROM table_203_339 WHERE "year" < 1965 AND "start" = 5
CREATE TABLE table_name_45 ( opponent VARCHAR, result VARCHAR )
Name the opponent when the resultwas w 12-11
SELECT opponent FROM table_name_45 WHERE result = "w 12-11"
CREATE TABLE table_12732 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which place is Andy Bean from the United States?
SELECT "Place" FROM table_12732 WHERE "Country" = 'united states' AND "Player" = 'andy bean'
CREATE TABLE table_22175 ( "Episodes" text, "Monday" text, "Tuesday" text, "Wednesday" text, "Thursday" text, "Friday" text )
How many episodes were shown on Friday if 210 Kirby's Epic Yarn was shown on Wednesday?
SELECT COUNT("Friday") FROM table_22175 WHERE "Wednesday" = '210 Kirby''s Epic Yarn'
CREATE TABLE table_62099 ( "Name" text, "Confederation" text, "International goals" real, "Caps" real, "Goals per Match" real )
What is Cha Bum-Kun's average number of goals per match?
SELECT COUNT("Goals per Match") FROM table_62099 WHERE "Name" = 'cha bum-kun'
CREATE TABLE table_55130 ( "Name" text, "Actual version" text, "System" text, "Platform" text, "License" text )
Which platform has an Actual version of 0.147?
SELECT "Platform" FROM table_55130 WHERE "Actual version" = '0.147'
CREATE TABLE table_24091 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Wildcats points" real, "Opponents" real, "Record" text )
How many games did they play when their record 0-2-0?
SELECT COUNT("Date") FROM table_24091 WHERE "Record" = '0-2-0'
CREATE TABLE table_491 ( "Celebrity" text, "Background" text, "Original Team" text, "Age" real, "Hometown" text, "Charity" text, "Result" text, "Raised" text )
What is the charity of the celebrity with the background reality star?
SELECT "Charity" FROM table_491 WHERE "Background" = 'Reality Star'
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
count the number of people diagnosed with chronic nephritis nec who did not come to the hospital in the same month.
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chronic ne...
CREATE TABLE table_24934 ( "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 (million)" text )
Name the title that got 1.54 viewers
SELECT "Title" FROM table_24934 WHERE "U.S. viewers (million)" = '1.54'
CREATE TABLE table_13444 ( "Debut year" real, "Player" text, "Games" real, "Goals" real, "Years at club" text )
Which Goals have Games of 51, and a Debut year smaller than 1992?
SELECT MIN("Goals") FROM table_13444 WHERE "Games" = '51' AND "Debut year" < '1992'
CREATE TABLE table_1353096_1 ( channel_tv___dt__ VARCHAR, station VARCHAR )
What channel has station kdfw ++?
SELECT channel_tv___dt__ FROM table_1353096_1 WHERE station = "KDFW ++"
CREATE TABLE table_14460937_2 ( pos INTEGER, clubs VARCHAR )
what is the minimum pos with clubs being 16
SELECT MIN(pos) FROM table_14460937_2 WHERE clubs = "16"
CREATE TABLE table_name_16 ( sport VARCHAR, name VARCHAR )
What sport did Miroslav Jambor Richard Csejtey participate in?
SELECT sport FROM table_name_16 WHERE name = "miroslav jambor richard csejtey"
CREATE TABLE table_3608 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
The district North Carolina 10 have what candidates?
SELECT "Candidates" FROM table_3608 WHERE "District" = 'North Carolina 10'
CREATE TABLE table_name_96 ( owner VARCHAR )
What is the owner of the channel that has a 2012 rating of 5.42?
SELECT owner FROM table_name_96 WHERE 2012 = "5.42"
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
what was the yearly maximum value of weight for patient 015-56556 until 2104?
SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) <= '2104' GROUP BY STRFTIME('%y', patient.unitadmitt...
CREATE TABLE table_54772 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
What is the total of PI GP played by Anton Rodin with a Reg GP less than 0?
SELECT COUNT("Pl GP") FROM table_54772 WHERE "Player" = 'anton rodin' AND "Reg GP" < '0'
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
give me some restaurants good for french food ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients have been prescribed the drug with code hald5i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "HALD5I"
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose ethnicity is black/cape verdean and age is less than 86?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "86"
CREATE TABLE table_68607 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What were the highest points before the year 1974?
SELECT MAX("Points") FROM table_68607 WHERE "Year" < '1974'
CREATE TABLE table_62844 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What's the 2012 when 2009 was 205?
SELECT "2012" FROM table_62844 WHERE "2009" = '205'
CREATE TABLE table_204_78 ( id number, "no." number, "train no." text, "origin" text, "destination" text, "train name" text )
what are the number of times bangalore is listed as the destination ?
SELECT COUNT(*) FROM table_204_78 WHERE "destination" = 'bangalore'
CREATE TABLE table_50508 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
Where was the game where the senators scored 80 points?
SELECT "Location" FROM table_50508 WHERE "Points" = '80'
CREATE TABLE table_name_20 ( region VARCHAR, format VARCHAR )
Which region had a release format of CD Maxi?
SELECT region FROM table_name_20 WHERE format = "cd maxi"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
until 09/10/2105, what was the daily average dose of enteral formula volume/bolus amt (ml) of patient 004-13672?
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13672')) AND intakeoutput.celllabel = 'enter...
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 (...
how many of the patients with item id 51181 had an unobtainable religious belief?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "UNOBTAINABLE" AND lab.itemid = "51181"
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
What's the unit of measure for sample 3879?
SELECT conunit FROM resultsdata15 WHERE sample_pk = 3879
CREATE TABLE table_74580 ( "Lane" real, "Name" text, "Nationality" text, "Split (50m)" real, "Time" real )
What is the total sum of 50m splits for josefin lillhage in lanes above 8?
SELECT SUM("Split (50m)") FROM table_74580 WHERE "Name" = 'josefin lillhage' AND "Lane" > '8'
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Bar chart x axis job y axis the average of age, list by the y-axis in desc.
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) DESC
CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT ) CREATE TABLE Patient ...
Return the name of each physician and the number of patients he or she treats in a bar chart, and sort total number from high to low order.
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) DESC
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( ro...
what was the first value of an mch lab test in patient 17953?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17953) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') ORDER BY labevents.charttime LIMIT 1
CREATE TABLE table_20555 ( "Vehicle" text, "EPA rated All-electric range" text, "EPA rated combined fuel economy" text, "Alaska ( Juneau )" text, "California (San Francisco)" text, "Mid-Atlantic South (Washington, D.C.)" text, "U.S. national average electric mix" text, "Southeast (Atlant...
What was the emission rating in California for the vehicle that was rated 80 g/mi (50 g/km) in Alaska and 250 g/mi (155 g/km) in the Southeast ?
SELECT "California (San Francisco)" FROM table_20555 WHERE "Alaska ( Juneau )" = '80 g/mi (50 g/km)' AND "Southeast (Atlanta)" = '250 g/mi (155 g/km)'
CREATE TABLE table_1302 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Name the number of pictorials for 5-85
SELECT COUNT("Pictorials") FROM table_1302 WHERE "Date" = '5-85'
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...
what flights from CHICAGO to KANSAS CITY
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS...
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Instances of 'sudo gedit'. 'sudo gedit' instead of 'gksudo gedit' or similar (common misadvice, can make root own dotfiles in home dir)
SELECT Id AS "post_link", Score, ViewCount AS Views FROM Posts WHERE PostTypeId = 2 AND Body LIKE '%sudo gedit%' AND NOT Body LIKE '%gksudo gedit%' ORDER BY Views DESC
CREATE TABLE table_54794 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
I want the driver for Laps more than 8 and ferrari with Grid of 8
SELECT "Driver" FROM table_54794 WHERE "Laps" > '8' AND "Constructor" = 'ferrari' AND "Grid" = '8'
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number...
what did patient 17286 receive for his or her first procedure?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17286) ORDER BY procedures_icd.charttime LIMIT 1)
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients whose item id is 51214?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51214"
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( r...
in 07/this year, is patient 19096's arterial bp [diastolic] ever greater than 58.0?
SELECT COUNT(*) > 0 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 = 19096)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias...
CREATE TABLE table_1342233_32 ( first_elected VARCHAR, incumbent VARCHAR )
Name the total number of first elected for sol bloom
SELECT COUNT(first_elected) FROM table_1342233_32 WHERE incumbent = "Sol Bloom"
CREATE TABLE table_61497 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
What's the 2013 result for the grand slam tournaments?
SELECT "2013" FROM table_61497 WHERE "Tournament" = 'grand slam tournaments'
CREATE TABLE table_44342 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text )
What manufacturer has a year made of 1923?
SELECT "Manufacturer" FROM table_44342 WHERE "Year made" = '1923'
CREATE TABLE table_204_779 ( id number, "network name" text, "flagship" text, "programming type" text, "owner" text, "affiliates" number )
what is the difference between the number of affiliates galavision has and the number of affiliates azteca 13 has ?
SELECT ABS((SELECT "affiliates" FROM table_204_779 WHERE "network name" = 'galavision') - (SELECT "affiliates" FROM table_204_779 WHERE "network name" = 'azteca 13'))
CREATE TABLE table_name_16 ( lane VARCHAR, heat VARCHAR, country VARCHAR, mark VARCHAR )
What is the total lane number for the United States when the mark is 6.62 and the heat is greater than 8?
SELECT COUNT(lane) FROM table_name_16 WHERE country = "united states" AND mark = "6.62" AND heat > 8
CREATE TABLE Aircraft ( aid VARCHAR, name VARCHAR ) CREATE TABLE Certificate ( eid VARCHAR, aid VARCHAR ) CREATE TABLE Employee ( name VARCHAR, eid VARCHAR )
Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300"
CREATE TABLE table_203_651 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
what was galina chistyakova 's last competition ?
SELECT "competition" FROM table_203_651 ORDER BY "year" DESC LIMIT 1
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, ...
How close am I to the Self-learner badge? All self-answers to my own questions. For each answer to my own questions I have question score and answer score. To get the Self-learner badge I need at least 3 votes on an answer among these.
SELECT q.Id AS QuestionId, a.Id AS AnswerId, q.Id AS "post_link", q.Score AS QuestionScore, a.Score AS MyAnswerScore FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id INNER JOIN Users ON Users.Id = q.OwnerUserId WHERE q.OwnerUserId = a.OwnerUserId AND Users.Id = '##UserId##'
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
count the number of patients whose year of birth is less than 2035 and drug name is oxycodone (immediate release) ?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2035" AND prescriptions.drug = "OxycoDONE (Immediate Release) "
CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE department ( dept_code text, de...
What is the first name of each student enrolled in class ACCT-211?
SELECT T3.stu_fname FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'
CREATE TABLE table_26542 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
How many production codes were in series 39?
SELECT COUNT("Production code") FROM table_26542 WHERE "No. in series" = '39'
CREATE TABLE table_63570 ( "Song" text, "Performer" text, "Original artist" text, "Length" text, "Recorded" text )
Who is the original artist of 'Let's Dance'?
SELECT "Original artist" FROM table_63570 WHERE "Song" = 'let''s dance'
CREATE TABLE table_64471 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text )
Who was the opponent for game 30?
SELECT "Opponent" FROM table_64471 WHERE "Game" = '30'
CREATE TABLE table_59914 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "5:00 pm" text, "6:30 pm" ...
What is on at 1:30PM with 12:30 local programs, and Pinky and the Brain shows at 4:00pm?
SELECT "1:30 pm" FROM table_59914 WHERE "12:30 pm" = 'local programs' AND "4:00 pm" = 'pinky and the brain'
CREATE TABLE table_name_47 ( scottish_cup INTEGER, position VARCHAR, league_cup VARCHAR, total VARCHAR )
What is the sum of the scottish cup of the forward player with less than 2 league cups and a total greater than 6?
SELECT SUM(scottish_cup) FROM table_name_47 WHERE league_cup < 2 AND total > 6 AND position = "forward"
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
tell me the total amount of chest tubes left pleural 1 output for patient 97330 in the previous day.
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'che...
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 ) ...
what is the number of patients whose marital status is married and procedure icd9 code is 3607?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "3607"
CREATE TABLE table_52380 ( "Player" text, "Tackles" real, "Solo" real, "Assisted" real, "Sack" real, "Yards" real, "TD's" real )
How many yards for the player with 1 solo tackle and over 0 sacks?
SELECT MAX("Yards") FROM table_52380 WHERE "Solo" = '1' AND "Sack" > '0'
CREATE TABLE table_name_36 ( player VARCHAR, years_for_jazz VARCHAR )
Which player was active in Jazz in 1975-79?
SELECT player FROM table_name_36 WHERE years_for_jazz = "1975-79"
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 )
For those products with a price between 60 and 120, draw a bar chart about the distribution of name and manufacturer , display by the X from low to high.
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number...
select Id from Posts.
SELECT Id FROM Posts
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 admission location is emergency room admit and diagnoses icd9 code is v5416?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "V5416"
CREATE TABLE table_204_948 ( id number, "year" number, "award" text, "category" text, "film" text, "result" text )
what is the difference between the number times the result was won and the number of times the result was nominated ?
SELECT ABS((SELECT COUNT(*) FROM table_204_948 WHERE "result" = 'won') - (SELECT COUNT(*) FROM table_204_948 WHERE "result" = 'nominated'))
CREATE TABLE table_2562572_20 ( largest_ethnic_group__2002_ VARCHAR, population__2011_ VARCHAR )
Name the largest ethnic group for 24112
SELECT largest_ethnic_group__2002_ FROM table_2562572_20 WHERE population__2011_ = 24112
CREATE TABLE table_30830 ( "DrumSet Name" text, "Product Line" text, "Years Available" text, "Drum Module" text, "KickDrum Pad" text, "Snare Pad" text, "Tom-Tom Pads" text, "Hi-HatPad/ Controller" text, "CrashandRide CymbalPads" text, "DrumStand (oftenoptional)" text )
for the drumset name td-15k how many snare pads are
SELECT COUNT("Snare Pad") FROM table_30830 WHERE "DrumSet Name" = 'TD-15K'
CREATE TABLE table_59555 ( "Season" real, "Year" real, "Mole" text, "Winner" text, "Runner-up" text, "Total prize money" text, "Potential prize money" text, "Destination" text )
Who was the runner-up after season 2 when the total prize money was $108,000?
SELECT "Runner-up" FROM table_59555 WHERE "Season" > '2' AND "Total prize money" = '$108,000'
CREATE TABLE table_76971 ( "Result" text, "Race" text, "Distance" text, "Weight" real, "Winner or 2nd" text, "Pos'n" text )
What was the race when the winner of 2nd was Voleuse?
SELECT "Race" FROM table_76971 WHERE "Winner or 2nd" = 'voleuse'
CREATE TABLE table_2624098_1 ( old_english_day_name VARCHAR, glossed_from_latin_day_name VARCHAR )
how mant different day names in old English were coined from the Latin day name 'dies iovis'?
SELECT COUNT(old_english_day_name) FROM table_2624098_1 WHERE glossed_from_latin_day_name = "Dies Iovis"
CREATE TABLE table_name_63 ( mascot VARCHAR, enrollment VARCHAR )
Which Mascot has an Enrollment of 640?
SELECT mascot FROM table_name_63 WHERE enrollment = 640
CREATE TABLE table_name_96 ( city_of_license__market VARCHAR, station VARCHAR )
Which city contains the KPIX station?
SELECT city_of_license__market FROM table_name_96 WHERE station = "kpix"
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, ...
provide the number of patients whose days of hospital stay is greater than 11 and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "11" AND lab.fluid = "Ascites"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
how many patients received a hemodialysis after the procedure of the hypothermia in the previous year within 2 months?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hypothermia' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of yea...
CREATE TABLE table_name_49 ( finish VARCHAR, wins VARCHAR )
What is the Finish of 28 Wins?
SELECT finish FROM table_name_49 WHERE wins = "28"
CREATE TABLE table_name_22 ( player VARCHAR, nhl_team VARCHAR, pick__number VARCHAR )
What is the name of the Player that shows the NHL team of new york rangers, and a Pick # of 31?
SELECT player FROM table_name_22 WHERE nhl_team = "new york rangers" AND pick__number = "31"
CREATE TABLE table_9989 ( "Year" real, "Film" text, "Song" text, "Composer" text, "Language" text )
What year was the composition by Mejo Joseph?
SELECT COUNT("Year") FROM table_9989 WHERE "Composer" = 'mejo joseph'
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
what's the total dose of d10nss that patient 24547 had received since 1446 days ago?
SELECT SUM(inputevents_cv.amount) 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 = 24547)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
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 ) CREATE TABLE diagnoses_icd ( row_id number, ...
count how many times patient 19412 has gone to hospital in this year.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 19412 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
CREATE TABLE table_name_5 ( socialist_ticket VARCHAR, democratic_ticket VARCHAR )
Who's the Socialist ticket with a Democratic ticket of herbert h. lehman?
SELECT socialist_ticket FROM table_name_5 WHERE democratic_ticket = "herbert h. lehman"
CREATE TABLE table_64744 ( "Rank" text, "Province" text, "Population (2011)" real, "Percentage" real, "Population Estimate (2013)" real )
What is the lowest 2013 population estimate of south africa, which has a percentage greater than 19.8 and a 2011 population greater than 51,770,561?
SELECT MIN("Population Estimate (2013)") FROM table_64744 WHERE "Percentage" > '19.8' AND "Province" = 'south africa' AND "Population (2011)" > '51,770,561'
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescription...
list the patient identifications of those patients who were diagnosed with nasal bone fx-closed during the previous year.
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nasal bone fx-closed') AND DATETIME(diagnoses_icd.charttime, 'start of yea...
CREATE TABLE table_name_42 ( date_of_appointment VARCHAR, outgoing_manager VARCHAR )
What is Date of Appointment, when Outgoing Manager is 'Hakan Kutlu'?
SELECT date_of_appointment FROM table_name_42 WHERE outgoing_manager = "hakan kutlu"
CREATE TABLE table_73689 ( "Series #" real, "Season #" text, "Episode" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers (in millions)" text )
What is the series minimum if the season number is 2.08?
SELECT MIN("Series #") FROM table_73689 WHERE "Season #" = '2.08'
CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE...
Bar chart x axis role code y axis the total number
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose diagnoses icd9 code is 25040 and drug type is additive?
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.icd9_code = "25040" AND prescriptions.drug_type = "ADDITIVE"
CREATE TABLE table_41453 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity" real, "Capacity in use" text )
What is the capacity in use of the airport in Rio de Janeiro with an annual change of 40.53%?
SELECT "Capacity in use" FROM table_41453 WHERE "Location" = 'rio de janeiro' AND "Annual change" = '40.53%'
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...
what is the number of patients whose admission type is urgent and insurance is medicaid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Medicaid"
CREATE TABLE table_45635 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
What were the high points on september 9?
SELECT "High points" FROM table_45635 WHERE "Date" = 'september 9'
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...
provide the number of elective hospital admission patients who have been diagnosed with other staphylococcus pneumonia.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Other Staphylococcus pneumonia"
CREATE TABLE table_1773908_3 ( provider VARCHAR, resale VARCHAR, up__up_to_kbit_s_ VARCHAR )
How many providers are there where the resale category is yes and bandwith is up is 1024?
SELECT COUNT(provider) FROM table_1773908_3 WHERE resale = "yes" AND up__up_to_kbit_s_ = 1024
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date...
Most popular tags during the last quarter.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS LastQuarterRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsLastQuarter, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts....
CREATE TABLE table_67883 ( "City" text, "Province/Region" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
In what city is RJSN located?
SELECT "City" FROM table_67883 WHERE "ICAO" = 'rjsn'
CREATE TABLE table_name_15 ( score VARCHAR, opponent_in_the_final VARCHAR )
What score has wynne prakusya as the opponent in the final?
SELECT score FROM table_name_15 WHERE opponent_in_the_final = "wynne prakusya"
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...
count the number of patients who have been diagnosed with acute coronary syndrome and did not come back to the hospital within 2 months since 3 years ago.
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute coronary syndrome' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year'...
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 decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
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, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, and show total number in descending order.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC
CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text )
What are the names and years of the movies that has the top 3 highest rating star?
SELECT T2.title, T2.year FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid ORDER BY T1.stars DESC LIMIT 3