instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is highest place reached by artist Ray Adams? | CREATE TABLE table_72489 ("Position" real,"Artist" text,"Song title" text,"Highest position" real,"Points" real) | SELECT MAX("Position") FROM table_72489 WHERE "Artist" = 'Ray Adams' |
What was the result in Illinois 7? | CREATE TABLE table_72364 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text) | SELECT "Results" FROM table_72364 WHERE "District" = 'Illinois 7' |
Which neighborhood in Madison has the Italian restaurant with the highest stars | CREATE TABLE checkin (cid int,business_id varchar,count int,day varchar)CREATE TABLE business (bid int,business_id varchar,name varchar,full_address varchar,city varchar,latitude varchar,longitude varchar,review_count bigint,is_open tinyint,rating float,state varchar)CREATE TABLE tip (tip_id int,business_id varchar,tex... | SELECT neighborhood.neighborhood_name FROM business, category AS CATEGORY_0, category AS CATEGORY_1, neighborhood WHERE business.city = 'Madison' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'restaurant' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name =... |
Which formula has a thial as a chemical class? | CREATE TABLE table_56824 ("Chemical class" text,"Group" text,"Formula" text,"Prefix" text,"Suffix" text) | SELECT "Formula" FROM table_56824 WHERE "Chemical class" = 'thial' |
How many accounts are opened in each day for all accounts by the customer with first name 'Meaghan' ? Bin the account open day by year interval in a bar chart, could you rank x-axis in ascending order? | CREATE TABLE Product_Categories (production_type_code VARCHAR(15),product_type_description VARCHAR(80),vat_rating DECIMAL(19,4))CREATE TABLE Invoices (invoice_number INTEGER,order_id INTEGER,invoice_date DATETIME)CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,date_account_opened DATETIME,account_name VAR... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY date_account_opened |
Which college has a pick number of 155? | CREATE TABLE table_name_19 (college VARCHAR,pick__number VARCHAR) | SELECT college FROM table_name_19 WHERE pick__number = 155 |
What is the country for Sony / Sony Bmg? | CREATE TABLE table_12179 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalogue #" text) | SELECT "Country" FROM table_12179 WHERE "Label" = 'sony / sony bmg' |
What is every Gregorian month when the season in Tamil is ? | CREATE TABLE table_1740431_3 (gregorian_months VARCHAR,season_in_tamil VARCHAR) | SELECT gregorian_months FROM table_1740431_3 WHERE season_in_tamil = "இளவேனில்" |
What was the time of the 5th ranked swimmer who swam after heat 3 and was in a lane under 5? | CREATE TABLE table_63122 ("Rank" real,"Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Time" FROM table_63122 WHERE "Heat" > '3' AND "Lane" < '5' AND "Rank" = '5' |
What is the theme where the original artist is Noemi feat. Fiorella Mannoia? | CREATE TABLE table_25374338_1 (theme VARCHAR,original_artist VARCHAR) | SELECT theme FROM table_25374338_1 WHERE original_artist = "Noemi feat. Fiorella Mannoia" |
How many locations featured the Webb Family? | CREATE TABLE table_19897294_11 (location_s_ VARCHAR,family_families VARCHAR) | SELECT COUNT(location_s_) FROM table_19897294_11 WHERE family_families = "The Webb Family" |
Can I take 792 when ? | CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int... | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 792 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste... |
What was the race time of the horse with jockey Ramon Dominguez? | CREATE TABLE table_68180 ("Year" real,"Winner" text,"Jockey" text,"Trainer" text,"Owner" text,"Distance (Miles)" text,"Time" text) | SELECT "Time" FROM table_68180 WHERE "Jockey" = 'ramon dominguez' |
What were the scores of the games with a record of 47-34? | CREATE TABLE table_27902171_9 (score VARCHAR,record VARCHAR) | SELECT score FROM table_27902171_9 WHERE record = "47-34" |
the previous year how many people were diagnosed with pure hypercholesterolem within the same month after the first diagnosis of streptococcus group b? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_t... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pure hypercholeste... |
How many accounts for different statement details? Plot a pie chart. | CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Ref_Budget_C... | SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details |
what is primary disease of subject name theresa vedovelli? | 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 demographic (subject_id text,hadm_id text,name text,marita... | SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Theresa Vedovelli" |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and salary , and could you order by the y-axis in ascending? | 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 job_history... | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY |
When 1522 is the tonnes of co2 saved what is the year? | CREATE TABLE table_31188 ("Year" text,"Universities" real,"No. of Students Signed up" real,"% electricity reduction" text,"Tonnes of CO2 Saved" real,"\u00a3 Saved" text) | SELECT "Year" FROM table_31188 WHERE "Tonnes of CO2 Saved" = '1522' |
Give the number of patients whose ethnicity is Hispanic or Latino and were born before the year 1850. | 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 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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.dob_year < "1850" |
count the number of patients whose death status is 0 and procedure long title is allogeneic hematopoietic stem cell transpant without purging? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Allogeneic hematopoietic stem cell transpant without purging" |
Name the # country for new palestine | CREATE TABLE table_name_54 (_number___county VARCHAR,school VARCHAR) | SELECT _number___county FROM table_name_54 WHERE school = "new palestine" |
How many season 3 appearances by the character played by Stefan Van Ray? | CREATE TABLE table_26240046_1 (season_3 INTEGER,played_by VARCHAR) | SELECT MIN(season_3) FROM table_26240046_1 WHERE played_by = "Stefan van Ray" |
How many values of goal average 1 occur when the value of goals against is 92? | CREATE TABLE table_1679 ("Position" real,"Team" text,"Played" real,"Won" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Average 1" text,"Points 2" real) | SELECT COUNT("Goal Average 1") FROM table_1679 WHERE "Goals Against" = '92' |
what was the name of the specimen test that patient 031-19622 received until 46 months ago first? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622')) AND DATETIME(microlab.culturetakentime) <= DATETIME(CURRE... |
Top users for each tag. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)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 CloseAsOffTopicReasonTypes (Id number,IsUniversal... | WITH TotalScore AS (SELECT Ans.OwnerUserId, SUM(Ans.Score) AS Score, Tags.TagName, (ROW_NUMBER() OVER (PARTITION BY Tags.TagName ORDER BY SUM(Ans.Score) DESC)) AS Pos FROM Posts AS Ans INNER JOIN Posts AS Q ON Q.Id = Ans.ParentId INNER JOIN PostTags ON PostTags.PostId = Ans.ParentId INNER JOIN Tags ON Tags.Id = PostTag... |
what was the last time patient 005-4471 had intake of insulin on the current icu visit? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labres... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471') AND patient.unitdischargetime IS NULL) AND... |
What city does call sign K248am have its license in? | CREATE TABLE table_40243 ("Call sign" text,"Frequency MHz" text,"City of license" text,"ERP W" real,"FCC info" text) | SELECT "City of license" FROM table_40243 WHERE "Call sign" = 'k248am' |
What was the doctor for sorted series 6eb/b? | CREATE TABLE table_1620397_5 (doctor VARCHAR,series_sorted VARCHAR) | SELECT doctor FROM table_1620397_5 WHERE series_sorted = "6EB/B" |
What's the chassis for alexander wurz's playlife fb02 engine? | CREATE TABLE table_11742 ("Entrant" text,"Constructor" text,"Chassis" text,"Engine \u2020" text,"Tyre" text,"Driver" text,"Rounds" text) | SELECT "Chassis" FROM table_11742 WHERE "Engine \u2020" = 'playlife fb02' AND "Driver" = 'alexander wurz' |
Name the score for record of 2-5 | CREATE TABLE table_17432028_1 (score VARCHAR,record VARCHAR) | SELECT score FROM table_17432028_1 WHERE record = "2-5" |
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home by a bar chart, and list from low to high by the All_Home 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 All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home |
What was the team's record when they played minnesota? | CREATE TABLE table_27700530_9 (record VARCHAR,team VARCHAR) | SELECT record FROM table_27700530_9 WHERE team = "Minnesota" |
What is the overall of the running back player? | CREATE TABLE table_38697 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT "Overall" FROM table_38697 WHERE "Position" = 'running back' |
Who are the drivers with 133 laps in OC class? | CREATE TABLE table_name_23 (drivers VARCHAR,laps VARCHAR,class VARCHAR) | SELECT drivers FROM table_name_23 WHERE laps = 133 AND class = "oc" |
A bar chart for finding the number of the enrollment date for all the tests that have 'Pass' result, could you sort by the the number of date of enrolment in ascending? | CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_mf VARCHAR(1),address_line_1 VARCHAR(80))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) |
How many drivers participated in the race Australian Grand Prix held in 2009? | CREATE TABLE constructorresults (constructorresultsid number,raceid number,constructorid number,points number,status number)CREATE TABLE driverstandings (driverstandingsid number,raceid number,driverid number,points number,position number,positiontext text,wins number)CREATE TABLE seasons (year number,url text)CREATE T... | SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND year = 2009 |
What year was the score 269? | CREATE TABLE table_35809 ("Year" real,"Dates" text,"Venue" text,"Champion" text,"Country" text,"Score" real,"To par" text,"Margin of victory" text,"Runner(s)-up" text,"Purse ($)" real,"Winner's share ($)" real) | SELECT COUNT("Year") FROM table_35809 WHERE "Score" = '269' |
What was the crowd attendance when the home team scored 13.17 (95)? | CREATE TABLE table_58527 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT SUM("Crowd") FROM table_58527 WHERE "Home team score" = '13.17 (95)' |
What are the faculty ids of all the male faculty members? | CREATE TABLE activity (actid number,activity_name text)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major numbe... | SELECT facid FROM faculty WHERE sex = 'M' |
which episode was Transmitted on friday if the episode of '414 insanely twisted shadow planet' was transmitted on tuesday? | CREATE TABLE table_1824 ("Episodes" text,"Monday" text,"Tuesday" text,"Wednesday" text,"Thursday" text,"Friday" text) | SELECT "Friday" FROM table_1824 WHERE "Tuesday" = '414 Insanely Twisted Shadow Planet' |
Name the nationality of number 9 | CREATE TABLE table_20190 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text) | SELECT "Nationality" FROM table_20190 WHERE "No." = '9' |
Calculate the number of patients who had coronary artery disease or coronary artery bypass graft sda as their primary disease. | 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 WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" |
what was the name of that output that patient 007-849 first had since 11/07/2104? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,... | 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 = '007-849')) AND intakeoutput.cellpath LIKE '%output%' AND STR... |
What is the team for season 1911-12? | CREATE TABLE table_10556257_1 (team VARCHAR,season VARCHAR) | SELECT team FROM table_10556257_1 WHERE season = "1911-12" |
what is drug name of subject id 6983? | 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 demographic (subject_id text,hadm_id text,name text,marita... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.subject_id = "6983" |
Who was Dainty June when Boyd Gaines was Herbie? | CREATE TABLE table_52471 ("Productions" text,"Rose" text,"Louise" text,"Dainty June" text,"Herbie" text,"Director" text) | SELECT "Dainty June" FROM table_52471 WHERE "Herbie" = 'boyd gaines' |
Name the 2011 with 2010 of 1r and 2012 of sf | CREATE TABLE table_name_35 (Id VARCHAR) | SELECT 2011 FROM table_name_35 WHERE 2010 = "1r" AND 2012 = "sf" |
Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff. | CREATE TABLE staff (staff_name VARCHAR,staff_gender VARCHAR,staff_id VARCHAR)CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR,job_title_code VARCHAR) | SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Sales Person" EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code ... |
What is the Grid number for the Team from Italy? | CREATE TABLE table_name_87 (grid VARCHAR,team VARCHAR) | SELECT COUNT(grid) FROM table_name_87 WHERE team = "italy" |
Which room has the highest rate? List the room's full name, rate, check in and check out date. | CREATE TABLE rooms (roomid text,roomname text,beds number,bedtype text,maxoccupancy number,baseprice number,decor text)CREATE TABLE reservations (code number,room text,checkin text,checkout text,rate number,lastname text,firstname text,adults number,kids number) | SELECT T2.roomname, T1.rate, T1.checkin, T1.checkout FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid GROUP BY T1.room ORDER BY T1.rate DESC LIMIT 1 |
may i have a listing of flights from MILWAUKEE to TACOMA WASHINGTON departing in the evening | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name va... | 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, state 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... |
What is the average number conceded for hte team that had less than 19 points, played more than 18 games and had a position less than 10? | CREATE TABLE table_35521 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT AVG("Conceded") FROM table_35521 WHERE "Points" < '19' AND "Position" < '10' AND "Played" > '18' |
When 60 is the tries against what is the tries for? | CREATE TABLE table_17941032_1 (tries_for VARCHAR,tries_against VARCHAR) | SELECT tries_for FROM table_17941032_1 WHERE tries_against = "60" |
How many years was the building with 24 floors the tallest? | CREATE TABLE table_name_14 (years_as_tallest VARCHAR,floors VARCHAR) | SELECT years_as_tallest FROM table_name_14 WHERE floors = 24 |
Find the types of documents with more than 4 documents. | CREATE TABLE images (image_id number,image_alt_text text,image_name text,image_url text)CREATE TABLE functional_areas (functional_area_code text,parent_functional_area_code text,functional_area_description text)CREATE TABLE document_sections_images (section_id number,image_id number)CREATE TABLE document_functional_are... | SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4 |
Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them?, and show by the bar in ascending please. | CREATE TABLE AssignedTo (Scientist int,Project char(4))CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int)CREATE TABLE Scientists (SSN int,Name Char(30)) | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name |
Which Number stayed in Southeast has over 4,000 emigrated or forcibly removed? | CREATE TABLE table_6518 ("Nation" text,"Removal treaty (year signed)" text,"Years of major emigration" text,"Total number emigrated or forcibly removed" text,"Number stayed in Southeast" text,"Deaths from warfare" text) | SELECT "Number stayed in Southeast" FROM table_6518 WHERE "Total number emigrated or forcibly removed" = 'over 4,000' |
Which Team has Points of 15? | CREATE TABLE table_name_80 (team VARCHAR,points VARCHAR) | SELECT team FROM table_name_80 WHERE points = "15" |
Which venue has more than 9 against and a status of second test? | CREATE TABLE table_name_90 (venue VARCHAR,against VARCHAR,status VARCHAR) | SELECT venue FROM table_name_90 WHERE against > 9 AND status = "second test" |
I want to know the lowest week with a date of december 19, 2004 | CREATE TABLE table_57667 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT MIN("Week") FROM table_57667 WHERE "Date" = 'december 19, 2004' |
What is the hot 100 reaction in week of top 13 for Kanye West? | CREATE TABLE table_name_41 (hot_100_reaction VARCHAR,week VARCHAR,performer_s_ VARCHAR) | SELECT hot_100_reaction FROM table_name_41 WHERE week = "top 13" AND performer_s_ = "kanye west" |
How many delegates in each committee? Return a bar chart, and display by the y-axis in descending. | CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE county (County_Id int,County_name text,Population real,Zip_code text)CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroll... | SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY COUNT(Committee) DESC |
provide the number of patients whose primary disease is st elevated myocardial infarction\cardiac cath and admission year is less than 2135? | 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 demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2135" |
which wrestler lasted the least amount of time in part two of battle royal ? | CREATE TABLE table_203_277 (id number,"entered" number,"wrestler" text,"place" text,"eliminated by" text,"time" text) | SELECT "wrestler" FROM table_203_277 ORDER BY "time" LIMIT 1 |
what is the number of patients whose diagnoses short title is status autm crd dfbrltr and drug type is base? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" AND prescriptions.drug_type = "BASE" |
What was the smallest crowd at a game when Richmond was the away team? | CREATE TABLE table_56096 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MIN("Crowd") FROM table_56096 WHERE "Away team" = 'richmond' |
What is the average number for Northgate which commenced its construction before 1951? | CREATE TABLE table_name_42 (number_on_map INTEGER,name VARCHAR,construction_commenced VARCHAR) | SELECT AVG(number_on_map) FROM table_name_42 WHERE name = "northgate" AND construction_commenced < 1951 |
Which To par is of thomas aiken? | CREATE TABLE table_63613 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money (\u00a3)" text) | SELECT "To par" FROM table_63613 WHERE "Player" = 'thomas aiken' |
What is the lowest Rank when Attempts was 319, and the Year was larger than 2000? | CREATE TABLE table_name_46 (rank INTEGER,attempts VARCHAR,year VARCHAR) | SELECT MIN(rank) FROM table_name_46 WHERE attempts = 319 AND year > 2000 |
Whose Visitor has a Record of 10 11 5? | CREATE TABLE table_name_82 (visitor VARCHAR,record VARCHAR) | SELECT visitor FROM table_name_82 WHERE record = "10–11–5" |
Plot date of transaction by mean share count as a trend line, and I want to show from high to low by the x-axis. | CREATE TABLE Transactions_Lots (transaction_id INTEGER,lot_id INTEGER)CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction DATETIME,amount_of_transaction DECIMAL(19,4),share_count VARCHAR(40),other_details VARCHAR(255))CREATE TABLE Sales (sales_tran... | SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY date_of_transaction DESC |
What are the number of the dates of transactions with at least 100 share count or amount bigger than 100? | CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR(10),transaction_type_description VARCHAR(80))CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Investors (investor_id INTEGER,Inv... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 |
When My Name is Earl played at 8:00 what aired at 9:30? | CREATE TABLE table_42063 ("8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text) | SELECT "9:30" FROM table_42063 WHERE "8:00" = 'my name is earl' |
In what year was Martin Sheen nominated? | CREATE TABLE table_48931 ("Year" real,"Category" text,"President" text,"Nominee" text,"Film or Television Series or Miniseries" text) | SELECT "Year" FROM table_48931 WHERE "Nominee" = 'martin sheen' |
What is Administration of Oaths, when Rights of Audience is Yes, and when Reserved Instruments is Yes? | CREATE TABLE table_7690 ("Regulator" text,"Rights of audience" text,"Conduct of litigation" text,"Reserved instruments" text,"Probate activities" text,"Notarial activities" text,"Administration of oaths" text) | SELECT "Administration of oaths" FROM table_7690 WHERE "Rights of audience" = 'yes' AND "Reserved instruments" = 'yes' |
What females have males of 1 234? | CREATE TABLE table_name_21 (females VARCHAR,males VARCHAR) | SELECT females FROM table_name_21 WHERE males = "1 234" |
What is the Uyghur Latin with a population of 69,361? | CREATE TABLE table_name_14 (uyghur_latin___uly__ VARCHAR,population__2010_census_ VARCHAR) | SELECT uyghur_latin___uly__ FROM table_name_14 WHERE population__2010_census_ = "69,361" |
What is the date for the tournament McDonald's wpga championship? | CREATE TABLE table_2167226_3 (date VARCHAR,tournament VARCHAR) | SELECT date FROM table_2167226_3 WHERE tournament = "McDonald's WPGA Championship" |
Name the school/s with is size of 604. | CREATE TABLE table_1984697_85 (school VARCHAR,size VARCHAR) | SELECT school FROM table_1984697_85 WHERE size = 604 |
what was the first year that kid creole and the coconuts recorded with I Too Have Seen The Woods / Sire Records? | CREATE TABLE table_30418 ("Year" real,"Song (s)" text,"Producer (s)" text,"Written By" text,"Artist" text,"Title/Label" text) | SELECT MIN("Year") FROM table_30418 WHERE "Artist" = 'Kid Creole and the Coconuts' |
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 amount of job_id over the job_id , and group by attribute job_id by a bar chart, and sort y-axis in asc order. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCAT... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) |
what is the one thing patient 013-11660 was diagnosed with on this hospital visit for the last time? | 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 diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-11660' AND patient.hospitaldischargetime IS NULL)) ORDER BY d... |
how many patients are admitted before the year 2184 and used the drug fluoxetine hcl? | 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 demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2184" AND prescriptions.drug = "Fluoxetine HCl" |
What was the final score of the game on November 23, 2008? | CREATE TABLE table_39976 ("Week" real,"Date" text,"Time" text,"Opponent" text,"Result" text,"Game site" text,"Record" text) | SELECT "Result" FROM table_39976 WHERE "Date" = 'november 23, 2008' |
What is the smallest Attendance with H / A of h, and Opponents of nottingham forest? | CREATE TABLE table_12321 ("Date" text,"Opponents" text,"H / A" text,"Result F \u2013 A" text,"Attendance" real,"League position" text) | SELECT MIN("Attendance") FROM table_12321 WHERE "H / A" = 'h' AND "Opponents" = 'nottingham forest' |
Which gender has Years of 1 8, an Authority of state, a Roll less than 184, and a Name of matatoki school? | CREATE TABLE table_name_17 (gender VARCHAR,name VARCHAR,roll VARCHAR,years VARCHAR,authority VARCHAR) | SELECT gender FROM table_name_17 WHERE years = "1–8" AND authority = "state" AND roll < 184 AND name = "matatoki school" |
How many ranks have an industry of health care? | CREATE TABLE table_75243 ("Rank" real,"Name" text,"Headquarters" text,"Primary industry" text,"Market value (USD million)" real) | SELECT COUNT("Rank") FROM table_75243 WHERE "Primary industry" = 'health care' |
i'd like to have some information on a ticket from DENVER to PITTSBURGH and ATLANTA | CREATE TABLE code_description (code varchar,description text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,f... | 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, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_2.ci... |
What are the types of vocals that the band member with the first name 'Solveig' played the most? | CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE TABLE vocals (songid number,bandmate number,type text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE performance (songid number,bandmate number,s... | SELECT type FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1 |
For each position, what is the average number of points for players in that position Plot them as bar chart, I want to order x axis in asc order. | CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE competition_result (Competition_I... | SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY Position |
In 1970, what entrant had a cosworth v8 engine? | CREATE TABLE table_79747 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Entrant" FROM table_79747 WHERE "Engine" = 'cosworth v8' AND "Year" = '1970' |
What was the rank of flori lang when his time was less than 22.27 | CREATE TABLE table_64754 ("Rank" real,"Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" real) | SELECT SUM("Rank") FROM table_64754 WHERE "Name" = 'flori lang' AND "Time" < '22.27' |
What was the score of the game on February 8? | CREATE TABLE table_9944 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Score" FROM table_9944 WHERE "Date" = 'february 8' |
How many golds for west germany with over 8 total? | CREATE TABLE table_15533 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Gold") FROM table_15533 WHERE "Nation" = 'west germany' AND "Total" > '8' |
What is the 2008 population in (Ham Hyung)? | CREATE TABLE table_name_55 (population__2008_ INTEGER,korean VARCHAR) | SELECT SUM(population__2008_) FROM table_name_55 WHERE korean = "함흥" |
how many of the male patients received rosiglitazone maleate for treatment. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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.gender = "M" AND prescriptions.drug = "Rosiglitazone Maleate" |
What was the arrival time of the train that departed at 18.16? | CREATE TABLE table_18365784_3 (arrival VARCHAR,departure VARCHAR) | SELECT arrival FROM table_18365784_3 WHERE departure = "18.16" |
Which team did they play at Rich Stadium? | CREATE TABLE table_14423274_3 (opponent VARCHAR,game_site VARCHAR) | SELECT opponent FROM table_14423274_3 WHERE game_site = "Rich Stadium" |
What day is carlton the home side? | CREATE TABLE table_57965 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_57965 WHERE "Home team" = 'carlton' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.