instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What field did the Home Team score 5.10 (40)? | CREATE TABLE table_11268 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Date" text) | SELECT "Venue" FROM table_11268 WHERE "Home team score" = '5.10 (40)' |
What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38? | CREATE TABLE table_name_40 (goals_for VARCHAR,played VARCHAR,draws VARCHAR,losses VARCHAR) | SELECT COUNT(goals_for) FROM table_name_40 WHERE draws = 3 AND losses > 18 AND played < 38 |
what is the most bronze when the total is 9? | CREATE TABLE table_name_94 (bronze INTEGER,total VARCHAR) | SELECT MAX(bronze) FROM table_name_94 WHERE total = 9 |
What date was the location attendance at&t center 18,797, and a game earlier than 57? | CREATE TABLE table_name_24 (date VARCHAR,location_attendance VARCHAR,game VARCHAR) | SELECT date FROM table_name_24 WHERE location_attendance = "at&t center 18,797" AND game < 57 |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and employee_id in a bar chart, and I want to list X-axis in ascending order. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE loc... | SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME |
What is the highest draws when more than 6 are played and the points against are 54? | CREATE TABLE table_name_92 (drawn INTEGER,against VARCHAR,played VARCHAR) | SELECT MAX(drawn) FROM table_name_92 WHERE against = 54 AND played > 6 |
For airlines named Aeroflot Group, what is the alliance? | CREATE TABLE table_name_11 (alliance__association VARCHAR,airline_holding VARCHAR) | SELECT alliance__association FROM table_name_11 WHERE airline_holding = "aeroflot group" |
provide me the number of black/haitian patients diagnosed with lower extremity embolism. | 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.ethnicity = "BLACK/HAITIAN" AND diagnoses.short_title = "Lower extremity embolism" |
what are the three most frequently prescribed drugs for patients who have been prescribed phentolamine mesylate also at the same time since 2105? | 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_procedur... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'phentolamine mesylate' AND STRFTIME('%y', prescriptions.startdate... |
Name the Evening that has a Sunday of no, and a Name of s. vidal/plant express? | CREATE TABLE table_name_18 (evening VARCHAR,sunday VARCHAR,name VARCHAR) | SELECT evening FROM table_name_18 WHERE sunday = "no" AND name = "s. vidal/plant express" |
What is Spandau 04 Player Jens Pohlmann's Pos.? | CREATE TABLE table_62457 ("Name" text,"Pos." text,"Height" text,"Weight" text,"Date of Birth" text,"Club" text) | SELECT "Pos." FROM table_62457 WHERE "Club" = 'spandau 04' AND "Name" = 'jens pohlmann' |
Tell me the Europe for z.h.p. unlosing ranger vs darkdeath evilman | CREATE TABLE table_name_79 (europe VARCHAR,title VARCHAR) | SELECT europe FROM table_name_79 WHERE title = "z.h.p. unlosing ranger vs darkdeath evilman" |
How many female patients are aged below 43 years? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "43" |
What Position has a Super League 1 Competition? | CREATE TABLE table_name_85 (position VARCHAR,competition VARCHAR) | SELECT position FROM table_name_85 WHERE competition = "super league 1" |
what is primary disease and admission time of subject name michael tyndall? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.name = "Michael Tyndall" |
What is High Assists, when High Points is 'Tayshaun Prince (23)'? | CREATE TABLE table_name_64 (high_assists VARCHAR,high_points VARCHAR) | SELECT high_assists FROM table_name_64 WHERE high_points = "tayshaun prince (23)" |
Scores of posts by a specific user. | CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans... | SELECT Id AS "post_link", Score FROM Posts WHERE OwnerUserId = '##id?210401##' ORDER BY Id |
Which Rank has a Bronze larger than 1, and a Silver larger than 0, and a Nation of norway (host nation), and a Total larger than 16? | CREATE TABLE table_36673 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Rank") FROM table_36673 WHERE "Bronze" > '1' AND "Silver" > '0' AND "Nation" = 'norway (host nation)' AND "Total" > '16' |
What is the Surface of the court in the match with a Score of 4 6, 6 4, 3 6? | CREATE TABLE table_name_16 (surface VARCHAR,score VARCHAR) | SELECT surface FROM table_name_16 WHERE score = "4–6, 6–4, 3–6" |
If the home team was footscray which venue did they play it? | CREATE TABLE table_51607 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_51607 WHERE "Home team" = 'footscray' |
Count the number of different complaint type codes. | CREATE TABLE staff (staff_id number,gender text,first_name text,last_name text,email_address text,phone_number text)CREATE TABLE customers (customer_id number,customer_type_code text,address_line_1 text,address_line_2 text,town_city text,state text,email_address text,phone_number text)CREATE TABLE complaints (complaint... | SELECT COUNT(DISTINCT complaint_type_code) FROM complaints |
What is the highest Lane, when Mark is 46.65, and when React is greater than 0.251? | CREATE TABLE table_name_44 (lane INTEGER,mark VARCHAR,react VARCHAR) | SELECT MAX(lane) FROM table_name_44 WHERE mark = "46.65" AND react > 0.251 |
A scatter chart shows the correlation between Team_ID and ACC_Percent . | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT Team_ID, ACC_Percent FROM basketball_match |
In which week was attendance at 50,814? | CREATE TABLE table_42912 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT COUNT("Week") FROM table_42912 WHERE "Attendance" = '50,814' |
please list all the flights from BOSTON to DENVER which serve meals | CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE clas... | 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, food_service WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_ser... |
Top 100 most economical posts (site-wide). | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE ... | SELECT Id AS "post_link", LENGTH(Body) AS Length, Score, (Score / CAST(NULLIF(LENGTH(Body), 0) AS FLOAT(9, 2))) AS Economy FROM Posts AS p ORDER BY Economy DESC LIMIT 100 |
Top Answerers for Tag: score = sum of answer scores/viewCount. | 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,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostHistoryT... | SELECT P.OwnerUserId AS "user_link", SUM(1000 * P.Score / Q.ViewCount) AS TotalScore, SUM(P.Score) AS TotalVotes, SUM(Q.ViewCount) AS TotalViews, COUNT(*) AS "#Answers" FROM Posts AS P INNER JOIN Posts AS Q ON Q.Id = P.ParentId INNER JOIN PostTags AS PT ON PT.PostId = P.ParentId INNER JOIN Tags AS T ON T.Id = PT.TagId ... |
which country has the most fide rated players after germany ? | CREATE TABLE table_203_663 (id number,"country" text,"zone" text,"national federation" text,"#gm" number,"#fide" number,"national championship" text) | SELECT "country" FROM table_203_663 WHERE "country" <> 'germany' ORDER BY "#fide" DESC LIMIT 1 |
what is the number of patients whose ethnicity is black/cape verdean and diagnoses long title is unspecified problem with head, neck, or trunk? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND diagnoses.long_title = "Unspecified problem with head, neck, or trunk" |
How many values for attendance correspond to the 1986 Peach Bowl? | CREATE TABLE table_20213 ("#" real,"Season" real,"Bowl game" text,"Result" text,"Opponent" text,"Stadium" text,"Location" text,"Attendance" text) | SELECT COUNT("Attendance") FROM table_20213 WHERE "Bowl game" = '1986 Peach Bowl' |
Return the names and typical buying prices for all products. | CREATE TABLE characteristics (characteristic_id number,characteristic_type_code text,characteristic_data_type text,characteristic_name text,other_characteristic_details text)CREATE TABLE product_characteristics (product_id number,characteristic_id number,product_characteristic_value text)CREATE TABLE products (product_... | SELECT product_name, typical_buying_price FROM products |
Name the tournament for top-5 more thn 1 and top-25 of 13 with wins of 3 | CREATE TABLE table_79797 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT "Tournament" FROM table_79797 WHERE "Top-5" > '1' AND "Top-25" = '13' AND "Wins" = '3' |
Name the interview for peru delegate | CREATE TABLE table_287 ("Delegate" text,"Interview" text,"Swimsuit" text,"Evening Gown" text,"Average" text) | SELECT "Interview" FROM table_287 WHERE "Delegate" = 'Peru' |
List the state names and the number of customers living in each state. | CREATE TABLE customer_addresses (address_id VARCHAR)CREATE TABLE addresses (state_province_county VARCHAR,address_id VARCHAR) | SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county |
Close Votes per Question, 2020. | CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT (LENGTH(Text) - LENGTH(REPLACE(Text, 'DisplayName', ''))) / 11 AS CloseVoters, COUNT(1) FROM PostHistory WHERE YEAR(CreationDate) = 2020 AND PostHistoryTypeId = 10 GROUP BY (LENGTH(Text) - LENGTH(REPLACE(Text, 'DisplayName', ''))) / 11 ORDER BY (LENGTH(Text) - LENGTH(REPLACE(Text, 'DisplayName', ''))) / 11 |
i need a flight from BOSTON to DENVER | CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer va... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER'... |
what were the changes in heart rate in patient 3327 last measured on the first icu visit compared to the value first measured on the first icu visit? | 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 microbiologyevents (row_id number,subject_id number,hadm_id nu... | SELECT (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 = 3327) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi... |
Where was the home court on April 14? | CREATE TABLE table_name_34 (home VARCHAR,date VARCHAR) | SELECT home FROM table_name_34 WHERE date = "april 14" |
count the amount of patients who were prescribed atovaquone suspension in the same hospital encounter after having been diagnosed with crnry athrscl natve vssl until 2104. | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)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 chartevents (row_id n... | SELECT COUNT(DISTINCT t1.subject_id) 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 diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... |
What is Opponent in Final, when Date is '13 January 1992'? | CREATE TABLE table_58904 ("Date" text,"Tournament" text,"Surface" text,"Opponent in Final" text,"Score in Final" text) | SELECT "Opponent in Final" FROM table_58904 WHERE "Date" = '13 january 1992' |
i need flights that arrive in BALTIMORE from PITTSBURGH | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE dual_carrier (main_airl... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL... |
Which Tournament has a Partner of mart n rodr guez? | CREATE TABLE table_name_19 (tournament VARCHAR,partner VARCHAR) | SELECT tournament FROM table_name_19 WHERE partner = "martín rodríguez" |
Who is the vacator when south carolina 4th is the district? | CREATE TABLE table_73404 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text) | SELECT "Vacator" FROM table_73404 WHERE "District" = 'South Carolina 4th' |
What are the dates where the opponent was guillermo garc a-l pez albert portas? | CREATE TABLE table_69838 ("Outcome" text,"Date" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Date" FROM table_69838 WHERE "Opponents" = 'guillermo garcía-lópez albert portas' |
What country is the film directed by Michael Haneke from? | CREATE TABLE table_68198 ("Year" real,"English title" text,"Original title" text,"Country" text,"Director'" text) | SELECT "Country" FROM table_68198 WHERE "Director'" = 'michael haneke' |
what is the number of patients whose diagnoses long title is acute glomerulonephritis with other specified pathological lesion in kidney and drug route is iv drip? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Acute glomerulonephritis with other specified pathological lesion in kidney" AND prescripti... |
unable to swallow uncrushed oral medication in capsule form | CREATE TABLE table_train_78 ("id" int,"mini_mental_state_examination_mmse" int,"consent" bool,"swallow_oral_medication" bool,"rosen_modified_hachinski_ischemic_score" int,"NOUSE" float) | SELECT * FROM table_train_78 WHERE swallow_oral_medication = 0 |
Which Winner has a Country of norway, and a FIS Nordic World Ski Championships of 1924? | CREATE TABLE table_name_97 (winner VARCHAR,country VARCHAR,fis_nordic_world_ski_championships VARCHAR) | SELECT winner FROM table_name_97 WHERE country = "norway" AND fis_nordic_world_ski_championships = "1924" |
What is the Days, hours, minutes for 21 26 October? | CREATE TABLE table_name_81 (days VARCHAR,_hours VARCHAR,_minutes VARCHAR,dates VARCHAR) | SELECT days, _hours, _minutes FROM table_name_81 WHERE dates = "21 – 26 october" |
What is the total number of Year(s) Won, when Player is Ed Furgol, and when To Par is greater than 12? | CREATE TABLE table_50191 ("Player" text,"Country" text,"Year(s) won" real,"Total" real,"To par" real,"Finish" text) | SELECT COUNT("Year(s) won") FROM table_50191 WHERE "Player" = 'ed furgol' AND "To par" > '12' |
What are the names of the top 8 countries by total invoice size and what are those sizes. Plot them as bar chart. | CREATE TABLE albums (id INTEGER,title VARCHAR(160),artist_id INTEGER)CREATE TABLE customers (id INTEGER,first_name VARCHAR(40),last_name VARCHAR(20),company VARCHAR(80),address VARCHAR(70),city VARCHAR(40),state VARCHAR(40),country VARCHAR(40),postal_code VARCHAR(10),phone VARCHAR(24),fax VARCHAR(24),email VARCHAR(60),... | SELECT billing_country, SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8 |
Name the total number of domestic mail for 7853 for total frieght and mail | CREATE TABLE table_1754531_4 (domestic_mail VARCHAR,total_freight_and_mail VARCHAR) | SELECT COUNT(domestic_mail) FROM table_1754531_4 WHERE total_freight_and_mail = 7853 |
Which Score has a Competition of world cup qualifying, and a Brazil scorers of baltazar, and a Date of march 14, 1954? | CREATE TABLE table_name_65 (score VARCHAR,date VARCHAR,competition VARCHAR,brazil_scorers VARCHAR) | SELECT score FROM table_name_65 WHERE competition = "world cup qualifying" AND brazil_scorers = "baltazar" AND date = "march 14, 1954" |
When 2008 t is the original number what is the lowest year? | CREATE TABLE table_24614 ("Original number" text,"UIC number" text,"Name" text,"Constructer" text,"constructor number" real,"Year" real,"Withdrawn" text,"Kilometers worked" real) | SELECT MIN("Year") FROM table_24614 WHERE "Original number" = '2008 T' |
How many total credits are offered by each department? | CREATE TABLE time_slot (time_slot_id text,day text,start_hr number,start_min number,end_hr number,end_min number)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,time_slot_id text)CREATE TABLE department (dept_name text,building text,budget number)CREATE TABLE cl... | SELECT SUM(credits), dept_name FROM course GROUP BY dept_name |
Name the episode for vic reeves and claudia winkleman | CREATE TABLE table_23292220_7 (episode VARCHAR,seans_team VARCHAR) | SELECT episode FROM table_23292220_7 WHERE seans_team = "Vic Reeves and Claudia Winkleman" |
Plot how many minister by grouped by minister as a bar graph, and list in desc by the y axis. | CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE party_events (E... | SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY COUNT(Minister) DESC |
How much did the home team st kilda score? | CREATE TABLE table_name_76 (home_team VARCHAR) | SELECT home_team AS score FROM table_name_76 WHERE home_team = "st kilda" |
What is the Rank of the player with 158 Goals in more than 362 Matches? | CREATE TABLE table_name_85 (rank VARCHAR,goals VARCHAR,matches VARCHAR) | SELECT COUNT(rank) FROM table_name_85 WHERE goals = 158 AND matches > 362 |
what RENTAL CAR are available next sunday from DEN airport | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport tex... | SELECT DISTINCT ground_service.transport_type FROM airport, ground_service WHERE airport.airport_code = 'DEN' AND ground_service.airport_code = airport.airport_code AND ground_service.transport_type = 'RENTAL CAR' |
What is the 1944 result for the U.S. Championships? | CREATE TABLE table_name_52 (tournament VARCHAR) | SELECT 1944 FROM table_name_52 WHERE tournament = "u.s. championships" |
How many viewers in millions watched the episode with the number 10.18? | CREATE TABLE table_25391981_20 (viewers__millions_ VARCHAR,episode_number VARCHAR) | SELECT viewers__millions_ FROM table_25391981_20 WHERE episode_number = "10.18" |
how many patients received intracranial/cerebral perfusion pressure monitoring - csf drainage via ventriculostomy after the first procedure of the antiemetic - serotonin antagonist in the same month since 1 year ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiemetic - serotonin antagonist' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-1 yea... |
What race is on 26 June 2011? | CREATE TABLE table_43995 ("Rank" text,"Time" text,"Athlete" text,"Nation" text,"Date" text,"Race" text) | SELECT "Race" FROM table_43995 WHERE "Date" = '26 june 2011' |
what number of patients diagnosed with gangrene were transferred from hosp/extram? | 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.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "GANGRENE" |
With an aggregate of 0-2, what is listed for home? | CREATE TABLE table_17968229_1 (home__2nd_leg_ VARCHAR,aggregate VARCHAR) | SELECT home__2nd_leg_ FROM table_17968229_1 WHERE aggregate = "0-2" |
what's the total number of position with driver robby gordon | CREATE TABLE table_10160447_1 (position VARCHAR,driver VARCHAR) | SELECT COUNT(position) FROM table_10160447_1 WHERE driver = "Robby Gordon" |
What is Doucet when Lawrance is 36? | CREATE TABLE table_16796 ("Ward" text,"Bello" text,"Ben-Tahir" text,"Doucet" text,"Furtenbacher" text,"Gauthier" text,"Haydon" text,"Larter" text,"Lawrance" text,"Libweshya" text,"Liscumb" text) | SELECT "Doucet" FROM table_16796 WHERE "Lawrance" = '36' |
Show the title and the lowest rating among all movies in a bar chart. | CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text) | SELECT title, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title |
What was the injured entry for Venezuela? | CREATE TABLE table_name_16 (injured VARCHAR,country VARCHAR) | SELECT injured FROM table_name_16 WHERE country = "venezuela" |
how did patient 028-47306 last visit in this year to the hospital? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,lab... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '028-47306' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
What is Name, when Laps is '50', when Grid is greater than 9, when Team is 'Jim Beam Racing', and when Time/Retired is '+ 18.0s'? | CREATE TABLE table_48468 ("Name" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Name" FROM table_48468 WHERE "Laps" = '50' AND "Grid" > '9' AND "Team" = 'jim beam racing' AND "Time/Retired" = '+ 18.0s' |
Select posts with historic use of tag. | CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans... | SELECT PostId AS "post_link" FROM PostHistory WHERE PostHistoryTypeId IN (3, 6) AND Text LIKE '%<database-schema>%' |
Ignore movies whose director is NULL. For each director, what are the titles and ratings for all the movies they reviewed? Show the result by a pie chart. | CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text) | SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" |
What stadiums had an attendance of 8,256? | CREATE TABLE table_19343 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" text,"Date" text,"Time" text,"Report" text) | SELECT "Ground" FROM table_19343 WHERE "Crowd" = '8,256' |
The race tony bettenhausen 200 has what smallest rd? | CREATE TABLE table_72118 ("Rd" real,"Name" text,"Pole Position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text,"Report" text) | SELECT MIN("Rd") FROM table_72118 WHERE "Name" = 'Tony Bettenhausen 200' |
how many players won at least later than 2010 ? | CREATE TABLE table_204_310 (id number,"month" text,"year" number,"player" text,"county" text,"club" text,"position" number) | SELECT COUNT("player") FROM table_204_310 WHERE "year" > 2010 |
Who was the match against at the PRIDE 31 event? | CREATE TABLE table_50246 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Opponent" FROM table_50246 WHERE "Event" = 'pride 31' |
What country offered a prize of 66400 US dollars? | CREATE TABLE table_31084 ("Rk" real,"Name" text,"Country" text,"Matches Played" real,"Matches Won" real,"Points" real,"Prize Money (USD)" real) | SELECT "Country" FROM table_31084 WHERE "Prize Money (USD)" = '66400' |
Who did the high rebounds for the team Minnesota? | CREATE TABLE table_29893 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High rebounds" FROM table_29893 WHERE "Team" = 'Minnesota' |
between car plates of 80-84 what is the population in 1000 in year 1931? | CREATE TABLE table_57094 ("car plates (since 1937)" text,"Voivodeship Separate city" text,"Capital" text,"Area in 1000km\u00b2 (1930)" text,"Population in 1000 (1931)" text) | SELECT "Population in 1000 (1931)" FROM table_57094 WHERE "car plates (since 1937)" = '80-84' |
Count the Rank-Final which has a Year larger than 2008, and an Apparatus of balance beam, and a Rank-Qualifying larger than 4? | CREATE TABLE table_63827 ("Year" real,"Competition Description" text,"Location" text,"Apparatus" text,"Rank-Final" real,"Score-Final" real,"Rank-Qualifying" real,"Score-Qualifying" real) | SELECT COUNT("Rank-Final") FROM table_63827 WHERE "Year" > '2008' AND "Apparatus" = 'balance beam' AND "Rank-Qualifying" > '4' |
What is the natural change per year for the 34 IMR group? | CREATE TABLE table_29509 ("Period" text,"Live births per year" text,"Deaths per year" text,"Natural change per year" text,"CBR*" text,"CDR*" text,"NC*" text,"TFR*" text,"IMR*" real,"Life expectancy total" text,"Life expectancy males" text,"Life expectancy females" text) | SELECT "Natural change per year" FROM table_29509 WHERE "IMR*" = '34' |
What is class I can take to fulfill the ULCS requirement and is easiest ? | 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.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... |
What party does the incumbent from the Ohio 20 district belong to? | CREATE TABLE table_1342218_35 (party VARCHAR,district VARCHAR) | SELECT party FROM table_1342218_35 WHERE district = "Ohio 20" |
Which Class has a Weight of 203? | CREATE TABLE table_name_57 (class VARCHAR,weight VARCHAR) | SELECT class FROM table_name_57 WHERE weight = 203 |
what is the number of patients who have had a nicardipine hcl intake? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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 inputevents_cv (ro... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'nicardipine hcl' AN... |
List the name and the number of enrolled student for each course. Show bar chart. | CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_mf VARCHAR(1),address_line_1 VARCHAR(80))... | SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name |
How many dates did David Savage get man of the match? | CREATE TABLE table_21355 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Competition" text,"Man of the Match" text) | SELECT COUNT("Date") FROM table_21355 WHERE "Man of the Match" = 'David Savage' |
what was the last single kitty wells released ? | CREATE TABLE table_204_500 (id number,"year" number,"title" text,"peak chart positions\nus country" number,"peak chart positions\nus" number,"album" text) | SELECT "title" FROM table_204_500 ORDER BY id DESC LIMIT 1 |
What is the total number of Super Cup, when Title Playoff is '0', when Total is greater than 9, and when League is less than 11? | CREATE TABLE table_name_97 (super_cup VARCHAR,league VARCHAR,title_playoff VARCHAR,total VARCHAR) | SELECT COUNT(super_cup) FROM table_name_97 WHERE title_playoff = 0 AND total > 9 AND league < 11 |
What is the average number of rounds when fighting against Clay Guida? | CREATE TABLE table_name_54 (round INTEGER,opponent VARCHAR) | SELECT AVG(round) FROM table_name_54 WHERE opponent = "clay guida" |
What are the details and star ratings of the three hotels with the lowest price ranges? | CREATE TABLE photos (photo_id number,tourist_attraction_id number,name text,description text,filename text,other_details text)CREATE TABLE ref_attraction_types (attraction_type_code text,attraction_type_description text)CREATE TABLE visits (visit_id number,tourist_attraction_id number,tourist_id number,visit_date time,... | SELECT other_hotel_details, star_rating_code FROM hotels ORDER BY price_range LIMIT 3 |
What are the total number of podiums for more than 4 laps, and less than 149 races? | CREATE TABLE table_47056 ("Season" text,"Races" real,"Wins" real,"Podiums" real,"Poles" real,"Fastest Laps" real) | SELECT COUNT("Podiums") FROM table_47056 WHERE "Fastest Laps" > '4' AND "Races" < '149' |
What are the number of the last names for all scholarship students?, list by the how many lname in ascending please. | CREATE TABLE Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))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 SportsInfo (StuID INTEGER,SportName VARCHAR(32),HoursPerWeek INTEGER,GamesPlayed... | 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) |
What was the score on August 19? | CREATE TABLE table_69354 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Time" text,"Record" text) | SELECT "Score" FROM table_69354 WHERE "Date" = 'august 19' |
Who is the head coach of the team, whose shirt sponsor is karstadt quelle versicherungen? | CREATE TABLE table_48625 ("Team" text,"Head coach" text,"Team captain" text,"Kitmaker" text,"Shirt sponsor" text) | SELECT "Head coach" FROM table_48625 WHERE "Shirt sponsor" = 'karstadt quelle versicherungen' |
what are the newly prescribed drugs for patient 022-6959 today compared to that yesterday? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '022-6959') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicat... |
what is the average hospital cost that would involve a vitamin b12 lab test until 4 years ago? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE microbiologyevents (row_id number,subject_id nu... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'vitamin b12')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.had... |
In how many locations did Game 13 take place? | CREATE TABLE table_17058116_5 (location_attendance VARCHAR,game VARCHAR) | SELECT COUNT(location_attendance) FROM table_17058116_5 WHERE game = 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.