instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the bronze number for the nation with less than 0 gold? | CREATE TABLE table_name_53 (bronze INTEGER,gold INTEGER) | SELECT MIN(bronze) FROM table_name_53 WHERE gold < 0 |
What year at the US Open Cup quarterfinals, were the playoffs in the semifinals for the USL second division? | CREATE TABLE table_1939202_2 (year VARCHAR,us_open_cup VARCHAR,league VARCHAR,playoffs VARCHAR) | SELECT year FROM table_1939202_2 WHERE league = "USL Second division" AND playoffs = "Semifinals" AND us_open_cup = "Quarterfinals" |
Show the total number of rooms of all apartments with facility code 'Gym'. | CREATE TABLE guests (guest_id number,gender_code text,guest_first_name text,guest_last_name text,date_of_birth time)CREATE TABLE view_unit_status (apt_id number,apt_booking_id number,status_date time,available_yn others)CREATE TABLE apartments (apt_id number,building_id number,apt_type_code text,apt_number text,bathroo... | SELECT SUM(T2.room_count) FROM apartment_facilities AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym" |
Who exited on Day 12? | CREATE TABLE table_name_64 (celebrity VARCHAR,exited VARCHAR) | SELECT celebrity FROM table_name_64 WHERE exited = "day 12" |
How many times was there a record of 49-15-11? | CREATE TABLE table_25955 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real) | SELECT COUNT("Attendance") FROM table_25955 WHERE "Record" = '49-15-11' |
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, order from high to low by the names. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
Does class 381 include a project ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE ta (campus_job_id int,student_id int,location var... | SELECT DISTINCT has_projects FROM course WHERE department = 'EECS' AND number = 381 |
When was incumbent Leo E. Allen first elected? | CREATE TABLE table_18646 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT MIN("First elected") FROM table_18646 WHERE "Incumbent" = 'Leo E. Allen' |
What is the average GBP Price with an event in Monterey, a RM auction house, and a price of $154,000 later than 2003? | CREATE TABLE table_37888 ("Auction House" text,"Year" real,"Event" text,"Price" real,"GBP Price" real) | SELECT AVG("GBP Price") FROM table_37888 WHERE "Event" = 'monterey' AND "Auction House" = 'rm' AND "Price" = '154,000' AND "Year" > '2003' |
What was the career of the rank higher than 1, with an average less than 36.13 and 15 wickets, and player George O'Brien? | CREATE TABLE table_13232 ("Rank" real,"Player" text,"Wickets" real,"Average" real,"Career" text) | SELECT "Career" FROM table_13232 WHERE "Rank" > '1' AND "Average" < '36.13' AND "Wickets" = '15' AND "Player" = 'george o''brien' |
Who is the lites 2 race two winning team when #11 Performance Tech is the lites 1 race two winning team? | CREATE TABLE table_26638600_3 (lites_2_race_two_winning_team VARCHAR,lites_1_race_two_winning_team VARCHAR) | SELECT lites_2_race_two_winning_team FROM table_26638600_3 WHERE lites_1_race_two_winning_team = "#11 Performance Tech" |
For countries that won more than 32 gold medals, what was the highest number of golds? | CREATE TABLE table_name_81 (gold INTEGER,total INTEGER) | SELECT MAX(gold) FROM table_name_81 WHERE total > 32 |
how many patients whose year of birth is less than 2031 and diagnoses short title is dysphagia nec? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2031" AND diagnoses.short_title = "Dysphagia NEC" |
how many patients whose marital status is married and procedure long title is transfusion of packed cells? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Transfusion of packed cells" |
What is the average pick with 85 overall in a round lower than 3? | CREATE TABLE table_50382 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT AVG("Pick") FROM table_50382 WHERE "Overall" = '85' AND "Round" < '3' |
User Answer Accepted Rate (per tag). Gives the percentage of accepted answers for a user, per tag. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT t.TagName, COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostTags AS pt ON pt.PostId = q.Id... |
What classes can I finish this semester that are a prerequisite for most other classes ? | 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 semester (semester_id int,semester varchar,year int)CREATE TABLE instructo... | SELECT COUNT(DISTINCT COURSE_PREREQUISITEalias0.course_id), COURSEalias0.department, COURSEalias0.name, COURSEalias0.number FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course AS COURSEalias1, course_offering AS COURSE_OFFERINGali... |
Which road team has a result of 117-114? | CREATE TABLE table_49631 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text) | SELECT "Road Team" FROM table_49631 WHERE "Result" = '117-114' |
What is the name of the team with a qual 1 time of 1:17.481? | CREATE TABLE table_58165 ("Name" text,"Team" text,"Qual 1" text,"Qual 2" text,"Best" text) | SELECT "Team" FROM table_58165 WHERE "Qual 1" = '1:17.481' |
D&D family views vs total views. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE... | WITH results AS (SELECT (SELECT SUM(ViewCount) FROM Posts WHERE PostTypeId = 1 AND (Posts.Tags LIKE '%dnd%' OR Posts.Tags LIKE '%pathfinder%' OR Posts.Tags LIKE '%dungeons-and-dragons%')) AS DndViews, (SELECT SUM(ViewCount) FROM Posts WHERE PostTypeId = 1) AS TotalViews) SELECT DndViews, TotalViews, (DndViews * 1.0 / T... |
Which date has 3 as the goal? | CREATE TABLE table_80336 ("Goal" real,"Date" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_80336 WHERE "Goal" = '3' |
When was incumbent Bud Shuster first elected? | CREATE TABLE table_1341453_40 (first_elected VARCHAR,incumbent VARCHAR) | SELECT first_elected FROM table_1341453_40 WHERE incumbent = "Bud Shuster" |
What's the date when the score was 690.3? | CREATE TABLE table_66303 ("Score" text,"Shooter" text,"Date" text,"Comp" text,"Place" text) | SELECT "Date" FROM table_66303 WHERE "Score" = '690.3' |
Users with most Necromancer badges. Most decorated users | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe te... | SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS rank, UserId AS "user_link", COUNT(*) AS badges FROM Badges WHERE Name = 'Necromancer' GROUP BY UserId ORDER BY Badges DESC LIMIT 120 |
A line chart for what are the number of the dates of transactions with at least 100 share count or amount bigger than 100?, and sort from high to low by the X-axis. | CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction DATETIME,amount_of_transaction DECIMAL(19,4),share_count VARCHAR(40),other_details VARCHAR(255))CREATE TABLE Lots (lot_i... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY date_of_transaction DESC |
What are the dominant religions in the place with a population of 83? | CREATE TABLE table_2562572_27 (dominant_religion__2002_ VARCHAR,population__2011_ VARCHAR) | SELECT dominant_religion__2002_ FROM table_2562572_27 WHERE population__2011_ = "83" |
when did patient 32168 have a hemoglobin test for the first time on their first hospital visit? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit ... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32168 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime ... |
Name the number of viewers for series number 50 | CREATE TABLE table_20704243_5 (us_viewers__in_millions_ VARCHAR,series__number VARCHAR) | SELECT us_viewers__in_millions_ FROM table_20704243_5 WHERE series__number = 50 |
What is the Grid of R gis Laconi's bike that is a Kawasaki zx-10r? | CREATE TABLE table_47539 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real) | SELECT "Grid" FROM table_47539 WHERE "Bike" = 'kawasaki zx-10r' AND "Rider" = 'régis laconi' |
What is the event result for athlete Ali Ekranpour? | CREATE TABLE table_36616 ("Athlete" text,"Event" text,"Quarterfinal" text,"Semifinal" text,"Final" text) | SELECT "Event" FROM table_36616 WHERE "Athlete" = 'ali ekranpour' |
Show minimum, maximum, and average market value for all companies. | CREATE TABLE company (market_value INTEGER) | SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company |
What is the prom with Hewitt class and a Height (m) of 715? | CREATE TABLE table_name_20 (prom__m_ VARCHAR,class VARCHAR,height__m_ VARCHAR) | SELECT prom__m_ FROM table_name_20 WHERE class = "hewitt" AND height__m_ = 715 |
Draw a pie chart for how many captains with younger than 50 are in each rank? | CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text) | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank |
During the Spring of 2019 how many professors teach LATIN 993 ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE program_course (program_id int,course_id int,work... | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LATIN' AND course.number = 993 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe... |
How many citations does li dong 's Semantic Parsing paper have ? | CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE writes (paperid int,autho... | SELECT DISTINCT COUNT(cite.citingpaperid) FROM author, cite, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid AND writ... |
what are the four most frequent specimen tests since 3 years ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosi... | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 4 |
What type of race took place on the course Orta San Giulio to Milan? | CREATE TABLE table_57706 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text) | SELECT "Type" FROM table_57706 WHERE "Course" = 'orta san giulio to milan' |
For all employees who have the letters D or S in their first name, give me the trend about employee_id over hire_date . | 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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varcha... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
Plot how many booking start date by grouped by booking start date as a bar graph | CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt_number CHAR(10),bathroom_count INTEGER,bedroom_count INTEGER,room_count CHAR(5))CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),build... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings |
What tournament is played on a carpet surface? | CREATE TABLE table_14070 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Tournament" FROM table_14070 WHERE "Surface" = 'carpet' |
What is the total number for the position that has less than 2 draws, less than 9 losses and more than 24? | CREATE TABLE table_63776 ("Position" real,"Name" text,"Played" real,"Drawn" real,"Lost" real,"Points" real) | SELECT COUNT("Position") FROM table_63776 WHERE "Drawn" < '2' AND "Lost" < '9' AND "Points" > '24' |
ENVIRON 255 courses will be taught by how many professors in Fall 2008 ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varcha... | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ENVIRON' AND course.number = 255 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... |
provide the number of patients whose insurance is self pay and lab test name is fibrin degradation products? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Fibrin Degradation Products" |
What is the average feet that has a Latitude (N) of 35 48 35 , and under 8,047m? | CREATE TABLE table_name_11 (feet INTEGER,latitude__n_ VARCHAR,metres VARCHAR) | SELECT AVG(feet) FROM table_name_11 WHERE latitude__n_ = "35°48′35″" AND metres < 8 OFFSET 047 |
A bar chart showing the number of films each cinema has, order Y-axis from low to high order. | CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Locatio... | SELECT Name, COUNT(Name) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name ORDER BY COUNT(Name) |
What was the label in the region of Argentina and had a format of CD? | CREATE TABLE table_name_82 (label VARCHAR,format VARCHAR,region VARCHAR) | SELECT label FROM table_name_82 WHERE format = "cd" AND region = "argentina" |
Show the facility codes of apartments with more than 4 bedrooms, and count them by a bar chart | CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE Guests (guest_id INTEGER,gender_code CHAR(1),guest_first_name VARCHAR(80),guest_last_name VARCHAR(80),date_of_birth DATETIME)CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code C... | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code |
How many civil liberties 2013 values are associated with a 2010 political rights value of 6, civil liberties 2012 values over 5, and political rights 2011 under 6? | CREATE TABLE table_75637 ("Country" text,"Political Rights 2010" real,"Civil Liberties 2010" real,"Status 2010" text,"Political Rights 2011" real,"Civil Liberties 2011" real,"Status 2011" text,"Political Rights 2012" real,"Civil Liberties 2012" real,"Status 2012" text,"Political Rights 2013" real,"Civil Liberties 2013"... | SELECT COUNT("Civil Liberties 2013") FROM table_75637 WHERE "Political Rights 2010" = '6' AND "Civil Liberties 2012" > '5' AND "Political Rights 2011" < '6' |
What is the score of game 4? | CREATE TABLE table_27756014_1 (score VARCHAR,game VARCHAR) | SELECT score FROM table_27756014_1 WHERE game = 4 |
Name the home with chicago visiting | CREATE TABLE table_name_76 (home VARCHAR,visitor VARCHAR) | SELECT home FROM table_name_76 WHERE visitor = "chicago" |
how many patients whose lab test name is alveolar-arterial gradient? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Alveolar-arterial Gradient" |
how much is the minimum cost for a hospital that contains indomethacin until 4 years ago? | 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 MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'indomethacin') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.hadm_id) AS t1 |
Who won the race on June 26? | CREATE TABLE table_30831 ("Round" real,"Date" text,"Grand Prix" text,"Circuit" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text) | SELECT "Race Winner" FROM table_30831 WHERE "Date" = 'June 26' |
What year was the competition vitry-sur-seine humarathon? | CREATE TABLE table_name_41 (year INTEGER,competition VARCHAR) | SELECT AVG(year) FROM table_name_41 WHERE competition = "vitry-sur-seine humarathon" |
What is the score of the tournament on November 5, 2007 with a carpet surface? | CREATE TABLE table_35955 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Score" FROM table_35955 WHERE "Surface" = 'carpet' AND "Date" = 'november 5, 2007' |
Where was the game played where North Melbourne was the away team? | CREATE TABLE table_10773 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_10773 WHERE "Away team" = 'north melbourne' |
what is the cost of LIMOUSINE service in PHILADELPHIA | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,... | SELECT DISTINCT ground_service.ground_fare FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'LIMOUSINE' |
how many patients whose lab test name is renal epithelial cells? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Renal Epithelial Cells" |
in 2105, what is the list of the five most frequent specimen tests ordered for patients in the same hospital visit after being diagnosed with loc osteoarth nos-l/leg? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 inputevents_cv (row_id number,subject_id numb... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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_diagnos... |
What D Player with a Height of m (ft 4in) is in the Spandau 04 Club? | CREATE TABLE table_name_5 (name VARCHAR,pos VARCHAR,club VARCHAR,height VARCHAR) | SELECT name FROM table_name_5 WHERE club = "spandau 04" AND height = "m (ft 4in)" AND pos = "d" |
What's the area of ask y, with a Municipal code less than 1247? | CREATE TABLE table_name_34 (area INTEGER,name VARCHAR,municipal_code VARCHAR) | SELECT SUM(area) FROM table_name_34 WHERE name = "askøy" AND municipal_code < 1247 |
Who won when V. A. Muthiah was the runner-up? | CREATE TABLE table_22756549_1 (winner VARCHAR,runner_up_a VARCHAR) | SELECT winner FROM table_22756549_1 WHERE runner_up_a = "V. A. Muthiah" |
When did the episode viewed by 10.50 millions of people in the US run for the first time? | CREATE TABLE table_73580 ("No. in Series" real,"No. in Season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text) | SELECT "Original air date" FROM table_73580 WHERE "U.S. viewers (millions)" = '10.50' |
What is the series number for the episode directed by jay sandrich that aired October 23, 1986? | CREATE TABLE table_2818164_4 (no_in_series INTEGER,directed_by VARCHAR,original_air_date VARCHAR) | SELECT MIN(no_in_series) FROM table_2818164_4 WHERE directed_by = "Jay Sandrich" AND original_air_date = "October 23, 1986" |
What label is the ALCA-9197 Catalog? | CREATE TABLE table_71462 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Label" FROM table_71462 WHERE "Catalog" = 'alca-9197' |
Which home team had a crowd size of 14,000 at Junction Oval? | CREATE TABLE table_10106 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_10106 WHERE "Crowd" > '14,000' AND "Venue" = 'junction oval' |
calculate the number of patients who had received a fiber-optic bronchoscopy procedure until 1 year ago. | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title 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 d_items (row_id number,itemid number,label text,linksto te... | 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 = 'fiber-optic bronchoscopy') AND DATETIME(procedures_i... |
Find the name of the organization that has published the largest number of papers. | CREATE TABLE inst (name VARCHAR,instid VARCHAR)CREATE TABLE papers (paperid VARCHAR)CREATE TABLE authorship (instid VARCHAR,paperid VARCHAR) | SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1 |
prior history of heart failure, left ventricular dysfunction or cardiomyopathy | CREATE TABLE table_test_10 ("id" int,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"immunosuppressive_disease" bool,"systolic_arterial_pressure_sap" int,"lymphomas" bool,"left_ventricular_dysfunction" bool,"tissue_hypoperfusion" bool,"heart_disease" bool,"renal_disease" bool,"positive_... | SELECT * FROM table_test_10 WHERE heart_disease = 1 OR left_ventricular_dysfunction = 1 OR cardiomyopathy = 1 |
What is the per capita income of shasta? | CREATE TABLE table_72444 ("County" text,"Population" real,"Per capita income" text,"Median household income" text,"Median family income" text) | SELECT "Per capita income" FROM table_72444 WHERE "County" = 'Shasta' |
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, what is the relationship between employee_id and manager_id ? | 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),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUN... | SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
What country does Bobby Nichols play for? | CREATE TABLE table_name_70 (country VARCHAR,player VARCHAR) | SELECT country FROM table_name_70 WHERE player = "bobby nichols" |
count the number of patients whose primary disease is pneumonia and procedure short title is circumcision. | 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.diagnosis = "PNEUMONIA" AND procedures.short_title = "Circumcision" |
What years did jersey number 55 play? | CREATE TABLE table_name_81 (years VARCHAR,jersey_number_s_ VARCHAR) | SELECT years FROM table_name_81 WHERE jersey_number_s_ = "55" |
Who was the Rookie of the Year for the Season in 2000? | CREATE TABLE table_name_72 (rookie_of_the_year VARCHAR,season VARCHAR) | SELECT rookie_of_the_year FROM table_name_72 WHERE season = 2000 |
What are the different card types, and how many transactions have been made with each Visualize by bar chart, could you order bars in asc 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_Cards (card_id IN... | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY card_type_code |
What is the total when the finish was t44? | CREATE TABLE table_name_99 (total VARCHAR,finish VARCHAR) | SELECT total FROM table_name_99 WHERE finish = "t44" |
What is the total revenue of each manufacturer, and order in desc by the names. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name DESC |
On which date did Footscray play an away game? | CREATE TABLE table_name_48 (date VARCHAR,away_team VARCHAR) | SELECT date FROM table_name_48 WHERE away_team = "footscray" |
What did Hawthorn score as the home team? | CREATE TABLE table_name_21 (home_team VARCHAR) | SELECT home_team AS score FROM table_name_21 WHERE home_team = "hawthorn" |
of those actresses receiving a tony after 1960 , which took the most amount of years to get their egot completed . | CREATE TABLE table_204_673 (id number,"name" text,"egot completed" text,"emmy" number,"grammy" number,"oscar" number,"tony" number) | SELECT "name" FROM table_204_673 WHERE "tony" > 1960 ORDER BY "egot completed" DESC LIMIT 1 |
which came first , the judge 's choice or birth year song ? | CREATE TABLE table_204_51 (id number,"week #" text,"theme" text,"song choice" text,"original artist" text,"order #" number,"result" text) | SELECT "theme" FROM table_204_51 WHERE "theme" IN ("judge's choice", 'birth year songs') ORDER BY "order #" LIMIT 1 |
What was the result of the Top 12 Men theme? | CREATE TABLE table_29676 ("Week #" text,"Theme" text,"Song Choice" text,"Original Artist" text,"Order #" text,"Result" text) | SELECT "Result" FROM table_29676 WHERE "Theme" = 'Top 12 Men' |
What team were the bills playing where their first down was 23? | CREATE TABLE table_16677887_2 (opponent VARCHAR,bills_first_downs VARCHAR) | SELECT opponent FROM table_16677887_2 WHERE bills_first_downs = 23 |
Find the number of courses for each subject in a bar chart, and order total number in desc order. | 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))CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id... | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) DESC |
What is the Country with the T3 Place Player with a Score of 71-76-71=218? | CREATE TABLE table_name_99 (country VARCHAR,place VARCHAR,score VARCHAR) | SELECT country FROM table_name_99 WHERE place = "t3" AND score = 71 - 76 - 71 = 218 |
What format is Premi re Cha ne? | CREATE TABLE table_66604 ("Frequency" text,"Call sign" text,"Branding" text,"Format" text,"Owner" text) | SELECT "Format" FROM table_66604 WHERE "Branding" = 'première chaîne' |
For R. Magjistari scores over 12, what is the highest number of points? | CREATE TABLE table_51902 ("Draw" real,"Artist" text,"Song" text,"Rank" real,"Points" real,"A. Krajka" real,"Gj. Leka" real,"B. Haxhia" real,"D. Tukiqi" real,"R. Magjistari" real,"Gj. Xhuvani" real,"A. Sk\u00ebnderaj" real) | SELECT MAX("Points") FROM table_51902 WHERE "R. Magjistari" > '12' |
what was the name of the specimen test that patient 031-22988 last received until 03/2104. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labnam... | 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 = '031-22988')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2104... |
How many games drawn when there are 78 losses and over 121 games played? | CREATE TABLE table_name_41 (drawn VARCHAR,lost VARCHAR,played VARCHAR) | SELECT COUNT(drawn) FROM table_name_41 WHERE lost = 78 AND played > 121 |
What are all the dates with a score of 203 (-13)? | CREATE TABLE table_11622829_1 (date VARCHAR,score VARCHAR) | SELECT date FROM table_11622829_1 WHERE score = "203 (-13)" |
Questions I've answered that are closed. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ... | SELECT Score AS "question_score", Id AS "post_link", ClosedDate FROM Posts WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL AND Id IN (SELECT ParentId FROM Posts WHERE NOT ParentId IS NULL AND OwnerUserId = '##MyID##') |
explain the restriction AP/57 | 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 food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE code_description (code varchar,descr... | SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57' |
What is the third stage that has the first phase of 5,443kg? | CREATE TABLE table_50294 ("Parameter" text,"1st stage" text,"2nd stage" text,"3rd stage" text,"4th stage" text) | SELECT "3rd stage" FROM table_50294 WHERE "1st stage" = '5,443kg' |
what is procedure short title of procedure icd9 code 9744? | 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 procedures.short_title FROM procedures WHERE procedures.icd9_code = "9744" |
how many products are there for each manufacturer?, display in desc by the bar. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
what was the last procedure time patient 035-14278 has had during a year before? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayi... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-14278')) AND DATETIME(treatment.treatmenttime, 'start of year... |
List the name of products in ascending order of price. | CREATE TABLE Products (Product_Name VARCHAR,Product_Price VARCHAR) | SELECT Product_Name FROM Products ORDER BY Product_Price |
Which Year has a Runner(s)-up of tammie green? | CREATE TABLE table_name_71 (year INTEGER,runner_s__up VARCHAR) | SELECT MIN(year) FROM table_name_71 WHERE runner_s__up = "tammie green" |
How many document types are there? | CREATE TABLE document_locations (document_id number,location_code text,date_in_location_from time,date_in_locaton_to time)CREATE TABLE documents_to_be_destroyed (document_id number,destruction_authorised_by_employee_id number,destroyed_by_employee_id number,planned_destruction_date time,actual_destruction_date time,oth... | SELECT COUNT(*) FROM ref_document_types |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.