instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
who is at the top of the chart ? | CREATE TABLE table_204_234 (id number,"round" text,"100 yd (91 m)" text,"80 yd (73 m)" text,"60 yd (55 m)" text,"50 yd (46 m)" text,"40 yd (37 m)" text) | SELECT "round" FROM table_204_234 ORDER BY id LIMIT 1 |
How many games did they play when their record 0-2-0? | CREATE TABLE table_21058823_1 (date VARCHAR,record VARCHAR) | SELECT COUNT(date) FROM table_21058823_1 WHERE record = "0-2-0" |
how many passengers can a BOEING 737 hold | CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE food_service (meal_code tex... | SELECT DISTINCT aircraft_code FROM aircraft WHERE basic_type = '737' AND manufacturer = 'BOEING' |
how many players had a transfer fee of at least 8 million ? | CREATE TABLE table_203_440 (id number,"rank" number,"player" text,"from" text,"to" text,"transfer fee\n(\u20ac million)" number,"year" number) | SELECT COUNT("player") FROM table_203_440 WHERE "transfer fee\n(\u20ac million)" >= 8 |
What Career has a Super G of 5, and a Combined of 6? | CREATE TABLE table_78835 ("Country" text,"Career" text,"Victories" real,"Super G" text,"Giant Slalom" text,"Slalom" text,"Combined" text,"Parallel" text) | SELECT "Career" FROM table_78835 WHERE "Super G" = '5' AND "Combined" = '6' |
Bar chart of mean stu gpa from each dept code, sort in descending by the total number. | CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE ENROLL (CLASS_CODE varchar(5),STU_NUM int,ENROLL_GRADE varchar(50))CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,S... | SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY AVG(STU_GPA) DESC |
What is the Director for the episode titled some lapse of time ? | CREATE TABLE table_name_85 (director VARCHAR,title VARCHAR) | SELECT director FROM table_name_85 WHERE title = "“some lapse of time”" |
Which sport resulted in a gold medal in the 2000 Sydney games? | CREATE TABLE table_name_41 (sport VARCHAR,medal VARCHAR,games VARCHAR) | SELECT sport FROM table_name_41 WHERE medal = "gold" AND games = "2000 sydney" |
when did patient 004-79017 last got the maximum of respiration on the current icu visit? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017') AND patient.unitdischargetime IS NULL) ... |
Who directed the episode with an audience of 14.11 million? | CREATE TABLE table_29979 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Directed by" FROM table_29979 WHERE "U.S. viewers (million)" = '14.11' |
For upper level elective classes offered next semester , which ones do n't meet on Fridays ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments ... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ... |
List all the directors of movies about nuclear weapons | CREATE TABLE made_by (id int,msid int,pid int)CREATE TABLE genre (gid int,genre text)CREATE TABLE tags (id int,msid int,kid int)CREATE TABLE movie (mid int,title text,release_year int,title_aka text,budget text)CREATE TABLE writer (wid int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TAB... | SELECT director.name FROM directed_by, director, keyword, movie, tags WHERE director.did = directed_by.did AND keyword.keyword = 'nuclear weapons' AND movie.mid = directed_by.msid AND tags.kid = keyword.id AND tags.msid = movie.mid |
what are the top three most common drugs prescribed to patients within 2 months after antihypertensives - labetalol? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayi... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antihypertensives - labetalol') AS t1 JOIN (SELECT... |
Show the number of games for each home team in a bar chart, sort by the y-axis in desc please. | CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team text,Score text,Competition text)CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendan... | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY COUNT(Home_team) DESC |
Is there an MCDB 680 section on any day other than Monday next semester ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time... | SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'MCDB' AND course.number = 680 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.y... |
What is Fleet Number(s), when Wheel Arrangement is '2-6-0', and when Class is 'Z'? | CREATE TABLE table_9752 ("Class" text,"Wheel arrangement" text,"Fleet number(s)" text,"Quantity made" text,"Quantity preserved" text) | SELECT "Fleet number(s)" FROM table_9752 WHERE "Wheel arrangement" = '2-6-0' AND "Class" = 'z' |
What is the lowest episode number with an original airdate on 8 June 2008? | CREATE TABLE table_47551 ("Episode" real,"Original airdate" text,"Timeslot (approx.)" text,"Viewers (millions)" real,"Nightly rank" text) | SELECT MIN("Episode") FROM table_47551 WHERE "Original airdate" = '8 june 2008' |
which communes have a population above 30,000 ? | CREATE TABLE table_203_413 (id number,"rank" text,"city" text,"population" number,"area\n(km2)" number,"density\n(inhabitants/km2)" number,"altitude\n(mslm)" number) | SELECT "city" FROM table_203_413 WHERE "population" > 30000 |
How many cable channels have callsign CBFT-DT? | CREATE TABLE table_63927 ("Call sign" text,"Broadcast channel" real,"Digital PSIP" real,"Cable channel" real,"Network" text) | SELECT COUNT("Cable channel") FROM table_63927 WHERE "Call sign" = 'cbft-dt' |
Which Top 10 is the lowest one that has Winnings of $405,300, and an Avg Start smaller than 30? | CREATE TABLE table_name_86 (top_10 INTEGER,winnings VARCHAR,avg_start VARCHAR) | SELECT MIN(top_10) FROM table_name_86 WHERE winnings = "$405,300" AND avg_start < 30 |
how many days have elapsed since the last time patient 022-187132 had an intake of po reg diet on the current icu visit? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealths... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 =... |
What are the details of all organizations that are described as Sponsors and sort the results in ascending order? | CREATE TABLE research_staff (staff_id number,employer_organisation_id number,staff_details text)CREATE TABLE organisation_types (organisation_type text,organisation_type_description text)CREATE TABLE project_staff (staff_id number,project_id number,role_code text,date_from time,date_to time,other_details text)CREATE TA... | SELECT organisation_details FROM organisations AS T1 JOIN organisation_types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details |
all right do you have a flight from WASHINGTON to BOSTON that stops in PHILADELPHIA | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stop... | 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 = 'BOSTON' AND CITY_2.cit... |
what is the drug code and route for the drug propafenone hcl? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Propafenone HCl" |
The episode with the no. 54, directed by Charles Haid, is written by who? | CREATE TABLE table_28788 ("No." real,"#" real,"Title" text,"Directed by" text,"Written by" text,"Patient Portrayer" text,"Original air date" text,"Production code" text) | SELECT "Written by" FROM table_28788 WHERE "Directed by" = 'Charles Haid' AND "No." = '54' |
On what dates were employees without the letter M in their first names hired, and count them by a bar chart | 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 job_history (EMPLOYEE_ID decimal(6,0)... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' |
What is the record when the game was played at raymond james stadium? | CREATE TABLE table_name_46 (record VARCHAR,game_site VARCHAR) | SELECT record FROM table_name_46 WHERE game_site = "raymond james stadium" |
most reputation user from sri lanka. | 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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%sri lanka%' ORDER BY Reputation DESC |
specify the total number of male patients having incisional ventral hernia with obstruction. | 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.gender = "M" AND diagnoses.long_title = "Incisional ventral hernia with obstruction" |
How many categories of new entries this round are there for the fourth round proper? | CREATE TABLE table_17814838_1 (new_entries_this_round VARCHAR,round VARCHAR) | SELECT COUNT(new_entries_this_round) FROM table_17814838_1 WHERE round = "Fourth round Proper" |
What are the electric companies drawing power from Itaipu? | CREATE TABLE table_22766 ("Entities" text,"Country" text,"Supply point" text,"Voltage (kV)" real,"Power (MW)" real) | SELECT "Entities" FROM table_22766 WHERE "Supply point" = 'Itaipu' |
Show the average room count of the apartments that have booking status code 'Provisional'. | CREATE TABLE guests (guest_id number,gender_code text,guest_first_name text,guest_last_name text,date_of_birth time)CREATE TABLE view_unit_status (apt_id number,apt_booking_id number,status_date time,available_yn others)CREATE TABLE apartment_bookings (apt_booking_id number,apt_id number,guest_id number,booking_status_... | SELECT AVG(room_count) FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" |
What week was October 9, 1938? | CREATE TABLE table_55737 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT COUNT("Week") FROM table_55737 WHERE "Date" = 'october 9, 1938' |
What is the episode number of the episode titled 'Threshold of Pain'? | CREATE TABLE table_11011 ("Episode #" text,"Title" text,"Directed by" text,"Written by" text,"Original airdate" text) | SELECT "Episode #" FROM table_11011 WHERE "Title" = 'threshold of pain' |
Which Laps have a Time/Retired of +23.215, and a Grid larger than 11? | CREATE TABLE table_76655 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT MIN("Laps") FROM table_76655 WHERE "Time/Retired" = '+23.215' AND "Grid" > '11' |
Find All_Home and Team_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and order in desc by the x axis. | 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, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC |
Which city does student Linda Smith live in? | CREATE TABLE visits_restaurant (stuid number,resid number,time time,spent number)CREATE TABLE restaurant_type (restypeid number,restypename text,restypedescription text)CREATE TABLE type_of_restaurant (resid number,restypeid number)CREATE TABLE restaurant (resid number,resname text,address text,rating number)CREATE TAB... | SELECT city_code FROM student WHERE fname = "Linda" AND lname = "Smith" |
What is the mpg-UK urban (cold) for a fuel type of diesel, extraurban MPG in the UK over 68.9, engine capacity of 1422, and L/100km urban (cold) over 5.1? | CREATE TABLE table_name_8 (mpg_uk_urban__cold_ VARCHAR,l_100km_urban__cold_ VARCHAR,engine_capacity VARCHAR,fuel_type VARCHAR,mpg_uk_extra_urban VARCHAR) | SELECT mpg_uk_urban__cold_ FROM table_name_8 WHERE fuel_type = "diesel" AND mpg_uk_extra_urban > 68.9 AND engine_capacity = 1422 AND l_100km_urban__cold_ > 5.1 |
When 1546 is inns of court and chancery what is the finsbury division? | CREATE TABLE table_20952 ("Year" real,"Edmonton Hundred" real,"Elthorne Hundred" real,"Gore Hundred" real,"Isleworth Hundred" real,"Holborn Division" real,"Finsbury Division" real,"Kensington Division" real,"Tower Division" real,"Spelthorne Hundred" real,"Within the Walls" real,"Without the Walls" real,"Inns of Court a... | SELECT "Finsbury Division" FROM table_20952 WHERE "Inns of Court and Chancery" = '1546' |
A bar chart for what are the number of the category of music festivals with result 'Awarded'?, and I want to order by the X-axis from high to low. | CREATE TABLE artist (Artist_ID int,Artist text,Age int,Famous_Title text,Famous_Release_date text)CREATE TABLE volume (Volume_ID int,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID int)CREATE TABLE music_festival (ID int,Music_Festival text,Date_of_ceremony text,Category text,Volume int,Result t... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category DESC |
how many patients was given endo polpectomy lrge int since 2 years ago for two times? | CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid nu... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 = 'endo polpectomy lrge ... |
What is the date that the away team scored 4.7 (31)? | CREATE TABLE table_11735 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_11735 WHERE "Away team score" = '4.7 (31)' |
what is the total number of nations that participated in the beach games of 2012 ? | CREATE TABLE table_203_165 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT COUNT("nation") FROM table_203_165 |
What rank was the country with no bronze but at least 1 silver medals? | CREATE TABLE table_name_57 (rank INTEGER,bronze VARCHAR,silver VARCHAR) | SELECT AVG(rank) FROM table_name_57 WHERE bronze < 1 AND silver > 1 |
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time. | 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 (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE employees (EMP... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
what was the last ward id that patient 27739 went since 3 years ago? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,war... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27739) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY transfers.intime DESC LIMIT 1 |
count the number of patients whose diagnosis long title is phlebitis and thrombophlebitis of superficial veins of upper extremities and lab test abnormal status is abnormal. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Phlebitis and thrombophlebitis of superficial veins of upper extremities" AND lab.flag = "abnormal" |
Is there a list for next semester of 300 -level courses being offered ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE gsi (course_offering_id in... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester... |
Which Frequency MHz has an ERP W larger than 4, and a Call sign of w218ap? | CREATE TABLE table_35480 ("Call sign" text,"Frequency MHz" text,"City of license" text,"ERP W" real,"FCC info" text) | SELECT "Frequency MHz" FROM table_35480 WHERE "ERP W" > '4' AND "Call sign" = 'w218ap' |
Give me a pie to show the total number from different location code. | CREATE TABLE Documents_to_be_Destroyed (Document_ID INTEGER,Destruction_Authorised_by_Employee_ID INTEGER,Destroyed_by_Employee_ID INTEGER,Planned_Destruction_Date DATETIME,Actual_Destruction_Date DATETIME,Other_Details VARCHAR(255))CREATE TABLE Employees (Employee_ID INTEGER,Role_Code CHAR(15),Employee_Name VARCHAR(25... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code |
Find names of instructors with salary greater than that of some (at least one) instructor in the Biology department. | CREATE TABLE classroom (building text,room_number text,capacity number)CREATE TABLE instructor (id text,name text,dept_name text,salary number)CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE department (dept_name text,building text,budget number)CREATE TABLE advisor (s_id text,i_id text)CREATE TABLE tim... | SELECT name FROM instructor WHERE salary > (SELECT MIN(salary) FROM instructor WHERE dept_name = 'Biology') |
What is the rank by average where the total was larger than 245 and the average was 27.1 with fewer than 15 dances? | CREATE TABLE table_77663 ("Rank by average" real,"Place" real,"Couple" text,"Total" real,"Number of dances" real,"Average" real) | SELECT AVG("Rank by average") FROM table_77663 WHERE "Total" > '245' AND "Average" = '27.1' AND "Number of dances" < '15' |
What is the 1993 finish for the event that had a 1990 of QF and 1995 of 2R? | CREATE TABLE table_name_44 (Id VARCHAR) | SELECT 1993 FROM table_name_44 WHERE 1990 = "qf" AND 1995 = "2r" |
What was the margin in 2001 at the McDonald's LPGA Championship? | CREATE TABLE table_name_88 (margin VARCHAR,year VARCHAR,championship VARCHAR) | SELECT margin FROM table_name_88 WHERE year = 2001 AND championship = "mcdonald's lpga championship" |
What Winning Jockey ran in the Tampa Bay Downs Track on Winning Horse Barkley Sound? | CREATE TABLE table_10940 ("Date" text,"Track" text,"Race" text,"Distance" text,"Purse (US$)" text,"Surface track" text,"Winning horse" text,"Winning jockey" text) | SELECT "Winning jockey" FROM table_10940 WHERE "Track" = 'tampa bay downs' AND "Winning horse" = 'barkley sound' |
Name the average population hervey bay with population maryborough more than 11,415 and population region total less than 48,308 and population tiaro less than 2,066 and population woocoo of 491 | CREATE TABLE table_68365 ("Year" real,"Population (Region total)" real,"Population (Maryborough)" real,"Population (Hervey Bay)" real,"Population (Woocoo)" real,"Population (Tiaro)" real) | SELECT AVG("Population (Hervey Bay)") FROM table_68365 WHERE "Population (Maryborough)" > '11,415' AND "Population (Region total)" < '48,308' AND "Population (Tiaro)" < '2,066' AND "Population (Woocoo)" = '491' |
if the estimated exposure ( mrem )/hr* is 0.28, what is the specimen weight/size? | CREATE TABLE table_28430 ("Specimen weight/size" text,"Calculated activity (Bq)" real,"Calculated activity (Ci)" text,"Estimated activity GR(api)" text,"Estimated exposure (mRem)/hr*" text) | SELECT COUNT("Specimen weight/size") FROM table_28430 WHERE "Estimated exposure ( mRem )/hr*" = '0.28' |
Which Outcome has an Opponent in the final of simone colombo? | CREATE TABLE table_name_43 (outcome VARCHAR,opponent_in_the_final VARCHAR) | SELECT outcome FROM table_name_43 WHERE opponent_in_the_final = "simone colombo" |
Find the name of the genre that is most frequent across all tracks. | CREATE TABLE playlisttrack (playlistid number,trackid number)CREATE TABLE invoice (invoiceid number,customerid number,invoicedate time,billingaddress text,billingcity text,billingstate text,billingcountry text,billingpostalcode text,total number)CREATE TABLE album (albumid number,title text,artistid number)CREATE TABLE... | SELECT T1.name FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid GROUP BY T2.genreid ORDER BY COUNT(*) DESC LIMIT 1 |
Who attracted the most people into the system. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE T... | WITH FirstQuestions AS (SELECT OwnerUserId, RANK() OVER (PARTITION BY OwnerUserId ORDER BY Id) AS Rank, PostTypeId, AcceptedAnswerId FROM Posts WHERE NOT OwnerUserId IS NULL), AttractedUsers AS (SELECT A.OwnerUserId, COUNT(*) AS Count FROM FirstQuestions, Posts AS A WHERE FirstQuestions.Rank = 1 AND FirstQuestions.Acce... |
What is the Place, when the Player is Chris Dimarco? | CREATE TABLE table_41296 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Place" FROM table_41296 WHERE "Player" = 'chris dimarco' |
what are the average daily number of patients diagnosed with s/p vascular bypass since 5 years ago? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender ... | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 's/p vascular bypass' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1 |
What is the highest lane for the poland swimmer who ranked under 6? | CREATE TABLE table_13822 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT MAX("Lane") FROM table_13822 WHERE "Rank" < '6' AND "Nationality" = 'poland' |
What are the category of music festivals with result 'Awarded', and count them by a bar chart, and show by the Y-axis from high to low. | CREATE TABLE artist (Artist_ID int,Artist text,Age int,Famous_Title text,Famous_Release_date text)CREATE TABLE music_festival (ID int,Music_Festival text,Date_of_ceremony text,Category text,Volume int,Result text)CREATE TABLE volume (Volume_ID int,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID ... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) DESC |
When did the staff member named Janessa Sawayn join the company? | CREATE TABLE vehicles (vehicle_id number,vehicle_details text)CREATE TABLE lessons (lesson_id number,customer_id number,lesson_status_code text,staff_id number,vehicle_id number,lesson_date time,lesson_time text,price number)CREATE TABLE staff (staff_id number,staff_address_id number,nickname text,first_name text,middl... | SELECT date_joined_staff FROM staff WHERE first_name = "Janessa" AND last_name = "Sawayn" |
What is the finale number ranked at number 7? | CREATE TABLE table_22888 ("Rank" real,"English title" text,"Chinese title" text,"Average" real,"Peak" real,"Premiere" real,"Finale" real,"HK viewers" text) | SELECT "Finale" FROM table_22888 WHERE "Rank" = '7' |
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 manager_id , and show from low to high by the x-axis. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUM... | SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER |
provide the number of patients whose admission location is emergency room admit and procedure icd9 code is 14. | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.icd9_code = "14" |
-- Most popular StackOverflow tags in 2013. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)... | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank2013, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId A... |
What is the division in the season with 13 tms and pos smaller than 8? | CREATE TABLE table_33055 ("Season" real,"Division" real,"Tms." real,"Pos." real,"FA Cup" text) | SELECT COUNT("Division") FROM table_33055 WHERE "Tms." = '13' AND "Pos." < '8' |
What is the power in KW that has a station type of relay and a callsign of DXCL-TV? | CREATE TABLE table_27057 ("Branding" text,"Callsign" text,"Ch. #" text,"Power kW" text,"Station Type" text,"Location (Transmitter site)" text) | SELECT "Power kW" FROM table_27057 WHERE "Station Type" = 'Relay' AND "Callsign" = 'DXCL-TV' |
Which charts had debut sales of of more than 339333.011497678? | CREATE TABLE table_2783 ("Release" text,"Oricon Albums Chart" text,"Peak Position" real,"Debut Sales (copies)" real,"Sales Total (copies)" real,"Chart Run" text) | SELECT "Oricon Albums Chart" FROM table_2783 WHERE "Debut Sales (copies)" > '339333.011497678' |
how many hours had it been since the first procedure patient 032-21820 received on the current hospital visit? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna... | SELECT 24 * (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 = '032-21820... |
What race was won by Tazio Nuvolari? | CREATE TABLE table_32012 ("Name" text,"Circuit" text,"Date" text,"Winning drivers" text,"Winning constructor" text,"Report" text) | SELECT "Name" FROM table_32012 WHERE "Winning drivers" = 'tazio nuvolari' |
how many patients whose ethnicity is white and item id is 51078? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.itemid = "51078" |
What was the rank with the qual of 115.095? | CREATE TABLE table_80300 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real) | SELECT "Rank" FROM table_80300 WHERE "Qual" = '115.095' |
What is the title of every song, and how many weeks was each song at #1 for Rihanna in 2012? | CREATE TABLE table_19542477_9 (song_s__—_weeks VARCHAR,issue_years VARCHAR,artist_s_ VARCHAR) | SELECT song_s__—_weeks FROM table_19542477_9 WHERE issue_years = 2012 AND artist_s_ = "Rihanna" |
What is the highest to par of the player from the United States with a t3 place and a 74-73-72-69=288 place? | CREATE TABLE table_50496 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" text) | SELECT MAX("To par") FROM table_50496 WHERE "Country" = 'united states' AND "Place" = 't3' AND "Score" = '74-73-72-69=288' |
what was the first value of the anion gap lab test of patient 30525 during the last hospital visit. | 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 cost (row_id number,subject_id number,hadm_id number,event_typ... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30525 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '... |
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 first_name and manager_id . | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_P... | SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
what was the last hospital admission time in which patient 006-57924 was admitted via the emergency department? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patient... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-57924' AND patient.hospitaladmitsource = 'emergency department' ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
What's the record that had an opponent of Krzysztof Soszynski and a time of 4:00? | CREATE TABLE table_13266 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Record" FROM table_13266 WHERE "Time" = '4:00' AND "Opponent" = 'krzysztof soszynski' |
Around what time frame release a Sampling Rate of 12-bit 40khz? | CREATE TABLE table_name_63 (release_date INTEGER,sampling_rate VARCHAR) | SELECT SUM(release_date) FROM table_name_63 WHERE sampling_rate = "12-bit 40khz" |
What is the highest crowd at arden street oval? | CREATE TABLE table_32319 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MAX("Crowd") FROM table_32319 WHERE "Venue" = 'arden street oval' |
A bar chart shows how many locations, list by the the number of location from high to low. | CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train_station (Train_ID int,Station_ID int)CREATE TABLE train (Train_ID int,Name text,Time text,Service text) | SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY COUNT(Location) DESC |
What kind of IATA has an Airport of hamburg airport? | CREATE TABLE table_7003 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "IATA" FROM table_7003 WHERE "Airport" = 'hamburg airport' |
i need to fly from ST. LOUIS to MILWAUKEE on wednesday afternoon | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_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_discounts text)CREATE ... | SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYalias0.year = 1991)) AND to... |
What is the Home team with Away team score of 15.9 (99)? | CREATE TABLE table_54552 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_54552 WHERE "Away team score" = '15.9 (99)' |
How many values of Other A correspond to Tommy Johnson Category:Articles with hCards? | CREATE TABLE table_14962287_2 (other_a VARCHAR,name VARCHAR) | SELECT COUNT(other_a) FROM table_14962287_2 WHERE name = "Tommy Johnson Category:Articles with hCards" |
What couple had a vote percentage of 7.691% | CREATE TABLE table_19744915_15 (couple VARCHAR,vote_percentage VARCHAR) | SELECT couple FROM table_19744915_15 WHERE vote_percentage = "7.691%" |
Who is the home team that played at MCG? | CREATE TABLE table_53001 ("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_53001 WHERE "Venue" = 'mcg' |
What are the debut year for wrestlers born in Nara? | CREATE TABLE table_1557974_1 (debut VARCHAR,birthplace VARCHAR) | SELECT debut FROM table_1557974_1 WHERE birthplace = "Nara" |
how has patient 27177 last visited the hospital since 2 years ago? | 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,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,s... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 27177 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY admissions.admittime DESC LIMIT 1 |
is there a microbiology test result in this month for patient 13054's sputum? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,ge... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13054) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 m... |
Which season has more than 5 episodes each 159 minutes in length? | CREATE TABLE table_name_12 (season VARCHAR,episode_count VARCHAR,time_length VARCHAR) | SELECT season FROM table_name_12 WHERE episode_count > 5 AND time_length = "159 minutes" |
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by weekday, sort by the Y-axis in desc. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC |
Show average of budget in each year and bin creation time by year in a line chart, and could you display by the X-axis in asc? | CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real)CREATE TABLE head (head_ID int,name text,born_state text,age real) | SELECT Creation, AVG(Budget_in_Billions) FROM department ORDER BY Creation |
What is the first party for Lord John Hay earlier than 1857? | CREATE TABLE table_60784 ("Year" real,"First member" text,"First party" text,"Second member" text,"Second party" text) | SELECT "First party" FROM table_60784 WHERE "Year" < '1857' AND "First member" = 'lord john hay' |
Which champion has sentosa golf club as the tournament location? | CREATE TABLE table_name_55 (champion VARCHAR,tournament_location VARCHAR) | SELECT champion FROM table_name_55 WHERE tournament_location = "sentosa golf club" |
Name the most attendance for november 17, 1946 and week more than 8 | CREATE TABLE table_34509 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT MAX("Attendance") FROM table_34509 WHERE "Date" = 'november 17, 1946' AND "Week" > '8' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.