instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
For those records from the products and each product's manufacturer, find headquarter and the amount of headquarter , and group by attribute headquarter, and visualize them by a bar chart, and sort in asc by the X-axis. | 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 Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter |
What is the number of start date of each apartment booking for each year? Return a bar chart, rank by the Y in descending. | CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt_number CHAR(10),bathroom_count INTEGER,bedroom_count INTEGER,r... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_date) DESC |
when patient 31615 was first discharged from the hospital since 1 year ago? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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_cod... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 31615 AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.dischtime LIMIT 1 |
What award did the film Ozone win? | CREATE TABLE table_79931 ("Film" text,"Director(s)" text,"Recipient" text,"Date" text,"Award" text) | SELECT "Award" FROM table_79931 WHERE "Film" = 'ozone' |
What is the record for November 26, with the decision made by Prusek? | CREATE TABLE table_67270 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT "Record" FROM table_67270 WHERE "Decision" = 'prusek' AND "Date" = 'november 26' |
Top stackoverflow users from Lebanon. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Lubnan%' ORDER BY Reputation DESC |
Rep gained by asking a duplicate. http://meta.stackexchange.com/questions/237286/how-to-find-data-on-dupes-in-sp | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId num... | SELECT * FROM Tags WHERE TagName LIKE 'reg%' |
What was the outcome when Jing-Jing Lu was the opponent? | CREATE TABLE table_name_81 (outcome VARCHAR,opponent VARCHAR) | SELECT outcome FROM table_name_81 WHERE opponent = "jing-jing lu" |
what is the number of patients whose admission year is less than 2144 and diagnoses short title is hypoxemia? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.short_title = "Hypoxemia" |
What kind of competition had an attendance of more than 914 people and the Wightlink Raiders as an opponent? | CREATE TABLE table_name_52 (competition VARCHAR,attendance VARCHAR,opponent VARCHAR) | SELECT competition FROM table_name_52 WHERE attendance > 914 AND opponent = "wightlink raiders" |
What was the 1980-1981 team of the player born in Warroad, Minnesota? | CREATE TABLE table_name_22 (birthplace VARCHAR) | SELECT 1980 AS _1981_team FROM table_name_22 WHERE birthplace = "warroad, minnesota" |
What is the score of the game that was a loss to Dotson (2-3)? | CREATE TABLE table_68605 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Score" FROM table_68605 WHERE "Loss" = 'dotson (2-3)' |
what was the last value of the temperature c (calc) of patient 2518 today? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id numb... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatur... |
What was the winning score of the Valero Texas Open? | CREATE TABLE table_name_99 (winning_score VARCHAR,tournament VARCHAR) | SELECT winning_score FROM table_name_99 WHERE tournament = "valero texas open" |
What is the part 3 of the word in class 7a? | CREATE TABLE table_72909 ("Class" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Verb meaning" text) | SELECT "Part 3" FROM table_72909 WHERE "Class" = '7a' |
5 Hoops larger than 19.325, and a Total of 39.4, and a Place larger than 2 had what total number of 3 balls and 2 ribbons? | CREATE TABLE table_38206 ("Place" real,"Nation" text,"5 Hoops" real,"3 Balls,2 Ribbons" real,"Total" real) | SELECT COUNT("3 Balls, 2 Ribbons") FROM table_38206 WHERE "5 Hoops" > '19.325' AND "Total" = '39.4' AND "Place" > '2' |
who is the incumbent for district mississippi 4 | CREATE TABLE table_18704 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Incumbent" FROM table_18704 WHERE "District" = 'Mississippi 4' |
Which team scored less than 35 points? | CREATE TABLE table_name_78 (team VARCHAR,points INTEGER) | SELECT team FROM table_name_78 WHERE points < 35 |
What is the lowest week that has 7:15 p.m. as the time (cst) and fedexfield as the game site? | CREATE TABLE table_41825 ("Week" real,"Date" text,"Time (CST)" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"NFL Recap" text) | SELECT MIN("Week") FROM table_41825 WHERE "Time (CST)" = '7:15 p.m.' AND "Game site" = 'fedexfield' |
What engine has g tyres and is driven by elio de angelis? | CREATE TABLE table_57348 ("Constructor" text,"Chassis" text,"Engine" text,"Tyres" text,"Driver" text,"Rounds" text) | SELECT "Engine" FROM table_57348 WHERE "Tyres" = 'g' AND "Driver" = 'elio de angelis' |
Find Nationality and the sum of meter_100 , and group by attribute Nationality, and visualize them by a bar chart, and rank from low to high by the Y-axis. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100) |
Show the company name with the number of gas station Show bar chart, rank in descending by the y-axis please. | CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value real)CREATE TABL... | SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY COUNT(*) DESC |
What was the points againt when played is played? | CREATE TABLE table_12828723_5 (points_against VARCHAR) | SELECT points_against FROM table_12828723_5 WHERE "played" = "played" |
What is China's IATA? | CREATE TABLE table_name_58 (iata VARCHAR,country VARCHAR) | SELECT iata FROM table_name_58 WHERE country = "china" |
What is Score, when Player is 'David Toms'? | CREATE TABLE table_61914 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_61914 WHERE "Player" = 'david toms' |
What s the format for the catalog nebcd058? | CREATE TABLE table_7554 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Format" FROM table_7554 WHERE "Catalog" = 'nebcd058' |
when is the hire date for those employees whose first name does not containing the letter M, and count them by a bar chart, rank from high to low by the total number. | CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),R... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY COUNT(HIRE_DATE) DESC |
What percentage of people in 2011 had a mother tongue that was shared by less than 8,085 in 2006 and less than 145 in 2011? | CREATE TABLE table_65784 ("Mother Tongue" text,"Population (2006)" real,"Percentage (2006)" text,"Population (2011)" real,"Percentage (2011)" text) | SELECT "Percentage (2011)" FROM table_65784 WHERE "Population (2006)" < '8,085' AND "Population (2011)" < '145' |
For those records from the products and each product's manufacturer, find name and revenue , and group by attribute headquarter, and visualize them by a bar chart. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name |
What is listed in p when the type is listed as free agent 1? | CREATE TABLE table_17634290_7 (p VARCHAR,type VARCHAR) | SELECT p FROM table_17634290_7 WHERE type = "Free agent 1" |
What's the target for the brand mylotarg? | CREATE TABLE table_name_96 (target VARCHAR,brand_name VARCHAR) | SELECT target FROM table_name_96 WHERE brand_name = "mylotarg" |
what was the total number of positions in the 125cc classification ? | CREATE TABLE table_204_214 (id number,"pos" text,"no." number,"rider" text,"manufacturer" text,"laps" number,"time/retired" text,"grid" number,"points" number) | SELECT COUNT("pos") FROM table_204_214 |
Users who post longest answers. Statistical summary of users who like to post long answers.
Filters for users above a minimal post count.
(Fixed to have user links and shorter column names.) | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera... | SELECT Rank = ROW_NUMBER() OVER (ORDER BY AVG(LENGTH(p.Body)) DESC), 'user_link' = p.OwnerUserId, Posts = COUNT(*), LengthAvg = AVG(LENGTH(p.Body)), LengthMax = MAX(LENGTH(p.Body)), LengthStDev = CAST(STDEV(LENGTH(p.Body)) AS INT), LengthTotal = SUM(LENGTH(p.Body)), Reputation = MIN(u.Reputation), RepPer1000Char = CAST... |
in the drum module td-5 what are the tom-tom pads | CREATE TABLE table_2889300_6 (tom_tom_pads VARCHAR,drum_module VARCHAR) | SELECT tom_tom_pads FROM table_2889300_6 WHERE drum_module = "TD-5" |
What is the releases number under Season 2? | CREATE TABLE table_16279520_1 (release VARCHAR,timeline VARCHAR) | SELECT release FROM table_16279520_1 WHERE timeline = "Season 2" |
What is the format for the station owned by Dakota Broadcasting? | CREATE TABLE table_29302 ("Frequency" text,"Call sign" text,"Name" text,"Format" text,"Owner" text,"Target city/ market" text,"City of license" text) | SELECT "Format" FROM table_29302 WHERE "Owner" = 'Dakota Broadcasting' |
Return a histogram on what are the different role codes for users, and how many users have each?, and show y-axis from high to low order. | CREATE TABLE Document_Sections (section_id INTEGER,document_code VARCHAR(15),section_sequence INTEGER,section_code VARCHAR(20),section_title VARCHAR(80))CREATE TABLE Images (image_id INTEGER,image_alt_text VARCHAR(80),image_name VARCHAR(40),image_url VARCHAR(255))CREATE TABLE Document_Sections_Images (section_id INTEGE... | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY COUNT(*) DESC |
What class year was Vencie Glenn from? | CREATE TABLE table_22982552_9 (class_year INTEGER,player VARCHAR) | SELECT MIN(class_year) FROM table_22982552_9 WHERE player = "Vencie Glenn" |
provide the number of patients whose diagnosis short title is dmi keto nt st uncontrolled and lab test category is blood gas. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "DMI keto nt st uncntrld" AND lab."CATEGORY" = "Blood Gas" |
Which weightlifter, who had a bodyweight of less than 136.16 and a clean and jerk larger than 135, had the highest Total? | CREATE TABLE table_name_43 (total__kg_ INTEGER,bodyweight VARCHAR,clean_ VARCHAR,_jerk VARCHAR) | SELECT MAX(total__kg_) FROM table_name_43 WHERE bodyweight < 136.16 AND clean_ & _jerk > 135 |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and department_id in a bar chart, and could you show by the names from high to low? | 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, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC |
Will next semester 's offerings include DENT 753 ? | CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'DENT' AND course.number = 753 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
Show me about the distribution of name and meter_100 in a bar chart, show by the X-axis in desc. | CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadiu... | SELECT name, meter_100 FROM swimmer ORDER BY name DESC |
who were the director of the episode whose number in the season is 17? | CREATE TABLE table_27622417_1 (directed_by VARCHAR,no_in_season VARCHAR) | SELECT directed_by FROM table_27622417_1 WHERE no_in_season = 17 |
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of first_name and department_id , and show in descending by the DEPARTMENT_ID. | 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 FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC |
On what date was the Record 41 32 6? | CREATE TABLE table_78729 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text,"Arena" text,"Points" real) | SELECT "Date" FROM table_78729 WHERE "Record" = '41–32–6' |
what is drug type and drug code of drug name vial? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Vial" |
What competition was held 1 March 1909? | CREATE TABLE table_name_31 (competition VARCHAR,date VARCHAR) | SELECT competition FROM table_name_31 WHERE date = "1 march 1909" |
Which team played at VFL Park? | CREATE TABLE table_name_95 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_95 WHERE venue = "vfl park" |
Where is lootospark from? | CREATE TABLE table_29492 ("Club" text,"Location" text,"Ground" text,"Manager" text,"Titles" real,"Last title" text) | SELECT "Location" FROM table_29492 WHERE "Ground" = 'Lootospark' |
what is the minimum amount of hospital cost that includes macrophages until 2103? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'macrophages')) AND STRFTIME('%y', cost.chargetime) <= '2103' GROUP BY cost.hadm_id) AS t1 |
what is the highest rank when the nation is united states (usa) and bronze is more than 1? | CREATE TABLE table_50717 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Rank") FROM table_50717 WHERE "Nation" = 'united states (usa)' AND "Bronze" > '1' |
Who directed the film Antonio's Breakfast? | CREATE TABLE table_67767 ("Film" text,"Director(s)" text,"Producer(s)" text,"Recipient" text,"Date" text,"Award" text) | SELECT "Director(s)" FROM table_67767 WHERE "Film" = 'antonio''s breakfast' |
Find the average of credits of courses that have more than one prerequisite for each department with a bar chart. | CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar... | SELECT dept_name, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name |
What date had a record of 15-14-4? | CREATE TABLE table_45966 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Record" text) | SELECT "Date" FROM table_45966 WHERE "Record" = '15-14-4' |
Which Athletes have a Run 2 of 2:21.82? | CREATE TABLE table_45517 ("Rank" text,"Team" text,"Athletes" text,"Run 1" text,"Run 2" text,"Run 3" text,"Run 4" text,"Final" text) | SELECT "Athletes" FROM table_45517 WHERE "Run 2" = '2:21.82' |
How many values for population(2011) correspond to a 1.40% in 2006? | CREATE TABLE table_22742 ("Mother Tongue" text,"Population (2006)" real,"Percentage (2006)" text,"Population (2011)" real,"Percentage (2011)" text) | SELECT COUNT("Population (2011)") FROM table_22742 WHERE "Percentage (2006)" = '1.40%' |
How many registed students do each course have? List course name and the number of their registered students, display X in descending order. | CREATE TABLE Courses (course_id VARCHAR(100),course_name VARCHAR(120),course_description VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Student_Course_Registrations (student_id INTEGER,course_id INTEGER,registration_date DATETIME)CREATE TABLE People (person_id INTEGER,first_name VARCHAR(255),middle_name VARCHAR(2... | SELECT course_name, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id JOIN Courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id ORDER BY course_name DESC |
What is the date for the name ryan lochte? | CREATE TABLE table_44619 ("Event" text,"Date" text,"Round" text,"Name" text,"Nationality" text,"Time" text,"Record" text) | SELECT "Date" FROM table_44619 WHERE "Name" = 'ryan lochte' |
who had the high points on june 8? | CREATE TABLE table_76286 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text) | SELECT "High points" FROM table_76286 WHERE "Date" = 'june 8' |
what was the number of patients who received a lactate dehydrogenase, ascites test since 2105? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location t... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate dehydrogenase, ascites') AND STRFTIME('%y', labevents.charttime) >= '2105') |
is TW flight 497 766 from ST. PETERSBURG to MILWAUKEE with 1 stop available tomorrow morning | CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int... | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight AS FLIGHT_0, flight AS FLIGHT_1, flight AS FLIGHT_2, flight_leg AS FLIGHT_LEG_0, flight_leg AS FLIGHT_LEG_1 WHERE ((((((date_day.day_number = 20 AND ... |
until 2104 what were the four most commonly ordered drugs for patients of age 30s? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', medication.drugstarttime) <= '2104' GROUP BY medication.drugn... |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of price , and group by attribute name, show by the X in desc please. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
what is the number of patients whose insurance is self pay and diagnoses icd9 code is 5761? | 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 procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.icd9_code = "5761" |
Show the trend about the total average number of attendance at home games change over the years, bin year into year interval. | CREATE TABLE manager_half (player_id TEXT,year INTEGER,team_id TEXT,league_id TEXT,inseason INTEGER,half INTEGER,g INTEGER,w INTEGER,l INTEGER,rank INTEGER)CREATE TABLE team_half (year INTEGER,league_id TEXT,team_id TEXT,half INTEGER,div_id TEXT,div_win TEXT,rank INTEGER,g INTEGER,w INTEGER,l INTEGER)CREATE TABLE pitch... | SELECT year, AVG(attendance) FROM home_game GROUP BY year |
Name the maximum discs | CREATE TABLE table_14562722_2 (discs INTEGER) | SELECT MAX(discs) FROM table_14562722_2 |
People with top reputation in your city. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,P... | WITH citywiderep AS (SELECT Id, DisplayName, Reputation, Location, SUM(Reputation) OVER () AS "total_stackoverflow_reputation_in_your_city" FROM Users WHERE LOWER(Location) LIKE '%visakhapatnam%') SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS rowno, *, SUM(Reputation) OVER () AS "total_stackoverflow_reputation... |
who is listed previous to prue watt ? | CREATE TABLE table_204_160 (id number,"rank" number,"name" text,"nationality" text,"time" text,"notes" text) | SELECT "name" FROM table_204_160 WHERE id = (SELECT id FROM table_204_160 WHERE "name" = 'prue watt') - 1 |
How many people attended the game at VFL Park? | CREATE TABLE table_name_71 (crowd INTEGER,venue VARCHAR) | SELECT SUM(crowd) FROM table_name_71 WHERE venue = "vfl park" |
What was the circumstance that happened on the road to Jalalabad? | CREATE TABLE table_name_89 (circumstances VARCHAR,location VARCHAR) | SELECT circumstances FROM table_name_89 WHERE location = "road to jalalabad" |
What week had attendance of 52,714? | CREATE TABLE table_43797 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT MAX("Week") FROM table_43797 WHERE "Attendance" = '52,714' |
what is drug route of drug name lactated ringers? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Lactated Ringers" |
Name the season number for 'the night of the feathered fury | CREATE TABLE table_23348 ("Series #" real,"Season #" real,"Title" text,"Director(s)" text,"Writer(s)" text,"Airdate" text,"Production code" real,"Arties disguises" text) | SELECT COUNT("Season #") FROM table_23348 WHERE "Title" = 'The Night of the Feathered Fury' |
what is the number of medicaid insurance patients who have undergone hemodialysis? | 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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Hemodialysis" |
Which Place has a Player of justin leonard? | CREATE TABLE table_name_48 (place VARCHAR,player VARCHAR) | SELECT place FROM table_name_48 WHERE player = "justin leonard" |
Venue of thessaloniki (without participation) had what score? | CREATE TABLE table_34959 ("Outcome" text,"Year" text,"Venue" text,"Last opponent" text,"Score" text) | SELECT "Score" FROM table_34959 WHERE "Venue" = 'thessaloniki (without participation)' |
WHAT IS THE AVERAGE NANGUN WITH A RANK LARGER THAN 2, TOTAL OF 17.85? | CREATE TABLE table_name_80 (nangun INTEGER,rank VARCHAR,total VARCHAR) | SELECT AVG(nangun) FROM table_name_80 WHERE rank > 2 AND total = 17.85 |
What was the result for the team with 3 draws? | CREATE TABLE table_76390 ("Year" text,"Result" text,"Matches" text,"Wins" text,"Draws" text,"Losses" text) | SELECT "Result" FROM table_76390 WHERE "Draws" = '3' |
Am I able to take RCIDIV 316 and RCIDIV 224 in the same semester ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE requirement (requirement_id int,requirement var... | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'RCIDIV' AND COURS... |
In what position did Salina Kosgei finish in the Tokyo Marathon? | CREATE TABLE table_13505 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text) | SELECT "Position" FROM table_13505 WHERE "Competition" = 'tokyo marathon' |
What is listed as the highest Nominal GDP World Bank, 2009 (million USD) that has a GDP per capita World Bank, 2009 nominal (USD) of 14267? | CREATE TABLE table_63424 ("State" text,"Adopted" text,"Population (2011-01-01)" text,"Nominal GDP World Bank,2009 (million USD)" real,"Relative GDP of total (nominal)" text,"GDP per capita World Bank,2009 nominal (USD)" real) | SELECT MAX("Nominal GDP World Bank, 2009 (million USD)") FROM table_63424 WHERE "GDP per capita World Bank, 2009 nominal (USD)" = '14267' |
How many hispanic or latino patients have an additive type drug prescription? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND prescriptions.drug_type = "ADDITIVE" |
How many artists are above age 46 and joined after 1990? | CREATE TABLE artist (artist_id number,name text,country text,year_join number,age number)CREATE TABLE exhibition (exhibition_id number,year number,theme text,artist_id number,ticket_price number)CREATE TABLE exhibition_record (exhibition_id number,date text,attendance number) | SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990 |
Opponent of igor samoilenco had what result? | CREATE TABLE table_name_11 (result VARCHAR,opponent VARCHAR) | SELECT result FROM table_name_11 WHERE opponent = "igor samoilenco" |
What is the score for the United States when Harry Hampton is the player and the money is $73? | CREATE TABLE table_name_23 (score VARCHAR,player VARCHAR,country VARCHAR,money___$__ VARCHAR) | SELECT score FROM table_name_23 WHERE country = "united states" AND money___$__ = "73" AND player = "harry hampton" |
What is the average Enrollment of Dickinson College? | CREATE TABLE table_50250 ("Institution" text,"Location" text,"Nickname" text,"Enrollment" real,"Established" real) | SELECT AVG("Enrollment") FROM table_50250 WHERE "Institution" = 'dickinson college' |
What is Most Laps Led, when Winning Team is Chip Ganassi Racing, and when Fastest Lap is Marco Andretti? | CREATE TABLE table_40549 ("Race" text,"Pole position" text,"Fastest lap" text,"Most laps led" text,"Winning driver" text,"Winning team" text,"Report" text) | SELECT "Most laps led" FROM table_40549 WHERE "Winning team" = 'chip ganassi racing' AND "Fastest lap" = 'marco andretti' |
which school was established first ? | CREATE TABLE table_203_416 (id number,"school name" text,"city" text,"grades" text,"establishment" number,"charter" text) | SELECT "school name" FROM table_203_416 ORDER BY "establishment" LIMIT 1 |
Average number of questions per day, over a week - about Apache Beam + Stack Overflow. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)... | SELECT MIN(Posts.CreationDate) AS period, SUM(CASE WHEN Posts.PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions per month" FROM Posts WHERE Posts.PostTypeId = 1 AND (Posts.Tags LIKE '%apache-beam%' OR Posts.Tags LIKE '%google-cloud-dataflow%') GROUP BY TIME_TO_STR(Posts.CreationDate, '%m'), TIME_TO_STR(Posts.CreationDate... |
What is the since year for the player with more than 3 goals and a transfer fee of 400k? | CREATE TABLE table_name_24 (since VARCHAR,goals VARCHAR,transfer_fee VARCHAR) | SELECT since FROM table_name_24 WHERE goals > 3 AND transfer_fee = "£400k" |
How many patients have had an open and other sigmoidectomy procedure? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Open and other sigmoidectomy" |
What is the 17th c. pronunciation when the british is ? | CREATE TABLE table_58754 ("\"Long\" vowels" text,"17th c." text,"American" text,"British" text,"Australian" text) | SELECT "17th c." FROM table_58754 WHERE "British" = 'əʊ' |
What is the total number of games that led to a record of 12-4-2 after November 22? | CREATE TABLE table_8806 ("Game" real,"November" real,"Opponent" text,"Score" text,"Record" text) | SELECT COUNT("Game") FROM table_8806 WHERE "Record" = '12-4-2' AND "November" > '22' |
how many times patient 71129 was prescribed 0.9% sodium chloride in 2105? | 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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numb... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71129) AND prescriptions.drug = '0.9% sodium chloride' AND STRFTIME('%y', prescriptions.startdate) = '2105' |
Tell me the club with a replacement of alberto malesani | CREATE TABLE table_name_8 (club VARCHAR,replacement VARCHAR) | SELECT club FROM table_name_8 WHERE replacement = "alberto malesani" |
What is the biggest roll number of Sylvia Park School, which has a state authority? | CREATE TABLE table_name_12 (roll INTEGER,authority VARCHAR,name VARCHAR) | SELECT MAX(roll) FROM table_name_12 WHERE authority = "state" AND name = "sylvia park school" |
What number of upper level courses have labs ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_pre... | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%' |
for the first time, what procedure did in the first hospital encounter patient 85407 receive? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_i... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85407 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admit... |
What is the Type of castle from the 14th Century which Condition is preserved? | CREATE TABLE table_name_72 (type VARCHAR,date VARCHAR,condition VARCHAR) | SELECT type FROM table_name_72 WHERE date = "14th century" AND condition = "preserved" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.