instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is Party, when Left Office is '23 April 2005', when Portfolio is 'Minister of Reforms and Devolutions'? | CREATE TABLE table_47621 ("Portfolio" text,"Minister" text,"Took office" text,"Left office" text,"Party" text) | SELECT "Party" FROM table_47621 WHERE "Left office" = '23 april 2005' AND "Portfolio" = 'minister of reforms and devolutions' |
What is the distance for the 5 September race? | CREATE TABLE table_6212 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text) | SELECT "Distance" FROM table_6212 WHERE "Date" = '5 september' |
What date did Adriano Buzaid have the pole position? | CREATE TABLE table_21373283_3 (date VARCHAR,pole_position VARCHAR) | SELECT date FROM table_21373283_3 WHERE pole_position = "Adriano Buzaid" |
Name the most games with drawn more than 1 | CREATE TABLE table_5924 ("Games" real,"Drawn" real,"Lost" real,"Points difference" text,"Points" real) | SELECT MAX("Games") FROM table_5924 WHERE "Drawn" > '1' |
Open questions with no comments or answers. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Sug... | SELECT Id AS "post_link", Score, ViewCount AS "View Count" FROM Posts WHERE PostTypeId = 1 AND DeletionDate IS NULL AND AnswerCount = 0 AND CommentCount = 0 AND ClosedDate IS NULL AND CommunityOwnedDate IS NULL AND NOT EXISTS(SELECT * FROM PostHistory WHERE Posts.Id = PostHistory.PostId AND PostHistory.PostHistoryTypeI... |
what member comes next after hon trish worth ? | CREATE TABLE table_204_659 (id number,"seat" text,"state" text,"majority" number,"member" text,"party" text) | SELECT "member" FROM table_204_659 WHERE id = (SELECT id FROM table_204_659 WHERE "member" = 'hon trish worth') + 1 |
display all fare codes | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_f... | SELECT DISTINCT fare_basis_code FROM fare_basis |
let me know the number of patients still living who have heparin (iabp) prescription. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "Heparin (IABP)" |
What is Mean Free Path, when Vacuum Range is 'medium vacuum'? | CREATE TABLE table_name_25 (mean_free_path VARCHAR,vacuum_range VARCHAR) | SELECT mean_free_path FROM table_name_25 WHERE vacuum_range = "medium vacuum" |
For those employees who was hired before 2002-06-21, show me the trend about department_id over hire_date with a line chart. | CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' |
What is the Hangul equivalent of the Greek , ? | CREATE TABLE table_name_96 (hangul VARCHAR,greek VARCHAR) | SELECT hangul FROM table_name_96 WHERE greek = "ϝ, υ" |
What is the number of group b winner for francavilla? | CREATE TABLE table_1137142_1 (group_b_winner VARCHAR,group_c_winner VARCHAR) | SELECT COUNT(group_b_winner) FROM table_1137142_1 WHERE group_c_winner = "Francavilla" |
What is the class of the locomotive with a 0-4-0st type? | CREATE TABLE table_70762 ("Class" text,"Type" text,"Names" text,"Quantity made" text,"Manufacturer" text,"Date made" text) | SELECT "Class" FROM table_70762 WHERE "Type" = '0-4-0st' |
how many models had the 8 mhz intel 8086 processor ? | CREATE TABLE table_203_136 (id number,"year" number,"ibm model number" text,"name" text,"processor" text,"bus" text,"hd interface" text,"case" text,"notes" text) | SELECT COUNT(*) FROM table_203_136 WHERE "processor" = '8 mhz intel 8086' |
how many patients have died in or before the year 2183? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2183.0" |
What is the total number of Viewers with a Rank (Night) of n/a, and a Timeslot of 8:30 p.m.? | CREATE TABLE table_53884 ("Episode" text,"Air Date" text,"Timeslot" text,"Rating" real,"Share" real,"18-49 (Rating/Share)" text,"Viewers (m)" real,"Rank (Timeslot)" real,"Rank (Night)" text,"Rank (Overall)" real) | SELECT COUNT("Viewers (m)") FROM table_53884 WHERE "Rank (Night)" = 'n/a' AND "Timeslot" = '8:30 p.m.' |
Who was the director for Tango Bar? | CREATE TABLE table_27423508_1 (director VARCHAR,spanish_title VARCHAR) | SELECT director FROM table_27423508_1 WHERE spanish_title = "Tango Bar" |
Which Radon has Neon of 4.79? | CREATE TABLE table_59865 ("Atomic property" text,"Helium" text,"Neon" text,"Argon" text,"Krypton" text,"Xenon" text,"Radon" text) | SELECT "Radon" FROM table_59865 WHERE "Neon" = '4.79' |
Wha episode number in the series had 24.8 million u.s. viewers? | CREATE TABLE table_29801 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text) | SELECT MIN("No. in series") FROM table_29801 WHERE "U.S. viewers (millions)" = '24.8' |
how many of the patients on urgent admission had icd9 code 4105? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "4105" |
What is the sum of the goals with less than 30 points, a position less than 10, and more than 57 goals against? | CREATE TABLE table_name_14 (goals_for INTEGER,goals_against VARCHAR,points VARCHAR,position VARCHAR) | SELECT SUM(goals_for) FROM table_name_14 WHERE points < 30 AND position < 10 AND goals_against > 57 |
What was the attendance of the Cup Quarterfinals game? | CREATE TABLE table_67411 ("Date" text,"Opponent" text,"Result" text,"Game Site" text,"Attendance" text) | SELECT "Attendance" FROM table_67411 WHERE "Game Site" = 'cup quarterfinals' |
What was the highest number of touchdowns by a player? | CREATE TABLE table_25647137_2 (touchdowns INTEGER) | SELECT MAX(touchdowns) FROM table_25647137_2 |
which song has the most in us r & b ? | CREATE TABLE table_204_56 (id number,"year" number,"song" text,"us r&b" number,"us rap" number,"album" text) | SELECT "song" FROM table_204_56 ORDER BY "us r&b" LIMIT 1 |
what is the difference between weights on patient 10431 second measured on the first hospital visit compared to the value first measured on the first hospital visit? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharg... | 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 = 10431 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev... |
How many actors have appeared in each musical. Show a pie chart. | CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text)CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int) | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID |
List of bounties offered in a given period. | 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 PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationI... | SELECT p.Id AS "post_link", p.Score AS "Score", p.AnswerCount AS "Answers", bs.BountyAmount AS "Amount", CAST(TIME_TO_STR(bs.CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) AS "Bounty Start" FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId AND bs.VoteTypeId = 8 AND bs.CreationDate >= '##Date1?2018-01-01##' AN... |
How many upvotes does one user have from another user?. | 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 COUNT(*) AS UpVotes FROM Posts AS P INNER JOIN Votes AS V ON V.PostId = P.Id AND V.VoteTypeId = 2 AND V.UserId = @UserId2 WHERE P.OwnerUserId = @UserId1 |
What courses can I take in the Fall or Winter semester to satisfy my MDE requirement ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)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 program_course (program_id int,course_id in... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0... |
Display a pie chart for what are the names and ids of the tourist attractions that are visited at most once? | CREATE TABLE Shops (Shop_ID INTEGER,Shop_Details VARCHAR(255))CREATE TABLE Ref_Hotel_Star_Ratings (star_rating_code CHAR(15),star_rating_description VARCHAR(80))CREATE TABLE Hotels (hotel_id INTEGER,star_rating_code CHAR(15),pets_allowed_yn CHAR(1),price_range real,other_hotel_details VARCHAR(255))CREATE TABLE Street_M... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID |
When the team is the Boston Red Sox and the is date July 27, 1946, what are the average RBIs? | CREATE TABLE table_name_79 (rbis INTEGER,team VARCHAR,date VARCHAR) | SELECT AVG(rbis) FROM table_name_79 WHERE team = "boston red sox" AND date = "july 27, 1946" |
What was the outcome on 13 may 2007? | CREATE TABLE table_name_80 (outcome VARCHAR,date VARCHAR) | SELECT outcome FROM table_name_80 WHERE date = "13 may 2007" |
WHAT IS THE FIRST LEG OF TUILLA? | CREATE TABLE table_name_79 (team_1 VARCHAR) | SELECT 1 AS st_leg FROM table_name_79 WHERE team_1 = "tuilla" |
what is patient 002-3736's first output on 02/26/2103? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-3736')) AND intakeoutput.cellpath LIKE '%output%' AND ST... |
what is the number of patients whose insurance is medicare and lab test name is reticulocyte count, automated? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicare" AND lab.label = "Reticulocyte Count, Automated" |
What is the Date of the Rodez, France Tournament? | CREATE TABLE table_name_63 (date VARCHAR,tournament VARCHAR) | SELECT date FROM table_name_63 WHERE tournament = "rodez, france" |
What year was Ethereal 77, which has a CD album release type? | CREATE TABLE table_name_26 (year VARCHAR,release_type VARCHAR,released_as VARCHAR) | SELECT year FROM table_name_26 WHERE release_type = "cd album" AND released_as = "ethereal 77" |
Which Team has a Record of 17 8? | CREATE TABLE table_50070 ("Game" real,"Date" text,"Team" text,"Score" text,"Record" text,"Streak" text) | SELECT "Team" FROM table_50070 WHERE "Record" = '17–8' |
what is the number of patients in ward 12 in 2105? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_items (row_id number,itemid number,label text... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 12 AND STRFTIME('%y', transfers.intime) = '2105') |
Which Player has a To par of 12, and a Country of fiji? | CREATE TABLE table_59807 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real) | SELECT "Player" FROM table_59807 WHERE "To par" = '12' AND "Country" = 'fiji' |
papers on semantic spaces appeared at arxiv last year | CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'semantic spaces' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'arxiv' |
Name trofeo fast team with young rider classification of francesco casagrande and stage of 10 | CREATE TABLE table_name_55 (trofeo_fast_team VARCHAR,young_rider_classification VARCHAR,stage VARCHAR) | SELECT trofeo_fast_team FROM table_name_55 WHERE young_rider_classification = "francesco casagrande" AND stage = "10" |
Answers with the most bounty points.. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId... | SELECT CURRENT_TIMESTAMP() |
Return a histogram on how many actors have appeared in each musical? | CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int)CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text) | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID |
What is the current map designation of the feature for which derain crater was the namesake? | CREATE TABLE table_36681 ("Name" text,"Number" text,"Namesake" text,"Albedo feature name" text,"Area" text,"Current map" text) | SELECT "Current map" FROM table_36681 WHERE "Namesake" = 'derain crater' |
What Week falls on September 4, 1994? | CREATE TABLE table_48616 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT AVG("Week") FROM table_48616 WHERE "Date" = 'september 4, 1994' |
Who were the quarter-finalists in the event where the champion was Terry Moor 3-6, 7-6, 6-2? | CREATE TABLE table_31077 ("Week of" text,"Tournament" text,"Champion" text,"Runner-up" text,"Semifinalists" text,"Quarterfinalists" text) | SELECT "Quarterfinalists" FROM table_31077 WHERE "Champion" = 'Terry Moor 3-6, 7-6, 6-2' |
Name the team for co-drivers of david brabham mario andretti | CREATE TABLE table_68667 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text,"Class Pos." text) | SELECT "Team" FROM table_68667 WHERE "Co-Drivers" = 'david brabham mario andretti' |
What is the total number of games that has Juan Carlos Navarro and more than 266 points? | CREATE TABLE table_45000 ("Rank" real,"Name" text,"Team" text,"Games" real,"Points" real) | SELECT SUM("Games") FROM table_45000 WHERE "Points" > '266' AND "Name" = 'juan carlos navarro' |
Are there any Fall or Winter classes available for the 200 -level ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname 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 int,heavy_assi... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_of... |
What day did they record a score of 1-2 in 1994? | CREATE TABLE table_57315 ("Year" real,"Competition" text,"Date" text,"Location" text,"Score" text,"Result" text) | SELECT "Date" FROM table_57315 WHERE "Score" = '1-2' AND "Year" = '1994' |
What is the total frequency mhz of the kgrj call sign, which has an erp w greater than 21,500? | CREATE TABLE table_79685 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text) | SELECT COUNT("Frequency MHz") FROM table_79685 WHERE "Call sign" = 'kgrj' AND "ERP W" > '21,500' |
What are the type come, name, and description of the document that has either the name 'Noel CV' or 'King Book'? | CREATE TABLE documents_with_expenses (document_id number,budget_type_code text,document_details text)CREATE TABLE projects (project_id number,project_details text)CREATE TABLE ref_document_types (document_type_code text,document_type_name text,document_type_description text)CREATE TABLE documents (document_id number,do... | SELECT document_type_code, document_name, document_description FROM documents WHERE document_name = 'Noel CV' OR document_name = 'King Book' |
List all user ids with name Michelle | CREATE TABLE checkin (cid int,business_id varchar,count int,day varchar)CREATE TABLE user (uid int,user_id varchar,name varchar)CREATE TABLE review (rid int,business_id varchar,user_id varchar,rating float,text longtext,year int,month varchar)CREATE TABLE neighborhood (id int,business_id varchar,neighborhood_name varch... | SELECT user_id FROM user WHERE name = 'Michelle' |
please give me the cheapest flight from DENVER to PITTSBURGH | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE month (month_number int,month_name text)CRE... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... |
what's the evening gown with swimsuit being 9.134 | CREATE TABLE table_17365 ("Country" text,"Preliminaries" text,"Interview" text,"Swimsuit" text,"Evening Gown" text,"Average" text) | SELECT "Evening Gown" FROM table_17365 WHERE "Swimsuit" = '9.134' |
Show all product colors. | CREATE TABLE financial_transactions (transaction_id number,account_id number,invoice_number number,transaction_type text,transaction_date time,transaction_amount number,transaction_comment text,other_transaction_details text)CREATE TABLE order_items (order_item_id number,order_id number,product_id number,product_quanti... | SELECT DISTINCT product_color FROM products |
Which strain has 1,312 genes? | CREATE TABLE table_58060 ("Species" text,"Strain" text,"Type" text,"Base Pairs" text,"Genes" text) | SELECT "Strain" FROM table_58060 WHERE "Genes" = '1,312' |
What's the lowest attendance for October 13, 1968, and is larger than week 5? | CREATE TABLE table_name_19 (attendance INTEGER,date VARCHAR,week VARCHAR) | SELECT MIN(attendance) FROM table_name_19 WHERE date = "october 13, 1968" AND week > 5 |
give me the admission type and death status of subject id 16438. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "16438" |
What is the highest Established for the kuntz stadium? | CREATE TABLE table_7655 ("Club" text,"League" text,"Sport" text,"Venue" text,"Established" real) | SELECT MAX("Established") FROM table_7655 WHERE "Venue" = 'kuntz stadium' |
What is Venue, when Date is '14/12/1996'? | CREATE TABLE table_name_44 (venue VARCHAR,date VARCHAR) | SELECT venue FROM table_name_44 WHERE date = "14/12/1996" |
How many polls show a result where democrat Christine Gregoire was polling at 50% and had a lead margin of 2? | CREATE TABLE table_1714 ("Source" text,"Dates administered" text,"Democrat: Christine Gregoire" text,"Republican: Dino Rossi" text,"Lead Margin" text) | SELECT COUNT("Source") FROM table_1714 WHERE "Democrat: Christine Gregoire" = '50%' AND "Lead Margin" = '2' |
For those records from the products and each product's manufacturer, visualize the relationship between manufacturer and code . | 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.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code |
What was the max mach when the maximum speed was 3887? | CREATE TABLE table_221315_3 (max_mach VARCHAR,max_speed__mph_ VARCHAR) | SELECT max_mach FROM table_221315_3 WHERE max_speed__mph_ = 3887 |
Who is the visiting team when Dipietro received a decision on October 27? | CREATE TABLE table_name_50 (visitor VARCHAR,decision VARCHAR,date VARCHAR) | SELECT visitor FROM table_name_50 WHERE decision = "dipietro" AND date = "october 27" |
Name the total number of position for don clegg | CREATE TABLE table_23198 ("Name" text,"Nation" text,"Position" text,"FA Cup Apps" real,"FA Cup Goals" real,"Total Apps" real,"Total Goals" real) | SELECT COUNT("Position") FROM table_23198 WHERE "Name" = 'Don Clegg' |
What percentage of the votes were for others in the county where 462 people voted that way? | CREATE TABLE table_73611 ("County" text,"Kerry%" text,"Kerry#" real,"Bush%" text,"Bush#" real,"Others%" text,"Others#" real) | SELECT "Others%" FROM table_73611 WHERE "Others#" = '462' |
what is minimum age of patients whose gender is m and discharge location is long term care hospital? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL" |
Who was the Away team at Hawthorn? | CREATE TABLE table_name_24 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_24 WHERE away_team = "hawthorn" |
What are the maximum and minimum budget of the departments? | CREATE TABLE department (budget_in_billions INTEGER) | SELECT MAX(budget_in_billions), MIN(budget_in_billions) FROM department |
Questions per day by week per tag. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location te... | WITH questions_by_week AS (SELECT CAST(DATEADD(week, DATEDIFF(week, GETDATE(), CreationDate), GETDATE()) AS DATE) AS Week, COUNT(*) AS post_count FROM Posts AS p WHERE PostTypeId = 1 AND Tags LIKE '%##tag##%' GROUP BY DATEDIFF(week, GETDATE(), CreationDate)) SELECT p.Week, CAST(post_count AS FLOAT) / 7 AS questions_per... |
What number was the person eliminated at 22:50? | CREATE TABLE table_29692554_2 (eliminated VARCHAR,time VARCHAR) | SELECT eliminated FROM table_29692554_2 WHERE time = "22:50" |
Where did the away team have round 2? | CREATE TABLE table_name_71 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_71 WHERE away_team = "round 2" |
Find the number of customers in total. | CREATE TABLE regular_orders (regular_order_id number,distributer_id number)CREATE TABLE customers (customer_id number,payment_method text,customer_name text,customer_phone text,customer_email text,date_became_customer time)CREATE TABLE regular_order_products (regular_order_id number,product_id number)CREATE TABLE produ... | SELECT COUNT(*) FROM customers |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the job_id , sort from high to low by the bars. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_... | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC |
List the employees who have not showed up in any circulation history of documents. List the employee's name. | CREATE TABLE Circulation_History (employee_name VARCHAR)CREATE TABLE Employees (employee_name VARCHAR) | SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id |
What are characteristic names used at least twice across all products? | CREATE TABLE product_characteristics (product_id VARCHAR,characteristic_id VARCHAR)CREATE TABLE products (product_id VARCHAR)CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR,characteristic_id VARCHAR) | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2 |
What is the total where there are 4 MLS Cups and more US Open Cups than 1? | CREATE TABLE table_name_43 (total VARCHAR,mls_cup VARCHAR,us_open_cup VARCHAR) | SELECT COUNT(total) FROM table_name_43 WHERE mls_cup = 4 AND us_open_cup > 1 |
Name the circuit for gt3 alex mortimer bradley ellis | CREATE TABLE table_14574130_3 (circuit VARCHAR,gt3_winner VARCHAR) | SELECT circuit FROM table_14574130_3 WHERE gt3_winner = "Alex Mortimer Bradley Ellis" |
Which high school is located in Kyoto? | CREATE TABLE table_2518850_4 (high_school_name VARCHAR,prefecture VARCHAR) | SELECT high_school_name FROM table_2518850_4 WHERE prefecture = "Kyoto" |
Name the home with toronto visiting | CREATE TABLE table_name_29 (home VARCHAR,visitor VARCHAR) | SELECT home FROM table_name_29 WHERE visitor = "toronto" |
How many assists per game in the tournament 2010 fiba world championship? | CREATE TABLE table_2387461_1 (assists_per_game VARCHAR,tournament VARCHAR) | SELECT assists_per_game FROM table_2387461_1 WHERE tournament = "2010 FIBA World Championship" |
Average lifespan of hall of fame players | CREATE TABLE salary (year number,team_id text,league_id text,player_id text,salary number)CREATE TABLE player_award (player_id text,award_id text,year number,league_id text,tie text,notes text)CREATE TABLE player_award_vote (award_id text,year number,league_id text,player_id text,points_won number,points_max number,vot... | SELECT AVG(T1.death_year - T1.birth_year) FROM player AS T1 JOIN hall_of_fame AS T2 ON T1.player_id = T2.player_id WHERE T2.inducted = "Y" |
which player is taller , brown or olmeda ? | CREATE TABLE table_204_602 (id number,"name" text,"position" text,"height" text,"weight" number,"date of birth" text,"current/last known team" text) | SELECT "name" FROM table_204_602 WHERE "name" IN ('bobby brown', 'jose olmeda') ORDER BY "height" DESC LIMIT 1 |
Which team has the team captain Jon Newsome? | CREATE TABLE table_14671 ("Team" text,"Manager" text,"Captain" text,"Kit manufacturer" text,"Shirt sponsor" text) | SELECT "Team" FROM table_14671 WHERE "Captain" = 'jon newsome' |
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the average of salary bin hire_date by time. | 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 job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID dec... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' |
Name the three for william prewett for four and five being richard ellis with seven being nicholas king on 5 november 1693 | CREATE TABLE table_name_83 (three VARCHAR,date VARCHAR,seven VARCHAR,four VARCHAR,five VARCHAR) | SELECT three FROM table_name_83 WHERE four = "william prewett" AND five = "richard ellis" AND seven = "nicholas king" AND date = "5 november 1693" |
Which date has a Race Leader of hermann buse ( ger ), and a Stage of 5? | CREATE TABLE table_71067 ("Stage" text,"Date" text,"Course" text,"Distance" text,"Winner" text,"Race Leader" text) | SELECT "Date" FROM table_71067 WHERE "Race Leader" = 'hermann buse ( ger )' AND "Stage" = '5' |
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, draw a scatter chart about the correlation between employee_id and salary . | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGE... | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
how many times does patient 19981 during the last year go to the icu? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,st... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19981) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
Which location has a date of may 21? | CREATE TABLE table_79981 ("Date" text,"Winning Team" text,"Score" text,"Winning Pitcher" text,"Losing Pitcher" text,"Attendance" real,"Location" text) | SELECT "Location" FROM table_79981 WHERE "Date" = 'may 21' |
How many points differ from 134? | CREATE TABLE table_23886 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Points difference" text,"Bonus Points" text,"Points" text) | SELECT "Points difference" FROM table_23886 WHERE "Points for" = '134' |
Among the upper-level courses are any taught by Yanay Israeli ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins... |
Pie. which catalog contents has price above 700 dollars? Show their catalog entry names and capacities. | CREATE TABLE Attribute_Definitions (attribute_id INTEGER,attribute_name VARCHAR(30),attribute_data_type VARCHAR(10))CREATE TABLE Catalog_Contents (catalog_entry_id INTEGER,catalog_level_number INTEGER,parent_entry_id INTEGER,previous_entry_id INTEGER,next_entry_id INTEGER,catalog_entry_name VARCHAR(80),product_stock_nu... | SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 |
Users with at least one post. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostTags ... | SELECT COUNT(u.Id) AS "users_with_a_post" FROM Users AS u WHERE EXISTS(SELECT p.Id FROM Posts AS p WHERE p.OwnerUserId = u.Id) |
count the number of patients whose ethnicity is white and drug route is both eyes? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "BOTH EYES" |
get the number of black/haitian ethnic background patients who were admitted before 2125. | 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.ethnicity = "BLACK/HAITIAN" AND demographic.admityear < "2125" |
What's the to par for the score of 68-74-71-77=290? | CREATE TABLE table_name_5 (to_par VARCHAR,score VARCHAR) | SELECT to_par FROM table_name_5 WHERE score = 68 - 74 - 71 - 77 = 290 |
A bar chart shows the distribution of ACC_Regular_Season and All_Games_Percent , rank All_Games_Percent in ascending order please. | 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 ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.