instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the list of courses that are 17 credits ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)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 ... | SELECT DISTINCT name, number FROM course WHERE credits = 17 AND department = 'EECS' |
How many general elections that have won smaller than 23 with candidates larger than 108? | CREATE TABLE table_name_95 (general_election VARCHAR,_number_of_seats_won VARCHAR,_number_of_candidates VARCHAR) | SELECT COUNT(general_election) FROM table_name_95 WHERE _number_of_seats_won < 23 AND _number_of_candidates > 108 |
Who was the Coat of Cash Wearing Celebrity in Episode 6? | CREATE TABLE table_name_81 (coat_of_cash_wearing_celebrity VARCHAR,episode_number VARCHAR) | SELECT coat_of_cash_wearing_celebrity FROM table_name_81 WHERE episode_number = 6 |
What is the record for the game against New England Patriots at the Rich Stadium? | CREATE TABLE table_42278 ("Week" real,"Date" text,"Opponent" text,"Game Site" text,"Final Score" text,"Record" text,"TV Time" text,"Attendance" text) | SELECT "Record" FROM table_42278 WHERE "Game Site" = 'rich stadium' AND "Opponent" = 'new england patriots' |
What season had bachelor Byron Velvick? | CREATE TABLE table_9121 ("Season" real,"Premiered" text,"Bachelor" text,"Winner" text,"Runner(s)-Up" text,"Proposal" text) | SELECT MIN("Season") FROM table_9121 WHERE "Bachelor" = 'byron velvick' |
How many patients died in or before 2138 with lab test item id 51355? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2138.0" AND lab.itemid = "51355" |
Show details of all visitors. | CREATE TABLE tourist_attractions (tourist_attraction_id number,attraction_type_code text,location_id number,how_to_get_there text,name text,description text,opening_hours text,other_details text)CREATE TABLE visitors (tourist_id number,tourist_details text)CREATE TABLE hotels (hotel_id number,star_rating_code text,pets... | SELECT tourist_details FROM visitors |
What is the total money requested by entrepreneurs with height more than 1.85? | CREATE TABLE people (people_id number,name text,height number,weight number,date_of_birth text)CREATE TABLE entrepreneur (entrepreneur_id number,people_id number,company text,money_requested number,investor text) | SELECT SUM(T1.money_requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.height > 1.85 |
what is average age of patients whose marital status is widowed and age is greater than or equal to 41? | 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,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "41" |
what is the number of patients whose admission location is phys referral/normal deli and procedure icd9 code is 309? | 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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "309" |
what nation was ranked first in total number of gold medals ? | CREATE TABLE table_204_727 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_727 ORDER BY "gold" DESC LIMIT 1 |
what is the number of patient whose hospital stay is above 16 days and with lab test item id 51250? | 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 (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.itemid = "51250" |
What is the location of the river mile that is larger than 938.9, and Olmsted Locks and Dam? | CREATE TABLE table_name_8 (location_ VARCHAR,l_ VARCHAR,river_mile VARCHAR,locks_ VARCHAR,_dam VARCHAR) | SELECT location_ AS "l_" FROM table_name_8 WHERE river_mile > 938.9 AND locks_ & _dam = "olmsted locks and dam" |
what number of the athletes are from spain ? | CREATE TABLE table_204_893 (id number,"rank" number,"name" text,"nationality" text,"time" text,"notes" text) | SELECT COUNT("name") FROM table_204_893 WHERE "nationality" = 'spain' |
When Grand Rapids's fare was $377.29, what is the fare to Detroit? | CREATE TABLE table_20703 ("Year" real,"Lansing (LAN)" text,"Detroit (DTW)" text,"Grand Rapids (GRR)" text,"Flint (FNT)" text,"Kalamazoo (AZO)" text,"Saginaw (MBS)" text) | SELECT "Detroit (DTW)" FROM table_20703 WHERE "Grand Rapids (GRR)" = '$377.29' |
For those employees who was hired before 2002-06-21, a line chart shows the change of salary over hire_date | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEP... | SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' |
What is the 2012 with A in 2009 and 2r in 2010? | CREATE TABLE table_name_96 (Id VARCHAR) | SELECT 2012 FROM table_name_96 WHERE 2009 = "a" AND 2010 = "2r" |
Who was firest elected in 2002 in a district larger than 41? | CREATE TABLE table_78548 ("District" real,"County(s) Represented" text,"Member Senator" text,"Party" text,"First Elected" real) | SELECT "Member Senator" FROM table_78548 WHERE "First Elected" = '2002' AND "District" > '41' |
what is the number of patients whose religion is romanian east. orth and item id is 51251? | 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,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "ROMANIAN EAST. ORTH" AND lab.itemid = "51251" |
what is average age of patients whose gender is f and discharge location is left against medical advi? | 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,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" |
when did patient 43052 get a procedure for the last time since 1 year 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 procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43052) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY procedures_icd.charttime DESC LIMIT 1 |
what is the name of drug that patient 7112 was prescribed during the same hospital visit after being diagnosed with ocl crtd art wo infrct this month? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE outputevent... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 7112 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.sh... |
What result has outstanding achievement in drama, as the role/episode with a year prior to 1995? | CREATE TABLE table_name_48 (result VARCHAR,role_episode VARCHAR,year VARCHAR) | SELECT result FROM table_name_48 WHERE role_episode = "outstanding achievement in drama" AND year < 1995 |
Show different locations and the number of performances at each location by a bar chart, and I want to sort by the bars from high to low. | CREATE TABLE member_attendance (Member_ID int,Performance_ID int,Num_of_Pieces int)CREATE TABLE performance (Performance_ID real,Date text,Host text,Location text,Attendance int)CREATE TABLE member (Member_ID text,Name text,Nationality text,Role text) | SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY Location DESC |
what is marital status and days of hospital stay of subject name jerry deberry? | 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 demographic.marital_status, demographic.days_stay FROM demographic WHERE demographic.name = "Jerry Deberry" |
Find Name and Height , and visualize them by a bar chart. | CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real) | SELECT Name, Height FROM people |
How many stadiums does each country have? | CREATE TABLE stadium (id number,name text,capacity number,city text,country text,opening_year number)CREATE TABLE swimmer (id number,name text,nationality text,meter_100 number,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,time text)CREATE TABLE record (id number,result text,... | SELECT country, COUNT(*) FROM stadium GROUP BY country |
When was incumbent William B. Oliver first elected? | CREATE TABLE table_1342379_2 (first_elected INTEGER,incumbent VARCHAR) | SELECT MAX(first_elected) FROM table_1342379_2 WHERE incumbent = "William B. Oliver" |
count the number of patients whose admission year is less than 2125 and diagnoses icd9 code is 69514? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2125" AND diagnoses.icd9_code = "69514" |
What is the proportion of each customer's move in date? You can show me a bar chart that bins move in date into Weekday interval. | CREATE TABLE Customers (customer_id INTEGER,customer_details VARCHAR(255))CREATE TABLE Properties (property_id INTEGER,property_type_code CHAR(15),property_address VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Residents_Services (resident_id INTEGER,service_id INTEGER,date_moved_in DATETIME,property_id INTEGER,d... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id |
has patient 16472 underwent a cl red-int fix rad/ulna procedure this year? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,ic... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cl red-int fix rad/ulna') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16472) AND DATETIME(pro... |
What is scored with the position of 6? | CREATE TABLE table_22565 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws P.K. Wins / P.K. Losses" text,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT MIN("Scored") FROM table_22565 WHERE "Position" = '6' |
what is the number of patients whose marital status is divorced and drug route is ih? | 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 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,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "IH" |
count the number of patients whose insurance is medicaid and admission year is less than 2108? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.admityear < "2108" |
which is the minimun amount of silver medals? | CREATE TABLE table_22355_35 (silver INTEGER) | SELECT MIN(silver) FROM table_22355_35 |
Return the categories of music festivals that have the result 'Awarded', and count them by a bar chart, sort by the X in desc please. | CREATE TABLE music_festival (ID int,Music_Festival text,Date_of_ceremony text,Category text,Volume int,Result text)CREATE TABLE volume (Volume_ID int,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID int)CREATE TABLE artist (Artist_ID int,Artist text,Age int,Famous_Title text,Famous_Release_date t... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category DESC |
Which Win/Lose Percentage has Champs larger than 0, and a Draw larger than 3? | CREATE TABLE table_name_92 (win_lose_percentage VARCHAR,champs VARCHAR,draw VARCHAR) | SELECT win_lose_percentage FROM table_name_92 WHERE champs > 0 AND draw > 3 |
Return the top 3 greatest support rates. | 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 support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3 |
How many of the patients whose other body fluid was tested by lab died in or before the year 2111? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Other Body Fluid" |
did we score more in the plymouth argyle game or in the reading game ? | CREATE TABLE table_204_318 (id number,"date" text,"opponent" text,"venue" text,"result" text,"attendance" number,"scorers" text) | SELECT "opponent" FROM table_204_318 WHERE "opponent" IN ('plymouth argyle', 'reading') ORDER BY "result" DESC LIMIT 1 |
What is the Speed when the rank is smaller than 3, and time is 1:06.19.90? | CREATE TABLE table_65038 ("Rank" real,"Rider" text,"Team" text,"Speed" text,"Time" text) | SELECT "Speed" FROM table_65038 WHERE "Rank" < '3' AND "Time" = '1:06.19.90' |
Which Sydney has a Perth of no, a Melbourne of yes, and a Gold Coast of no? | CREATE TABLE table_name_27 (sydney VARCHAR,gold_coast VARCHAR,perth VARCHAR,melbourne VARCHAR) | SELECT sydney FROM table_name_27 WHERE perth = "no" AND melbourne = "yes" AND gold_coast = "no" |
Find the number of patients with other pulmonary insufficiency, not elsewhere classified, who died in or before the year 2132. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2132.0" AND diagnoses.long_title = "Other pulmonary insufficiency, not elsewhere classified" |
What is the Name of the Prime Minister with a Born-Died of 1873 1933? | CREATE TABLE table_name_34 (name VARCHAR,born_died VARCHAR) | SELECT name FROM table_name_34 WHERE born_died = "1873–1933" |
Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa. | CREATE TABLE payment (payment_date VARCHAR,staff_id VARCHAR)CREATE TABLE staff (staff_id VARCHAR,first_name VARCHAR) | SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' |
What are the department ids for which more than 10 employees had a commission? | CREATE TABLE countries (country_id text,country_name text,region_id number)CREATE TABLE jobs (job_id text,job_title text,min_salary number,max_salary number)CREATE TABLE locations (location_id number,street_address text,postal_code text,city text,state_province text,country_id text)CREATE TABLE departments (department_... | SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10 |
Name the high points for mo williams , lebron james , j.j. hickson (6) | CREATE TABLE table_22654073_7 (high_points VARCHAR,high_rebounds VARCHAR) | SELECT COUNT(high_points) FROM table_22654073_7 WHERE high_rebounds = "Mo Williams , LeBron James , J.J. Hickson (6)" |
count the number of patients whose admission type is elective and lab test category is chemistry? | 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 (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab."CATEGORY" = "Chemistry" |
How many seasons has John Mcfadden coached? | CREATE TABLE table_57801 ("Coach" text,"Years" text,"Seasons" real,"Lost" real,"Pct." real) | SELECT COUNT("Seasons") FROM table_57801 WHERE "Coach" = 'john mcfadden' |
For each station, bin its longitude divided by zero as buckets, and count the frequency in each bucket, and I want to show by the Y in ascending. | CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_... | SELECT long, COUNT(long) FROM station ORDER BY COUNT(long) |
What is the departure for Peterborough East whose arrival time is 12.40? | CREATE TABLE table_22269 ("Departure" text,"Going to" text,"Calling at" text,"Arrival" text,"Operator" text) | SELECT "Departure" FROM table_22269 WHERE "Going to" = 'Peterborough East' AND "Arrival" = '12.40' |
How many different engines are there for the model with model designation 97G00? | CREATE TABLE table_20866024_2 (engine VARCHAR,model_designation VARCHAR) | SELECT COUNT(engine) FROM table_20866024_2 WHERE model_designation = "97G00" |
Name the college for andrej podkonicky | CREATE TABLE table_74274 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "College/junior/club team" FROM table_74274 WHERE "Player" = 'Andrej Podkonicky' |
Show all ages and corresponding number of students in a scatter chart | 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 INTEGER,Allergy VARCHAR(20)) | SELECT Age, COUNT(*) FROM Student GROUP BY Age |
How many IRST figures for the show that premiered on Canale 5 (2006)? | CREATE TABLE table_28803803_1 (irst VARCHAR,original_channel VARCHAR) | SELECT COUNT(irst) FROM table_28803803_1 WHERE original_channel = "Canale 5 (2006)" |
at lease how many bell griffons are in service . | CREATE TABLE table_204_161 (id number,"name" text,"1968 cf\ndesignator" text,"place of\nmanufacture" text,"primary\nrole(s)" text,"service\nperiod" text,"#\nused" number) | SELECT "#\nused" FROM table_204_161 WHERE "name" = 'bell griffon' |
Give me the dates when the max temperature was higher than 85. | CREATE TABLE status (station_id number,bikes_available number,docks_available number,time text)CREATE TABLE trip (id number,duration number,start_date text,start_station_name text,start_station_id number,end_date text,end_station_name text,end_station_id number,bike_id number,subscription_type text,zip_code number)CREA... | SELECT date FROM weather WHERE max_temperature_f > 85 |
What is the price of 150 mbps downstread? | CREATE TABLE table_name_20 (price VARCHAR,downstream VARCHAR) | SELECT price FROM table_name_20 WHERE downstream = "150 mbps" |
Which home team plays at the Western Oval? | CREATE TABLE table_11259 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_11259 WHERE "Venue" = 'western oval' |
What date has a theme of fate or fortune? | CREATE TABLE table_name_21 (date VARCHAR,theme VARCHAR) | SELECT date FROM table_name_21 WHERE theme = "fate or fortune" |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name, display by the y-axis in descending. | 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, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC |
Which home team has higher than 92 points? | CREATE TABLE table_name_14 (home VARCHAR,points INTEGER) | SELECT home FROM table_name_14 WHERE points > 92 |
Name the site with game of game 6 | CREATE TABLE table_name_49 (site VARCHAR,game VARCHAR) | SELECT site FROM table_name_49 WHERE game = "game 6" |
Give me the comparison about the sum of meter_100 over the Nationality , and group by attribute Nationality. | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Openin... | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality |
the shows with at most 1 cameo | CREATE TABLE table_203_485 (id number,"year" text,"show" text,"role" text,"notes" text) | SELECT "show" FROM table_203_485 WHERE "notes" = 'cameo' |
is patient 007-16517 prescribed any drugs this year? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labres... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-16517')) AND DATETIME(medication.drugstarttime, 'start of year') = DAT... |
Who was the artist with a start date of 1966-10-23? | CREATE TABLE table_3320 ("Episode #" text,"Fan Title" text,"Writer" text,"Artist(s)" text,"Start Date" text,"End Date" text,"Inc. Dailies?" text,"Inc. Sundays?" text) | SELECT "Artist(s)" FROM table_3320 WHERE "Start Date" = '1966-10-23' |
After 1993, what is the Seats with a % votes of 38.72? | CREATE TABLE table_name_26 (seats VARCHAR,year VARCHAR,_percentage_votes VARCHAR) | SELECT seats FROM table_name_26 WHERE year > 1993 AND _percentage_votes = 38.72 |
Where were games played when the record was 9-1? | CREATE TABLE table_22862203_2 (location VARCHAR,record VARCHAR) | SELECT location FROM table_22862203_2 WHERE record = "9-1" |
provide the number of patients whose marital status is married and diagnoses long title is depressive disorder, not elsewhere classified? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.long_title = "Depressive disorder, not elsewhere classified" |
what is drug code of subject name kelly gallardo? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo" |
SELECT TOP 40 u.DisplayName, u.Reputation, u.Location, u.Age, u.Views, u.UpVotes FROM Users u WHERE. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount... | SELECT u.Id, u.DisplayName, u.Reputation, u.Location, u.Age, u.Views, u.UpVotes FROM Users AS u WHERE (u.Location LIKE '%Rockville%' OR u.Location LIKE '%Bethesda%' OR u.Location LIKE '%Silver Spring%' OR u.Location LIKE '%Kensington%' OR u.Location LIKE '%Gaithersburg%') AND (NOT u.Location LIKE '%London%') GROUP BY u... |
Which Team has a Previous team of san diego rockets, and a Position of f? | CREATE TABLE table_61795 ("Player" text,"Pos." text,"Nationality" text,"Team" text,"Previous team" text,"Years of NBA experience [a ]" real,"Career with the franchise [b ]" text) | SELECT "Team" FROM table_61795 WHERE "Previous team" = 'san diego rockets' AND "Pos." = 'f' |
provide the number of patients whose days of hospital stay is greater than 4 and lab test category is chemistry? | 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 text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "4" AND lab."CATEGORY" = "Chemistry" |
Are there any upper level classes that produce 1 credits ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE semester (semester_id int,semester varchar,year i... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS' |
What is Scott Hoch with a Score of 66 Country? | CREATE TABLE table_name_36 (country VARCHAR,score VARCHAR,player VARCHAR) | SELECT country FROM table_name_36 WHERE score = 66 AND player = "scott hoch" |
what is the 2001 % for the status widowed or surviving partner? | CREATE TABLE table_74101 ("Status" text,"2001 number (,000)" real,"2001 %" text,"2011 number (,000)" real,"2011 %" text) | SELECT "2001 %" FROM table_74101 WHERE "Status" = 'Widowed or surviving partner' |
What is the number of points when there was a BMW 269 F2 chassis earlier than 1969? | CREATE TABLE table_15719 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT COUNT("Points") FROM table_15719 WHERE "Chassis" = 'bmw 269 f2' AND "Year" < '1969' |
What is the sum of the ranks for india? | CREATE TABLE table_79378 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text) | SELECT SUM("Rank") FROM table_79378 WHERE "Country" = 'india' |
What is the number of the leading scorer for keyarena 16,640? | CREATE TABLE table_11964047_8 (leading_scorer VARCHAR,attendance VARCHAR) | SELECT COUNT(leading_scorer) FROM table_11964047_8 WHERE attendance = "KeyArena 16,640" |
How many patients who died in or before year 2138 had pituitary bleed as the primary disease? | 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,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2138.0" |
deleteme - Tunisia Top 200. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,Re... | SELECT Id AS ID, DisplayName AS Name, Reputation, LastAccessDate AS Seen FROM Users WHERE Location LIKE '%Tunisia%' ORDER BY Reputation DESC LIMIT 200 |
What is the duration when Lok Sabha shows fifth? | CREATE TABLE table_name_86 (duration VARCHAR,lok_sabha VARCHAR) | SELECT duration FROM table_name_86 WHERE lok_sabha = "fifth" |
What was the date for a catalog formatted in stereo LP? | CREATE TABLE table_15649 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Date" FROM table_15649 WHERE "Format" = 'stereo lp' |
Who was the Race Winner of the Southern Illinois 100? | CREATE TABLE table_name_48 (race_winner VARCHAR,event_name VARCHAR) | SELECT race_winner FROM table_name_48 WHERE event_name = "southern illinois 100" |
What nationality is mark eaton, center position? | CREATE TABLE table_name_51 (nationality VARCHAR,position VARCHAR,player VARCHAR) | SELECT nationality FROM table_name_51 WHERE position = "center" AND player = "mark eaton" |
patient 90019 had been admitted to the hospital since 5 years ago? | 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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE transfers (row_id nu... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 90019 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year') |
What is Date (Closing), when Opening Film is 'Deconstruction of Korean Housewife'? | CREATE TABLE table_name_95 (date__closing_ VARCHAR,opening_film VARCHAR) | SELECT date__closing_ FROM table_name_95 WHERE opening_film = "deconstruction of korean housewife" |
What is the Director of the Filmography The Iceman Ducketh? | CREATE TABLE table_14213 ("Title" text,"Series" text,"Director" text,"Production Number" text,"Release date" text) | SELECT "Director" FROM table_14213 WHERE "Title" = 'the iceman ducketh' |
What's the report for the mosport park circuit? | CREATE TABLE table_name_67 (report VARCHAR,circuit VARCHAR) | SELECT report FROM table_name_67 WHERE circuit = "mosport park" |
Please give me a bar chart to compare the stars by directors, and list by the X-axis from high to low. | CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text) | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY director DESC |
More than 2 professors teach how many courses ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, offering_instructor AS OFFERING_INSTRUCTOR_0, offering_instructor AS OFFERING_INSTRUCTOR_1, offering_instructor AS OFFERING_INSTRUCTOR_2 WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND OFFERING_INSTRUCTO... |
how many current patients have been there? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numb... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL |
Which Viavoice 5/15/09 has a CSA 5/14/09 of 5%, and a TNS-Sofres 5/28/09 of 4.5%? | CREATE TABLE table_54444 ("Party" text,"Results 2004" text,"CSA 5/14/09" text,"Viavoice 5/15/09" text,"Ifop- La Croix 5/15/09" text,"Ipsos 5/16/09" text,"OpinionWay 5/18/09" text,"CSA 5/20/09" text,"Ipsos 5/25/09" text,"TNS-Sofres 5/26/09" text,"OpinionWay 5/28/09" text,"TNS-Sofres 5/28/09" text) | SELECT "Viavoice 5/15/09" FROM table_54444 WHERE "CSA 5/14/09" = '5%' AND "TNS-Sofres 5/28/09" = '4.5%' |
Name the total number of league for 5 | CREATE TABLE table_17598822_11 (league VARCHAR,total VARCHAR) | SELECT COUNT(league) FROM table_17598822_11 WHERE total = 5 |
how many of the current state regents have a listed office title ? | CREATE TABLE table_204_68 (id number,"name" text,"profession" text,"hometown" text,"term expires" number,"office" text) | SELECT COUNT("name") FROM table_204_68 WHERE NOT "office" IS NULL |
What is the Location of the Frequency with a Callsign of DXBL? | CREATE TABLE table_name_89 (location VARCHAR,callsign VARCHAR) | SELECT location FROM table_name_89 WHERE callsign = "dxbl" |
List the dates and vote percents of elections Show bar chart, order by the names in ascending. | CREATE TABLE representative (Representative_ID int,Name text,State text,Party text,Lifespan text)CREATE TABLE election (Election_ID int,Representative_ID int,Date text,Votes real,Vote_Percent real,Seats real,Place real) | SELECT Date, Vote_Percent FROM election ORDER BY Date |
Who was the Runner(s)-up on the Date 4 Oct 2009? | CREATE TABLE table_name_66 (runner_s__up VARCHAR,date VARCHAR) | SELECT runner_s__up FROM table_name_66 WHERE date = "4 oct 2009" |
What was the winning score in the u.s. women's open that was won by 5 strokes? | CREATE TABLE table_name_75 (winning_score VARCHAR,championship VARCHAR,margin VARCHAR) | SELECT winning_score FROM table_name_75 WHERE championship = "u.s. women's open" AND margin = "5 strokes" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.