instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the sum of Year(s), when Championship is 'Australian Open', when Outcome is 'Runner-Up', and when Score in Final is 3-6, 6-3, 6-2? | CREATE TABLE table_8741 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents in final" text,"Score in final" text) | SELECT SUM("Year") FROM table_8741 WHERE "Championship" = 'australian open' AND "Outcome" = 'runner-up' AND "Score in final" = '3-6, 6-3, 6-2' |
has patient 022-47232 been prescribed ecotrin ec in 01/this year. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,lab... | 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 = '022-47232')) AND medication.drugname = 'ecotrin ec' AND DATETIME(medicatio... |
select count(*), Date(CreationDate) from posts group by Date(CreationDate) order by CreationDate. | 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 COUNT(*), DAY(CreationDate), MONTH(CreationDate), YEAR(CreationDate) FROM Posts GROUP BY DAY(CreationDate), MONTH(CreationDate), YEAR(CreationDate) ORDER BY YEAR(CreationDate) DESC, MONTH(CreationDate) DESC, DAY(CreationDate) DESC |
What is the highest overall pick number for george nicula who had a pick smaller than 9? | CREATE TABLE table_name_35 (overall INTEGER,name VARCHAR,pick VARCHAR) | SELECT MAX(overall) FROM table_name_35 WHERE name = "george nicula" AND pick < 9 |
Name the year when the publisher was argonaut games sierra entertainment | CREATE TABLE table_name_50 (year VARCHAR,publisher VARCHAR) | SELECT year FROM table_name_50 WHERE publisher = "argonaut games sierra entertainment" |
What is the value for Monday August 24 if Friday August 28 is 26' 04.60 86.814mph? | CREATE TABLE table_2889 ("Rank" real,"Rider" text,"Mon 24 Aug" text,"Tues 25 Aug" text,"Wed 26 Aug" text,"Thurs 27 Aug" text,"Fri 28 Aug" text) | SELECT "Mon 24 Aug" FROM table_2889 WHERE "Fri 28 Aug" = '26'' 04.60 86.814mph' |
What was Law Hiu Fung's time? | CREATE TABLE table_63788 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text) | SELECT "Time" FROM table_63788 WHERE "Athlete" = 'law hiu fung' |
Which season had 16 losses for the Hampshire team? | CREATE TABLE table_name_79 (season VARCHAR,losses VARCHAR,team VARCHAR) | SELECT season FROM table_name_79 WHERE losses = "16" AND team = "hampshire" |
How many players were in the event after 2011 with less than 9 aces? | CREATE TABLE table_68470 ("!Aces" real,"Player" real,"Opponent" text,"Round" text,"Year" text,"Event" real,"Surface" text,"Sets" text) | SELECT COUNT("Player") FROM table_68470 WHERE "Event" > '2011' AND "!Aces" < '9' |
What Gershausen has a Willingshain of 243 and Reckerode of 224? | CREATE TABLE table_name_46 (gershausen VARCHAR,willingshain VARCHAR,reckerode_ VARCHAR) | SELECT gershausen FROM table_name_46 WHERE willingshain = "243" AND reckerode_ * * * * = "224" |
How many times did the team with an average start of 18.9 make the top 10? | CREATE TABLE table_name_82 (top_10 INTEGER,avg_start VARCHAR) | SELECT SUM(top_10) FROM table_name_82 WHERE avg_start = 18.9 |
count the number of patients born before 1850 who have been diagnosed with unspecified intestinal obstruction. | 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 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.dob_year < "1850" AND diagnoses.short_title = "Intestinal obstruct NOS" |
return me the conferences, which have more than 60 papers containing keyword ' Relational Database ' . | CREATE TABLE conference (cid int,homepage varchar,name varchar)CREATE TABLE domain_author (aid int,did int)CREATE TABLE writes (aid int,pid int)CREATE TABLE cite (cited int,citing int)CREATE TABLE publication_keyword (kid int,pid int)CREATE TABLE keyword (keyword varchar,kid int)CREATE TABLE domain (did int,name varcha... | SELECT conference.name FROM conference, keyword, publication, publication_keyword WHERE keyword.keyword = 'Relational Database' AND publication_keyword.kid = keyword.kid AND publication.cid = conference.cid AND publication.pid = publication_keyword.pid GROUP BY conference.name HAVING COUNT(DISTINCT (publication.title))... |
when did patient 14467 enter the hospital for the last time since 2105? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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)C... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 14467 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1 |
When was the last instance of a violent or sexual offense in Manchester? | CREATE TABLE greatermanchestercrime (crimeid text,crimets time,location text,lsoa text,type text,outcome text) | SELECT crimeid FROM greatermanchestercrime WHERE type = "Violence and sexual offences" ORDER BY crimets DESC LIMIT 1 |
how many patients whose drug route is sc? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "SC" |
What is the sum of bronze when silver is greater than 3? | CREATE TABLE table_32848 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Bronze") FROM table_32848 WHERE "Silver" > '3' |
What easy class can I take that will fulfill the ULCS requirement ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course (course_... | 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 is the total for Danny Pinheiro Rodrigues ( fra ), in a Position smaller than 7? | CREATE TABLE table_64177 ("Position" real,"Gymnast" text,"A Score" real,"B Score" real,"Total" real) | SELECT AVG("Total") FROM table_64177 WHERE "Gymnast" = 'danny pinheiro rodrigues ( fra )' AND "Position" < '7' |
Who was the writer when Parkville Pictures Ltd was the recipient? | CREATE TABLE table_name_57 (writer_s_ VARCHAR,recipient VARCHAR) | SELECT writer_s_ FROM table_name_57 WHERE recipient = "parkville pictures ltd" |
What classes are required to declare JUDAIC as a major ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE p... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%JUDAIC%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
has there been any organism found until 2103 during the first other microbiology test of patient 031-22988? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientuni... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND microlab.culturesite = 'other' AND STRFTIME('%y', microlab.cu... |
Name the result for massachusetts 3 | CREATE TABLE table_18431 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Result" FROM table_18431 WHERE "District" = 'Massachusetts 3' |
Post Count Comparison Between Esri and Qgis tags.. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score n... | SELECT 'QGIS Tags' AS Software, Count AS PostCount FROM Tags WHERE TagName LIKE 'qgis%' |
How many copies of scouting for girls were sold? | CREATE TABLE table_5520 ("Position" real,"Album title" text,"Artist" text,"Sales" real,"Peak" text) | SELECT COUNT("Sales") FROM table_5520 WHERE "Album title" = 'scouting for girls' |
i'd like an early flight tomorrow from COLUMBUS to NASHVILLE | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_s... | 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, date_day, days, flight WHERE (((flight.departure_time BETWEEN 1000 AND 0) AND date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_nam... |
When is Biddle's DOB? | CREATE TABLE table_name_5 (dob VARCHAR,surname VARCHAR) | SELECT dob FROM table_name_5 WHERE surname = "biddle" |
Can you show a bar chart to visualize the number of carriers?, and I want to display in ascending by the x-axis. | CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int)CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real)CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int) | SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier ORDER BY Carrier |
What source has a race winner of ben adriaenssen / ben van den bogaart, and the gp winner of ben adriaenssen / ben van den bogaart, for the date of 1 april? | CREATE TABLE table_49573 ("Date" text,"Place" text,"Race winners" text,"GP winner" text,"Source" text) | SELECT "Source" FROM table_49573 WHERE "Race winners" = 'ben adriaenssen / ben van den bogaart' AND "GP winner" = 'ben adriaenssen / ben van den bogaart' AND "Date" = '1 april' |
Which Rank has a Total smaller than 10, and a 3rd run of 36.457 (2)? | CREATE TABLE table_64480 ("Rank" real,"Name" text,"1st run" text,"2nd run" text,"3rd run" text,"Total" real) | SELECT MAX("Rank") FROM table_64480 WHERE "Total" < '10' AND "3rd run" = '36.457 (2)' |
what was the name of procedure, that patient 009-5801 was last received during the last hospital encounter? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patient... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5801' AND NOT patient.hospitaldischargetime IS NULL ORDER BY ... |
Name the builder for 4/1906 and works number more than 199 | CREATE TABLE table_39515 ("Number" real,"Builder" text,"Type" text,"Date" text,"Works number" real) | SELECT "Builder" FROM table_39515 WHERE "Works number" > '199' AND "Date" = '4/1906' |
Return the apartment number and the number of rooms for each apartment by a bar chart, and show by the y-axis from high to low. | CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CH... | SELECT apt_number, room_count FROM Apartments ORDER BY room_count DESC |
What is the highest apps total with FA cup apps of 26 with total number of goals larger than 9? | CREATE TABLE table_name_41 (total_apps INTEGER,fa_cup_apps VARCHAR,total_goals VARCHAR) | SELECT MAX(total_apps) FROM table_name_41 WHERE fa_cup_apps = 26 AND total_goals > 9 |
What is the L2 cache for the Mobile Pentium 333? | CREATE TABLE table_9499 ("Model number" text,"sSpec number" text,"Frequency" text,"L2 cache" text,"Mult." text,"Voltage" text,"Socket" text,"Part number(s)" text) | SELECT "L2 cache" FROM table_9499 WHERE "Model number" = 'mobile pentium 333' |
How many medicines have the FDA approval status 'No' ? | CREATE TABLE medicine (FDA_approved VARCHAR) | SELECT COUNT(*) FROM medicine WHERE FDA_approved = 'No' |
Show the number of cards in different card type code in a bar chart, show y axis in descending order. | CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER,account_id INTEGER,card_id INTEGER,transaction_type VARCHAR(15),transaction_date DATETIME,transaction_amount DOUBLE,transaction_comment VARCHAR(255),other_transaction_details VARCHAR(255))CREATE TABLE Customers (customer_id INTE... | SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(card_type_code) DESC |
Show me a bar chart for what are the titles and ids for albums containing tracks with unit price greater than 1?, and rank in descending by the AlbumId. | CREATE TABLE Album (AlbumId integer,Title varchar(160),ArtistId integer)CREATE TABLE PlaylistTrack (PlaylistId integer,TrackId integer)CREATE TABLE Customer (CustomerId integer,FirstName varchar(40),LastName varchar(20),Company varchar(80),Address varchar(70),City varchar(40),State varchar(40),Country varchar(40),Posta... | SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.AlbumId DESC |
what is a building that is proposed and will have 32 floors? | CREATE TABLE table_34671 ("Rank" real,"Building" text,"City" text,"Height (m/ft)" text,"Floors" real,"Status" text) | SELECT "Building" FROM table_34671 WHERE "Status" = 'proposed' AND "Floors" = '32' |
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, show me about the distribution of job_id and the average of salary , and group by attribute job_id in a bar chart, I want to display bar from high to low order please. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGE... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC |
What is the sum of goals scored in regular league play by Mustoe where he scored 0 goals in the League Cup? | CREATE TABLE table_53428 ("Name" text,"League" real,"FA Cup" real,"League Cup" real,"Total" real) | SELECT SUM("League") FROM table_53428 WHERE "Name" = 'mustoe' AND "League Cup" < '0' |
Provide the number of patients on additive type drug prescription who have other pulmonary insufficiency not elsewhere classified diagnoses. | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other pulmonary insufficiency, not elsewhere classified" AND prescriptions.drug_type = "ADD... |
Which of the entrants had Luigi Fagioli as a driver? | CREATE TABLE table_name_79 (entrant VARCHAR,driver VARCHAR) | SELECT entrant FROM table_name_79 WHERE driver = "luigi fagioli" |
What season had 1st position, 33 pld, and 58 points? | CREATE TABLE table_63305 ("Season" text,"Div." text,"Pos." text,"Pld." text,"Pts." text) | SELECT "Season" FROM table_63305 WHERE "Pos." = '1st' AND "Pld." = '33' AND "Pts." = '58' |
when was the first time since 05/2102 patient 006-146580 was prescribed an aspirin and 2 ml vial : famotidine 10 mg/ml iv soln at the same time? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'aspirin' AND patient.uniquepid = '006-146580' AND STRFTIME('%y-%m', medication.drugstarttime) >= '2102-05') AS t1 JOIN (S... |
how many patients born before the year 2089 were given the drug metaformin (glucophage)? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2089" AND prescriptions.drug = "MetFORMIN (Glucophage)" |
Where is the lacrosse school located? | CREATE TABLE table_name_98 (location VARCHAR,school VARCHAR) | SELECT location FROM table_name_98 WHERE school = "lacrosse" |
What school has a team called the Pirates? | CREATE TABLE table_name_79 (school VARCHAR,team_name VARCHAR) | SELECT school FROM table_name_79 WHERE team_name = "pirates" |
Name the least wins for 5 losses | CREATE TABLE table_18607260_6 (wins INTEGER,losses VARCHAR) | SELECT MIN(wins) FROM table_18607260_6 WHERE losses = 5 |
How many accounts are opened in each day? Bin the account open day by weekday in a bar chart. | CREATE TABLE Invoice_Line_Items (order_item_id INTEGER,invoice_number INTEGER,product_id INTEGER,product_title VARCHAR(80),product_quantity VARCHAR(50),product_price DECIMAL(19,4),derived_product_cost DECIMAL(19,4),derived_vat_payable DECIMAL(19,4),derived_total_cost DECIMAL(19,4))CREATE TABLE Products (product_id INTE... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts |
give me the number of patients whose language is ptun and year of death is less than or equal to 2133? | 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 WHERE demographic.language = "PTUN" AND demographic.dod_year <= "2133.0" |
What period was there a 22.7 NC? | CREATE TABLE table_29507 ("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 "Period" FROM table_29507 WHERE "NC*" = '22.7' |
What circuit was the race where Hideki Mutoh had the fastest lap? | CREATE TABLE table_16018 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Team" text) | SELECT "Circuit" FROM table_16018 WHERE "Fastest Lap" = 'Hideki Mutoh' |
Who was the home team when the away team is Carlton? | CREATE TABLE table_20769 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_20769 WHERE "Away team" = 'Carlton' |
What is the year of the first appearance of the Black Knights, who had less than 1 finals appearances? | CREATE TABLE table_5474 ("Corps Name" text,"Number of Finals Appearances" real,"Year of First Appearance" real,"Year of Most Recent Appearance" real,"All Years of Finals Appearances" text) | SELECT COUNT("Year of First Appearance") FROM table_5474 WHERE "Corps Name" = 'black knights' AND "Number of Finals Appearances" < '1' |
How many players are from Indianapolis, Indiana? | CREATE TABLE table_17085 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text) | SELECT COUNT("Player") FROM table_17085 WHERE "Hometown" = 'Indianapolis, Indiana' |
Draw a scatter chart about the correlation between School_ID and ACC_Percent , and group by attribute All_Neutral. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY All_Neutral |
What is the current code for the club trophy, in 1867 only? | CREATE TABLE table_name_20 (current_code VARCHAR,type VARCHAR,years VARCHAR) | SELECT current_code FROM table_name_20 WHERE type = "club trophy" AND years = "1867 only" |
What are the number of dates of birth of all the guests whose gender is 'Male'?, I want to show x axis in ascending order. | CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),building_address VARCHAR(255),building_manager VARCHAR(50),building_phone VARCHAR(80))CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATET... | SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY date_of_birth |
count the number of patients whose primary disease is s/p hanging and drug type is main? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "S/P HANGING" AND prescriptions.drug_type = "MAIN" |
what is the difference in the capacity between penydarren park and hand stadium ? | CREATE TABLE table_204_750 (id number,"team" text,"stadium" text,"capacity" number,"seated" number) | SELECT ABS((SELECT "capacity" FROM table_204_750 WHERE "stadium" = 'penydarren park') - (SELECT "capacity" FROM table_204_750 WHERE "stadium" = 'hand stadium')) |
Who is entered earlier than 1975 and has a Lotus 20 chassis? | CREATE TABLE table_71258 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Entrant" FROM table_71258 WHERE "Year" < '1975' AND "Chassis" = 'lotus 20' |
If new entries this round is 65, what is the round? | CREATE TABLE table_22439 ("Round" text,"Clubs remaining" real,"Clubs involved" real,"Winners from previous round" text,"New entries this round" text,"Leagues entering at this round" text) | SELECT COUNT("Round") FROM table_22439 WHERE "New entries this round" = '65' |
What's the value for arizona when colorado and nevada are nixon, and texas is humphrey? | CREATE TABLE table_name_83 (arizona VARCHAR,texas VARCHAR,colorado VARCHAR,nevada VARCHAR) | SELECT arizona FROM table_name_83 WHERE colorado = "nixon" AND nevada = "nixon" AND texas = "humphrey" |
what is the material of the surface in the dehradun , uttarakhand, india location | CREATE TABLE table_74361 ("Outcome" text,"Date" text,"Tournament" text,"Location" text,"Surface" text,"Opponent in the final" text,"Score in the final" text) | SELECT "Surface" FROM table_74361 WHERE "Location" = 'Dehradun , Uttarakhand, India' |
what is the lowest position of brendan sole | CREATE TABLE table_23529 ("Pos" real,"Driver" text,"Vehicle" text,"Top 13 Time" text,"Shoot-Out Time" text,"Best Time of Day" text) | SELECT MAX("Pos") FROM table_23529 WHERE "Driver" = 'Brendan Sole' |
provide the number of patients whose diagnoses short title is b12 defic anemia nec and drug type is main? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "B12 defic anemia NEC" AND prescriptions.drug_type = "MAIN" |
What's the highest game against the New York Rangers with more than 55 points? | CREATE TABLE table_35236 ("Game" real,"January" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT MAX("Game") FROM table_35236 WHERE "Opponent" = 'new york rangers' AND "Points" > '55' |
What is the date of the Last Performance of Billy Elliot with a Cast Status of past replacement? | CREATE TABLE table_name_46 (last_performance VARCHAR,status VARCHAR) | SELECT last_performance FROM table_name_46 WHERE status = "past replacement" |
A bar chart for what are the number of the last names of female students, ordered by age descending? | CREATE TABLE Department (DNO INTEGER,Division VARCHAR(2),DName VARCHAR(25),Room VARCHAR(5),Building VARCHAR(13),DPhone INTEGER)CREATE TABLE Enrolled_in (StuID INTEGER,CID VARCHAR(7),Grade VARCHAR(2))CREATE TABLE Course (CID VARCHAR(7),CName VARCHAR(40),Credits INTEGER,Instructor INTEGER,Days VARCHAR(5),Hours VARCHAR(11... | SELECT LName, COUNT(LName) FROM Student WHERE Sex = "F" GROUP BY LName ORDER BY Age DESC |
How many times was Mike McIntyre elected? | CREATE TABLE table_1805191_34 (results VARCHAR,incumbent VARCHAR) | SELECT COUNT(results) FROM table_1805191_34 WHERE incumbent = "Mike McIntyre" |
What is the name of the tournament played 13 November 2000? | CREATE TABLE table_41300 ("Date" text,"Tournament" text,"Surface" text,"Partnering" text,"Opponent in the final" text,"Score" text) | SELECT "Tournament" FROM table_41300 WHERE "Date" = '13 november 2000' |
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, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, display by the total number from low to high. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME va... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) |
Name the region before 2008 when name of best 1200 | CREATE TABLE table_52169 ("Region" text,"Year" real,"Name" text,"Format(s)" text,"Label" text) | SELECT "Region" FROM table_52169 WHERE "Year" < '2008' AND "Name" = 'best 1200' |
how long after the third prion characterization would it take for another to be characterized ? | CREATE TABLE table_203_589 (id number,"protein" text,"natural host" text,"normal function" text,"prion state" text,"prion phenotype" text,"year identified" number) | SELECT (SELECT "year identified" FROM table_203_589 WHERE id = 3 + 1) - (SELECT "year identified" FROM table_203_589 WHERE id = 3) |
find flight from MEMPHIS to CINCINNATI on sunday | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCINNATI' AND date_day.day_number = 27 AND date_day.month_number = 8 AN... |
how many patients whose ethnicity is american indian/alaska native and procedure short title is aortocor bypas-3 cor art? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Aortocor bypas-3 cor art" |
what is the country for rank 6? | CREATE TABLE table_name_3 (country VARCHAR,rank VARCHAR) | SELECT country FROM table_name_3 WHERE rank = 6 |
What are the number of goals conceded that has a played greater than 18? | CREATE TABLE table_name_13 (goals_conceded VARCHAR,played INTEGER) | SELECT COUNT(goals_conceded) FROM table_name_13 WHERE played > 18 |
which two chips have the most flash size ? | CREATE TABLE table_204_416 (id number,"chip" text,"flash size" text,"eeprom" number,"sram" number,"frequency\n[mhz]" number,"package" text) | SELECT "chip" FROM table_204_416 WHERE "flash size" = (SELECT MAX("flash size") FROM table_204_416) |
What is the Point of Chassis of Lancia d50 in 1954 | CREATE TABLE table_71847 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" text) | SELECT "Points" FROM table_71847 WHERE "Chassis" = 'lancia d50' AND "Year" = '1954' |
what was the first medication that patient 28343 was prescribed via po route? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value num... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28343) AND prescriptions.route = 'po' ORDER BY prescriptions.startdate LIMIT 1 |
provide the number of patients whose gender is m and procedure short title is sm-to-sm bowel anastom? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.short_title = "Sm-to-sm bowel anastom" |
Find the average age of students who live in the city with code 'NYC' and have secretary votes in the spring election cycle. | CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)CREATE TABLE STUDENT (Age INTEGER,StuID VARCHAR,city_code VARCHAR) | SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = "NYC" AND T2.Election_Cycle = "Spring" |
What is the lowest score that Bob Tway get when he placed t5? | CREATE TABLE table_79778 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT MIN("Score") FROM table_79778 WHERE "Place" = 't5' AND "Player" = 'bob tway' |
Return a scatter on how many students does one classroom have? | CREATE TABLE teachers (LastName TEXT,FirstName TEXT,Classroom INTEGER)CREATE TABLE list (LastName TEXT,FirstName TEXT,Grade INTEGER,Classroom INTEGER) | SELECT COUNT(*), Classroom FROM list GROUP BY Classroom |
What is Hungary's time with a heat higher than 2 and two lanes? | CREATE TABLE table_name_45 (time VARCHAR,lane VARCHAR,heat VARCHAR,nationality VARCHAR) | SELECT time FROM table_name_45 WHERE heat > 2 AND nationality = "hungary" AND lane = 2 |
What are the name and description for role code 'MG'? | CREATE TABLE document_locations (document_id number,location_code text,date_in_location_from time,date_in_locaton_to time)CREATE TABLE roles (role_code text,role_name text,role_description text)CREATE TABLE all_documents (document_id number,date_stored time,document_type_code text,document_name text,document_descriptio... | SELECT role_name, role_description FROM roles WHERE role_code = "MG" |
Show the average age of heads of departments born in each state with a bar chart, and could you display y-axis in descending order? | CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real) | SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY AVG(age) DESC |
Total for 1994, 1997 years won? | CREATE TABLE table_45396 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT SUM("Total") FROM table_45396 WHERE "Year(s) won" = '1994, 1997' |
What is the total PL G of player pennant, who has less than 7 CL G, less than 7 CL apps, and a FA YC of 0? | CREATE TABLE table_8288 ("Player" text,"PL Apps" real,"PL G" real,"CL Apps" real,"CL G" real,"FAC / LC Apps" real,"FAC / LC G" real,"Total Apps" real,"Total G" real,"FA YC" real,"UEFA YC" real) | SELECT COUNT("PL G") FROM table_8288 WHERE "CL G" < '7' AND "CL Apps" < '7' AND "FA YC" = '0' AND "Player" = 'pennant' |
What is the highest Car with more than 155 yards? | CREATE TABLE table_56183 ("Player" text,"Car." real,"Yards" real,"Avg." real,"TD's" real,"Long" real) | SELECT MAX("Car.") FROM table_56183 WHERE "Yards" > '155' |
show me the flights from PHILADELPHIA to BALTIMORE | CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE compartment... | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'B... |
Draw a bar chart for how many sections does each course have?, display in descending by the y-axis. | CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE CLASS (... | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC |
Which IATA has a ICAO of slk? | CREATE TABLE table_name_14 (iata VARCHAR,icao VARCHAR) | SELECT iata FROM table_name_14 WHERE icao = "slk" |
What is the liberal ticket that has judith white as the socialist workers? | CREATE TABLE table_42138 ("Office" text,"Republican ticket" text,"Democratic ticket" text,"Conservative ticket" text,"Liberal ticket" text,"Socialist Labor ticket" text,"Socialist Workers ticket" text) | SELECT "Liberal ticket" FROM table_42138 WHERE "Socialist Workers ticket" = 'judith white' |
What is the average work number of Snowdon Ranger with the builder Vulcan Foundry? | CREATE TABLE table_name_57 (works_number INTEGER,builder VARCHAR,name VARCHAR) | SELECT AVG(works_number) FROM table_name_57 WHERE builder = "vulcan foundry" AND name = "snowdon ranger" |
How many apartment bookings in each day? Show me a line chart grouping by booking end date, and I want to sort by the x axis in asc. | CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),building_address VARCHAR(255),building_manager VARCHAR(50),building_phone VARCHAR(80))CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATET... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date ORDER BY booking_end_date |
what is minimum age of patients whose admission type is urgent and year of birth is greater than 2175? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year > "2175" |
What's the loss for September 16? | CREATE TABLE table_name_62 (loss VARCHAR,date VARCHAR) | SELECT loss FROM table_name_62 WHERE date = "september 16" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.