instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
who had the largest margin of winning ? | CREATE TABLE table_204_924 (id number,"match" number,"date" text,"ground" text,"opponent" text,"score1" text,"pos." number,"pts." number,"gd" number) | SELECT "opponent" FROM table_204_924 ORDER BY ABS("score1" - "score1") DESC LIMIT 1 |
what is the record where the locaiton is tampa, fl and the opponent is louisville? | CREATE TABLE table_73536 ("Date" text,"Opponent" text,"Location" text,"Irish Points" real,"Opp. Points" real,"Record" text) | SELECT "Record" FROM table_73536 WHERE "Location" = 'Tampa, FL' AND "Opponent" = 'Louisville' |
Who was the opponent on December 18, 2005? | CREATE TABLE table_name_80 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_80 WHERE date = "december 18, 2005" |
What papers has Ed Desmond written on Semantic Parsing ? | CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE field (fieldid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE paperfield ... | SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Ed Desmond' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.auth... |
Who was the host team on November 17? | CREATE TABLE table_name_48 (host_team VARCHAR,date VARCHAR) | SELECT host_team FROM table_name_48 WHERE date = "november 17" |
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, give me the comparison about the average of department_id over the job_id , and group by attribute job_id by a bar chart, and sort by the y axis in descending. | 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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_I... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC |
Name the scientific name for veiled chameleon | CREATE TABLE table_175442_1 (scientific_name VARCHAR,common_name VARCHAR) | SELECT scientific_name FROM table_175442_1 WHERE common_name = "Veiled chameleon" |
Show me the New Media Writing courses that cover the MDE requirement . | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE requirement (requirement_id int,requirement var... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%New Media Writing%' OR course.description LIKE '%New Media Writing%' OR course.name LIKE '%New M... |
Which Scored has a Team of recoleta? | CREATE TABLE table_38588 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT SUM("Scored") FROM table_38588 WHERE "Team" = 'recoleta' |
Find the total checking and saving balance of all accounts sorted by the total balance in ascending order. | CREATE TABLE accounts (custid number,name text)CREATE TABLE checking (custid number,balance number)CREATE TABLE savings (custid number,balance number) | SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance |
What average played has an against less than 15? | CREATE TABLE table_42931 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT AVG("Played") FROM table_42931 WHERE "Against" < '15' |
What were the original teams for the season that was won by Danni Allen? | CREATE TABLE table_name_29 (original_teams VARCHAR,the_biggest_loser VARCHAR) | SELECT original_teams FROM table_name_29 WHERE the_biggest_loser = "danni allen" |
What are the number of the names of races held between 2009 and 2011?, and could you display by the Y from high to low? | CREATE TABLE constructorStandings (constructorStandingsId INTEGER,raceId INTEGER,constructorId INTEGER,points REAL,position INTEGER,positionText TEXT,wins INTEGER)CREATE TABLE results (resultId INTEGER,raceId INTEGER,driverId INTEGER,constructorId INTEGER,number INTEGER,grid INTEGER,position TEXT,positionText TEXT,posi... | SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY COUNT(name) DESC |
What are the miles when February 25 is the date? | CREATE TABLE table_2226343_1 (miles__km_ VARCHAR,date VARCHAR) | SELECT miles__km_ FROM table_2226343_1 WHERE date = "February 25" |
how many of the mountains have an elevation above 3,300 ft ? | CREATE TABLE table_203_808 (id number,"rank" number,"peak name" text,"elevation" text,"location" text,"notes" text) | SELECT COUNT("peak name") FROM table_203_808 WHERE "elevation" > 3300 |
What's the Loss listed for the Opponent of California Angels and has an Attendance of 57,762? | CREATE TABLE table_58250 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Loss" FROM table_58250 WHERE "Opponent" = 'california angels' AND "Attendance" = '57,762' |
Which Silver has a Total of 11, and a Gold smaller than 8? | CREATE TABLE table_name_31 (silver INTEGER,total VARCHAR,gold VARCHAR) | SELECT MIN(silver) FROM table_name_31 WHERE total = 11 AND gold < 8 |
First 20 Moroccan users in StackOverflow. | CREATE TABLE PostTypes (Id number,Name text)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 Badges (Id number,UserId number,Name text,Date time,Cl... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Id, Reputation FROM Users WHERE LOWER(Location) LIKE '%morocco%' ORDER BY Reputation DESC LIMIT 20 |
What are the full names and ages for all female students whose sex is F? | CREATE TABLE allergy_type (allergy text,allergytype text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE has_allergy (stuid number,allergy text) | SELECT fname, lname, age FROM student WHERE sex = 'F' |
what were the top four most frequent procedures that patients took within 2 months after receiving flexible sigmoidoscopy in a year before? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,va... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... |
Total comment on a tag. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseR... | SELECT SUM(CAST(CommentCount AS INT)) AS comment_count FROM Posts WHERE PostTypeId = 1 AND CreationDate > @from_date AND CreationDate < @to_date AND Tags LIKE '%##Tag##%' |
When roxanne and daniel are the couple what is the highest rank? | CREATE TABLE table_23247 ("Rank" real,"Couple" text,"Judges" real,"Public" real,"Total" real,"Vote percentage" text,"Result" text) | SELECT MAX("Rank") FROM table_23247 WHERE "Couple" = 'Roxanne and Daniel' |
For the group with 1.79% population in 1961, what was their percentage of the population in 1971? | CREATE TABLE table_name_14 (population__percentage_1971 VARCHAR,population__percentage_1961 VARCHAR) | SELECT population__percentage_1971 FROM table_name_14 WHERE population__percentage_1961 = "1.79%" |
What is the average cuts made at the top 25, less than 10, and at the Top 10 more than 3? | CREATE TABLE table_41860 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT AVG("Cuts made") FROM table_41860 WHERE "Top-25" < '10' AND "Top-10" > '3' |
What was the swimsuit score for the one who had a semifinal average of 8.759 (5)? | CREATE TABLE table_20672 ("State" text,"Preliminary Average" text,"Interview" text,"Swimsuit" text,"Evening Gown" text,"Semifinal Average" text) | SELECT "Swimsuit" FROM table_20672 WHERE "Semifinal Average" = '8.759 (5)' |
Percentage of closed questions by each hour of the day. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Comments (... | SELECT TIME_TO_STR(q.CreationDate, '%I') AS "Hour", CAST((100.0 * COUNT(q.ClosedDate) / COUNT(*)) AS FLOAT(10, 0)) AS "Closed percent", COUNT(*) AS "question_count" FROM Posts AS q WHERE q.PostTypeId = 1 GROUP BY TIME_TO_STR(q.CreationDate, '%I') ORDER BY 'Hour' |
What is the total against on 15/10/1999? | CREATE TABLE table_name_39 (against INTEGER,date VARCHAR) | SELECT SUM(against) FROM table_name_39 WHERE date = "15/10/1999" |
which nation finished first in total medals earned ? | CREATE TABLE table_203_165 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_203_165 ORDER BY "total" DESC LIMIT 1 |
Who was picked for the draft by St. Louis Blues? | CREATE TABLE table_2886617_9 (player VARCHAR,nhl_team VARCHAR) | SELECT player FROM table_2886617_9 WHERE nhl_team = "St. Louis Blues" |
What is the architecture version of Model 1b? | CREATE TABLE table_62531 ("Name / Generation" text,"Model" text,"Frequency [MHz]" text,"Architecture version" text,"Cores" text,"Process [nm]" text) | SELECT "Architecture version" FROM table_62531 WHERE "Model" = '1b' |
how many patients whose discharge location is rehab/distinct part hosp and procedure long title is other phototherapy? | 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.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.long_title = "Other phototherapy" |
what flights leave SEATTLE on sunday on CO after 2100 | CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE... | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE ((date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 2100 AND flight.flight_days = days.days_code) AND city.city_code = airport_service... |
what is the five year survival rate for patients who had been prescribed lr after having been diagnosed with cv dis nec-deliver w p/p? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABL... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... |
What 2010 has an A 2006 & 2011? | CREATE TABLE table_name_30 (Id VARCHAR) | SELECT 2010 FROM table_name_30 WHERE 2006 = "a" AND 2011 = "a" |
when has patient 018-20179 been prescribed medication for the first time since 02/2105 via intravenous route? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,ag... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179')) AND medication.routeadmin = 'intravenous' AND STR... |
how many times was midazolam hcl 2 mg/2ml ij soln prescribed until 01/2105 for patient 006-171217. | 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 COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND medication.drugname = 'midazolam hcl 2 mg/2ml ij soln' AND S... |
How many households have a median family income of $60,400? | CREATE TABLE table_name_15 (number_of_households VARCHAR,median_family_income VARCHAR) | SELECT number_of_households FROM table_name_15 WHERE median_family_income = "$60,400" |
Visualize a bar chart, count and group by nationality from the journalist table. | CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int)CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text) | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality |
What is the College of the Halfback Player? | CREATE TABLE table_name_57 (college VARCHAR,position VARCHAR) | SELECT college FROM table_name_57 WHERE position = "halfback" |
adult patients ( age > 18 years ) | CREATE TABLE table_train_56 ("id" int,"organ_transplantation" bool,"severe_sepsis" bool,"immune_suppression" bool,"autoimmune_disease" bool,"hematopoietic" bool,"chronic_infectious" bool,"steroid_therapy" bool,"sepsis" bool,"systemic_inflammatory_response" bool,"organ_failure" bool,"septic_shock" bool,"age" float,"NOUS... | SELECT * FROM table_train_56 WHERE age > 18 |
count the number of times that patient 54825 has had a rt/left heart card cath treatment during the last year. | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status t... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rt/left heart card cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND DATETIME(procedu... |
how many patients whose primary disease is colangitis and drug route is id? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "COLANGITIS" AND prescriptions.route = "ID" |
how many patients are primarily diagnosed for aortic valve insuffiency/aortic valve replacement /sda and lab tested for hematology? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND lab."CATEGORY" = "Hematology" |
Posts with the Azure tag but not any other tag with the word Azure in it. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREA... | SELECT DISTINCT Posts.Id, Posts.Title, Posts.Tags, Posts.CreationDate FROM Posts WHERE (Posts.CreationDate > '2020-10-01') AND (Posts.Tags LIKE '%azure%') AND (Posts.Id NOT IN (SELECT p.Id FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE (pt.TagId != 14158) AND t.TagName L... |
What is the temperature of 'Shanghai' city in January? | CREATE TABLE temperature (city_id number,jan number,feb number,mar number,apr number,jun number,jul number,aug number,sep number,oct number,nov number,dec number)CREATE TABLE hosting_city (year number,match_id number,host_city text)CREATE TABLE city (city_id number,city text,hanzi text,hanyu_pinyin text,regional_popula... | SELECT T2.jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai" |
Show all donor names. | CREATE TABLE endowment (endowment_id number,school_id number,donator_name text,amount number)CREATE TABLE school (school_id text,school_name text,location text,mascot text,enrollment number,ihsaa_class text,ihsaa_football_class text,county text)CREATE TABLE budget (school_id number,year number,budgeted number,total_bud... | SELECT DISTINCT donator_name FROM endowment |
Name the peak for height more than 619 and class of hewitt with prom being 148 | CREATE TABLE table_52939 ("Peak" text,"Height (m)" real,"Prom. (m)" real,"Class" text,"Parent" text) | SELECT "Peak" FROM table_52939 WHERE "Height (m)" > '619' AND "Class" = 'hewitt' AND "Prom. (m)" = '148' |
first-day closures who come back on another day. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT ucdfp.OwnerUserId, COUNT(p2.Id) AS futureposts FROM (SELECT udfp.OwnerUserId, udfp.dfp FROM (SELECT p.OwnerUserId, MIN(p.CreationDate) AS dfp FROM Posts AS p WHERE p.PostTypeId < 3 GROUP BY p.OwnerUserId) AS udfp LEFT OUTER JOIN Posts AS p ON p.OwnerUserId = udfp.OwnerUserId AND p.PostTypeId = 1 LEFT OUTER JOIN ... |
Which Builder has a Date of early 1871? | CREATE TABLE table_name_39 (builder VARCHAR,date VARCHAR) | SELECT builder FROM table_name_39 WHERE date = "early 1871" |
Get unanswered Latest 20 Questions By Tag. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,Co... | SELECT q.Id AS "post_link", q.Tags FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 WHERE q.PostTypeId = 1 AND a.Id IS NULL AND q.Tags LIKE '%<##TagName##>%' ORDER BY q.CreationDate LIMIT 20 |
What is the Branding for Group Owner Qantam of Cape Cod, LLC? | CREATE TABLE table_10333757_1 (branding VARCHAR,group_owner VARCHAR) | SELECT branding FROM table_10333757_1 WHERE group_owner = "Qantam of Cape Cod, LLC" |
round trip fare from BALTIMORE to PHILADELPHIA less than 1000 dollars | 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 aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion va... | 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, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... |
Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, and order x-axis in ascending order. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality |
tell me the number of patients with procedure icd9 code 5361. | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "5361" |
provide the number of patients whose diagnoses long title is personal history of venous thrombosis and embolism? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Personal history of venous thrombosis and embolism" |
what's the capital with area (km 2 ) being 12,245.9 | CREATE TABLE table_1404456_1 (capital VARCHAR,area__km_2__ VARCHAR) | SELECT capital FROM table_1404456_1 WHERE area__km_2__ = "12,245.9" |
What are the driving wheels of the model built in 1883? | CREATE TABLE table_name_51 (driving_wheels VARCHAR,date_built VARCHAR) | SELECT driving_wheels FROM table_name_51 WHERE date_built = "1883" |
Which eu party has a 29th count of 40,529? | CREATE TABLE table_36141 ("Candidate" text,"Party" text,"EU Party" text,"1st count" real,"29th count" text) | SELECT "EU Party" FROM table_36141 WHERE "29th count" = '40,529' |
How many bookings for each apartment number? Plot a bar chart, I want to sort names in asc order. | CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))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 View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date... | SELECT apt_number, COUNT(apt_number) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id GROUP BY apt_number ORDER BY apt_number |
Where is the director Dariush Mehrjui from? | CREATE TABLE table_name_99 (country VARCHAR,director VARCHAR) | SELECT country FROM table_name_99 WHERE director = "dariush mehrjui" |
Return a bar chart about the distribution of Name and Weight , list total number in descending order please. | CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real) | SELECT Name, Weight FROM people ORDER BY Weight DESC |
What is the Production Cost with a Date that is february 2000? | CREATE TABLE table_name_34 (production_cost VARCHAR,date VARCHAR) | SELECT production_cost FROM table_name_34 WHERE date = "february 2000" |
what tournament was played after the kremlin cup ? | CREATE TABLE table_204_724 (id number,"outcome" text,"no." number,"date" text,"tournament" text,"surface" text,"partner" text,"opponents in the final" text,"score in the final" text) | SELECT "tournament" FROM table_204_724 WHERE "date" > (SELECT "date" FROM table_204_724 WHERE "tournament" = 'kremlin cup') ORDER BY "date" LIMIT 1 |
What average game was held on february 24 and has an attendance smaller than 16,541? | CREATE TABLE table_name_7 (game INTEGER,date VARCHAR,attendance VARCHAR) | SELECT AVG(game) FROM table_name_7 WHERE date = "february 24" AND attendance < 16 OFFSET 541 |
What is the score for Footscray? | CREATE TABLE table_name_6 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_6 WHERE away_team = "footscray" |
Name the vessel type for beluga shipping | CREATE TABLE table_3485 ("No. in series" real,"No. in season" real,"Title" text,"Vessel Type" text,"Vessel Operator" text,"Narrated by" text,"Original air date" real) | SELECT "Vessel Type" FROM table_3485 WHERE "Vessel Operator" = 'Beluga Shipping' |
Who were the opponents in games before number 54? | CREATE TABLE table_37613 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT "Opponent" FROM table_37613 WHERE "Game" < '54' |
How many kills when percentage is more than 0.313, attempts are more than 1035 and assists are larger than 57? | CREATE TABLE table_59081 ("Season" text,"GP/MP" text,"Kills" real,"K/Game" real,"Errors" real,"Total Attempts" real,"Percentage" real,"Assists" real,"Service Aces" real,"Digs" real,"Solo Blocks" real,"Block Assists" real,"Total Blocks" real,"Points" real) | SELECT COUNT("Kills") FROM table_59081 WHERE "Percentage" > '0.313' AND "Total Attempts" > '1035' AND "Assists" > '57' |
when did patient 009-5001 receive an fio2 laboratory test for the last time during this hospital encounter? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugn... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'fio2' ORDE... |
What is the numeral where the English name is Florin? | CREATE TABLE table_21125 ("English name" text,"Irish name" text,"Numeral" text,"Reverse" text,"Introduction" text,"Withdrawal" text,"\u00a31 Fraction" text) | SELECT "Numeral" FROM table_21125 WHERE "English name" = 'Florin' |
What's the 1997 when 1992 is QF, 1995 is 1R, and 1999 is 1R? | CREATE TABLE table_64985 ("Tournament" text,"1986" text,"1988" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text) | SELECT "1997" FROM table_64985 WHERE "1999" = '1r' AND "1992" = 'qf' AND "1995" = '1r' |
how many patients whose drug code is metr500pm and lab test fluid is ascites? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "METR500PM" AND lab.fluid = "Ascites" |
What is Type, when Newspaper/Magazine is Telecoms & It Magazine? | CREATE TABLE table_name_97 (type VARCHAR,newspaper_magazine VARCHAR) | SELECT type FROM table_name_97 WHERE newspaper_magazine = "telecoms & it magazine" |
A bar chart shows the distribution of Team_Name and ACC_Percent , and rank in descending by the y-axis. | 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 Team_Name, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC |
When there was a tie of 16 what was the attendance? | CREATE TABLE table_name_8 (attendance VARCHAR,tie_no VARCHAR) | SELECT attendance FROM table_name_8 WHERE tie_no = "16" |
In what scholarly journals does Takashi Matsumoto publish ? | CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE field (fieldid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE keyphra... | SELECT DISTINCT paper.journalid FROM author, paper, writes WHERE author.authorname = 'Takashi Matsumoto' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.journalid |
What day had over 51,319 attending week 4? | CREATE TABLE table_74710 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Date" FROM table_74710 WHERE "Attendance" > '51,319' AND "Week" = '4' |
What are the percentage of hispanics in cities with the black percentage higher than 10? | CREATE TABLE city (Hispanic VARCHAR,Black INTEGER) | SELECT Hispanic FROM city WHERE Black > 10 |
Who is the author for the malasaurus? | CREATE TABLE table_7025 ("Name" text,"Status" text,"Authors" text,"Unit" text,"Location" text) | SELECT "Authors" FROM table_7025 WHERE "Name" = 'malasaurus' |
What was the rank# of the opponent when there was 93,829 in attendance? | CREATE TABLE table_59321 ("Date" text,"Time" text,"Opponent#" text,"Rank #" text,"Result" text,"Attendance" text) | SELECT "Rank #" FROM table_59321 WHERE "Attendance" = '93,829' |
calculate the number of patients with icd9 code 44020 who had a lab test for joint fluid | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "44020" AND lab.fluid = "Joint Fluid" |
Which Ties is the highest one that has Losses smaller than 9, and Starts of 26, and Wins smaller than 21? | CREATE TABLE table_name_65 (ties INTEGER,wins VARCHAR,losses VARCHAR,starts VARCHAR) | SELECT MAX(ties) FROM table_name_65 WHERE losses < 9 AND starts = 26 AND wins < 21 |
How many tries for Nelson RFC? | CREATE TABLE table_5364 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Tries for" FROM table_5364 WHERE "Club" = 'nelson rfc' |
With the number of electorates (2009) greater than 272,902, and 192 as the constituency number, what is the reserved for (SC / ST /None)? | CREATE TABLE table_62519 ("Constituency number" text,"Name" text,"Reserved for (SC / ST /None)" text,"District" text,"Number of electorates (2009)" real) | SELECT "Reserved for ( SC / ST /None)" FROM table_62519 WHERE "Number of electorates (2009)" > '272,902' AND "Constituency number" = '192' |
Top posts from users who never come back/are unregistered. | CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT p.Id AS "post_link" FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id WHERE P.PostTypeId = 1 AND CAST((JULIANDAY(LastAccessDate) - JULIANDAY(u.CreationDate)) * 24.0 AS INT) <= 1 AND p.Score > 5 |
how many patients were prescribed sodium chloride 0.9% 1000 ml lvp within the same month last year after the procedure of antihyperlipidemic agent - hmg-coa reductase inhibitor. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid numbe... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antihyperlipidemic agent - hmg-coa reductase inhibitor' AND DATETIME(treatment.treatmenttime, 'start of year... |
How many weeks had an attendance at 69,149? | CREATE TABLE table_43090 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT COUNT("Week") FROM table_43090 WHERE "Attendance" = '69,149' |
What is the average Attendance at Venue A on 16 October 2004? | CREATE TABLE table_55435 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real) | SELECT AVG("Attendance") FROM table_55435 WHERE "Venue" = 'a' AND "Date" = '16 october 2004' |
which schools have the largest number of shared titles ? | CREATE TABLE table_203_362 (id number,"school" text,"location" text,"outright titles" number,"shared titles" number,"runners-up" number,"total finals" number,"last title" number,"last final" number) | SELECT "school" FROM table_203_362 WHERE "shared titles" = (SELECT MAX("shared titles") FROM table_203_362) |
What is the Staffel A that has a Staffel D of Energie Cottbus and a Staffel C of Chemie Leipzig and a Staffel B of 1. FC Union Berlin? | CREATE TABLE table_43256 ("Season" text,"Staffel A" text,"Staffel B" text,"Staffel C" text,"Staffel D" text,"Staffel E" text) | SELECT "Staffel A" FROM table_43256 WHERE "Staffel D" = 'energie cottbus' AND "Staffel C" = 'chemie leipzig' AND "Staffel B" = '1. fc union berlin' |
Users who accepted my answers. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ... | WITH Q AS (SELECT * FROM Posts WHERE NOT AcceptedAnswerId IS NULL AND NOT OwnerUserId IS NULL AND OwnerUserId != @UserId) SELECT Q.OwnerUserId AS "user_link", COUNT(*) AS Num FROM Posts INNER JOIN Q ON Q.Id = Posts.ParentId WHERE Posts.OwnerUserId = @UserId GROUP BY Q.OwnerUserId HAVING COUNT(*) > 1 ORDER BY Num DESC |
Which Sleeves have a Year of 2006-2008? | CREATE TABLE table_44512 ("Year" text,"Supplier" text,"Chest" text,"Sleeves" text,"Back" text) | SELECT "Sleeves" FROM table_44512 WHERE "Year" = '2006-2008' |
Valmir Benavides won pole position at which circuit? | CREATE TABLE table_31110 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text) | SELECT "Circuit" FROM table_31110 WHERE "Pole Position" = 'Valmir Benavides' |
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,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 decima... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
From where did the Scout carrier rocket with the satellite that has a COSPAR ID of 1971-109a launch? | CREATE TABLE table_12779 ("Satellite" text,"Launch date" text,"Carrier rocket" text,"Launch site" text,"COSPAR ID" text) | SELECT "Launch site" FROM table_12779 WHERE "Carrier rocket" = 'scout' AND "COSPAR ID" = '1971-109a' |
What team has a Score of l 88 94 (ot)? | CREATE TABLE table_5816 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_5816 WHERE "Score" = 'l 88–94 (ot)' |
Name the date of the italian grand prix | CREATE TABLE table_11993 ("Race" text,"Circuit" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Constructor" text,"Tyre" text,"Report" text) | SELECT "Date" FROM table_11993 WHERE "Race" = 'italian grand prix' |
Find the number of courses that have two prerequisites for each title in a bar chart, and show names in ascending order. | CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE department (dept_name varchar(20),building varchar(15),budget numeric(12,2))CREATE TABLE time_slot (time_slot_id varchar(4),day varchar(1),start_hr numeric(2),start_min numeric(2),end_hr numeric(2),end_mi... | SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title |
Top 10 user in Indore. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Descriptio... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%indore%' OR UPPER(Location) LIKE '%INDORE%' OR Location LIKE '%indore%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 50 |
Which Week 10 Nov 2 has a Week 9 Oct 26 of lsu (5-2)? | CREATE TABLE table_5693 ("Week 6 Oct 5" text,"Week 7 Oct 12" text,"Week 9 Oct 26" text,"Week 10 Nov 2" text,"Week 11 Nov 9" text,"Week 13 Nov 23" text,"Week 14 Nov 30" text,"Week 15 (Final) Dec 7" text) | SELECT "Week 10 Nov 2" FROM table_5693 WHERE "Week 9 Oct 26" = 'lsu (5-2)' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.