instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What's the average laps driven by david coulthard?
CREATE TABLE table_51301 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT AVG("Laps") FROM table_51301 WHERE "Driver" = 'david coulthard'
What Nationality is Jeff Hornacek?
CREATE TABLE table_name_14 (nationality VARCHAR,player VARCHAR)
SELECT nationality FROM table_name_14 WHERE player = "jeff hornacek"
What 's the number of the course on Mentorship- Multidisciplinary Design ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course (course_id int,name varchar,department varchar,numbe...
SELECT DISTINCT number FROM course WHERE (description LIKE '%Mentorship- Multidisciplinary Design%' OR name LIKE '%Mentorship- Multidisciplinary Design%') AND department = 'EECS'
Tell me the DA for bureau chief ada
CREATE TABLE table_4310 ("Time Period" text,"Position" text,"Bureau" text,"Office" text,"District Attorney" text)
SELECT "District Attorney" FROM table_4310 WHERE "Position" = 'bureau chief ada'
what is four of the most frequent intakes in 2102?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayi...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2102' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4
In what district is the incumbent John Bell Williams?
CREATE TABLE table_18450 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "District" FROM table_18450 WHERE "Incumbent" = 'John Bell Williams'
I want to know the events for 106 bands
CREATE TABLE table_name_16 (event VARCHAR,acts VARCHAR)
SELECT event FROM table_name_16 WHERE acts = "106 bands"
what is item id and lab test name of subject name chandra schulman?
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 lab.itemid, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Chandra Schulman"
Name the total number of party for willis alston (j) 93.9% george e. spruill 6.1%
CREATE TABLE table_74000 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT COUNT("Party") FROM table_74000 WHERE "Candidates" = 'Willis Alston (J) 93.9% George E. Spruill 6.1%'
What is the notes distance for 2nd position earlier than 1986?
CREATE TABLE table_name_31 (notes VARCHAR,position VARCHAR,year VARCHAR)
SELECT notes FROM table_name_31 WHERE position = "2nd" AND year < 1986
Which To Par has a Money ($) of 350, and a Player of henry picard?
CREATE TABLE table_61954 ("Place" text,"Player" text,"Country" text,"Score" text,"To Par" text,"Money ($)" real)
SELECT "To Par" FROM table_61954 WHERE "Money ( $ )" = '350' AND "Player" = 'henry picard'
i'd like a morning flight from NEWARK to LOS ANGELES
CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion va...
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'NEWARK')) AND to_airport IN (SELECT AIRPORT_S...
List the names of the city with the top 5 white percentages.
CREATE TABLE city (Name VARCHAR,White VARCHAR)
SELECT Name FROM city ORDER BY White DESC LIMIT 5
How many deaths did eseta cause?
CREATE TABLE table_name_34 (deaths VARCHAR,name VARCHAR)
SELECT deaths FROM table_name_34 WHERE name = "eseta"
Show names of companies and that of employees in descending order of number of years working for that employee.
CREATE TABLE company (company_id number,name text,headquarters text,industry text,sales_in_billion number,profits_in_billion number,assets_in_billion number,market_value_in_billion number)CREATE TABLE employment (company_id number,people_id number,year_working number)CREATE TABLE people (people_id number,age number,nam...
SELECT T3.name, T2.name FROM employment AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id JOIN company AS T3 ON T1.company_id = T3.company_id ORDER BY T1.year_working
How many books fall into each category, and could you order by the bars in asc?
CREATE TABLE movie (movie_id int,Title text,Year int,Director text,Budget_million real,Gross_worldwide int)CREATE TABLE book_club (book_club_id int,Year int,Author_or_Editor text,Book_Title text,Publisher text,Category text,Result text)CREATE TABLE culture_company (Company_name text,Type text,Incorporated_in text,Group...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY Category
other than in gloucester city , name a game that was attended by more than 1,000 people .
CREATE TABLE table_204_146 (id number,"tie" number,"home team" text,"score" text,"away team" text,"attendance" number)
SELECT "home team" FROM table_204_146 WHERE "home team" <> 'gloucester city' AND "attendance" > 1000
give me the number of patients whose age is less than 80 and diagnoses short title is hx-ven thrombosis/embols?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "80" AND diagnoses.short_title = "Hx-ven thrombosis/embols"
how many days have passed since first procedure of patient 017-45919 on their current hospital visit?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-45919'...
when was the last time patient 51177 had an maximum chloride in a month before?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icust...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRE...
Which grid has a Time/Retired of +5.004?
CREATE TABLE table_54617 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT MIN("Grid") FROM table_54617 WHERE "Time/Retired" = '+5.004'
What's the year that Hagerstown joined?
CREATE TABLE table_name_66 (year_joined VARCHAR,school VARCHAR)
SELECT year_joined FROM table_name_66 WHERE school = "hagerstown"
What is the most amount of stolen ends for a skip with 1 W?
CREATE TABLE table_29546030_2 (stolen_ends INTEGER,w VARCHAR)
SELECT MAX(stolen_ends) FROM table_29546030_2 WHERE w = 1
patient 030-64961 underwent any active warming procedure in a year before?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemic...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-64961')) AND treatment.treatmentname = 'active warming' AND DATETIME(tre...
What is the enzyme involved in the disorder of Ornithine Transcarbamylase deficiency?
CREATE TABLE table_52256 ("Location" text,"Abb." text,"Enzyme" text,"Disorder" text,"Measurements" text)
SELECT "Enzyme" FROM table_52256 WHERE "Disorder" = 'ornithine transcarbamylase deficiency'
What is the administrative panel average when the cultural and educational panel is greater than 1 and the industrial and commercial panel less than 4?
CREATE TABLE table_name_77 (administrative_panel INTEGER,cultural_and_educational_panel VARCHAR,industrial_and_commercial_panel VARCHAR)
SELECT AVG(administrative_panel) FROM table_name_77 WHERE cultural_and_educational_panel > 1 AND industrial_and_commercial_panel < 4
Which Score has a Date of october 8, 2005, and a Venue of estadio alfonso lastras, san luis potos , mexico?
CREATE TABLE table_name_96 (score VARCHAR,date VARCHAR,venue VARCHAR)
SELECT score FROM table_name_96 WHERE date = "october 8, 2005" AND venue = "estadio alfonso lastras, san luis potosí, mexico"
Question and answer counts group by hour. Find the most quiet moment to ask or answer questions
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 q.hour AS "utc_hour", CAST(q.questions AS TEXT) + ' (' + CAST(q.percentage AS TEXT) + '%)' AS Questions, CAST(a.answers AS TEXT) + ' (' + CAST(a.percentage AS TEXT) + '%)' AS Answers FROM (SELECT TIME_TO_STR(CreationDate, '%h') AS hour, COUNT(*) AS questions, 100.0 * COUNT(*) / (SELECT COUNT(*) FROM Posts WHERE ...
How many values for points have Sophia Witherspoon as the player?
CREATE TABLE table_27578 ("Player" text,"Games Played" real,"Rebounds" real,"Assists" real,"Steals" real,"Blocks" real,"Points" real)
SELECT COUNT("Points") FROM table_27578 WHERE "Player" = 'Sophia Witherspoon'
is the ducati marlboro team above or below the team roberts in the team column ?
CREATE TABLE table_204_162 (id number,"team" text,"constructor" text,"motorcycle" text,"tyres" text,"no" number,"rider" text,"rounds" text)
SELECT (SELECT id FROM table_204_162 WHERE "team" = 'ducati marlboro team') < (SELECT id FROM table_204_162 WHERE "team" = 'team roberts')
Find the name of players whose card is yes in the descending order of training hours.
CREATE TABLE Player (pName VARCHAR,yCard VARCHAR,HS VARCHAR)
SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC
When chris barnes is on team usa how many europe teams are there?
CREATE TABLE table_22798 ("Match no." real,"Match Type" text,"Team Europe" text,"Score" text,"Team USA" text,"Progressive Total" text)
SELECT COUNT("Team Europe") FROM table_22798 WHERE "Team USA" = 'Chris Barnes'
What is Name, when WSU Year(s) is 1981-82?
CREATE TABLE table_44759 ("Name" text,"WSU Year(s)" text,"Position" text,"Team" text,"Pro Year(s)" text)
SELECT "Name" FROM table_44759 WHERE "WSU Year(s)" = '1981-82'
Show the name of track and the number of races in each track Visualize by bar chart, and could you order y-axis from low to high order?
CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real)CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text)
SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY COUNT(*)
Bar chart x axis minister y axis how many minister, display the number of minister in descending order.
CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE mem...
SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY COUNT(Minister) DESC
What was the Event for the prize of 850,000?
CREATE TABLE table_71055 ("Date" text,"City" text,"Event" text,"Winner" text,"Prize" text)
SELECT "Event" FROM table_71055 WHERE "Prize" = '€850,000'
What ist he Home with a Score that is 42-64?
CREATE TABLE table_39910 ("Date" text,"Time" text,"Home" text,"Away" text,"Score" text,"Ground" text)
SELECT "Home" FROM table_39910 WHERE "Score" = '42-64'
Which years have an Area of rangitoto?
CREATE TABLE table_name_16 (years VARCHAR,area VARCHAR)
SELECT years FROM table_name_16 WHERE area = "rangitoto"
Visualize a bar chart about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home, sort by the total number in descending.
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 All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(Team_ID) DESC
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of salary over the job_id , and group by attribute job_id by a bar chart, I want to rank by the sum salary in descending please.
CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE 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),CO...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC
Name the total number of reason for change for not filled this congress
CREATE TABLE table_25102 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text)
SELECT COUNT("Reason for change") FROM table_25102 WHERE "Date successor seated" = 'Not filled this congress'
Name the Home with has a Score of 2 7?
CREATE TABLE table_8379 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Home" FROM table_8379 WHERE "Score" = '2–7'
For each branch id, what are the names of the branches that were registered after 2015. Visualize by bar chart.
CREATE TABLE purchase (Member_ID int,Branch_ID text,Year text,Total_pounds real)CREATE TABLE membership_register_branch (Member_ID int,Branch_ID text,Register_Year text)CREATE TABLE member (Member_ID int,Card_Number text,Name text,Hometown text,Level int)CREATE TABLE branch (Branch_ID int,Name text,Open_year text,Addre...
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID
Which Points have a Score of 3 3, and a Date of november 11?
CREATE TABLE table_36669 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real)
SELECT "Points" FROM table_36669 WHERE "Score" = '3–3' AND "Date" = 'november 11'
Number of Compile-to-JS askers by Month.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,...
SELECT Tag, STR(Year) + '-' + REPLACE(STR(Month, 2), SPACE(1), '0') AS Month, COUNT(DISTINCT OwnerUserId) AS Askers FROM (SELECT ViewCount, OwnerUserId, MONTH(CreationDate) AS Month, YEAR(CreationDate) AS Year, CASE WHEN Tags LIKE '%<flowtype>%' THEN 'FlowType' ELSE CASE WHEN Tags LIKE '%<typescript>%' THEN 'TypeScript...
how many patients have been prescribed with warfarin sodium 5 mg po tabs until 4 years ago?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'warfarin sodium 5 mg po tabs' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-4 year'))
Which home team scored 14.11 (95)?
CREATE TABLE table_78416 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_78416 WHERE "Home team score" = '14.11 (95)'
What was the mls cup playoffs when the mls regular season was 4th, central (11-16-5)?
CREATE TABLE table_73688 ("Season" real,"MLS Regular Season" text,"MLS Cup Playoffs" text,"Lamar Hunt U.S. Open Cup" text,"CONCACAF Champions Cup / CONCACAF Champions League" text)
SELECT "MLS Cup Playoffs" FROM table_73688 WHERE "MLS Regular Season" = '4th, Central (11-16-5)'
Who wrote the film Jehovah's Witness?
CREATE TABLE table_name_5 (writer_s_ VARCHAR,film VARCHAR)
SELECT writer_s_ FROM table_name_5 WHERE film = "jehovah's witness"
What is the home team score of the Ghantoot Racing and Polo Club Ground?
CREATE TABLE table_34436 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" text,"Date" text,"Time" text,"Report" text)
SELECT "Home team score" FROM table_34436 WHERE "Ground" = 'ghantoot racing and polo club'
Name the round having an overall of 6
CREATE TABLE table_name_84 (round VARCHAR,overall VARCHAR)
SELECT round FROM table_name_84 WHERE overall = 6
What was the date of the friendly match, ending in a result of 1-1?
CREATE TABLE table_56727 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Date" FROM table_56727 WHERE "Competition" = 'friendly match' AND "Result" = '1-1'
Who is the opponent for week 5?
CREATE TABLE table_4360 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Opponent" FROM table_4360 WHERE "Week" = '5'
What was the Score that has an Attendance of 39,446?
CREATE TABLE table_name_3 (score VARCHAR,attendance VARCHAR)
SELECT score FROM table_name_3 WHERE attendance = "39,446"
How many lanes have 2 as the heat, and susanna kallur as the name?
CREATE TABLE table_8531 ("Heat" real,"Lane" real,"Name" text,"Country" text,"Mark" text)
SELECT SUM("Lane") FROM table_8531 WHERE "Heat" = '2' AND "Name" = 'susanna kallur'
Post length to score ratio.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUser...
SELECT Id AS "post_link", Score, LENGTH(Body) AS Length, CAST(Score AS FLOAT) / LENGTH(Body) AS Ratio, OwnerUserId AS "user_link" FROM Posts WHERE Body != '' ORDER BY CAST(Score AS FLOAT) / LENGTH(Body) DESC
was steven smith pick number 5 or number 8 ?
CREATE TABLE table_204_263 (id number,"pick" number,"player" text,"country of origin" text,"pba team" text,"college" text)
SELECT "pick" FROM table_204_263 WHERE "player" = 'steven smith'
What is the Set 1 when Set 3 was 25 15?
CREATE TABLE table_44810 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text)
SELECT "Set 1" FROM table_44810 WHERE "Set 3" = '25–15'
What date final has 1989 as the year?
CREATE TABLE table_67994 ("Year" text,"Date Final" text,"Venue" text,"Prize Money" text,"Champion" text,"Runner-up" text,"Score in final" text,"Commercial name" text)
SELECT "Date Final" FROM table_67994 WHERE "Year" = '1989'
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and manager_id , list bars 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 FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
What are the descriptions of the service types with product price above 100, and count them by a bar chart, I want to sort by the bars in asc.
CREATE TABLE Order_Items (Order_Item_ID INTEGER,Order_ID INTEGER,Product_ID INTEGER,Order_Quantity VARCHAR(288),Other_Item_Details VARCHAR(255))CREATE TABLE Products (Product_ID VARCHAR(100),Product_Name VARCHAR(255),Product_Price DECIMAL(20,4),Product_Description VARCHAR(255),Other_Product_Service_Details VARCHAR(255)...
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description
Which team has the high points of Raymond Felton (26)?
CREATE TABLE table_57669 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Team" FROM table_57669 WHERE "High points" = 'raymond felton (26)'
how many patients since 6 years ago received a procedure-one vessel after the first circumcision procedure within 2 months?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartti...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'circumcisio...
Name the number of number in season for 3.09
CREATE TABLE table_24870 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text)
SELECT COUNT("No. in season") FROM table_24870 WHERE "Production code" = '3.09'
Find the buildings which have rooms with capacity more than 50.
CREATE TABLE advisor (s_id text,i_id text)CREATE TABLE student (id text,name text,dept_name text,tot_cred number)CREATE TABLE department (dept_name text,building text,budget number)CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text...
SELECT DISTINCT building FROM classroom WHERE capacity > 50
What team is in the city of Rock Island?
CREATE TABLE table_30143 ("Institution" text,"City" text,"State" text,"Team Name" text,"Affiliation" text,"Enrollment" real,"Home Conference" text)
SELECT "Team Name" FROM table_30143 WHERE "City" = 'Rock Island'
How many people watched season 1?
CREATE TABLE table_name_69 (viewers__in_millions_ VARCHAR,season VARCHAR)
SELECT viewers__in_millions_ FROM table_name_69 WHERE season = "1"
for how many days was the patient with patient id 6983 admitted in hospital?
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 demographic.days_stay FROM demographic WHERE demographic.subject_id = "6983"
How many penalties are there when Eric Vigeanel is the rider?
CREATE TABLE table_18666752_3 (total_penalties VARCHAR,rider VARCHAR)
SELECT COUNT(total_penalties) FROM table_18666752_3 WHERE rider = "Eric Vigeanel"
what is the daily average amount of magnesium patient 23070 has in this year?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code ...
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(C...
What is the record that has the Rose Garden 20,126 as the attendance?
CREATE TABLE table_name_44 (record VARCHAR,attendance VARCHAR)
SELECT record FROM table_name_44 WHERE attendance = "rose garden 20,126"
Find ACC_Road and Team_ID , and group by attribute All_Home, and visualize them by a bar chart, list X in asc order.
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 ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road
Where has an IATA of BVA?
CREATE TABLE table_11727 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "City" FROM table_11727 WHERE "IATA" = 'bva'
Which lowest rank(player) has a rebound average larger than 9, out of 920 rebounds, and who played more than 79 games?
CREATE TABLE table_33415 ("Rank" real,"Player" text,"Years" text,"Games" real,"Reb. Avg." real,"Total Rebounds" real)
SELECT MIN("Rank") FROM table_33415 WHERE "Reb. Avg." > '9' AND "Total Rebounds" = '920' AND "Games" > '79'
Which role had thulasidas direction?
CREATE TABLE table_name_55 (role VARCHAR,direction VARCHAR)
SELECT role FROM table_name_55 WHERE direction = "thulasidas"
What are the names of all aircrafts that have won a match at least twice?
CREATE TABLE match (round number,location text,country text,date text,fastest_qualifying text,winning_pilot text,winning_aircraft text)CREATE TABLE airport_aircraft (id number,airport_id number,aircraft_id number)CREATE TABLE pilot (pilot_id number,name text,age number)CREATE TABLE aircraft (aircraft_id number,aircraft...
SELECT T1.aircraft FROM aircraft AS T1 JOIN match AS T2 ON T1.aircraft_id = T2.winning_aircraft GROUP BY T2.winning_aircraft HAVING COUNT(*) >= 2
Number of Stack Overflow users.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewT...
SELECT COUNT(*) FROM Users
has patient 73913 been diagnosed with hyposmolality?
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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hyposmolality') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73913)
Find the total number of instructors who teach a course in the Spring 2010 semester.
CREATE TABLE teaches (ID VARCHAR,semester VARCHAR,YEAR VARCHAR)
SELECT COUNT(DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
In what game was the attendance at the America West Arena 18,756?
CREATE TABLE table_29997127_4 (game INTEGER,location_attendance VARCHAR)
SELECT MAX(game) FROM table_29997127_4 WHERE location_attendance = "America West Arena 18,756"
How many nicknames were associated with Milton, Massachusetts?
CREATE TABLE table_2112 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Nickname" text,"Joined" real)
SELECT COUNT("Nickname") FROM table_2112 WHERE "Location" = 'Milton, Massachusetts'
List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
CREATE TABLE Documents (document_type_code VARCHAR,document_name VARCHAR,document_description VARCHAR)
SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'
What company does Simon Stone direct earlier than 2011?
CREATE TABLE table_34790 ("Year" real,"Production" text,"Role" text,"Director" text,"Company" text)
SELECT "Company" FROM table_34790 WHERE "Director" = 'simon stone' AND "Year" < '2011'
For those records from the products and each product's manufacturer, show me about the distribution of name and price , and group by attribute name in a bar chart.
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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
What is the final result of the game that was played on October 8, 2000?
CREATE TABLE table_7505 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Location" text,"Record" text,"Attendance" text)
SELECT "Result" FROM table_7505 WHERE "Date" = 'october 8, 2000'
how many exhibitions has each artist had?, I want to order by the bar in ascending.
CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name
Tell me the number range for 1965-66
CREATE TABLE table_31805 ("Class" text,"Type" text,"No. built (Converted*)" text,"Year built (Converted*)" text,"No. range" text,"Withdrawn" real)
SELECT "No. range" FROM table_31805 WHERE "Year built (Converted*)" = '1965-66'
what flights do you have from MILWAUKEE to TAMPA
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_dis...
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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMP...
What is the sum of the value 'League Cup', when the Total is less than 1, and when the League is less than 0?
CREATE TABLE table_name_7 (league INTEGER,total VARCHAR)
SELECT SUM(league) AS Cup FROM table_name_7 WHERE total < 1 AND league < 0
in 2105, what was the top five most frequently diagnosed diagnoses that patients were diagnosed with during the same hospital encounter after receiving coronar arteriogr-2 cath?
CREATE TABLE d_icd_procedures (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,discharge_location text,insurance text,language text,marital_status text,ethnicit...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i...
What type of surface was used for the game played on September 20, 1993?
CREATE TABLE table_name_93 (surface VARCHAR,date VARCHAR)
SELECT surface FROM table_name_93 WHERE date = "september 20, 1993"
Which School/Club Team has a Round larger than 3, and a Player of sammy okpro?
CREATE TABLE table_name_15 (school_club_team VARCHAR,round VARCHAR,player VARCHAR)
SELECT school_club_team FROM table_name_15 WHERE round > 3 AND player = "sammy okpro"
What is the lowest bronze medal count for Italy with fewer than 6 gold medals and greater than 10 total medals?
CREATE TABLE table_57074 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Bronze") FROM table_57074 WHERE "Gold" < '6' AND "Nation" = 'italy' AND "Total" > '10'
A bar chart shows the distribution of All_Neutral and ACC_Percent , and show in desc by the x axis.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce...
SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY All_Neutral DESC
What was the result in round qf?
CREATE TABLE table_name_56 (result VARCHAR,round VARCHAR)
SELECT result FROM table_name_56 WHERE round = "qf"
Who drove the Marlboro Mclaren Peugeot?
CREATE TABLE table_name_40 (driver VARCHAR,entrant VARCHAR)
SELECT driver FROM table_name_40 WHERE entrant = "marlboro mclaren peugeot"
Return a bar chart on how many different professors are there for the different schools?, list by the the total number in desc.
CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANS...
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC
How many people live in Norton?
CREATE TABLE table_name_1 (population INTEGER,town VARCHAR)
SELECT SUM(population) FROM table_name_1 WHERE town = "norton"
What type of school has the nickname the Oilers?
CREATE TABLE table_262560_2 (type VARCHAR,nickname VARCHAR)
SELECT type FROM table_262560_2 WHERE nickname = "Oilers"
what are the four most common procedures that patients received in the same month after being diagnosed with hepatic encephalopathy?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hepatic encephalopathy') AS t1 JOIN (SEL...