instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
when did patient 97314 get prescribed a drug via iv for the last time until 3 months ago? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,l... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97314) AND prescriptions.route = 'iv' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 month') ORDER BY prescriptions.startdate DESC LIMIT 1 |
what was the name of the output the first time patient 017-41154 had on 06/24/last year? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesi... | 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 = '017-41154')) AND intakeoutput.cellpath LIKE '%output%' AND D... |
What was the surface for Julie Halard when the final score was 6 3, 6 2? | CREATE TABLE table_name_55 (surface VARCHAR,partner VARCHAR,score_in_the_final VARCHAR) | SELECT surface FROM table_name_55 WHERE partner = "julie halard" AND score_in_the_final = "6–3, 6–2" |
Count the number of patients with diagnoses icd9 code 2930 who had a pleural fluid lab test. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2930" AND lab.fluid = "Pleural" |
the year the last intermediate ship was built . | CREATE TABLE table_203_547 (id number,"ship" text,"built" number,"in service for cunard" text,"type" text,"tonnage" text,"notes" text) | SELECT MAX("built") FROM table_203_547 WHERE "type" = 'intermediate' |
What was the home team score when the VFL played at Western Oval? | CREATE TABLE table_58388 ("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_58388 WHERE "Venue" = 'western oval' |
Who was the director for the title, 'funhouse'? | CREATE TABLE table_17133 ("Series #" real,"Season #" real,"Title" text,"Director(s)" text,"Writer(s)" text,"Original airdate" text) | SELECT "Director(s)" FROM table_17133 WHERE "Title" = 'Funhouse' |
Name the ends lost for canada | CREATE TABLE table_26745426_2 (Ends VARCHAR,country VARCHAR,Canada VARCHAR) | SELECT Ends AS lost FROM table_26745426_2 WHERE country = Canada |
What character is in over 22 episodes? | CREATE TABLE table_name_91 (character VARCHAR,episodes INTEGER) | SELECT character FROM table_name_91 WHERE episodes > 22 |
Name the seven for 29 november 1690 | CREATE TABLE table_51631 ("Date" text,"Three" text,"Four" text,"Five" text,"Seven" text) | SELECT "Seven" FROM table_51631 WHERE "Date" = '29 november 1690' |
show me return flights from CINCINNATI to SALT LAKE CITY nonstop | CREATE TABLE code_description (code varchar,description text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE flight_fare (f... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CINCINNATI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SA... |
What city is the lamar tower 1, ranked above 5? | CREATE TABLE table_56067 ("Rank" real,"Name" text,"City" text,"Height" text,"Floors" real) | SELECT "City" FROM table_56067 WHERE "Rank" < '5' AND "Name" = 'lamar tower 1' |
RANK, parition by id order by value_type. | CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | WITH test AS (SELECT 1 AS id, 'B' AS value_type UNION ALL SELECT 1, 'B' UNION ALL SELECT 1, 'A' UNION ALL SELECT 2, 'A' UNION ALL SELECT 2, 'A'), summary AS (SELECT t.*, RANK() OVER (PARTITION BY t.id ORDER BY t.value_type DESC) AS rank FROM test AS t) SELECT * FROM summary WHERE rank = 1 |
What is the Competition On 26 jan 2005 | CREATE TABLE table_66827 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Competition" FROM table_66827 WHERE "Date" = '26 jan 2005' |
Find the dates on which more than one revisions were made, and the bin the date of latest revision into weekday interval and count them as a bar chart. | CREATE TABLE Catalog_Structure (catalog_level_number INTEGER,catalog_id INTEGER,catalog_level_name VARCHAR(50))CREATE TABLE Attribute_Definitions (attribute_id INTEGER,attribute_name VARCHAR(30),attribute_data_type VARCHAR(10))CREATE TABLE Catalog_Contents (catalog_entry_id INTEGER,catalog_level_number INTEGER,parent_e... | SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs |
Who has high points when verizon center 17,152 is location attendance? | CREATE TABLE table_73523 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High points" FROM table_73523 WHERE "Location Attendance" = 'Verizon Center 17,152' |
provide the number of patients whose admission location is emergency room admit and procedure icd9 code is 14? | 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 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" |
Name the most episode numbers of 6 january 2006 | CREATE TABLE table_1590967_2 (episode_number INTEGER,air_date VARCHAR) | SELECT MAX(episode_number) FROM table_1590967_2 WHERE air_date = "6 January 2006" |
Calculate the number of actors in each duration of actors using a bar chart, order by the how many duration in descending. | CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int)CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text) | SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration ORDER BY COUNT(Duration) DESC |
What is the Region that has a Total GDP ( bn ) of 11,745.353? | CREATE TABLE table_name_58 (region VARCHAR,total_gdp__€_bn__ VARCHAR) | SELECT region FROM table_name_58 WHERE total_gdp__€_bn__ = "€11,745.353" |
Who did the Jets play in their post-week 15 game? | CREATE TABLE table_77531 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Attendance" text) | SELECT "Opponent" FROM table_77531 WHERE "Week" > '15' |
What are the names listed in the family il-1f2? | CREATE TABLE table_4257 ("Name" text,"Family name" text,"Receptor" text,"Coreceptor" text,"Property" text,"Chromosomal location" text) | SELECT "Name" FROM table_4257 WHERE "Family name" = 'IL-1F2' |
Who were the co-drivers with more than 377 laps in 1st position? | CREATE TABLE table_15372 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text) | SELECT "Co-Drivers" FROM table_15372 WHERE "Laps" > '377' AND "Pos." = '1st' |
A stacked bar chart about the total number in each competition type, and then split by country, could you order by the bars from low to high? | CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club_ID_2 int,Score text)CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE club (Club_ID int,name text,Region ... | SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country |
What are the names of companies with revenue between 100 and 150? | CREATE TABLE products (code number,name text,price number,manufacturer number)CREATE TABLE manufacturers (code number,name text,headquarter text,founder text,revenue number) | SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150 |
Who was the winner after 1989 when Stronach Stable was the owner? | CREATE TABLE table_46916 ("Year" real,"Winner" text,"Jockey" text,"Trainer" text,"Owner" text) | SELECT "Winner" FROM table_46916 WHERE "Year" > '1989' AND "Owner" = 'stronach stable' |
Visualize a bar chart about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, and rank from low to high by the y-axis please. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID) |
Which college was the player selected from in round 1? | CREATE TABLE table_4309 ("Round" real,"Overall" real,"Player" text,"Position" text,"College" text) | SELECT "College" FROM table_4309 WHERE "Round" = '1' |
provide the number of patients whose year of birth is less than 1821 and drug route is left eye? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1821" AND prescriptions.route = "LEFT EYE" |
Name the total number of points for for played | CREATE TABLE table_27293285_4 (points_for VARCHAR) | SELECT COUNT(points_for) FROM table_27293285_4 WHERE "played" = "played" |
What is Tiffani Johnson's maximum steals? | CREATE TABLE table_27209 ("Player" text,"Minutes" real,"Field Goals" real,"Rebounds" real,"Assists" real,"Steals" real,"Blocks" real,"Points" real) | SELECT MAX("Steals") FROM table_27209 WHERE "Player" = 'Tiffani Johnson' |
Create a bar chart showing the number of meter 200 across meter 200, and rank by the Y from low to high. | 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 stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Ev... | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY COUNT(meter_200) |
What is the largest number of seats won? | CREATE TABLE table_168482_1 (_number_of_seats_won INTEGER) | SELECT MAX(_number_of_seats_won) FROM table_168482_1 |
What is the grand slam in 1987, when round shows first round, and Ivan Lendl won? | CREATE TABLE table_name_35 (grand_slam VARCHAR,winner VARCHAR,year VARCHAR,round VARCHAR) | SELECT grand_slam FROM table_name_35 WHERE year = 1987 AND round = "first round" AND winner = "ivan lendl" |
Which overall pick was traded to the Cleveland Browns? | CREATE TABLE table_10360823_1 (overall VARCHAR,college VARCHAR) | SELECT overall FROM table_10360823_1 WHERE college = "Traded to the Cleveland Browns" |
Partnering of franco ferreiro had what tournament? | CREATE TABLE table_name_20 (tournament VARCHAR,partnering VARCHAR) | SELECT tournament FROM table_name_20 WHERE partnering = "franco ferreiro" |
Name the venue for score of 1-3 | CREATE TABLE table_15124 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Venue" FROM table_15124 WHERE "Score" = '1-3' |
Next semester is Prof. Lauren Benjamin teaching 453 ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)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 comment_instructor (instruc... | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 453 AND instructor.name LIKE '%Lauren Benjamin%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering... |
What is the method against Paula Mataele? | CREATE TABLE table_name_26 (method VARCHAR,opponent VARCHAR) | SELECT method FROM table_name_26 WHERE opponent = "paula mataele" |
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 average of salary over the hire_date bin hire_date by time, show by the y-axis in ascending please. | 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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decima... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) |
What is the Margin in 1953 when Patty Berg was Runner(s)-up? | CREATE TABLE table_33916 ("Year" real,"Championship" text,"Winning score" text,"Margin" text,"Runner(s)-up" text) | SELECT "Margin" FROM table_33916 WHERE "Runner(s)-up" = 'patty berg' AND "Year" = '1953' |
how many patients are with procedure icd9 code 17? | 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 procedures.icd9_code = "17" |
give me the number of patients whose gender is f and procedure short title is parent infus nutrit sub? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Parent infus nutrit sub" |
among patients who were prescribed potassium chl 40 meq / 1000 ml d5ns, what are the five most frequently prescribed drugs at the same time 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE icustays (row_id number,subject_id n... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'potassium chl 40 meq / 1000 ml d5ns' AND DATETIME(prescriptions.s... |
When 102 is the number in series who is the director? | CREATE TABLE table_2468961_6 (directed_by VARCHAR,no_in_series VARCHAR) | SELECT directed_by FROM table_2468961_6 WHERE no_in_series = 102 |
Which player has fewer than 2 rounds? | CREATE TABLE table_9418 ("Round" real,"Pick" real,"Player" text,"Position" text,"Nationality" text,"School/Club Team" text) | SELECT "Player" FROM table_9418 WHERE "Round" < '2' |
provide the number of patients whose admission location is emergency room admit and admission year is less than 2155? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.admityear < "2155" |
What is the highest total value when bask and base are each 3? | CREATE TABLE table_name_37 (total INTEGER,bask VARCHAR,base VARCHAR) | SELECT MAX(total) FROM table_name_37 WHERE bask = "3" AND base = "3" |
What season number did production code 2wab12? | CREATE TABLE table_20726262_3 (no_in_season VARCHAR,production_code VARCHAR) | SELECT no_in_season FROM table_20726262_3 WHERE production_code = "2WAB12" |
List the name and assets of each company in ascending order of company name. | CREATE TABLE companies (id number,name text,headquarters text,industry text,sales_billion number,profits_billion number,assets_billion number,market_value_billion text)CREATE TABLE buildings (id number,name text,city text,height number,stories number,status text)CREATE TABLE office_locations (building_id number,company... | SELECT name, assets_billion FROM companies ORDER BY name |
Populist badge candidate users and posts. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean... | SELECT answers.OwnerUserId AS "user_link", answers.Id AS "post_link", answers.CreationDate, answers.Score AS "user_score", acceptedanswers.Score AS "accepted_answer_score" FROM Posts AS answers INNER JOIN Posts AS questions ON answers.ParentId = questions.Id INNER JOIN Posts AS acceptedanswers ON questions.AcceptedAnsw... |
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, a bar chart shows the distribution of job_id and the sum of salary , and group by attribute job_id. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,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 varcha... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID |
What Player in 2005 Wimbledon had less than 5 Sets? | CREATE TABLE table_name_12 (player VARCHAR,sets VARCHAR,event VARCHAR) | SELECT player FROM table_name_12 WHERE sets < 5 AND event = "2005 wimbledon" |
What displacement & configuration does the car model Panamera 4s have? | CREATE TABLE table_46529 ("car model" text,"displacement & configuration" text,"max. motive power @ rpm" text,"max. torque @ rpm" text,"max. speed" text,"emissions CO2" text) | SELECT "displacement & configuration" FROM table_46529 WHERE "car model" = 'panamera 4s' |
what are the five year survival rates for those who were prescribed pantoprazole sod after having been diagnosed with pericardial tamponade - by echocardiogram? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... |
How many products are never booked with amount higher than 200? | CREATE TABLE Products_for_hire (product_id VARCHAR,booked_amount INTEGER)CREATE TABLE products_booked (product_id VARCHAR,booked_amount INTEGER) | SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200) |
For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of code , and group by attribute name in a bar chart, and sort from high to low by the total number. | 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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC |
For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of manager_id bin hire_date by time in a bar chart. | 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),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 dep... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
Which ERP W has a Frequency MHz of 89.3 fm? | CREATE TABLE table_name_98 (erp_w INTEGER,frequency_mhz VARCHAR) | SELECT MAX(erp_w) FROM table_name_98 WHERE frequency_mhz = "89.3 fm" |
What is the home team score where the home team is Fremantle? | CREATE TABLE table_20770 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_20770 WHERE "Home team" = 'Fremantle' |
What is the date where the record was 18 12? | CREATE TABLE table_29743 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Date" FROM table_29743 WHERE "Record" = '18–12' |
Which classes must I take in order to declare a major in COMP ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE stude... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%COMP%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
which version was around 7 minutes in length but remixed by enzo mori and stephan clark ? | CREATE TABLE table_203_289 (id number,"version" text,"length" text,"album" text,"remixed by" text,"year" number,"comment" text) | SELECT "version" FROM table_203_289 WHERE "length" = 7 AND "remixed by" = 'enzo mori and stephan clark' |
Name the country that has the yen | CREATE TABLE table_2764267_2 (country VARCHAR,currency VARCHAR) | SELECT country FROM table_2764267_2 WHERE currency = "Yen" |
Which method has a record of 3-0? | CREATE TABLE table_68577 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text) | SELECT "Method" FROM table_68577 WHERE "Record" = '3-0' |
How many entries for area correspond to a population density of 207.9? | CREATE TABLE table_31373 ("Country with flag" text,"Area (km\u00b2)" real,"Population (1 July 2005 est.)" real,"Population density (per km\u00b2)" text,"Capital" text) | SELECT COUNT("Area (km\u00b2)") FROM table_31373 WHERE "Population density (per km\u00b2)" = '207.9' |
Which League that has a Open Cup of 1st round, and a Year of 2009? | CREATE TABLE table_40053 ("Year" real,"Division" text,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text) | SELECT "League" FROM table_40053 WHERE "Open Cup" = '1st round' AND "Year" = '2009' |
What is the lowest number of seats from the election with 27.0% of votes? | CREATE TABLE table_38252 ("Election" text,"D\u00e1il" text,"Share of votes" text,"Seats" real,"Government" text) | SELECT MIN("Seats") FROM table_38252 WHERE "Share of votes" = '27.0%' |
What is ramtha when jeel is 1-0 and hussein is 1-0? | CREATE TABLE table_73889 ("\u00d7" text,"Faisaly" text,"Wehdat" text,"Ramtha" text,"Ahli" text,"Jazeera" text,"Hussein" text,"Amman" text,"Orthodoxy" text,"Jeel" text,"Ain Karem" text) | SELECT "Ramtha" FROM table_73889 WHERE "Jeel" = '1-0' AND "Hussein" = '1-0' |
Visualize a bar chart about the distribution of personal_name and author_id . | CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VA... | SELECT personal_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name |
Who were the opponents in the Rome championship? | CREATE TABLE table_27170 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Opponents" FROM table_27170 WHERE "Championship" = 'Rome' |
What is the form ('to sing') when brazilian portuguese is [k t mus]? | CREATE TABLE table_3272 ("Form (to sing)" text,"Latin" text,"Nuorese Sardinian" text,"Spanish" text,"Brazilian Portuguese" text,"Central Catalan" text,"Romanian" text,"French" text) | SELECT "Form (to sing)" FROM table_3272 WHERE "Brazilian Portuguese" = '[kɐ̃ˈtẽmus]' |
select posts with a link to a site. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,Re... | SELECT Body FROM Posts WHERE Body LIKE '%qbox%' |
For franklin of class aa, which school years does this occur? | CREATE TABLE table_14603212_1 (school_year VARCHAR,class_aA VARCHAR,Franklin VARCHAR) | SELECT school_year FROM table_14603212_1 WHERE class_aA = Franklin |
give me the number of patients whose admission year is less than 2167 and procedure short title is adm inhal nitric oxide? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2167" AND procedures.short_title = "Adm inhal nitric oxide" |
How many wins for the team with fewer than 2 byes? | CREATE TABLE table_name_1 (wins INTEGER,byes INTEGER) | SELECT AVG(wins) FROM table_name_1 WHERE byes < 2 |
Which round had 24 new entries? | CREATE TABLE table_23449363_1 (round VARCHAR,new_entries_this_round VARCHAR) | SELECT round FROM table_23449363_1 WHERE new_entries_this_round = "24" |
in this month, have gabapentin 300 mg po caps, potassium chloride 20 meq ud liq or amiodarone hcl 900 mg/18ml iv soln been prescribed for patient 016-18575? | 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 treatment (treatmentid number,patientun... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575')) AND medication.drugname IN ('gabapentin 300 mg po caps', 'pot... |
what's the minimum total cost of the hospital that involves a drug called sodium acetate until 4 years ago? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code tex... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'sodium acetate') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.hadm_id) AS t1 |
If the number of police officers is 94, what is the lowest population number? | CREATE TABLE table_17629 ("Municipality" text,"Population" real,"Police officers" real,"Residents per officer" real,"Total costs (2005)" text,"Cost per capita" text,"Case burden" real,"Crime rate per 1,000 people" real,"Police force" text) | SELECT MIN("Population") FROM table_17629 WHERE "Police officers" = '94' |
Which party is Lawrence H. Fountain part of? | CREATE TABLE table_1341738_34 (party VARCHAR,incumbent VARCHAR) | SELECT party FROM table_1341738_34 WHERE incumbent = "Lawrence H. Fountain" |
show me the top four most frequent intake events this year? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icust... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY inputevents_cv.it... |
had patient 021-250695 visited the emergency room since 6 years ago? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '021-250695' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-6 year') |
What is Date, when Away Team is 'Barnet'? | CREATE TABLE table_61639 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Date" FROM table_61639 WHERE "Away team" = 'barnet' |
A bar chart about what are the different software platforms for devices, and how many devices have each?, and could you display by the x-axis in desc? | CREATE TABLE stock (Shop_ID int,Device_ID int,Quantity int)CREATE TABLE shop (Shop_ID int,Shop_Name text,Location text,Open_Date text,Open_Year int)CREATE TABLE device (Device_ID int,Device text,Carrier text,Package_Version text,Applications text,Software_Platform text) | SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform ORDER BY Software_Platform DESC |
How many patients admitted before the year 2127 had a lab test for thyroxine (t4)? | 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.admityear < "2127" AND lab.label = "Thyroxine (T4)" |
Questions with a given string that a given user answered. | CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT q.Id AS "post_link", q.Score AS "question_score", q.ViewCount, q.Tags, a.Score AS "answer_score" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##UserID:int##' AND (q.Body LIKE '%' + '##SearchString:string##' + '%' OR q.Title LIKE '%' + '##SearchString:string##' + '%') |
show me the five most common diagnostics during the previous year? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime ti... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5 |
What county has less than $188 and a score of 74-76-73-75=298? | CREATE TABLE table_58768 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" real) | SELECT "Country" FROM table_58768 WHERE "Money ( $ )" < '188' AND "Score" = '74-76-73-75=298' |
i would like to book a flight for 8 27 with US from BALTIMORE to OAKLAND what flights do you have available | CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE equipment_sequence (aircraft_code_s... | 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND date_day.day_number = 27 AND date_day.month_number = 8 AND ... |
How many offensive line players played for a college in Alabama? | CREATE TABLE table_303 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text) | SELECT COUNT("Hometown") FROM table_303 WHERE "College" = 'Alabama' AND "Position" = 'Offensive line' |
count the number of patients that are admitted to the hospital since 2101. | 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 microlab (microlabid number,patientunitstayid number,culturesite text,orga... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) >= '2101' |
Name the height for demetrius jemison | CREATE TABLE table_25360865_1 (height VARCHAR,name VARCHAR) | SELECT height FROM table_25360865_1 WHERE name = "Demetrius Jemison" |
what is the number of patients whose discharge location is left against medical advi and procedure short title is int inser lead atri-vent? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.short_title = "Int inser lead atri-vent" |
what is the result when the venue is singapore on september 8, 1996? | CREATE TABLE table_63981 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Result" FROM table_63981 WHERE "Venue" = 'singapore' AND "Date" = 'september 8, 1996' |
When was there a result of w 65-20 after week 6? | CREATE TABLE table_name_43 (date VARCHAR,week VARCHAR,result VARCHAR) | SELECT date FROM table_name_43 WHERE week > 6 AND result = "w 65-20" |
Who came from the University of Michigan (NCAA) team? | CREATE TABLE table_73127 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Player" FROM table_73127 WHERE "College/junior/club team" = 'University of Michigan (NCAA)' |
which UA flight flies across this continent and leaves from BOSTON goes to DALLAS and makes a stopover in PHILADELPHIA | CREATE TABLE month (month_number int,month_name text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varch... | 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 = 'DALLAS' AND CITY_2.ci... |
Which class is tougher among 498 and 552 ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_cr... | SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 498 OR course.number = 552) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1 |
Who are the contenders In the New York 29 polling area race? | CREATE TABLE table_18604 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Candidates" FROM table_18604 WHERE "District" = 'New York 29' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.