instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Nickname of the school established in 1773 | CREATE TABLE table_16432543_1 (nickname VARCHAR,established VARCHAR) | SELECT nickname FROM table_16432543_1 WHERE established = 1773 |
WHAT ARE THE NAMES OF THE MENS DOUBLES WHEN THE WOMENS DOUBLES WAS PIRET HAMER HELEN REINO? | CREATE TABLE table_14903627_1 (mens_doubles VARCHAR,womens_doubles VARCHAR) | SELECT mens_doubles FROM table_14903627_1 WHERE womens_doubles = "Piret Hamer Helen Reino" |
How many drops did Nicky Little have in Hong Kong? | CREATE TABLE table_74696 ("Player" text,"Tries" text,"Conv" text,"Pens" text,"Drop" text,"Venue" text,"Date" text) | SELECT "Drop" FROM table_74696 WHERE "Player" = 'nicky little' AND "Venue" = 'hong kong' |
What is the result in 2008-09 that has a 2011-12 result of qf? | CREATE TABLE table_41247 ("Event" text,"2006\u201307" text,"2007\u201308" text,"2008\u201309" text,"2009\u201310" text,"2010\u201311" text,"2011\u201312" text,"2012\u201313" text) | SELECT "2008\u201309" FROM table_41247 WHERE "2011\u201312" = 'qf' |
What is the home team's score at corio oval? | CREATE TABLE table_name_66 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_66 WHERE venue = "corio oval" |
What's the average year lebanon won? | CREATE TABLE table_name_51 (year INTEGER,country_territory VARCHAR) | SELECT AVG(year) FROM table_name_51 WHERE country_territory = "lebanon" |
What are the student ID and login name of the student who are enrolled in the most courses? | CREATE TABLE students (student_id number,date_of_registration time,date_of_latest_logon time,login_name text,password text,personal_name text,middle_name text,family_name text)CREATE TABLE subjects (subject_id number,subject_name text)CREATE TABLE student_course_enrolment (registration_id number,student_id number,cours... | SELECT T1.student_id, T2.login_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
what is language of subject id 3343? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT demographic.language FROM demographic WHERE demographic.subject_id = "3343" |
Who was the director of the film that was not nominated and had the Spanish title of play? | CREATE TABLE table_23705 ("Year (Ceremony)" text,"Film title used in nomination" text,"Spanish title" text,"Director" text,"Result" text) | SELECT "Director" FROM table_23705 WHERE "Result" = 'Not Nominated' AND "Spanish title" = 'Play' |
Give me the number of faculty members who participate in an activity | CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE activity (... | SELECT COUNT(DISTINCT facid) FROM faculty_participates_in |
Who was the opponent at the game when the record was 22-13? | CREATE TABLE table_79896 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Opponent" FROM table_79896 WHERE "Record" = '22-13' |
What is the average for the RB with an 8 yard long? | CREATE TABLE table_name_7 (avg VARCHAR,long VARCHAR) | SELECT COUNT(avg) FROM table_name_7 WHERE long = 8 |
How many gold medals for bellbrook HS with less than 1 silver? | CREATE TABLE table_71150 ("Ensemble" text,"Gold Medals" real,"Silver Medals" real,"Bronze Medals" real,"Total Medals" real) | SELECT COUNT("Gold Medals") FROM table_71150 WHERE "Ensemble" = 'bellbrook hs' AND "Silver Medals" < '1' |
How many years did John Player Lotus used Cosworth v8? | CREATE TABLE table_name_3 (year INTEGER,engine VARCHAR,entrant VARCHAR) | SELECT SUM(year) FROM table_name_3 WHERE engine = "cosworth v8" AND entrant = "john player lotus" |
What are the number of rooms for each bed type Show bar chart, I want to show by the x axis in ascending. | 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, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType |
Name the total number of director for oro diablo | CREATE TABLE table_18123274_1 (director VARCHAR,original_title VARCHAR) | SELECT COUNT(director) FROM table_18123274_1 WHERE original_title = "Oro Diablo" |
Test - top users reputation from India. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%India%' OR UPPER(Location) LIKE '%India%' OR Location LIKE '%India%' AND Reputation >= 1000 ORDER BY Reputation DESC |
Who has friends that are older than the average age? Print their friends and their ages as well using a pie chart. | CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER) | SELECT friend, age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) |
Is MATSCIE 526 having morning classes ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester i... | SELECT COUNT(*) > 0 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 = 'MATSCIE' AND course.number = 526 AND semester.semester = 'WN' AND semester.semester_id = course_... |
What are the names of the mills which are not located in 'Donceel'? | CREATE TABLE mill (name VARCHAR,LOCATION VARCHAR) | SELECT name FROM mill WHERE LOCATION <> 'Donceel' |
What is the name of the manager of the Atl tico Baleares? | CREATE TABLE table_name_54 (manager VARCHAR,current_club VARCHAR) | SELECT manager FROM table_name_54 WHERE current_club = "atlético baleares" |
How many athletes completed a trans 1 within 0:26? | CREATE TABLE table_21265 ("Athlete" text,"Event" text,"Swim (1.5km)" text,"Trans 1" text,"Bike (40km)" text,"Trans 2" text,"Run (10km)" text,"Total Time" text,"Rank" real) | SELECT COUNT("Athlete") FROM table_21265 WHERE "Trans 1" = '0:26' |
What were the highest laps for glenn seton gregg hansford? | CREATE TABLE table_61708 ("Pos." text,"Class" text,"Entrant" text,"Drivers" text,"Laps" real) | SELECT MAX("Laps") FROM table_61708 WHERE "Drivers" = 'glenn seton gregg hansford' |
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, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by time, and could you list by the y-axis in asc? | 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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),CO... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) |
What is the semi-final television commentator status in 1962 with an unknown spokesperson? | CREATE TABLE table_37181 ("Year(s)" real,"Grand Final Television Commentator" text,"Grand Final Dual Television Commentator" text,"Spokesperson" text,"Semi Final Television Commentator" text,"Semi Final Dual Television Commentator" text) | SELECT "Semi Final Television Commentator" FROM table_37181 WHERE "Spokesperson" = 'unknown' AND "Year(s)" = '1962' |
What was the game when the record was 31-15? | CREATE TABLE table_64263 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location Attendance" text,"Record" text) | SELECT "Game" FROM table_64263 WHERE "Record" = '31-15' |
For the engine family MaxxForce 11, what is the years produced? | CREATE TABLE table_26352332_4 (years_produced VARCHAR,engine_family VARCHAR) | SELECT years_produced FROM table_26352332_4 WHERE engine_family = "MaxxForce 11" |
who is the season result where margin is 51 | CREATE TABLE table_16699 ("Year" real,"Winners" text,"Grand Finalist" text,"Scores" text,"Venue" text,"Crowd" real,"Margin" real,"Season Result" text) | SELECT "Season Result" FROM table_16699 WHERE "Margin" = '51' |
what is the number of patients whose admission type is emergency and year of death is less than or equal to 2180? | 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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year <= "2180.0" |
What was the Sat 21 Aug time for the driver whose Thurs 26 Aug time was 20' 56.01 108.143mph? | CREATE TABLE table_29203 ("Rank" real,"Rider" text,"Sat 21 Aug" text,"Mon 23 Aug" text,"Tues 24 Aug" text,"Wed 25 Aug" text,"Thurs 26 Aug" text,"Fri 27 Aug" text,"Sat 28 Aug" text) | SELECT "Sat 21 Aug" FROM table_29203 WHERE "Thurs 26 Aug" = '20'' 56.01 108.143mph' |
What writers are associated with a viewing figure of 7.01 million? | CREATE TABLE table_15026994_2 (writer VARCHAR,viewing_figure VARCHAR) | SELECT writer FROM table_15026994_2 WHERE viewing_figure = "7.01 million" |
What is the total number of silver medals of the team ranked 7 with more than 1 total medal? | CREATE TABLE table_6566 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Silver") FROM table_6566 WHERE "Rank" = '7' AND "Total" > '1' |
What is the highest Rank 1960 ? | CREATE TABLE table_62905 ("Rank" real,"Actor" text,"Character" text,"Soap Opera" text,"Years" text,"Duration" text) | SELECT MAX("Rank") FROM table_62905 WHERE "Years" = '1960—' |
Bar chart x axis customer last name y axis how many customer last name, and sort from high to low by the y axis. | CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(20),customer_last_name VARCHAR(20),customer_address VARCHAR(255),customer_phone VARCHAR(255),customer_email VARCHAR(255),other_customer_details VARCHAR(255))CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),othe... | SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY COUNT(customer_last_name) DESC |
Which driver won the iv j.c.c. jersey road race? | CREATE TABLE table_name_9 (winning_driver VARCHAR,race_name VARCHAR) | SELECT winning_driver FROM table_name_9 WHERE race_name = "iv j.c.c. jersey road race" |
What shows for Tie no when Sheffield United was the Away team? | CREATE TABLE table_name_10 (tie_no VARCHAR,away_team VARCHAR) | SELECT tie_no FROM table_name_10 WHERE away_team = "sheffield united" |
calculate the four year survival rate of the patients diagnosed with chr blood loss anemia. | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,subject_id number,gender te... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... |
Name the finished for exited day 13 | CREATE TABLE table_14345690_4 (finished VARCHAR,exited VARCHAR) | SELECT finished FROM table_14345690_4 WHERE exited = "Day 13" |
What is Distance, when Pilot is 'Stanislaw Wujczak'? | CREATE TABLE table_name_64 (distance VARCHAR,pilot VARCHAR) | SELECT distance FROM table_name_64 WHERE pilot = "stanislaw wujczak" |
What is the figure for Tujunga when Pasadena is 134,941? | CREATE TABLE table_78546 ("Tujunga" text,"La Crescenta- Montrose" text,"Glendale" text,"La Ca\u00f1ada Flintridge" text,"Pasadena" text) | SELECT "Tujunga" FROM table_78546 WHERE "Pasadena" = '134,941' |
Return the code of the card type that is most common. | CREATE TABLE customers (customer_id number,customer_first_name text,customer_last_name text,customer_address text,customer_phone text,customer_email text,other_customer_details text)CREATE TABLE customers_cards (card_id number,customer_id number,card_type_code text,card_number text,date_valid_from time,date_valid_to ti... | SELECT card_type_code FROM customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
What is the sum of losses for teams with under 10 matches? | CREATE TABLE table_name_5 (lost INTEGER,match INTEGER) | SELECT SUM(lost) FROM table_name_5 WHERE match < 10 |
since 2103 what are the top four most frequent diagnoses that patients were given within the same month after being diagnosed with resp obstr-inhal obj nec? | 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 (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE transfers (... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... |
how many patients whose insurance is private and diagnoses long title is shock, 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.insurance = "Private" AND diagnoses.long_title = "Shock, unspecified" |
List the countries that have more than one mountain. | CREATE TABLE climber (climber_id number,name text,country text,time text,points number,mountain_id number)CREATE TABLE mountain (mountain_id number,name text,height number,prominence number,range text,country text) | SELECT country FROM mountain GROUP BY country HAVING COUNT(*) > 1 |
Which builder has a railway of Rhodesia Railways? | CREATE TABLE table_5681 ("Gauge" text,"Railway" text,"Class" text,"Works no." text,"Year" text,"Builder" text) | SELECT "Builder" FROM table_5681 WHERE "Railway" = 'rhodesia railways' |
how many hours have it been since the last time patient 025-50213 was diagnosed with low cardiac output state - biventricular assist device during their current hospital visit? | 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-50213... |
Who was the home team when the opposition was Buller? | CREATE TABLE table_26847237_1 (home_team VARCHAR,opposition VARCHAR) | SELECT home_team FROM table_26847237_1 WHERE opposition = "Buller" |
Draw a scatter chart about the correlation between ACC_Percent and All_Games_Percent , and group by attribute Team_Name. | 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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY Team_Name |
Which Run 4 has a Country of united states, and an Athlete of bree schaaf emily azevedo, and a Run 3 smaller than 58.04? | CREATE TABLE table_12400 ("Athlete" text,"Country" text,"Run 1" real,"Run 2" real,"Run 3" real,"Run 4" real,"Total" text) | SELECT SUM("Run 4") FROM table_12400 WHERE "Country" = 'united states' AND "Athlete" = 'bree schaaf emily azevedo' AND "Run 3" < '58.04' |
How many paper types did Ian Drolet design stamps on? | CREATE TABLE table_11900773_6 (paper_type VARCHAR,design VARCHAR) | SELECT COUNT(paper_type) FROM table_11900773_6 WHERE design = "Ian Drolet" |
what is the average bodyweight when snatch is 80? | CREATE TABLE table_name_89 (bodyweight INTEGER,snatch VARCHAR) | SELECT AVG(bodyweight) FROM table_name_89 WHERE snatch = 80 |
how many patients have had a proximal gastrectomy procedure? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title 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 procedures_icd (row_id number,subject_id number,hadm_id ... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'proximal gastrectomy')) |
when was the last hospital admission time when patient 028-45936 was admitted via an recovery room? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '028-45936' AND patient.hospitaladmitsource = 'recovery room' ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
i'd like to know the price of FIRST class seats from ATLANTA to SAN FRANCISCO | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE airport (airport_code varchar,airport_name text,airpor... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare 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... |
count the number of patients whose drug code is lido2/5j and lab test fluid is urine? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LIDO2/5J" AND lab.fluid = "Urine" |
Visualize a bar chart for what are the different classes of races, and how many races correspond to each?, list by the y-axis from high to low. | CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text)CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real) | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC |
What was the score for the game with an attendance greater than 33,658 and a record of 73-66? | CREATE TABLE table_70486 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Score" FROM table_70486 WHERE "Attendance" > '33,658' AND "Record" = '73-66' |
highest rated answers since a date. | 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 PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number... | SELECT A.* FROM Posts AS A INNER JOIN Posts AS Q ON A.ParentId = Q.Id INNER JOIN PostTags AS PT ON Q.Id = PT.PostId INNER JOIN Tags AS T ON PT.TagId = T.Id WHERE A.PostTypeId = 2 AND Q.PostTypeId = 1 AND A.Score >= 80 AND A.CreationDate >= CAST('2017-10-01' AS DATETIME) AND T.TagName = 'r' ORDER BY A.Score DESC |
what is the fee for ankarag c previous club | CREATE TABLE table_27998152_1 (fee VARCHAR,previous_club VARCHAR) | SELECT fee FROM table_27998152_1 WHERE previous_club = "Ankaragücü" |
What are the names of all the teams in the basketball competition, sorted by all home scores in descending order? | CREATE TABLE basketball_match (team_id number,school_id number,team_name text,acc_regular_season text,acc_percent text,acc_home text,acc_road text,all_games text,all_games_percent number,all_home text,all_road text,all_neutral text)CREATE TABLE university (school_id number,school text,location text,founded number,affil... | SELECT team_name FROM basketball_match ORDER BY all_home DESC |
Which class Pos has a Team of jml team panoz? | CREATE TABLE table_67498 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text,"Class Pos." text) | SELECT "Class Pos." FROM table_67498 WHERE "Team" = 'jml team panoz' |
Which jockey had a group of G3? | CREATE TABLE table_name_76 (jockey VARCHAR,group VARCHAR) | SELECT jockey FROM table_name_76 WHERE group = "g3" |
Name the D 47 when it has a D 45 of d 32 | CREATE TABLE table_78244 ("D 48" text,"D 47" text,"D 46" text,"D 45" text,"D 44" text,"D 43" text,"D 42" text,"D 41" text) | SELECT "D 47" FROM table_78244 WHERE "D 45" = 'd 32' |
What is the average age for each gender. Visualize by bar chart. | CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER) | SELECT gender, AVG(age) FROM Person GROUP BY gender |
What shows for 1998 when 1996 is 1R, and 2002 is not held? | CREATE TABLE table_name_43 (Id VARCHAR) | SELECT 1998 FROM table_name_43 WHERE 1996 = "1r" AND 2002 = "not held" |
get me the short title of diagnoses and days for which patient with patient id 87275 was hospitalized. | 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 demographic.days_stay, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "87275" |
Which position did kevin edwards play for | CREATE TABLE table_16494599_5 (position VARCHAR,player VARCHAR) | SELECT position FROM table_16494599_5 WHERE player = "Kevin Edwards" |
what is the name of the specimen test that patient 025-44495 was last given since 11/2104? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2104... |
List the names of all genres in alphabetical oder, together with its ratings. | CREATE TABLE genre (g_name VARCHAR,rating VARCHAR) | SELECT g_name, rating FROM genre ORDER BY g_name |
what flights go from LONG BEACH to ST. LOUIS | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE compartment_class (c... | 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 = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST.... |
What was the away team's score against Hawthorn? | CREATE TABLE table_name_9 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team AS score FROM table_name_9 WHERE home_team = "hawthorn" |
Tell me the NHL team for mike gaffney | CREATE TABLE table_name_53 (nhl_team VARCHAR,player VARCHAR) | SELECT nhl_team FROM table_name_53 WHERE player = "mike gaffney" |
How many runs were scored when the strike rate was 101.42? | CREATE TABLE table_56389 ("Runs" text,"Balls" text,"Batsman" text,"Versus" text,"Venue" text,"Date" text,"Strike Rate" text) | SELECT "Runs" FROM table_56389 WHERE "Strike Rate" = '101.42' |
What was the location and attendance on the May 22 game? | CREATE TABLE table_name_13 (location_attendance VARCHAR,date VARCHAR) | SELECT location_attendance FROM table_name_13 WHERE date = "may 22" |
How many different conference records are there for season 2006? | CREATE TABLE table_20319085_2 (conference_record VARCHAR,season VARCHAR) | SELECT COUNT(conference_record) FROM table_20319085_2 WHERE season = 2006 |
What is the total number of titles for the episode numbered 29 in the series? | CREATE TABLE table_234886_3 (title VARCHAR,no_in_series VARCHAR) | SELECT COUNT(title) FROM table_234886_3 WHERE no_in_series = 29 |
what year was he most featured in shows ? | CREATE TABLE table_202_276 (id number,"year 1958" text,"title {the rebel" text,"role" text,"notes" text) | SELECT "year 1958" FROM table_202_276 ORDER BY "notes" DESC LIMIT 1 |
has patient 23929 ever received any lab tests since 05/2102? | 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 d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob ... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23929) AND STRFTIME('%y-%m', labevents.charttime) >= '2102-05' |
Name the number of women's doubles for 1986 | CREATE TABLE table_13845918_3 (womens_doubles VARCHAR,year VARCHAR) | SELECT COUNT(womens_doubles) FROM table_13845918_3 WHERE year = "1986" |
Top python answers, short time window. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate ti... | SELECT u.Id AS "user_link", u.WebsiteUrl, t.TagName, SUM(Score) AS totscore FROM Posts AS p, PostTags AS pt, Tags AS t, Users AS u WHERE PostTypeId = 2 AND p.ParentId = pt.PostId AND pt.TagId = t.Id AND p.OwnerUserId = u.Id AND t.TagName = '##tag:string?python##' GROUP BY u.Id, u.WebsiteUrl, t.TagName ORDER BY totscore... |
what were the top three most common procedures in patients of age 60 or above in 2105? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,c... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', treatment.treatmenttime) = '2105' GROUP BY treatment.treatmentname... |
Who were the winners in 2010-2011? | CREATE TABLE table_35588 ("Year" text,"Winners" text,"Score" text,"Runner-up" text,"Venue" text) | SELECT "Winners" FROM table_35588 WHERE "Year" = '2010-2011' |
how many geo id with 48.578664 are | CREATE TABLE table_1914 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" text,"Water (sqmi)" text,"Latitude" text,"Longitude" text,"GEO ID" real,"ANSI code" real) | SELECT COUNT("GEO ID") FROM table_1914 WHERE "Latitude" = '48.578664' |
List the name of all customers sorted by their account balance in ascending order. | CREATE TABLE bank (branch_id number,bname text,no_of_customers number,city text,state text)CREATE TABLE customer (cust_id text,cust_name text,acc_type text,acc_bal number,no_of_loans number,credit_score number,branch_id number,state text)CREATE TABLE loan (loan_id text,loan_type text,cust_id text,branch_id text,amount ... | SELECT cust_name FROM customer ORDER BY acc_bal |
What was the session at the circuit of lowes motor speedway? | CREATE TABLE table_name_70 (session VARCHAR,circuit VARCHAR) | SELECT session FROM table_name_70 WHERE circuit = "lowes motor speedway" |
What is the game site of the game with the san diego chargers as the opponent? | CREATE TABLE table_62400 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT "Game site" FROM table_62400 WHERE "Opponent" = 'san diego chargers' |
When was the episode number 2 originally aired? | CREATE TABLE table_19632728_1 (original_air_date VARCHAR,episode__number VARCHAR) | SELECT original_air_date FROM table_19632728_1 WHERE episode__number = 2 |
Where was the 1966 competition with a winner of Gary Cowan held? | CREATE TABLE table_name_18 (venue VARCHAR,winner VARCHAR,year VARCHAR) | SELECT venue FROM table_name_18 WHERE winner = "gary cowan" AND year = "1966" |
Which School in Wabash has a Mascot of knights? | CREATE TABLE table_name_96 (school VARCHAR,location VARCHAR,mascot VARCHAR) | SELECT school FROM table_name_96 WHERE location = "wabash" AND mascot = "knights" |
What is the fewest recorded entrants against paris saint-germain? | CREATE TABLE table_26455614_1 (entries INTEGER,winner VARCHAR) | SELECT MIN(entries) FROM table_26455614_1 WHERE winner = "Paris Saint-Germain" |
Which Location has a Floors of 03.0 n/a? | CREATE TABLE table_name_18 (location VARCHAR,floors VARCHAR) | SELECT location FROM table_name_18 WHERE floors = "03.0 n/a" |
What was the total number of Byes for the team that had 1136 Against and fewer than 0 Draws? | CREATE TABLE table_name_84 (byes VARCHAR,against VARCHAR,draws VARCHAR) | SELECT COUNT(byes) FROM table_name_84 WHERE against = 1136 AND draws < 0 |
count the number of patients whose age is less than 30 and procedure long title is other electric countershock of heart? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "30" AND procedures.long_title = "Other electric countershock of heart" |
how many days has passed since patient 92788 was given a ptt laboratory test for the first time in this hospital visit? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id numb... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ptt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788 AND admissions.disc... |
How many titles are listed with 8.44 million viewers? | CREATE TABLE table_24910733_1 (title VARCHAR,us_viewers__millions_ VARCHAR) | SELECT COUNT(title) FROM table_24910733_1 WHERE us_viewers__millions_ = "8.44" |
What college was the quarterback from? | CREATE TABLE table_65462 ("Pick" real,"Team" text,"Player" text,"Position" text,"College" text) | SELECT "College" FROM table_65462 WHERE "Position" = 'quarterback' |
provide the number of patients whose diagnoses icd9 code is 7756 and lab test category is blood gas? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | 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.icd9_code = "7756" AND lab."CATEGORY" = "Blood Gas" |
What kind of chassis does Ricardo Zonta have? | CREATE TABLE table_name_30 (chassis VARCHAR,driver VARCHAR) | SELECT chassis FROM table_name_30 WHERE driver = "ricardo zonta" |
What is the Academy Award for the Film Educating Peter? | CREATE TABLE table_13680 ("Name" text,"Ceremony" text,"Year" text,"Academy Award" text,"Film" text) | SELECT "Academy Award" FROM table_13680 WHERE "Film" = 'educating peter' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.