instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Top 20 Most Answered Questions. Top 20 Most Answered Questions on your site. This is intended for sites like Puzzling.SE or Code Golf, but it should work anywhere. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,... | SELECT AnswerCount AS "answers", Id AS "post_link", CommentCount AS "comments" FROM Posts ORDER BY AnswerCount DESC LIMIT 20 |
Name the singer for joe wilkinson | CREATE TABLE table_30945 ("Episode" real,"Broadcast date" text,"Guest(s)" text,"Singer(s)" text,"Comedian" text,"Ratings" text) | SELECT "Singer(s)" FROM table_30945 WHERE "Comedian" = 'Joe Wilkinson' |
What is Run 4, when Run 2 is 1:25.84? | CREATE TABLE table_name_21 (run_4 VARCHAR,run_2 VARCHAR) | SELECT run_4 FROM table_name_21 WHERE run_2 = "1:25.84" |
What was the number of races in the season in which the team placed on the 14th position? | CREATE TABLE table_23225 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text) | SELECT MIN("Races") FROM table_23225 WHERE "Position" = '14th' |
What are the original air dates when scientology isthe poll winner? | CREATE TABLE table_20302 ("#" real,"Advocate # 1" text,"Advocate # 2" text,"Root of All Evil" text,"Poll winner" text,"Original air date" text) | SELECT "Original air date" FROM table_20302 WHERE "Poll winner" = 'Scientology' |
How many tournaments ended with a score of 204 (-12)? | CREATE TABLE table_16950 ("Date" text,"Tournament" text,"Location" text,"Purse($)" real,"Winner" text,"Score" text,"1st Prize($)" real) | SELECT COUNT("Tournament") FROM table_16950 WHERE "Score" = '204 (-12)' |
What are the number of the names of all products?, rank x-axis from low to high order. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name |
Find the names of the products with length smaller than 3 or height greater than 5. | CREATE TABLE catalog_contents (catalog_entry_name VARCHAR,LENGTH VARCHAR,width VARCHAR) | SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5 |
Which captain has howard wilkinson as the manager? | CREATE TABLE table_name_52 (captain VARCHAR,manager VARCHAR) | SELECT captain FROM table_name_52 WHERE manager = "howard wilkinson" |
Which builder has the the kanji of ? | CREATE TABLE table_33844 ("Kanji" text,"Name (Translation)" text,"Builder" text,"Laid down" text,"Launched" text,"Completed" text) | SELECT "Builder" FROM table_33844 WHERE "Kanji" = '曙' |
how many patients whose ethnicity is hispanic or latino and days of hospital stay is greater than 23? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "23" |
Which FC match has a total of 24? | CREATE TABLE table_51177 ("Name of ground" text,"Location" text,"Year" text,"FC matches" text,"LA matches" text,"T20 matches" text,"Total" text) | SELECT "FC matches" FROM table_51177 WHERE "Total" = '24' |
what patient 035-4312's age is on this hospital encounter? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,... | SELECT patient.age FROM patient WHERE patient.uniquepid = '035-4312' AND patient.hospitaldischargetime IS NULL |
What country is Steve Jones from? | CREATE TABLE table_name_55 (country VARCHAR,player VARCHAR) | SELECT country FROM table_name_55 WHERE player = "steve jones" |
how many days has it elapsed since patient 9964 was admitted to the hospital? | 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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedur... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 9964 AND admissions.dischtime IS NULL |
What's the game with an attendance of 71,962? | CREATE TABLE table_name_53 (game INTEGER,attendance VARCHAR) | SELECT MIN(game) FROM table_name_53 WHERE attendance = 71 OFFSET 962 |
Name the least week for september 19, 1976 | CREATE TABLE table_14945881_1 (week INTEGER,date VARCHAR) | SELECT MIN(week) FROM table_14945881_1 WHERE date = "September 19, 1976" |
What is the total number of white (Hispanic/Non-Hispanic) having a black (Hispanic/Non-Hispanic) of 9.9 and Hispanic under 99.5? | CREATE TABLE table_name_77 (white__both_hispanic_and_non_hispanic_ VARCHAR,black__both_hispanic_and_non_hispanic_ VARCHAR,hispanic__of_any_race_ VARCHAR) | SELECT COUNT(white__both_hispanic_and_non_hispanic_) FROM table_name_77 WHERE black__both_hispanic_and_non_hispanic_ = 9.9 AND hispanic__of_any_race_ < 99.5 |
has patient 015-33415 been admitted into the hospital until 1 year ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '015-33415' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-1 year') |
What positions were drafted from Las Vegas, NV? | CREATE TABLE table_11677100_16 (position VARCHAR,hometown VARCHAR) | SELECT position FROM table_11677100_16 WHERE hometown = "Las Vegas, NV" |
What's the rank of the Province-Level Municipality? | CREATE TABLE table_50762 ("Rank" real,"City" text,"Population" text,"Definition" text,"Country" text) | SELECT "Rank" FROM table_50762 WHERE "Definition" = 'province-level municipality' |
Give me a histogram for what is the lowest salary in departments with average salary greater than the overall average, show by the Y-axis from low to high. | CREATE TABLE takes (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),grade varchar(2))CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE time_slot (time_slot_i... | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary) |
how many hours have passed since last time that patient 15986 stayed in careunit micu during their current hospital encounter? | CREATE TABLE d_labitems (row_id number,itemid number,label 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,intime time,outtime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15986 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1 |
What is the lowest overall amount of rainfall totals (million m 3)? | CREATE TABLE table_26609958_1 (rainfall_totals__million_m_3__ INTEGER) | SELECT MIN(rainfall_totals__million_m_3__) FROM table_26609958_1 |
Which producer worked with Robert Sproul-cran as writer? | CREATE TABLE table_name_94 (producer_s_ VARCHAR,writer_s_ VARCHAR) | SELECT producer_s_ FROM table_name_94 WHERE writer_s_ = "robert sproul-cran" |
Which Rider has a Grid larger than 6, and has Laps of 28, and a Time of +39.476? | CREATE TABLE table_47694 ("Rider" text,"Manufacturer" text,"Laps" real,"Time" text,"Grid" real) | SELECT "Rider" FROM table_47694 WHERE "Grid" > '6' AND "Laps" = '28' AND "Time" = '+39.476' |
What is the carrier of the most expensive phone? | CREATE TABLE market (market_id number,district text,num_of_employees number,num_of_shops number,ranking number)CREATE TABLE phone (name text,phone_id number,memory_in_g number,carrier text,price number)CREATE TABLE phone_market (market_id number,phone_id text,num_of_stock number) | SELECT carrier FROM phone ORDER BY price DESC LIMIT 1 |
Tell me the 1st leg for asfa rabat | CREATE TABLE table_name_9 (team__number1 VARCHAR) | SELECT 1 AS st_leg FROM table_name_9 WHERE team__number1 = "asfa rabat" |
how many female patients remained admitted in the hospital for more than 23 days? | 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,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "23" |
What is Denmark's rank? | CREATE TABLE table_66481 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Rank" FROM table_66481 WHERE "Nation" = 'denmark' |
period between 1985 - 1990 have minimum infant mortality rate of what. | CREATE TABLE table_21258_1 (infant_mortality_rate INTEGER,period VARCHAR) | SELECT MIN(infant_mortality_rate) FROM table_21258_1 WHERE period = "1985 - 1990" |
what was the name of the first intake of patient 011-35642 that they had until 1726 days ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllab... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-35642')) AND intakeoutput.cellpath LIKE '%intake%' AND D... |
How many years have a Form album of the thing? | CREATE TABLE table_64646 ("Year" real,"Title" text,"From album" text,"Label" text,"Label-Nr" text) | SELECT SUM("Year") FROM table_64646 WHERE "From album" = 'the thing' |
What is the airdate when the story is listed as hugh leonard? | CREATE TABLE table_15739098_2 (airdate VARCHAR,story VARCHAR) | SELECT airdate FROM table_15739098_2 WHERE story = "Hugh Leonard" |
What week did they have a bye? | CREATE TABLE table_name_52 (week VARCHAR,date VARCHAR) | SELECT week FROM table_name_52 WHERE date = "bye" |
What is the lowest Avg/G with a Long less than 0? | CREATE TABLE table_name_99 (avg_g INTEGER,long INTEGER) | SELECT MIN(avg_g) FROM table_name_99 WHERE long < 0 |
What episode premier received 0.680 million viewers? | CREATE TABLE table_26017 ("#" real,"Title" text,"Original airdate" text,"Timeslot" text,"Viewers (millions)" text,"Nightly rank" real,"Weekly rank" real) | SELECT "Original airdate" FROM table_26017 WHERE "Viewers (millions)" = '0.680' |
A scatter chart shows the correlation between ID and salary . | CREATE TABLE teaches (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0))CREATE TABLE department (dept_name varchar(20),building varchar(15),budget numeric(12,2))CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE section ... | SELECT ID, salary FROM instructor ORDER BY salary |
Name the lowest league for play-offs more than 0 and total of 25 | CREATE TABLE table_15386 ("Name" text,"League" real,"Play-offs" real,"FA Cup" real,"League Cup" real,"Total" real) | SELECT MIN("League") FROM table_15386 WHERE "Play-offs" > '0' AND "Total" = '25' |
how many patients with diagnoses of other alteration of consciousness were admitted before the year 2180? | 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 text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2180" AND diagnoses.long_title = "Other alteration of consciousness" |
how many patients whose primary disease is liver transplant and age is less than 85? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.age < "85" |
For those records from the products and each product's manufacturer, find name and code , and group by attribute headquarter, and visualize them by a bar chart, order x axis from high to low order. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC |
Which Result has a Category of outstanding actor (drama)? | CREATE TABLE table_61026 ("Year" real,"Award" text,"Category" text,"Role" text,"Result" text) | SELECT "Result" FROM table_61026 WHERE "Category" = 'outstanding actor (drama)' |
What is the lowest game number when the record was 26-24-9? | CREATE TABLE table_46036 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text) | SELECT MIN("Game") FROM table_46036 WHERE "Record" = '26-24-9' |
How many points did the opposing team get in the game with 6-2 record? | CREATE TABLE table_23184448_3 (opp_points INTEGER,record VARCHAR) | SELECT MIN(opp_points) FROM table_23184448_3 WHERE record = "6-2" |
history of significant trauma | CREATE TABLE table_train_55 ("id" int,"ejection_fraction_ef" int,"systolic_dysfunction" bool,"language" string,"valvular_dysfunction" bool,"consent" bool,"heart_disease" bool,"left_bundle_branch_block" bool,"trauma" bool,"pericardial_disease" bool,"complete_fluid_challenge" bool,"receiving_vasopressor" bool,"pulmonary_... | SELECT * FROM table_train_55 WHERE trauma = 1 |
How may draws did libertad have? | CREATE TABLE table_19658 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT COUNT("Draws") FROM table_19658 WHERE "Team" = 'Libertad' |
Game larger than 34, and a December smaller than 23 had what record? | CREATE TABLE table_name_20 (record VARCHAR,game VARCHAR,december VARCHAR) | SELECT record FROM table_name_20 WHERE game > 34 AND december < 23 |
What team got a draft pick player from McGill? | CREATE TABLE table_27352 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "CFL Team" FROM table_27352 WHERE "College" = 'McGill' |
what is age and discharge location of subject name jerry deberry? | 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 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_fla... | SELECT demographic.age, demographic.discharge_location FROM demographic WHERE demographic.name = "Jerry Deberry" |
the presence of any of the following diseases: asthma if treated with systemic or inhaled corticosteroids in the last 6 months ; cystic fibrosis ; angina ( recurrent heart pain ) | CREATE TABLE table_test_31 ("id" int,"ejection_fraction_ef" int,"macular_disease" bool,"systemic" bool,"alt" float,"iud" bool,"condom_with_spermicide" bool,"gender" string,"meropenem" bool,"non_q_wave_myocardial_infarction" bool,"hbcab" bool,"unstable_angina" bool,"birth_control_pills" bool,"cystic_fibrosis" bool,"hbv_... | SELECT * FROM table_test_31 WHERE (asthma = 1 AND (systemic = 1 OR inhaled_corticosteroids = 1)) OR cystic_fibrosis = 1 OR angina = 1 OR recurrent_heart_pain = 1 |
Show the number of apartment bookings for each weekday and bin booking start date by weekday interval in a bar chart, and sort y axis in desc order. | CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CH... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC |
Return all the information for all employees without any department number. | CREATE TABLE employees (department_id VARCHAR) | SELECT * FROM employees WHERE department_id = "null" |
What is Position, when Pick # is less than 40, and when College is Western? | CREATE TABLE table_name_40 (position VARCHAR,pick__number VARCHAR,college VARCHAR) | SELECT position FROM table_name_40 WHERE pick__number < 40 AND college = "western" |
Find the names of courses that have either 3 credits or 1 credit but 4 hours. | CREATE TABLE department (dno number,division text,dname text,room text,building text,dphone number)CREATE TABLE member_of (facid number,dno number,appt_type text)CREATE TABLE course (cid text,cname text,credits number,instructor number,days text,hours text,dno number)CREATE TABLE faculty (facid number,lname text,fname ... | SELECT cname FROM course WHERE credits = 3 UNION SELECT cname FROM course WHERE credits = 1 AND hours = 4 |
Which upper level electives are offered before noon ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)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 program_course (program_id int,cour... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest... |
On the Circuit Zolder who was the winning team? | CREATE TABLE table_3243 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Team" text) | SELECT "Winning Team" FROM table_3243 WHERE "Circuit" = 'Circuit Zolder' |
What is the record on October 30? | CREATE TABLE table_60313 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Record" FROM table_60313 WHERE "Date" = 'october 30' |
yes or no for the melbourne with yes for gold coast, yes for adelaide, no for auckland? | CREATE TABLE table_67836 ("Sydney" text,"Melbourne" text,"Perth" text,"Adelaide" text,"Gold Coast" text,"Auckland" text) | SELECT "Melbourne" FROM table_67836 WHERE "Gold Coast" = 'yes' AND "Adelaide" = 'no' AND "Auckland" = 'no' |
What is the highest Year, when the Venue is Beijing, PR China? | CREATE TABLE table_name_54 (year INTEGER,venue VARCHAR) | SELECT MAX(year) FROM table_name_54 WHERE venue = "beijing, pr china" |
Show me about the correlation between School_ID and All_Games_Percent , and group by attribute ACC_Regular_Season in a scatter chart. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season |
The episode which originally aired on December 17, 2004 was written by whom? | CREATE TABLE table_25518 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT "Written by" FROM table_25518 WHERE "Original air date" = 'December 17, 2004' |
What is the total number of Year, when Winner is 'Johnathan Gray'? | CREATE TABLE table_78631 ("Year" real,"Winner" text,"Sport" text,"Hometown" text,"College" text) | SELECT COUNT("Year") FROM table_78631 WHERE "Winner" = 'johnathan gray' |
What was the team from Austria when the Netherlands sent Brunssum/Schinnen LL Brunssum and Belgium sent Shape and Waterloo LL Brussels? | CREATE TABLE table_30603 ("Year" real,"Austria" text,"Belgium" text,"England" text,"Germany" text,"Italy" text,"Netherlands" text,"Saudi Arabia" text,"Spain" text,"United Arab Emirates" text) | SELECT "Austria" FROM table_30603 WHERE "Netherlands" = 'Brunssum/Schinnen LL Brunssum' AND "Belgium" = 'SHAPE and Waterloo LL Brussels' |
Which Country is the show aired on Fox? | CREATE TABLE table_19381 ("Country" text,"Local Name" text,"Host" text,"Channel" text,"Year Aired" text,"Top Prize" text) | SELECT "Country" FROM table_19381 WHERE "Channel" = 'Fox' |
which capacitor has the top voltage rating ? | CREATE TABLE table_204_583 (id number,"capacitor type" text,"capacity" text,"volts" text,"temp." text,"energy-to-weight ratio" text,"power-to-weight ratio" text) | SELECT "capacitor type" FROM table_204_583 ORDER BY "volts" DESC LIMIT 1 |
who scored higher in total score of the two athletes from the soviet union -lrb- urs -rrb- ? | CREATE TABLE table_204_296 (id number,"rank" number,"athlete" text,"qual" number,"final" number,"total" number,"notes" text) | SELECT "athlete" FROM table_204_296 WHERE "athlete" = 'urs' ORDER BY "total" DESC LIMIT 1 |
Which country scored 69-67-69-70=275? | CREATE TABLE table_46922 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Country" FROM table_46922 WHERE "Score" = '69-67-69-70=275' |
what is the average age of male patients who died before the year 2165? | 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,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dod_year < "2165.0" |
get the number of patients with cardiac arrest diagnoses who are widowed. | 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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Cardiac arrest" |
number of hospital visits of patient 65401 in this year. | 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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_locatio... | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 65401 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
Which Year(s) won has a Total smaller than 292, and a Player of hale irwin? | CREATE TABLE table_47172 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Year(s) won" FROM table_47172 WHERE "Total" < '292' AND "Player" = 'hale irwin' |
What is the sum of the ranks for india? | CREATE TABLE table_name_59 (rank INTEGER,country VARCHAR) | SELECT SUM(rank) FROM table_name_59 WHERE country = "india" |
For class RCIDIV 390 , how often does it meet ? | 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_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... |
Tell me the lowest pick number for columbus crew | CREATE TABLE table_4433 ("Pick #" real,"MLS team" text,"Player" text,"Position" text,"Affiliation" text) | SELECT MIN("Pick #") FROM table_4433 WHERE "MLS team" = 'columbus crew' |
what is admission location and diagnoses long title of subject id 9271? | 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,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT demographic.admission_location, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "9271" |
do you have a flight from SALT LAKE CITY to ST. PETERSBURG | CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufactu... | 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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... |
what does patient 021-102856 have to pay for their stay in hospital in 2104? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime ti... | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-102856') AND STRFTIME('%y', cost.chargetime) = '2104' |
What year was the No. 7 charts? | CREATE TABLE table_name_32 (year INTEGER,charts VARCHAR) | SELECT AVG(year) FROM table_name_32 WHERE charts = "no. 7" |
how many papers appeared at nips last year | CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TA... | SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'nips' |
how many patients whose procedure icd9 code is 5771? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "5771" |
What T9 Place Player had a Score of 73-67-74-71=285? | CREATE TABLE table_name_92 (player VARCHAR,place VARCHAR,score VARCHAR) | SELECT player FROM table_name_92 WHERE place = "t9" AND score = 73 - 67 - 74 - 71 = 285 |
Count the number of questions. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)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 ReviewTaskResults (Id number,ReviewTaskId number,... | SELECT COUNT(Id) FROM Posts WHERE PostTypeId = 2 AND (Body LIKE '%<pre>%') |
Which source has a Cost free, and an Activity of some, and an Editor of markitup? | CREATE TABLE table_name_48 (open_source VARCHAR,editor VARCHAR,cost___us$__ VARCHAR,activity VARCHAR) | SELECT open_source FROM table_name_48 WHERE cost___us$__ = "free" AND activity = "some" AND editor = "markitup" |
For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the average of revenue , and group by attribute headquarter in a bar chart, and I want to show by the Y from low to high. | 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 Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue) |
provide the number of patients whose diagnoses short title is hy kid nos w cr kid i-iv? | 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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Hy kid NOS w cr kid I-IV" |
Which Date has a Home team of st kilda? | CREATE TABLE table_54753 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_54753 WHERE "Home team" = 'st kilda' |
What is the result of the UFC 87? | CREATE TABLE table_name_95 (res VARCHAR,event VARCHAR) | SELECT res FROM table_name_95 WHERE event = "ufc 87" |
what is the difference in the total score between first and second place ? | CREATE TABLE table_203_780 (id number,"rank" number,"diver" text,"preliminary\npoints" number,"preliminary\nrank" number,"final\npoints" number,"final\nrank" number,"final\ntotal" number) | SELECT ABS((SELECT "final\ntotal" FROM table_203_780 WHERE "rank" = 1) - (SELECT "final\ntotal" FROM table_203_780 WHERE "rank" = 2)) |
With the official name Quispamsis, what is the census ranking? | CREATE TABLE table_171236_1 (census_ranking VARCHAR,official_name VARCHAR) | SELECT census_ranking FROM table_171236_1 WHERE official_name = "Quispamsis" |
What is the others# when bush% is 57.0%? | CREATE TABLE table_1302886_1 (others_number INTEGER,bush_percentage VARCHAR) | SELECT MAX(others_number) FROM table_1302886_1 WHERE bush_percentage = "57.0%" |
Return the maximum support rate, minimum consider rate, and minimum oppose rate across all candidates? | CREATE TABLE candidate (candidate_id number,people_id number,poll_source text,date text,support_rate number,consider_rate number,oppose_rate number,unsure_rate number)CREATE TABLE people (people_id number,sex text,name text,date_of_birth text,height number,weight number) | SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate |
bmi > 35 | CREATE TABLE table_train_195 ("id" int,"gender" string,"pregnancy_or_lactation" bool,"allergy_to_perflutren" bool,"heart_disease" bool,"body_mass_index_bmi" float,"age" float,"NOUSE" float) | SELECT * FROM table_train_195 WHERE body_mass_index_bmi >= 35 |
what is the district where the vacator is vacant? | CREATE TABLE table_2516 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text) | SELECT "District" FROM table_2516 WHERE "Vacator" = 'Vacant' |
How many season 3 appearances by Morgan the Dog? | CREATE TABLE table_26240046_1 (season_3 INTEGER,played_by VARCHAR) | SELECT MAX(season_3) FROM table_26240046_1 WHERE played_by = "Morgan the Dog" |
For all employees in the Finance department, compare the total number of different job id using a bar chart. | 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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),E... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID |
what is the top three most frequently prescribed drugs that were prescribed to patients within the same hospital visit after being diagnosed with pneumonia? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientu... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS ... |
What was the total tenure time with a rank of 49? | CREATE TABLE table_4524 ("Total tenure rank" real,"Uninterrupted rank" real,"Name" text,"Party affiliation" text,"Total tenure time" text,"Uninterrupted time" text) | SELECT "Total tenure time" FROM table_4524 WHERE "Total tenure rank" = '49' |
Show the number of courses for each course description in a bar chart, I want to sort x axis from low to high order please. | CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA ... | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION |
cardiogenic shock ( positive shock index or need for catecholamine support or systolic blood pressure < 90 mmhg ) | CREATE TABLE table_test_28 ("id" int,"positive_shock_index" bool,"anemia" bool,"serum_potassium" float,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"malignant_hypertension" bool,"severe_hypertension" bool,"hemoglobin_a1c_hba1c" float,"allergy_to_thienopyridine" bool,"platelets" int,"n... | SELECT * FROM table_test_28 WHERE cardiogenic_shock = 1 OR positive_shock_index = 1 OR catecholamine_support = 1 OR systolic_blood_pressure_sbp < 90 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.