instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what is the color quality when the relay is ? | CREATE TABLE table_name_9 (color_quality VARCHAR,relay VARCHAR) | SELECT color_quality FROM table_name_9 WHERE relay = "✓" |
Which were the bout 1 when the bout 5 was andreev ( rus ) w 5-2? | CREATE TABLE table_19398910_4 (bout_1 VARCHAR,bout_5 VARCHAR) | SELECT bout_1 FROM table_19398910_4 WHERE bout_5 = "Andreev ( RUS ) W 5-2" |
Which Catalog has a Date of july 15, 2011? | CREATE TABLE table_64721 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" real) | SELECT AVG("Catalog") FROM table_64721 WHERE "Date" = 'july 15, 2011' |
i'd like to know the latest flight from ATLANTA to BOSTON | 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 int,flight_number int,from_airport varchar,meal_code text,stop... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... |
on the current hospital encounter how many hours have passed since the first hypertension nos diagnosis of patient 14154? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid... | SELECT 24 * (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 = 'hypertension nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions... |
What was the home team's score in the match at Victoria Park? | CREATE TABLE table_32844 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_32844 WHERE "Venue" = 'victoria park' |
For Spring and Summer what courses meet the MDE requirement ? | 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 int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id... |
What is the velocity of the pilot named 'Thompson'? | CREATE TABLE flight (velocity INTEGER,pilot VARCHAR) | SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson' |
What is the lowest number of losses for teams that lost 52 ends? | CREATE TABLE table_20836 ("Locale" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot %" text) | SELECT MIN("L") FROM table_20836 WHERE "Ends Lost" = '52' |
Find All_Games and Team_ID , and visualize them by a bar chart, and could you display by the x-axis in desc? | 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 All_Games, Team_ID FROM basketball_match ORDER BY All_Games DESC |
Show the number of accounts opened in each year for all accounts and group by other account details in a group line chart, and sort from high to low by the X-axis. | CREATE TABLE Financial_Transactions (transaction_id INTEGER,account_id INTEGER,invoice_number INTEGER,transaction_type VARCHAR(15),transaction_date DATETIME,transaction_amount DECIMAL(19,4),transaction_comment VARCHAR(255),other_transaction_details VARCHAR(255))CREATE TABLE Invoices (invoice_number INTEGER,order_id INT... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY date_account_opened DESC |
Which Opponent has a Result of 0-3? | CREATE TABLE table_59829 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real) | SELECT "Opponent" FROM table_59829 WHERE "Result" = '0-3' |
Show the card type codes and the number of transactions. | CREATE TABLE customers_cards (card_id number,customer_id number,card_type_code text,card_number text,date_valid_from time,date_valid_to time,other_card_details text)CREATE TABLE accounts (account_id number,customer_id number,account_name text,other_account_details text)CREATE TABLE customers (customer_id number,custome... | SELECT T2.card_type_code, COUNT(*) FROM financial_transactions AS T1 JOIN customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code |
what is last weight of patient 28447 in this month. | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id numb... | SELECT 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 = 28447)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... |
What is the safari value with a 28.0% internet explorer? | CREATE TABLE table_name_70 (safari VARCHAR,internet_explorer VARCHAR) | SELECT safari FROM table_name_70 WHERE internet_explorer = "28.0%" |
What race was there in the formula one series when there was a test driver? | CREATE TABLE table_36576 ("Season" real,"Series" text,"Team" text,"Races" text,"Wins" text,"Poles" text,"F/Laps" text,"Podiums" text,"Points" text,"Position" text) | SELECT "Races" FROM table_36576 WHERE "Series" = 'formula one' AND "Poles" = 'test driver' |
What are the number of names of patients who made an appointment?, I want to sort by the y axis from high to low. | CREATE TABLE Patient (SSN INTEGER,Name VARCHAR(30),Address VARCHAR(30),Phone VARCHAR(30),InsuranceID INTEGER,PCP INTEGER)CREATE TABLE Affiliated_With (Physician INTEGER,Department INTEGER,PrimaryAffiliation BOOLEAN)CREATE TABLE On_Call (Nurse INTEGER,BlockFloor INTEGER,BlockCode INTEGER,OnCallStart DATETIME,OnCallEnd D... | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) DESC |
What year was Skyline High School founded? | CREATE TABLE table_18971 ("High School" text,"Location" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Nickname" text,"Division" text) | SELECT COUNT("Founded") FROM table_18971 WHERE "High School" = 'Skyline' |
What are the names of candidates who have a lower support rate than oppose rate? | 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 t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate |
What are the names of players who train between 500 and 1500 hours? | CREATE TABLE college (cname text,state text,enr number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE player (pid number,pname text,ycard text,hs number) | SELECT pname FROM player WHERE hs BETWEEN 500 AND 1500 |
How many runs were ranked 4? | CREATE TABLE table_7696 ("Rank" text,"Runs" text,"Player" text,"Average" text,"Season" text) | SELECT "Runs" FROM table_7696 WHERE "Rank" = '4' |
What is the D44 when D43 is R 14? | CREATE TABLE table_name_64 (d_44 VARCHAR,d_43 VARCHAR) | SELECT d_44 FROM table_name_64 WHERE d_43 = "r 14" |
give the number of patients born before the year 2152 who had procedure titled left heart cardiac cath. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2152" AND procedures.short_title = "Left heart cardiac cath" |
which morgan creek film grossed the most worldwide ? | CREATE TABLE table_203_98 (id number,"title" text,"year" number,"director" text,"budget" text,"gross (worldwide)" text,"notes" text) | SELECT "title" FROM table_203_98 ORDER BY "gross (worldwide)" DESC LIMIT 1 |
What was the religious affiliation for the athletics nicknamed lords/ladies? | CREATE TABLE table_76313 ("University" text,"Location" text,"Enrollment" real,"Founded" real,"Religious affiliation" text,"Athletics nickname" text,"School colors" text) | SELECT "Religious affiliation" FROM table_76313 WHERE "Athletics nickname" = 'lords/ladies' |
What is the Qual with less than 68 laps? | CREATE TABLE table_name_3 (qual VARCHAR,laps INTEGER) | SELECT qual FROM table_name_3 WHERE laps < 68 |
what is admission type and days of hospital stay of subject id 7273? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.subject_id = "7273" |
Find the names of customers who never placed an order. | CREATE TABLE customer_orders (order_id number,customer_id number,order_status text,order_date time,order_details text)CREATE TABLE order_items (order_id number,product_id number,order_quantity text)CREATE TABLE customer_addresses (customer_id number,address_id number,date_address_from time,address_type text,date_addres... | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id |
A bar chart for what are the number of the last names for all scholarship students?, and rank total number in desc order. | CREATE TABLE Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))CREATE TABLE Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)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 Spor... | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY COUNT(LName) DESC |
What are the total number of Domestic Passengers of airports that contain the word 'London'. | CREATE TABLE pilot (pilot_id number,name text,age number)CREATE TABLE airport (airport_id number,airport_name text,total_passengers number,%_change_2007 text,international_passengers number,domestic_passengers number,transit_passengers number,aircraft_movements number,freight_metric_tonnes number)CREATE TABLE aircraft ... | SELECT SUM(domestic_passengers) FROM airport WHERE airport_name LIKE "%London%" |
Name the centennial for 1992 akimel | CREATE TABLE table_20446 ("Information" text,"Akimel A-al The name is Tohono Oodham for children of the river" text,"Altade\u00f1a" text,"Aprende" text,"Centennial" text,"Kyrene MS" text,"del Pueblo" text) | SELECT "Centennial" FROM table_20446 WHERE "Akimel A-al The name is Tohono Oodham for children of the river" = '1992' |
What are the LOA (metres) of boat with sail number M10? | CREATE TABLE table_20854943_2 (loa__metres_ VARCHAR,sail_number VARCHAR) | SELECT loa__metres_ FROM table_20854943_2 WHERE sail_number = "M10" |
Find the first names and last names of teachers in alphabetical order of last name. | CREATE TABLE Teachers (first_name VARCHAR,last_name VARCHAR) | SELECT first_name, last_name FROM Teachers ORDER BY last_name |
What year was the game that ended with a score of 24-14? | CREATE TABLE table_name_22 (year INTEGER,result VARCHAR) | SELECT AVG(year) FROM table_name_22 WHERE result = "24-14" |
Which Position has a Pick # smaller than 23, and a Player of garrett sutherland? | CREATE TABLE table_name_12 (position VARCHAR,pick__number VARCHAR,player VARCHAR) | SELECT position FROM table_name_12 WHERE pick__number < 23 AND player = "garrett sutherland" |
what is the place when the score is 76-69-71-70=286? | CREATE TABLE table_46191 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Place" FROM table_46191 WHERE "Score" = '76-69-71-70=286' |
What was Team 1 Junior's points? | CREATE TABLE table_27603010_14 (points VARCHAR,team__number1 VARCHAR) | SELECT points FROM table_27603010_14 WHERE team__number1 = "Junior" |
Who was the supporting actress in 'For Whom the Bell Tolls'? | CREATE TABLE table_24225238_1 (supporting_actress VARCHAR,film VARCHAR) | SELECT supporting_actress FROM table_24225238_1 WHERE film = "For Whom the Bell Tolls" |
On May 9 after Game 3, what was the Opponent? | CREATE TABLE table_5316 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Series" text) | SELECT "Opponent" FROM table_5316 WHERE "Game" > '3' AND "Date" = 'may 9' |
since 3 years ago, what are the three most frequently prescribed drugs to hypertension female patients aged 40s within the same hospital visit after they have been diagnosed with hypertension? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | 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 = 'hypertension' A... |
who finished directly before akinremi ? | CREATE TABLE table_204_71 (id number,"rank" number,"heat" number,"name" text,"nationality" text,"time" text,"notes" text) | SELECT "name" FROM table_204_71 WHERE "rank" = (SELECT "rank" FROM table_204_71 WHERE "name" = 'christy akinremi') - 1 |
what is the number of patients whose age is less than 55 and drug code is warf1? | 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)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "55" AND prescriptions.formulary_drug_cd = "WARF1" |
show me the top five most frequent diagnoses? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_... | 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 GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 5) |
I want the outgoing manager for craig brewster | CREATE TABLE table_10574 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Replaced by" text,"Date of appointment" text) | SELECT "Outgoing manager" FROM table_10574 WHERE "Replaced by" = 'craig brewster' |
Show the proportion of the number of ranks for each rank. | CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Student (StuID INTEGER,... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank |
What is Model Number, when Voltage is 2.0V, and when Frequency is 350 mhz? | CREATE TABLE table_49715 ("Model number" text,"Frequency" text,"L2 cache" text,"Mult." text,"Voltage" text,"Socket" text) | SELECT "Model number" FROM table_49715 WHERE "Voltage" = '2.0v' AND "Frequency" = '350 mhz' |
which parts have more than 2 faults? Show the part name and id. | CREATE TABLE Maintenance_Contracts (maintenance_contract_id INTEGER,maintenance_contract_company_id INTEGER,contract_start_date DATETIME,contract_end_date DATETIME,other_contract_details VARCHAR(255))CREATE TABLE Fault_Log (fault_log_entry_id INTEGER,asset_id INTEGER,recorded_by_staff_id INTEGER,fault_log_entry_datetim... | SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id |
hmm.. what was patient 96937's first sodium since 109 months ago? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status t... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96937) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-109 mon... |
What party was the member peter howson part of? | CREATE TABLE table_9192 ("Member" text,"Party" text,"Electorate" text,"State" text,"Term of office" text) | SELECT "Party" FROM table_9192 WHERE "Member" = 'peter howson' |
What Tournament had a Winning score of 6 (73-68-72-69=282)? | CREATE TABLE table_9999 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Tournament" FROM table_9999 WHERE "Winning score" = '–6 (73-68-72-69=282)' |
Which country is Pete Cooper, who made $816, from? | CREATE TABLE table_77149 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Country" FROM table_77149 WHERE "Money ( $ )" = '816' AND "Player" = 'pete cooper' |
What year was the expansion in the city of San Juan? | CREATE TABLE table_66099 ("Continent" text,"Location" text,"City" text,"Date" text,"Year" real) | SELECT COUNT("Year") FROM table_66099 WHERE "City" = 'san juan' |
How many first tournaments are associated with bowling? | CREATE TABLE table_2849652_2 (sport VARCHAR) | SELECT COUNT(1 AS st_tournament) FROM table_2849652_2 WHERE sport = "Bowling" |
Which bubbles has an atribute of onlostpointercapture? | CREATE TABLE table_35692 ("Category" text,"Type" text,"Attribute" text,"Bubbles" text,"Cancelable" text) | SELECT "Bubbles" FROM table_35692 WHERE "Attribute" = 'onlostpointercapture' |
what is the number of patients whose ethnicity is white and procedure short title is dx ultrasound-heart? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.short_title = "Dx ultrasound-heart" |
What year did Team of Andretti Green Racing have a finish smaller than 8 with a Dallara chassis? | CREATE TABLE table_name_51 (year VARCHAR,finish VARCHAR,chassis VARCHAR,team VARCHAR) | SELECT year FROM table_name_51 WHERE chassis = "dallara" AND team = "andretti green racing" AND finish < 8 |
Give me a histogram for what are the types of competition and number of competitions for that type? | CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE competition... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type |
What is the to par for t10 and Colin Montgomerie? | CREATE TABLE table_60495 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "To par" FROM table_60495 WHERE "Place" = 't10' AND "Player" = 'colin montgomerie' |
Which morning classes are for RCCORE 410 ? | 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 course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'RCCORE' AND c... |
Name the aspect ratio for smpte 259m and interlaced scanning | CREATE TABLE table_29367 ("Vertical" real,"Horizontal" real,"Aspect ratio" text,"Pixel aspect ratio" text,"Scanning" text,"Frame rate (Hz)" text) | SELECT "Aspect ratio" FROM table_29367 WHERE "Pixel aspect ratio" = 'SMPTE 259M' AND "Scanning" = 'interlaced' |
Which artist/group has the highest average download of songs? | CREATE TABLE torrents (groupname text,totalsnatched number,artist text,groupyear number,releasetype text,groupid number,id number)CREATE TABLE tags (index number,id number,tag text) | SELECT artist FROM torrents GROUP BY artist ORDER BY AVG(totalsnatched) DESC LIMIT 1 |
What are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located in London? | CREATE TABLE member (member_id number,card_number text,name text,hometown text,level number)CREATE TABLE branch (branch_id number,name text,open_year text,address_road text,city text,membership_amount text)CREATE TABLE membership_register_branch (member_id number,branch_id text,register_year text)CREATE TABLE purchase ... | SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London' |
which has the largest volume number ? | CREATE TABLE table_204_696 (id number,"issue" number,"volume" number,"title" text,"main feature story" text,"first/early appearance story/stories" text,"release date" text) | SELECT "title" FROM table_204_696 ORDER BY "volume" DESC LIMIT 1 |
What is the number of patients discharged to psychiatric facility-partial hospitalization who had a (aorto)coronary bypass of three coronary arteries procedure? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.long_title = "(Aorto)coronary bypass of three coronary arteries" |
Who was the coach for episode 15? | CREATE TABLE table_73286 ("Season" real,"Episode" real,"Episode Summary" text,"Premier date" text,"External Link" text,"Coach" text) | SELECT "Coach" FROM table_73286 WHERE "Episode" = '15' |
Which of the events only lasted no more than 0:55? | CREATE TABLE table_71518 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Event" FROM table_71518 WHERE "Time" = '0:55' |
Which Position has Goals For of 52, and Goals Against larger than 70? | CREATE TABLE table_79160 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text) | SELECT MAX("Position") FROM table_79160 WHERE "Goals For" = '52' AND "Goals Against" > '70' |
how many current patients aged 30s are there? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 30 AND 39 |
Create a bar chart showing how many allergytype across allergytype, and show Y from low to high order. | 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 Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20)) | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(AllergyType) |
Between EECS 540 and EECS 628 ; which is the easiest ? | 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.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 540 OR course.number = 628) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... |
What is the lowest league goals that have 0 as the FA Cup Apps, with 1 (3) as totals apps? | CREATE TABLE table_name_46 (league_goals INTEGER,fa_cup_apps VARCHAR,total_apps VARCHAR) | SELECT MIN(league_goals) FROM table_name_46 WHERE fa_cup_apps = "0" AND total_apps = "1 (3)" |
provide the number of patients admitted before the year 2165 and diagnosed with hepatitis, unspecified. | 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.admityear < "2165" AND diagnoses.long_title = "Hepatitis, unspecified" |
what is the name of the medicine that was prescribed to patient 005-77687 for the first time through the dialysis route in the last month? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealths... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND medication.routeadmin = 'dialysis' AND DATETIME(me... |
Who is the trainer of the winner skylighter? | CREATE TABLE table_name_5 (trainer VARCHAR,winner VARCHAR) | SELECT trainer FROM table_name_5 WHERE winner = "skylighter" |
What is the game with the golden state warriors? | CREATE TABLE table_name_37 (game VARCHAR,team VARCHAR) | SELECT game FROM table_name_37 WHERE team = "golden state warriors" |
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, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time. | 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 decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANA... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
On what date did Contac 12 Hours of Sebring take place? | CREATE TABLE table_name_21 (date VARCHAR,race VARCHAR) | SELECT date FROM table_name_21 WHERE race = "contac 12 hours of sebring" |
What's the track for 1978? | CREATE TABLE table_7794 ("Year" real,"Track" text,"50 cc" text,"125 cc" text,"Report" text) | SELECT "Track" FROM table_7794 WHERE "Year" = '1978' |
How many days in April has a record of 42 22 12 3, and less than 99 points? | CREATE TABLE table_name_98 (april VARCHAR,record VARCHAR,points VARCHAR) | SELECT COUNT(april) FROM table_name_98 WHERE record = "42–22–12–3" AND points < 99 |
What companyw as the constructor when the Time/Retired was collision, and a Grid of 11? | CREATE TABLE table_67299 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Constructor" FROM table_67299 WHERE "Time/Retired" = 'collision' AND "Grid" = '11' |
When has a Source of rasmussen reports? | CREATE TABLE table_42113 ("Source" text,"Date" text,"Clinton" text,"Obama" text,"Undecided" text) | SELECT "Date" FROM table_42113 WHERE "Source" = 'rasmussen reports' |
Which urban area has a 2011 population of 5010? | CREATE TABLE table_1940144_1 (urban_area VARCHAR,population_2011 VARCHAR) | SELECT urban_area FROM table_1940144_1 WHERE population_2011 = 5010 |
what is the difference in years between the first volume published and the 13th volume published ? | CREATE TABLE table_204_843 (id number,"volume" number,"year" text,"names" text,"articles" number,"pages" number,"images" number,"maps" number,"number of copies" number) | SELECT ABS((SELECT "year" FROM table_204_843 WHERE "volume" = 1) - (SELECT "year" FROM table_204_843 WHERE "volume" = 13)) |
Visualize the title and their total smallest ratings of the movie using a bar chart, show bar in desc order. | CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date) | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title DESC |
what is the number of patients whose age is less than 68 and lab test fluid is joint fluid? | 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)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Joint Fluid" |
What round has a position of F/C from Iowa College? | CREATE TABLE table_name_56 (round VARCHAR,position VARCHAR,college VARCHAR) | SELECT round FROM table_name_56 WHERE position = "f/c" AND college = "iowa" |
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of manufacturer , and group by attribute name, I want to show in desc by the x axis. | 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
Return a pie chart on what is the average base price of different bed type? List bed type and average base price. | CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER) | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType |
What is the smallest drawn with a position bigger than 10 and a played less than 20? | CREATE TABLE table_40505 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT MIN("Drawn") FROM table_40505 WHERE "Position" > '10' AND "Played" < '20' |
What is the point total for the Formula Renault 2.0 Italy series? | CREATE TABLE table_21795650_1 (points VARCHAR,series VARCHAR) | SELECT COUNT(points) FROM table_21795650_1 WHERE series = "Formula Renault 2.0 Italy" |
What date did Ben Gordon (8) have high assists? | CREATE TABLE table_name_20 (date VARCHAR,high_assists VARCHAR) | SELECT date FROM table_name_20 WHERE high_assists = "ben gordon (8)" |
Which Affiliation has a Nickname of cougars? | CREATE TABLE table_47949 ("Institution" text,"Location" text,"Founded" real,"Affiliation" text,"Nickname" text) | SELECT "Affiliation" FROM table_47949 WHERE "Nickname" = 'cougars' |
what is the record for score 1-3? | CREATE TABLE table_74139 ("Game" real,"November" real,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text,"Points" real) | SELECT "Record" FROM table_74139 WHERE "Score" = '1-3' |
Which player has a place of t2? | CREATE TABLE table_name_4 (player VARCHAR,place VARCHAR) | SELECT player FROM table_name_4 WHERE place = "t2" |
Which kind of part has the least number of faults? List the part name. | CREATE TABLE fault_log_parts (fault_log_entry_id number,part_fault_id number,fault_status text)CREATE TABLE engineer_skills (engineer_id number,skill_id number)CREATE TABLE skills (skill_id number,skill_code text,skill_description text)CREATE TABLE staff (staff_id number,staff_name text,gender text,other_staff_details ... | SELECT T1.part_name FROM parts AS T1 JOIN part_faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) LIMIT 1 |
how many patients whose diagnoses long title is diverticulosis of colon with hemorrhage and lab test fluid is blood? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Diverticulosis of colon with hemorrhage" AND lab.fluid = "Blood" |
What is the hometown of the player who is headed to Duke? | CREATE TABLE table_52468 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text) | SELECT "Hometown" FROM table_52468 WHERE "College" = 'duke' |
What is the lowest Loss number when the Gain is less than 61 and the Avg/G is 6? | CREATE TABLE table_name_94 (loss INTEGER,gain VARCHAR,avg_g VARCHAR) | SELECT MIN(loss) FROM table_name_94 WHERE gain < 61 AND avg_g = 6 |
Search questions by any keyword. | 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 PostHistoryTypes (Id number,Name text)CREATE TABLE Comments (Id number,PostId number,Score number,... | SELECT p.CreationDate, p.Body, p.Id AS "post_link" FROM Posts AS p WHERE p.PostTypeId = 1 AND p.Body LIKE '%##keyword1##%' LIMIT 100 |
Calculate the total number of portuguese speaking patients. | 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 WHERE demographic.language = "PORT" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.