instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
provide the number of patients whose ethnicity is hispanic/latino - puerto rican and drug type is base? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug_type = "BASE" |
When there was a draw, what was the time? | CREATE TABLE table_32025 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Time" FROM table_32025 WHERE "Res." = 'draw' |
I 'm looking for the easiest class I can take to fulfill the Core requirement . | 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 semester (semester_id int,semester varchar,year int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit i... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... |
What team was the away team when the home team was Hereford United? | CREATE TABLE table_name_32 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team FROM table_name_32 WHERE home_team = "hereford united" |
What was the average crowd attendance for the Junction Oval venue? | CREATE TABLE table_name_36 (crowd INTEGER,venue VARCHAR) | SELECT AVG(crowd) FROM table_name_36 WHERE venue = "junction oval" |
Compare the average of artists' age by country in a bar graph. | CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real) | SELECT Country, AVG(Age) FROM artist GROUP BY Country |
How many episodes received rating of 8.2? | CREATE TABLE table_24910733_2 (episode VARCHAR,rating VARCHAR) | SELECT COUNT(episode) FROM table_24910733_2 WHERE rating = "8.2" |
What is the year of the TV series directed by Soroush Sehat? | CREATE TABLE table_68677 ("Year" text,"Title" text,"(Title in English)" text,"Director" text,"Character" text) | SELECT "Year" FROM table_68677 WHERE "Director" = 'soroush sehat' |
Give me the comparison about meter_100 over the meter_600 , display X in descending 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 meter_600, meter_100 FROM swimmer ORDER BY meter_600 DESC |
What is the average attendance of the team that had a regular season result of 2nd aisa, 24-16? | CREATE TABLE table_33062 ("Year" text,"League" text,"Reg. Season" text,"Playoffs" text,"Attendance Average" text) | SELECT "Attendance Average" FROM table_33062 WHERE "Reg. Season" = '2nd aisa, 24-16' |
since 5 years ago, what are the top four most frequent procedures given to patients in the same hospital visit after diagnosis of adv eff fibrinolysis agt? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,... | 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, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... |
What is the home team with scarborough as the away team? | CREATE TABLE table_77133 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Home team" FROM table_77133 WHERE "Away team" = 'scarborough' |
What rank is He Yingqin who was born before 1890? | CREATE TABLE table_name_75 (rank INTEGER,name VARCHAR,birth VARCHAR) | SELECT AVG(rank) FROM table_name_75 WHERE name = "he yingqin" AND birth < 1890 |
What is the Score with a Team that is @ portland? | CREATE TABLE table_name_1 (score VARCHAR,team VARCHAR) | SELECT score FROM table_name_1 WHERE team = "@ portland" |
Who are the semi finalists on the week of 12 june, when the runner-up is listed as Lori McNeil? | CREATE TABLE table_76096 ("Week of" text,"Tier" text,"Winner" text,"Runner-up" text,"Semi finalists" text) | SELECT "Semi finalists" FROM table_76096 WHERE "Week of" = '12 june' AND "Runner-up" = 'lori mcneil' |
what is the dadar xi b where pifa colaba is sporting options? | CREATE TABLE table_30720 ("Athens XI" text,"PIFA Colaba FC u-17" text,"Tata Power" text,"Dadar XI \u2018B\u2019" text,"IDBI" text,"World Network Services" text,"United FC" text,"Good Shepherd" text) | SELECT "Dadar XI \u2018B\u2019" FROM table_30720 WHERE "PIFA Colaba FC u-17" = 'Sporting Options' |
Comments on my posts containing two given phrases (case insensitive). | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName ... | SELECT c.Id AS "comment_link", c.Text, c.UserId AS "user_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE (p.OwnerUserId = '##UserId?8297##') AND (c.Text LIKE '%##Word1?chat##%' COLLATE Latin1_General_CI_AI) AND (c.Text LIKE '%##Word2?here##%' COLLATE Latin1_General_CI_AI) |
Find the customer name and date of the orders that have the status 'Delivered'. | CREATE TABLE customer_orders (order_date VARCHAR,customer_id VARCHAR)CREATE TABLE customers (customer_name VARCHAR,customer_id VARCHAR) | SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered" |
What was the score of the away team while playing at the arden street oval? | CREATE TABLE table_77602 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_77602 WHERE "Venue" = 'arden street oval' |
what is the number of patients whose age is less than 61 and lab test name is monocytes? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "61" AND lab.label = "Monocytes" |
What is the frequency of trains numbered 12671/12672? | CREATE TABLE table_24574 ("Train No." text,"Train Name" text,"Destination" text,"Category" text,"Frequency" text) | SELECT "Frequency" FROM table_24574 WHERE "Train No." = '12671/12672' |
Top 10 Zero score questions with highest view count. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score nu... | SELECT Id AS "post_link", ViewCount FROM Posts AS p WHERE Score = 0 ORDER BY ViewCount DESC LIMIT 10 |
what is the different between the number of people who attended august 30th and the number of people who attended november 1st | CREATE TABLE table_204_858 (id number,"date" text,"time" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number) | SELECT ABS((SELECT "attendance" FROM table_204_858 WHERE "date" = 'august 30') - (SELECT "attendance" FROM table_204_858 WHERE "date" = 'november 1')) |
give me the number of patients whose gender is m and item id is 51148? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.itemid = "51148" |
how many films has neha sharma been in ? | CREATE TABLE table_203_157 (id number,"year" number,"film" text,"role" text,"language" text,"notes" text) | SELECT COUNT("film") FROM table_203_157 |
What is the lowest maximum of fps with a width of 3072 and a height less than 1620? | CREATE TABLE table_70538 ("Frame size" text,"Width" real,"Height" real,"Mpix" real,"Aspect Ratio" text,"Maximum fps" real,"Maximum fps HDRx" real,"least compression at 24 fps" text,"least compression at maximum fps" text) | SELECT MIN("Maximum fps") FROM table_70538 WHERE "Width" = '3072' AND "Height" < '1620' |
Who is the replaced by when the date of vacancy is 27 december 2010? | CREATE TABLE table_26998135_2 (replaced_by VARCHAR,date_of_vacancy VARCHAR) | SELECT replaced_by FROM table_26998135_2 WHERE date_of_vacancy = "27 December 2010" |
what is the total number of names ? | CREATE TABLE table_204_29 (id number,"rank" number,"lane" number,"name" text,"nationality" text,"time" text,"notes" text) | SELECT COUNT("name") FROM table_204_29 |
What is the Visitor with a Series with 3 2? | CREATE TABLE table_name_50 (visitor VARCHAR,series VARCHAR) | SELECT visitor FROM table_name_50 WHERE series = "3 – 2" |
What is the lowest # in Atlanta, GA with the Georgia Bulldogs as an opponent? | CREATE TABLE table_20212 ("#" real,"Season" real,"Bowl game" text,"Result" text,"Opponent" text,"Stadium" text,"Location" text,"Attendance" text) | SELECT MIN("#") FROM table_20212 WHERE "Location" = 'Atlanta, GA' AND "Opponent" = 'Georgia Bulldogs' |
What was the team features at Oran Park Raceway? | CREATE TABLE table_name_41 (team VARCHAR,circuit VARCHAR) | SELECT team FROM table_name_41 WHERE circuit = "oran park raceway" |
What character won the best dramatic performance award? | CREATE TABLE table_10959 ("Year" real,"Result" text,"Award" text,"Category" text,"Film or series" text,"Character" text) | SELECT "Character" FROM table_10959 WHERE "Category" = 'best dramatic performance' |
How many different combinations of team colors are there in all the schools in Maroa, Illinois? | CREATE TABLE table_29612224_1 (colors VARCHAR,location VARCHAR) | SELECT COUNT(colors) FROM table_29612224_1 WHERE location = "Maroa, Illinois" |
What is every song title for 2007? | CREATE TABLE table_24419 ("Year" real,"Song Title" text,"Artist" text,"Genre" text,"Original Game" text,"Band Tier/Venue" text,"Exportable to GH5/BH" text) | SELECT "Song Title" FROM table_24419 WHERE "Year" = '2007' |
how many patients whose primary disease is overdose and lab test abnormal status is delta? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "OVERDOSE" AND lab.flag = "delta" |
List the names of all distinct races in reversed lexicographic order? | CREATE TABLE races (name VARCHAR) | SELECT DISTINCT name FROM races ORDER BY name DESC |
In which year is Nerida Gregory listed as the loser? | CREATE TABLE table_60816 ("Year" real,"Grand Slam" text,"Round" text,"Winner" text,"Loser" text) | SELECT AVG("Year") FROM table_60816 WHERE "Loser" = 'nerida gregory' |
Game site of candlestick park had what opponent? | CREATE TABLE table_6224 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Attendance" real) | SELECT "Opponent" FROM table_6224 WHERE "Game site" = 'candlestick park' |
How many teams have skyhawks as a nickname? | CREATE TABLE table_2105 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Nickname" text,"Joined" real,"Division" text) | SELECT COUNT("Division") FROM table_2105 WHERE "Nickname" = 'Skyhawks' |
name the only athlete from sri lanka . | CREATE TABLE table_204_937 (id number,"rank" number,"lane" number,"athlete" text,"time" number) | SELECT "athlete" FROM table_204_937 WHERE "athlete" = 'sri' |
Please use a bar chart to compare the number of customers of each customer's move in date, and rank by the total number from low to high. | CREATE TABLE Things (thing_id INTEGER,organization_id INTEGER,Type_of_Thing_Code CHAR(15),service_type_code CHAR(10),service_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,customer_details VARCHAR(255))CREATE TABLE Services (service_id INTEGER,organization_id INTEGER,service_type_code CHAR(15),service... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY date_moved_in ORDER BY COUNT(date_moved_in) |
What is the date of the match with a result of ud 12/12 between Pernell Whitaker and James Mcgirt? | CREATE TABLE table_name_87 (date VARCHAR,opponent VARCHAR,result VARCHAR,name VARCHAR) | SELECT date FROM table_name_87 WHERE result = "ud 12/12" AND name = "pernell whitaker" AND opponent = "james mcgirt" |
What team was ranked in 7th? | CREATE TABLE table_3120 ("Rank" text,"Player" text,"Nationality" text,"Team" text,"Opponent" text,"Score" text,"Competition" text,"Vote percentage" text) | SELECT "Team" FROM table_3120 WHERE "Rank" = '7th' |
1 or more of the following infections: a ) primary or secondary bacteremia by gram negative bacteria, b ) acute pyelonephritis, or c ) intrabdominal infection. | CREATE TABLE table_train_66 ("id" int,"pregnancy_or_lactation" bool,"white_blood_cell_count_wbc" int,"acute_pyelonephritis" bool,"intrabdominal_infection" bool,"body_weight" float,"oxygen_therapy_by_face_mask" bool,"temperature" float,"heart_rate" int,"paco2" float,"band_form" int,"respiratory_rate" int,"bacteremia_by_... | SELECT * FROM table_train_66 WHERE (CASE WHEN bacteremia_by_gram_negative_bacteria = 1 THEN 1 ELSE 0 END + CASE WHEN acute_pyelonephritis = 1 THEN 1 ELSE 0 END + CASE WHEN intrabdominal_infection = 1 THEN 1 ELSE 0 END) >= 1 |
indicate the daily minimum amount of urine output that patient 005-9883 had had until 02/07/2102. | 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 MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-9883')) AND intakeoutput.celllabel = 'urine'... |
who is the the incumbent with candidates being percy e. quin (d) unopposed | CREATE TABLE table_1342379_23 (incumbent VARCHAR,candidates VARCHAR) | SELECT incumbent FROM table_1342379_23 WHERE candidates = "Percy E. Quin (D) Unopposed" |
What's the title of the song by Winger? | CREATE TABLE table_69010 ("Year" real,"Song title" text,"Artist" text,"Master recording?" text,"Tier" text) | SELECT "Song title" FROM table_69010 WHERE "Artist" = 'winger' |
Name the lowest frequency for brand of radio manantial | CREATE TABLE table_68583 ("Frequency" real,"Callsign" text,"Brand" text,"Format" text,"City of License" text,"Website" text,"Webcast" text) | SELECT MIN("Frequency") FROM table_68583 WHERE "Brand" = 'radio manantial' |
answers with code that aren't tagged that way - for specific user(s). | CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans... | SELECT a.Id AS "post_link", q.Tags, a.Score, REPLACE(a.Body, CHAR(10), '') AS "body" FROM Posts AS a LEFT OUTER JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId IN ('##UserID##') AND a.PostTypeId = 2 AND (a.Body LIKE '%Sub %' OR a.Body LIKE '%Function %') AND NOT q.Tags LIKE '%vba%' ORDER BY a.Score DESC |
What is the number of total offense when the opponentis Penn State? | CREATE TABLE table_30692 ("Rank" real,"Player" text,"Year" real,"Opponent" text,"Passing yards" real,"Rushing yards" real,"Total offense" real) | SELECT MAX("Total offense") FROM table_30692 WHERE "Opponent" = 'Penn State' |
how many patients are with admission location clinic referral/premature and discharged to snf? | 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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "SNF" |
Find the ids and first names of the 3 teachers that have the most number of assessment notes? | CREATE TABLE assessment_notes (notes_id number,student_id number,teacher_id number,date_of_notes time,text_of_notes text,other_details text)CREATE TABLE student_addresses (student_id number,address_id number,date_address_from time,date_address_to time,monthly_rental number,other_details text)CREATE TABLE detention (det... | SELECT T1.teacher_id, T2.first_name FROM assessment_notes AS T1 JOIN teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 3 |
which sensor has the largest area ? | CREATE TABLE table_203_356 (id number,"type" text,"diagonal (mm)" text,"width (mm)" text,"height (mm)" text,"area (mm2)" text,"stops (area)" number,"crop factor" text) | SELECT "type" FROM table_203_356 ORDER BY "area (mm2)" DESC LIMIT 1 |
what is the sspec number when the socket is standard power? | CREATE TABLE table_name_75 (sspec_number VARCHAR,socket VARCHAR) | SELECT sspec_number FROM table_name_75 WHERE socket = "standard power" |
What was the Position of the Player, Britton Johnsen? | CREATE TABLE table_name_79 (position VARCHAR,player VARCHAR) | SELECT position FROM table_name_79 WHERE player = "britton johnsen" |
What was the film title nominated from the Netherlands? | CREATE TABLE table_71315 ("Country" text,"Film title used in nomination" text,"Language" text,"Original title" text,"Director" text) | SELECT "Film title used in nomination" FROM table_71315 WHERE "Country" = 'netherlands' |
Finding out new java queries. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE ... | SELECT q.Id, q.CreationDate, q.ViewCount, u.DisplayName AS "UserHandle", q.OwnerUserId AS "UserId", q.Tags, q.Title, q.Body FROM Posts AS q INNER JOIN Tags AS t ON (t.TagName = 'new to java') INNER JOIN PostTags AS pt ON pt.TagId = t.Id AND q.Id = pt.PostId INNER JOIN Users AS u ON u.Id = q.OwnerUserId WHERE q.Tags LIK... |
Name the college for dl | CREATE TABLE table_28059992_2 (college VARCHAR,position VARCHAR) | SELECT college FROM table_28059992_2 WHERE position = "DL" |
What is the production code for episode number 86 in the series? | CREATE TABLE table_2409041_5 (production_code INTEGER,no_in_series VARCHAR) | SELECT MIN(production_code) FROM table_2409041_5 WHERE no_in_series = 86 |
Which Draw has a Season of 2001 02, and Points larger than 47? | CREATE TABLE table_6836 ("Season" text,"League" text,"Draw" real,"Lost" real,"Points" real,"Position" text) | SELECT SUM("Draw") FROM table_6836 WHERE "Season" = '2001–02' AND "Points" > '47' |
what is the name of the builder who launched in danaide | CREATE TABLE table_75588 ("Name" text,"Pennant number" text,"Builder" text,"Laid Down" text,"Launched" text,"Commissioned" text,"Current status" text) | SELECT "Launched" FROM table_75588 WHERE "Name" = 'danaide' |
Give me a bar chart for total number of school id of each all home, and display in asc by the bars please. | 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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home |
What competition has 17-1 as the result? | CREATE TABLE table_40974 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Competition" FROM table_40974 WHERE "Result" = '17-1' |
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 weekday, show by the the average of manager id in descending. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE jobs (JOB_I... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) DESC |
What is the construction of Olivier Panis' car that retired due to a collision? | CREATE TABLE table_name_23 (constructor VARCHAR,time_retired VARCHAR,driver VARCHAR) | SELECT constructor FROM table_name_23 WHERE time_retired = "collision" AND driver = "olivier panis" |
What was Spring Creek School's area when the decile was 4? | CREATE TABLE table_name_67 (area VARCHAR,decile VARCHAR,name VARCHAR) | SELECT area FROM table_name_67 WHERE decile = 4 AND name = "spring creek school" |
Number of questions asked on site before date. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,O... | SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND CreationDate < '##Date##' |
how many patients whose year of birth is less than 2103 and diagnoses short title is preterm nec 1250-1499g? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2103" AND diagnoses.short_title = "Preterm NEC 1250-1499g" |
For which venue did Leicester City lose? | CREATE TABLE table_62256 ("Season" text,"Date" text,"Winner" text,"Loser" text,"Score" text,"Venue" text,"Attendance" text) | SELECT "Venue" FROM table_62256 WHERE "Loser" = 'leicester city' |
What year did the team from City of Aurora join? | CREATE TABLE table_63668 ("School" text,"City" text,"Team Name" text,"Enrollment 08-09" real,"IHSAA Class" text,"IHSAA Class Football" text,"County" text,"Year Joined (Or Joining)" real,"Previous Conference" text) | SELECT AVG("Year Joined (Or Joining)") FROM table_63668 WHERE "City" = 'aurora' |
What are the number one tags for low quality posts?. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,... | SELECT t.TagName, (COUNT(*) * 1.0 / (SELECT COUNT(*) FROM PostTags AS ptt WHERE ptt.TagId = t.Id)) AS dvpercent FROM PostTags AS pt INNER JOIN Tags AS t ON pt.TagId = t.Id INNER JOIN (SELECT pv.Id, COUNT(*) AS downmod FROM Posts AS pv INNER JOIN Votes AS v ON v.PostId = pv.Id AND v.VoteTypeId = 3 WHERE CAST((JULIANDAY(... |
What is the earliest election with 2 seats and the outcome of the election of minority in parliament? | CREATE TABLE table_name_67 (election INTEGER,outcome_of_election VARCHAR,seats VARCHAR) | SELECT MIN(election) FROM table_name_67 WHERE outcome_of_election = "minority in parliament" AND seats = "2" |
For those employees who did not have any job in the past, find hire_date and the amount of hire_date bin hire_date by time, and visualize them by a bar chart, and rank by the Y-axis in ascending please. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUN... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) |
what were the five most frequently provided tests for patients who had previously been diagnosed with cerv spondyl w myelopath during the same hospital encounter, until 1 year ago? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE admissions (row_id ... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W... |
Unanswered questions by low-reputation users. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score n... | SELECT p.CreationDate, p.Id AS "post_link", p.Tags FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE u.Reputation < 15 AND p.PostTypeId = 1 AND COALESCE(p.AnswerCount, 0) = 0 AND p.ClosedDate IS NULL ORDER BY p.CreationDate DESC |
What is the Winning score on oct 22, 2000? | CREATE TABLE table_name_93 (winning_score VARCHAR,date VARCHAR) | SELECT winning_score FROM table_name_93 WHERE date = "oct 22, 2000" |
Show different publishers together with the number of publications they have in a bar chart, and I want to order by the bars in asc. | CREATE TABLE book (Book_ID int,Title text,Issues real,Writer text)CREATE TABLE publication (Publication_ID int,Book_ID int,Publisher text,Publication_Date text,Price real) | SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher ORDER BY Publisher |
when did patient 031-3355 have a other microbiology test last on their current 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 intakeoutput (intakeoutputid number,patientunitstayid number,c... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microla... |
In what year was Lindenwood University founded? | CREATE TABLE table_15916 ("School" text,"Location" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Team Nickname" text,"Primary conference" text) | SELECT MIN("Founded") FROM table_15916 WHERE "School" = 'Lindenwood University' |
how many FIRST class flights does UA have today | CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airline (airline_code varchar,airline_name text,no... | SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 29 AND DATE_DAY_0.month_number = 4 AND DATE_DAY_0.year = 1... |
Which Report is Dated 9 March? | CREATE TABLE table_name_72 (report VARCHAR,date VARCHAR) | SELECT report FROM table_name_72 WHERE date = "9 march" |
Return a histogram on what are the first names and ids for customers who have two or more accounts?, and display in descending by the names. | CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,production_type_code VARCHAR(15),unit_price DECIMAL(19,4),product_name VARCHAR(80),product_color VARCHAR(20),product_size VARCHAR(20))CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,date_account_opened DATETIME,account_name VARCHAR(50),ot... | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.customer_first_name DESC |
What was the location on October 16? | CREATE TABLE table_name_29 (location VARCHAR,date VARCHAR) | SELECT location FROM table_name_29 WHERE date = "october 16" |
Give me a histogram for what is the code of each role and the number of employees in each role?, and sort x axis in desc order please. | CREATE TABLE Employees (Employee_ID INTEGER,Role_Code CHAR(15),Employee_Name VARCHAR(255),Gender_MFU CHAR(1),Date_of_Birth DATETIME,Other_Details VARCHAR(255))CREATE TABLE Document_Locations (Document_ID INTEGER,Location_Code CHAR(15),Date_in_Location_From DATETIME,Date_in_Locaton_To DATETIME)CREATE TABLE All_Documents... | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY Role_Code DESC |
Series of oilers win 4 3 had what highest game? | CREATE TABLE table_75435 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Series" text) | SELECT MAX("Game") FROM table_75435 WHERE "Series" = 'oilers win 4–3' |
Name the sumof points for year less than 1994 and chassis of lola lc89b | CREATE TABLE table_name_47 (points INTEGER,year VARCHAR,chassis VARCHAR) | SELECT SUM(points) FROM table_name_47 WHERE year < 1994 AND chassis = "lola lc89b" |
What was the tie number of the game when the queens park rangers were the home team? | CREATE TABLE table_8266 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text) | SELECT "Tie no" FROM table_8266 WHERE "Home team" = 'queens park rangers' |
A bar chart about how many students are affected by each allergy type?, show by the y axis in asc. | CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20)) | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY COUNT(*) |
list all flights from NEW YORK to LAS VEGAS that fly nonstop on sunday and list flights from MEMPHIS to LAS VEGAS that fly nonstop on sunday | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant i... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, flight WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'LAS VEGAS' AND dat... |
Name the total number of troops per one million being 2.76 | CREATE TABLE table_31482 ("Country" text,"Number of Troops" real,"% of Total Troops" text,"Troops per one million population" text,"Troops per $1 billion (USD) GDP" text) | SELECT COUNT("Troops per one million population") FROM table_31482 WHERE "Troops per $1 billion ( USD ) GDP" = '2.76' |
among patients on nebulizer therapy, how many of them were widowed? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "NEB" |
Who was the winning team at Zandvoort? | CREATE TABLE table_60864 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Team" text) | SELECT "Winning Team" FROM table_60864 WHERE "Circuit" = 'zandvoort' |
What is the smallest number of field goals for players with 4 touchdowns and less than 9 extra points? | CREATE TABLE table_name_5 (field_goals INTEGER,touchdowns VARCHAR,extra_points VARCHAR) | SELECT MIN(field_goals) FROM table_name_5 WHERE touchdowns = 4 AND extra_points < 9 |
What is the number of starts for the player who lost fewer than 22 and has more than 4 tries? | CREATE TABLE table_33122 ("Player" text,"Span" text,"Start" real,"Tries" real,"Conv" real,"Pens" real,"Drop" real,"Lost" real,"Draw" real) | SELECT AVG("Start") FROM table_33122 WHERE "Lost" < '22' AND "Tries" > '4' |
What was the manner of departure for the outgoing manager, davide ballardini? | CREATE TABLE table_name_92 (manner_of_departure VARCHAR,outgoing_manager VARCHAR) | SELECT manner_of_departure FROM table_name_92 WHERE outgoing_manager = "davide ballardini" |
What was Johnny Rutherford's fastest lap while Al Unser was the pole position? | CREATE TABLE table_10527215_3 (fastest_lap VARCHAR,winning_driver VARCHAR,pole_position VARCHAR) | SELECT fastest_lap FROM table_10527215_3 WHERE winning_driver = "Johnny Rutherford" AND pole_position = "Al Unser" |
which airlines have flights from SAN FRANCISCO to WASHINGTON by way of INDIANAPOLIS | 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 airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTO... |
Candidate of riikka manner has how many votes? | CREATE TABLE table_5763 ("Candidate" text,"Party" text,"Votes" text,"Quotient" text,"Municipality" text) | SELECT "Votes" FROM table_5763 WHERE "Candidate" = 'riikka manner' |
How many distinct companies are there? | CREATE TABLE entrepreneur (entrepreneur_id number,people_id number,company text,money_requested number,investor text)CREATE TABLE people (people_id number,name text,height number,weight number,date_of_birth text) | SELECT COUNT(DISTINCT company) FROM entrepreneur |
How many players are from the country of Brazil? | CREATE TABLE table_73681 ("Name" text,"Position" text,"Period" text,"Appearances\u00b9" real,"Goals\u00b9" real,"Nationality\u00b2" text) | SELECT COUNT("Position") FROM table_73681 WHERE "Nationality\u00b2" = 'Brazil' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.