instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the rank for the Mixed Team nation with a total of less than 13? | CREATE TABLE table_61257 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Rank" FROM table_61257 WHERE "Total" < '13' AND "Nation" = 'mixed team' |
what is the date when the format is cd (limited edition steel-box) from united kingdom? | CREATE TABLE table_63085 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalogue No." text) | SELECT "Date" FROM table_63085 WHERE "Format" = 'cd (limited edition steel-box)' AND "Country" = 'united kingdom' |
What is the time for the bike (40km) when the swim (1.5km) is 19:56? | CREATE TABLE table_name_38 (bike__40km_ VARCHAR,swim__15km_ VARCHAR) | SELECT bike__40km_ FROM table_name_38 WHERE swim__15km_ = "19:56" |
What are the number of the dates of the latest logon of the students with family name 'Jaskolski' or 'Langosh'?, and show in descending by the Y. | CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VARCHAR(255))CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,student_id INTE... | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) DESC |
SELECT a string plus a number. | 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 'Brent' + '100' |
tell me the short title of procedure for 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" |
What is the Population of the nation that has an Area (km ) of 70,273? | CREATE TABLE table_name_31 (population VARCHAR,area__km²_ VARCHAR) | SELECT population FROM table_name_31 WHERE area__km²_ = "70,273" |
Name the high assists for 29 game | CREATE TABLE table_17355408_5 (high_assists VARCHAR,game VARCHAR) | SELECT high_assists FROM table_17355408_5 WHERE game = 29 |
Who was the developer of Wii? | CREATE TABLE table_name_50 (developer_s_ VARCHAR,platform_s_ VARCHAR) | SELECT developer_s_ FROM table_name_50 WHERE platform_s_ = "wii" |
Who is the 92.5 with the press of 282.5? | CREATE TABLE table_name_26 (press VARCHAR) | SELECT 925 FROM table_name_26 WHERE press = "282.5" |
How much General election has a Share of votes of 17%? | CREATE TABLE table_13604 ("General election" real,"Name" text,"Share of votes" text,"Seats" real,"Share of seats" text) | SELECT SUM("General election") FROM table_13604 WHERE "Share of votes" = '17%' |
Which club is located in Thomson, Victoria? | CREATE TABLE table_name_15 (club VARCHAR,location VARCHAR) | SELECT club FROM table_name_15 WHERE location = "thomson, victoria" |
Bar chart of sum age from each nationality, and display by the x axis from high to low. | CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text)CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int) | SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality ORDER BY Nationality DESC |
what were the top three most frequent laboratory tests that followed within 2 months for patients who took non-cardiac angiography - angiography of arteries of extremities, bilateral in this year? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'non-cardiac angiography - angiography of arteries of... |
count the number of patients who were diagnosed with gangrene within 2 months after being diagnosed with ami anterolateral, init since 6 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 d_labitems (row_id number,itemid number,label text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_car... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gangrene') AND DAT... |
Top 2500 SO Users from NC. | 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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Location LIKE '%NC%' OR LOWER(Location) LIKE '%north carolina%' AND NOT LOWER(Location) LIKE '%france%' AND NOT Location LIKE '%NCR%' ORDER BY Reputation DESC LIMIT 2500 |
When the Away team was essendon, what was the Venue they played at? | CREATE TABLE table_10096 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_10096 WHERE "Away team" = 'essendon' |
What's the sum of Men's race when Women's race is less than 1, Women's Wheelchair is 1, Men's wheelchair is more than 3 and the Total is more than 3? | CREATE TABLE table_40033 ("Country" text,"Men's race" real,"Women's race" real,"Men's wheelchair" real,"Women's Wheelchair" real,"Total" real) | SELECT SUM("Men's race") FROM table_40033 WHERE "Women's race" < '1' AND "Women's Wheelchair" = '1' AND "Total" > '3' AND "Men's wheelchair" > '3' |
For all employees who have the letters D or S in their first name, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday by a bar chart, show by the how many hire date in ascending. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),M... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) |
For Core what classes do I need ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)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... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id |
What was the 2nd leg score for the tie that had a 5-0 first leg score? | CREATE TABLE table_41377 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "2nd leg" FROM table_41377 WHERE "1st leg" = '5-0' |
What university team is referred to as the tigers? | CREATE TABLE table_26673 ("Institution" text,"Nickname" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real,"Left" real) | SELECT "Institution" FROM table_26673 WHERE "Nickname" = 'Tigers' |
from LAS VEGAS to NEW YORK a nonstop TW and fare | CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREAT... | 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, fare, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CIT... |
Who received gold when the event is time trial details and silver is simon richardson great britain (gbr)? | CREATE TABLE table_name_2 (gold VARCHAR,event VARCHAR,silver VARCHAR) | SELECT gold FROM table_name_2 WHERE event = "time trial details" AND silver = "simon richardson great britain (gbr)" |
What is Home Team, when Date is '22 Nov 1989', and when Away Team is 'Bath City'? | CREATE TABLE table_62249 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Home team" FROM table_62249 WHERE "Date" = '22 nov 1989' AND "Away team" = 'bath city' |
What's the constituency number of the Seoni district and has none reserved? | CREATE TABLE table_64780 ("Constituency number" text,"Name" text,"Reserved for (SC / ST /None)" text,"District" text,"Number of electorates (2009)" real) | SELECT "Constituency number" FROM table_64780 WHERE "Reserved for ( SC / ST /None)" = 'none' AND "District" = 'seoni' |
What is the fewest number of occ championships for the team that last won an outright occ championship in 2006? | CREATE TABLE table_17429402_7 (occ_championships INTEGER,last_outright_occ_championship VARCHAR) | SELECT MIN(occ_championships) FROM table_17429402_7 WHERE last_outright_occ_championship = "2006" |
What is the smallest lane for rank 6? | CREATE TABLE table_67602 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT MIN("Lane") FROM table_67602 WHERE "Rank" = '6' |
What is the status of the independent station KPFB? | CREATE TABLE table_68566 ("Station" text,"Frequency" real,"Network Affiliation" text,"Format" text,"City of License" text,"Status" text) | SELECT "Status" FROM table_68566 WHERE "Network Affiliation" = 'independent' AND "Station" = 'kpfb' |
what is the minimum voted no where percent no is 56.6 | CREATE TABLE table_412 ("Jurisdiction" text,"Voted Yes" real,"Percent Yes" text,"Voted No" real,"Percent No" text) | SELECT MIN("Voted No") FROM table_412 WHERE "Percent No" = '56.6' |
What event did Rashid Sidek participate in? | CREATE TABLE table_37427 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text) | SELECT "Event" FROM table_37427 WHERE "Name" = 'rashid sidek' |
For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over the name , and group by attribute name by a bar chart, and sort by the x axis in ascending. | 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
Which position was in 2009? | CREATE TABLE table_name_82 (position VARCHAR,year VARCHAR) | SELECT position FROM table_name_82 WHERE year = 2009 |
On what date was a two-way tie (8) the high rebound? | CREATE TABLE table_57443 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Date" FROM table_57443 WHERE "High rebounds" = 'two-way tie (8)' |
Bar chart x axis year y axis total number of avg(price), order in desc by the sum avg(price). | CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT) | SELECT Year, SUM(AVG(Price)) FROM wine ORDER BY SUM(AVG(Price)) DESC |
Name the number for viewers being 1.87 | CREATE TABLE table_19229713_4 (_number INTEGER,us_viewers__million_ VARCHAR) | SELECT MAX(_number) FROM table_19229713_4 WHERE us_viewers__million_ = "1.87" |
Show the number of document type for different document type description in a bar chart. | CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Doc... | SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description |
Number of tag-info edits (including deleted users). | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)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,LastEditorDisplayN... | SELECT PostId, COUNT(*) FROM (SELECT h.RevisionGUID, h.PostId, h.Id, h.UserId AS "user_link", h.UserDisplayName FROM PostHistory AS h JOIN Posts AS p ON h.PostId = p.Id WHERE (p.PostTypeId IN (4, 5)) AND (h.PostHistoryTypeId IN (2, 5))) AS data GROUP BY PostId ORDER BY COUNT(*) DESC |
What was the average amount of laps for competitors with a grid that was more than 11 and a Time/Retired of +28.108? | CREATE TABLE table_78508 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT AVG("Laps") FROM table_78508 WHERE "Time/Retired" = '+28.108' AND "Grid" > '11' |
What week had an Attendance smaller than 21,097? | CREATE TABLE table_name_46 (week VARCHAR,attendance INTEGER) | SELECT COUNT(week) FROM table_name_46 WHERE attendance < 21 OFFSET 097 |
What shows for the location and attendance when the record is 41 36? | CREATE TABLE table_46328 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Location Attendance" FROM table_46328 WHERE "Record" = '41–36' |
What is the highest pick from Washington? | CREATE TABLE table_name_18 (pick INTEGER,school VARCHAR) | SELECT MAX(pick) FROM table_name_18 WHERE school = "washington" |
Which province is Luogang International Airport located in? | CREATE TABLE table_name_63 (province VARCHAR,airport VARCHAR) | SELECT province FROM table_name_63 WHERE airport = "luogang international airport" |
Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a bar chart, rank from low to high by the y axis. | CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text) | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) |
What country has a score of 73-72-67=212? | CREATE TABLE table_name_14 (country VARCHAR,score VARCHAR) | SELECT country FROM table_name_14 WHERE score = 73 - 72 - 67 = 212 |
For those employees who did not have any job in the past, show me about the change of salary over hire_date in a line chart, could you order X in ascending order? | 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 locations (LOCATION_ID decimal(4,0),S... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE |
WHAT IS THE ELEVATION OF THE UNAKA MOUNTAINS, IN ROAN HIGH BLUFF PEAK, AND ISOLATION LARGER THAN 1.54? | CREATE TABLE table_name_77 (elevation__ft_ INTEGER,isolation VARCHAR,range VARCHAR,peak_name VARCHAR) | SELECT AVG(elevation__ft_) FROM table_name_77 WHERE range = "unaka mountains" AND peak_name = "roan high bluff" AND isolation > 1.54 |
tell me the daily maximum sao2 of patient 022-199074 during this hospital encounter. | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean num... | SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074' AND patient.hospitaldischargetime IS NULL)) A... |
when did 'unpleasantville' air? | CREATE TABLE table_16380 ("No. in series" real,"No. in season" real,"Title" text,"Director" text,"Writer(s)" text,"Original air date" text,"Production code" text) | SELECT "Original air date" FROM table_16380 WHERE "Title" = 'Unpleasantville' |
how much did patient 23070's weight differ from the value measured at 2105-12-12 04:00:00 compared to the value measured at 2105-12-08 03:00:00? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title 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_diagnoses (row_id number,icd9_code text,short_title text,long_title text)C... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'a... |
Which IHSAA Class has a Mascot of wildcats? | CREATE TABLE table_34188 ("School" text,"Location" text,"Mascot" text,"Enrollment" real,"IHSAA Class" text,"# / County" text,"Year joined" real,"Previous conference" text) | SELECT "IHSAA Class" FROM table_34188 WHERE "Mascot" = 'wildcats' |
What is the group name when 3yo hcp restricted maiden was raced? | CREATE TABLE table_19758 ("Result" text,"Date" text,"Race" text,"Venue" text,"Group" text,"Distance" text,"Weight (kg)" text,"Jockey" text,"Winner/2nd" text) | SELECT "Group" FROM table_19758 WHERE "Race" = '3yo Hcp Restricted Maiden' |
Which college did Leon Perry attend? | CREATE TABLE table_16376436_1 (college VARCHAR,player VARCHAR) | SELECT college FROM table_16376436_1 WHERE player = "Leon Perry" |
What is Score, when Opponent is 'Daniel Gimeno-Traver'? | CREATE TABLE table_59333 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Score" FROM table_59333 WHERE "Opponent" = 'daniel gimeno-traver' |
What was the aggregate score that had Union Douala as Team 1? | CREATE TABLE table_70498 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "Agg." FROM table_70498 WHERE "Team 1" = 'union douala' |
What are the ranks of captains that are both in the Cutter and Armed schooner classes? | CREATE TABLE captain (captain_id number,name text,ship_id number,age text,class text,rank text)CREATE TABLE ship (ship_id number,name text,type text,built_year number,class text,flag text) | SELECT rank FROM captain WHERE class = 'Cutter' INTERSECT SELECT rank FROM captain WHERE class = 'Armed schooner' |
What is the home teams score when north melbourne is the away team? | CREATE TABLE table_name_87 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team AS score FROM table_name_87 WHERE away_team = "north melbourne" |
What nation with Rank 1 won the fewest gold medals while winning more than 11 silver but fewer than 7 bronze medals? | CREATE TABLE table_69260 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Gold") FROM table_69260 WHERE "Silver" > '11' AND "Rank" = '1' AND "Bronze" < '7' |
How many matches were won by the teams that scored exactly 61 tries for? | CREATE TABLE table_27293285_6 (won VARCHAR,tries_for VARCHAR) | SELECT won FROM table_27293285_6 WHERE tries_for = "61" |
count the number of patients who have been on 3% normal saline intake. | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime ... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '3% normal saline' A... |
i would like a schedule of flights from DENVER to SAN FRANCISCO on tuesday | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE food_service (meal_co... | SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time 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 AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... |
User List: DownVotes by percentage. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate ti... | SELECT Id AS "user_link", UpVotes, DownVotes, ROUND(CAST(DownVotes AS FLOAT) / (UpVotes + DownVotes) * 100, 2) AS DownVotesPCT FROM Users WHERE DownVotes > '##MinDownVotes##' ORDER BY DownVotesPCT DESC LIMIT 300 |
what is the number of games that the detriot lions lost in the 1980s ? | CREATE TABLE table_204_855 (id number,"year" number,"date" text,"winner" text,"result" text,"loser" text,"attendance" number,"location" text) | SELECT COUNT(*) FROM table_204_855 WHERE "loser" = 'detroit lions' |
was there any record of the microbiology test for the mrsa screen of patient 14990 until 10/2104? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14990) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2104-10' |
What club had over 0 goals in 2011? | CREATE TABLE table_name_40 (club VARCHAR,goals VARCHAR,season VARCHAR) | SELECT club FROM table_name_40 WHERE goals > 0 AND season = "2011" |
What is the name of the bowl game that was played in Tempe, Arizona? | CREATE TABLE table_20501 ("Bowl Game" text,"Date" text,"Stadium" text,"City" text,"Television" text,"Conference Matchups" text,"Payout (US$)" text) | SELECT "Bowl Game" FROM table_20501 WHERE "City" = 'Tempe, Arizona' |
count the number of patients whose procedure icd9 code is 14? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "14" |
When Essendon played away; where did they play? | CREATE TABLE table_name_50 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_50 WHERE away_team = "essendon" |
How many games were on october 17? | CREATE TABLE table_27713583_2 (high_points VARCHAR,date VARCHAR) | SELECT COUNT(high_points) FROM table_27713583_2 WHERE date = "October 17" |
What is the Full Word, when Case Suffix (case) is '-sa (dative)'? | CREATE TABLE table_76299 ("noun root (meaning)" text,"case suffix (case)" text,"postposition" text,"full word" text,"English meaning" text) | SELECT "full word" FROM table_76299 WHERE "case suffix (case)" = '-sa (dative)' |
What shows for ICAO when the IATA is sin? | CREATE TABLE table_40046 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "ICAO" FROM table_40046 WHERE "IATA" = 'sin' |
What is the 2010 value with A in 2009 and A in 2008 in the Australian Open? | CREATE TABLE table_name_43 (tournament VARCHAR) | SELECT 2010 FROM table_name_43 WHERE 2009 = "a" AND 2008 = "a" AND tournament = "australian open" |
What is the highest game number where the team was Cleveland? | CREATE TABLE table_25501 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT MAX("Game") FROM table_25501 WHERE "Team" = 'Cleveland' |
Who is the driver whose car was constructed by Renault and whose Q1 pos is greater than 2? | CREATE TABLE table_12088 ("Driver" text,"Constructor" text,"Q1 order" real,"Q1 time" text,"Q1 pos" real,"Q1+Q2 time" text) | SELECT "Driver" FROM table_12088 WHERE "Constructor" = 'renault' AND "Q1 pos" > '2' |
count the number of patients whose admission type is elective and admission year is less than 2176? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2176" |
what is the admission location and procedure long title of subject id 2560? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT demographic.admission_location, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" |
What is the To par of the Player who won in 1936? | CREATE TABLE table_name_45 (to_par VARCHAR,year_s__won VARCHAR) | SELECT to_par FROM table_name_45 WHERE year_s__won = "1936" |
Can you tell me the total number of Prev that has the Chng of +10, and the Rating larger than 2765? | CREATE TABLE table_40454 ("Rank" real,"Prev" real,"Player" text,"Rating" real,"Chng" text) | SELECT COUNT("Prev") FROM table_40454 WHERE "Chng" = '+10' AND "Rating" > '2765' |
what's the introduced where notes is 9 withdrawn in 1946 after fire | CREATE TABLE table_1181375_1 (introduced VARCHAR,notes VARCHAR) | SELECT introduced FROM table_1181375_1 WHERE notes = "9 withdrawn in 1946 after fire" |
For all employees who have the letters D or S in their first name, give me the comparison about the average of department_id over the job_id , and group by attribute job_id by a bar chart, list by the y-axis from high to low. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC |
What is the sum for the game with a score of 103 126? | CREATE TABLE table_34875 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT SUM("Game") FROM table_34875 WHERE "Score" = '103–126' |
What is the Score of game 35? | CREATE TABLE table_name_43 (score VARCHAR,game VARCHAR) | SELECT score FROM table_name_43 WHERE game = 35 |
what is the number of patients whose admission type is emergency and procedure long title is colostomy, not otherwise specified? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Colostomy, not otherwise specified" |
since 5 months ago, patient 3277 had received any medicine? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime t... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3277) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 month') |
give me the number of patients whose admission location is emergency room admit and year of death is less than or equal to 2138? | 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.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dod_year <= "2138.0" |
On what Date prior to Week 14 was the Record 7-1? | CREATE TABLE table_9878 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Attendance" text) | SELECT "Date" FROM table_9878 WHERE "Week" < '14' AND "Record" = '7-1' |
Name the date for the palace of auburn hills 14,554 | CREATE TABLE table_27700375_11 (date VARCHAR,location_attendance VARCHAR) | SELECT date FROM table_27700375_11 WHERE location_attendance = "The Palace of Auburn Hills 14,554" |
what are the flights from DENVER to PITTSBURGH | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE code_description (code varchar,description t... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... |
what is the total number of international goals d m szalai has made ? | CREATE TABLE table_203_551 (id number,"goal" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text) | SELECT COUNT("goal") FROM table_203_551 |
when was the last time that patient 19981 was given a hemoglobin lab test in 02/last year? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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 tex... | 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 = 19981) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURR... |
what was the last venue brian preformed in ? | CREATE TABLE table_203_855 (id number,"date" text,"city" text,"venue" text,"member" text,"performance" text,"notes" text) | SELECT "venue" FROM table_203_855 ORDER BY "date" DESC LIMIT 1 |
Find the number of professors with a PhD degree in each department Show bar chart, and could you display X from low to high order? | CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))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)C... | SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY DEPT_CODE |
how many patients had been in the careunit sicu during the previous year? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid numb... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'sicu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) |
li dong 's paper about semantic parsing | CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE field (fieldid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE p... | SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authori... |
Which Other classes are available next Winter ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... |
What is the name of the building in Bucharest with a rank of less than 12? | CREATE TABLE table_35776 ("Rank" real,"Building" text,"City" text,"Height (m/ft)" text,"Built" real) | SELECT "Building" FROM table_35776 WHERE "City" = 'bucharest' AND "Rank" < '12' |
Who took the loss against the California Angels when the attendance was 10,886? | CREATE TABLE table_10127 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Loss" FROM table_10127 WHERE "Opponent" = 'california angels' AND "Attendance" = '10,886' |
How many bronze medals for the United Kingdom when the silver was less than 0? | CREATE TABLE table_name_18 (bronze INTEGER,nation VARCHAR,silver VARCHAR) | SELECT AVG(bronze) FROM table_name_18 WHERE nation = "united kingdom" AND silver < 0 |
indicate the daily maximum amount of sao2 for patient 006-141797 on the last icu visit. | 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 medication (medicationid number,patientunitstayid number,drugname text,dos... | SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-141797') AND NOT patient.unitdischargetime IS NULL OR... |
What was the result for week 2? | CREATE TABLE table_65292 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Result" FROM table_65292 WHERE "Week" = '2' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.