instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what was the first time patient 24894 received calcium, total in a lab test during the first hospital visit? | 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 labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admitt... |
tell me the number of stations tv azteca owns . | CREATE TABLE table_204_796 (id number,"network name" text,"flagship" text,"programming type" text,"owner" text,"affiliates" number) | SELECT COUNT("network name") FROM table_204_796 WHERE "owner" = 'tv azteca' |
What place has the score of 67-74=141? | CREATE TABLE table_name_2 (place VARCHAR,score VARCHAR) | SELECT place FROM table_name_2 WHERE score = 67 - 74 = 141 |
What is the census ranking for the Perth parish? | CREATE TABLE table_176524_2 (census_ranking VARCHAR,official_name VARCHAR) | SELECT census_ranking FROM table_176524_2 WHERE official_name = "Perth" |
Who was the home team on March 5, 2008? | CREATE TABLE table_10100 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT "Home" FROM table_10100 WHERE "Date" = 'march 5, 2008' |
how many player with no being 12 | CREATE TABLE table_12962773_5 (player VARCHAR,no VARCHAR) | SELECT COUNT(player) FROM table_12962773_5 WHERE no = 12 |
Which driver has a # smaller than 40, less than 151 points, and Winnings of $84,400? | CREATE TABLE table_12045 ("Driver" text,"Car #" real,"Make" text,"Points" real,"Laps" real,"Winnings" text) | SELECT "Make" FROM table_12045 WHERE "Car #" < '40' AND "Points" < '151' AND "Winnings" = '$84,400' |
How many documents in different starting date? Return a line chart grouping by starting date. | CREATE TABLE Employees (Employee_ID INTEGER,Role_Code CHAR(15),Employee_Name VARCHAR(255),Gender_MFU CHAR(1),Date_of_Birth DATETIME,Other_Details VARCHAR(255))CREATE TABLE Roles (Role_Code CHAR(15),Role_Name VARCHAR(255),Role_Description VARCHAR(255))CREATE TABLE Documents_to_be_Destroyed (Document_ID INTEGER,Destructi... | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From |
How many places have an Artist of august , and a Draw smaller than 6? | CREATE TABLE table_64729 ("Draw" real,"Artist" text,"Song" text,"Points" real,"Place" real) | SELECT COUNT("Place") FROM table_64729 WHERE "Artist" = 'augustė' AND "Draw" < '6' |
On what date was game 3? | CREATE TABLE table_79596 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location Attendance" text,"Record" text) | SELECT "Date" FROM table_79596 WHERE "Game" = '3' |
What is the region 4 (Aus) date associated with a region 1 (US) date of January 16, 2007? | CREATE TABLE table_240936_2 (region_4__australia_ VARCHAR,region_1__us_ VARCHAR) | SELECT region_4__australia_ FROM table_240936_2 WHERE region_1__us_ = "January 16, 2007" |
What is the highest React that has a 7.61 Mark and a heat bigger than 1? | CREATE TABLE table_name_84 (react INTEGER,mark VARCHAR,heat VARCHAR) | SELECT MAX(react) FROM table_name_84 WHERE mark = "7.61" AND heat > 1 |
What year was USF founded? | CREATE TABLE table_1160660_1 (date_founded VARCHAR,acronym VARCHAR) | SELECT date_founded FROM table_1160660_1 WHERE acronym = "USF" |
what is the position in table when the team is hartlepool united? | CREATE TABLE table_64562 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text) | SELECT "Position in table" FROM table_64562 WHERE "Team" = 'hartlepool united' |
What was the position of the player from Butler High School? | CREATE TABLE table_17065 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text) | SELECT "Position" FROM table_17065 WHERE "School" = 'Butler High School' |
what is age and religion of subject id 84129? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "84129" |
how many prescriptions for multivitamins have been ordered? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'multivitamins' |
Which analog channel is Fox on? | CREATE TABLE table_52794 ("Analog Channel" text,"Digital Channel" text,"Call sign" text,"Name" text,"Network" text) | SELECT "Analog Channel" FROM table_52794 WHERE "Network" = 'fox' |
first opponent to defeat mocho cota in mexico city | CREATE TABLE table_204_373 (id number,"wager" text,"winner" text,"loser" text,"location" text,"date" text) | SELECT "winner" FROM table_204_373 WHERE "loser" = 'mocho cota' AND "location" = 'mexico city' ORDER BY "date" LIMIT 1 |
what is admission time and drug dose of subject id 74032? | 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 demographic.admittime, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "74032" |
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 job_id , and group by attribute job_id, I want to order in descending by the JOB_ID please. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 dec... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC |
What is the highest Aug 2013 with a Nov 2011 smaller than 968, and a Jul 2012 with 31, and a Jun 2011 larger than 30? | CREATE TABLE table_51528 ("Feb 2010" text,"Mar 2010" text,"May 2010" real,"Jun 2010" real,"Jul 2010" real,"Aug 2010" real,"Sep 2010" real,"Oct 2010" real,"Nov 2010" real,"Dec 2010" real,"Jan 2011" real,"Feb 2011" real,"Mar 2011" real,"Apr 2011" real,"May 2011" real,"Jun 2011" real,"Jul 2011" real,"Aug 2011" real,"Sep 2... | SELECT MAX("Aug 2013") FROM table_51528 WHERE "Nov 2011" < '968' AND "Jul 2012" = '31' AND "Jun 2011" > '30' |
How many rounds were on July 10? | CREATE TABLE table_24626 ("Round" real,"Date" text,"City and venue" text,"Winner" text,"Runner-up" text,"3rd placed" text,"4th placed" text,"Results" text) | SELECT COUNT("Round") FROM table_24626 WHERE "Date" = 'July 10' |
what country lost the most ships to u-502 ? | CREATE TABLE table_203_268 (id number,"date" text,"name" text,"nationality" text,"tonnage\n(grt)" number,"fate" text) | SELECT "nationality" FROM table_203_268 GROUP BY "nationality" ORDER BY COUNT("name") DESC LIMIT 1 |
how many hours have it been since the first time patient 027-140654 received procedures during their current hospital encounter? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientuni... | 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 = '027-14065... |
What district has counties represented by Baltimore county, a committee of health and government operations, and a first elected smaller than 2002? | CREATE TABLE table_15822 ("District" text,"Counties Represented" text,"Party" text,"First Elected" real,"Committee" text) | SELECT "District" FROM table_15822 WHERE "Counties Represented" = 'baltimore county' AND "Committee" = 'health and government operations' AND "First Elected" < '2002' |
what is the number of routes that intersect highway 91 ? | CREATE TABLE table_203_333 (id number,"kilometers" number,"name" text,"location" text,"intersecting routes" text) | SELECT COUNT("intersecting routes") FROM table_203_333 |
Who is the home side when the away side scores 11.15 (81)? | CREATE TABLE table_33617 ("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_33617 WHERE "Away team score" = '11.15 (81)' |
What is the frequency of the dates (bin into weekday interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and could you sort from low to high by the y-axis? | CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f... | SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) |
what is the diagnosis icd9 code for patient name kurt buczek? | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kurt Buczek" |
Find dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart. | CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real) | SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 |
Short Favorited Commented Questions with no Answers. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId n... | SELECT Id AS "post_link", Tags FROM Posts WHERE LENGTH(Body) < 100 AND PostTypeId = 1 AND ClosedDate IS NULL AND DeletionDate IS NULL AND CommunityOwnedDate IS NULL AND AnswerCount = 0 AND CommentCount > 0 AND FavoriteCount > 0 |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to show from high to low 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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
Which club lost exactly 7 matches? | CREATE TABLE table_74082 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Points" text) | SELECT "Club" FROM table_74082 WHERE "Lost" = '7' |
What is Tie no, when Date is '18 Nov 1989', and when Home Team is 'Doncaster Rovers'? | CREATE TABLE table_name_32 (tie_no VARCHAR,date VARCHAR,home_team VARCHAR) | SELECT tie_no FROM table_name_32 WHERE date = "18 nov 1989" AND home_team = "doncaster rovers" |
On August 22, how many people came to the game? | CREATE TABLE table_67152 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Attendance" FROM table_67152 WHERE "Date" = 'august 22' |
What is the latest year any of the incumbents were first elected? | CREATE TABLE table_1342270_42 (first_elected INTEGER) | SELECT MAX(first_elected) FROM table_1342270_42 |
count the number of people who were prescribed chlorhexidine gluconate 0.12% oral rinse within 2 months following a diagnosis of oth spf gastrt w hmrhg until 2102. | 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 text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABL... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth spf gastrt w h... |
when was the last time since 04/2104 that patient 88659 was prescribed vial and iso-osmotic dextrose at the same time? | 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value nu... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vial' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t1 JOIN (SELECT admissions.... |
Name the ppv for sky famiglia and dar 16:9 for mtv dance | CREATE TABLE table_20379 ("N\u00b0" real,"Television service" text,"Country" text,"Language" text,"Content" text,"DAR" text,"HDTV" text,"PPV" text,"Package/Option" text) | SELECT "PPV" FROM table_20379 WHERE "Package/Option" = 'Sky Famiglia' AND "DAR" = '16:9' AND "Television service" = 'MTV Dance' |
Show institution names along with the number of proteins for each institution in a bar chart, and order by the y-axis in desc. | CREATE TABLE protein (common_name text,protein_name text,divergence_from_human_lineage real,accession_number text,sequence_length real,sequence_identity_to_human_protein text,Institution_id text)CREATE TABLE building (building_id text,Name text,Street_address text,Years_as_tallest text,Height_feet int,Floors int)CREATE... | SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY COUNT(*) DESC |
what is the record when the round is before 3 and the time si 4:59? | CREATE TABLE table_48174 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Record" FROM table_48174 WHERE "Round" < '3' AND "Time" = '4:59' |
A line chart for finding the number of the enrollment date for all the tests that have 'Pass' result. | CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))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 VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Course_Authors_and_... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment |
When was 11-8 the record? | CREATE TABLE table_name_43 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_43 WHERE record = "11-8" |
provide the number of patients whose primary disease is left colon cancer and age is less than 67? | 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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT COLON CANCER" AND demographic.age < "67" |
What is the smallest share for a timeslot ranking less than 4 and fewer viewers than 8.78 million? | CREATE TABLE table_name_67 (share INTEGER,viewers__m_ VARCHAR,timeslot_rank VARCHAR) | SELECT MIN(share) FROM table_name_67 WHERE viewers__m_ < 8.78 AND timeslot_rank < 4 |
What surface was played on with a score of 6 4, 6 3 and on 4 May 1992? | CREATE TABLE table_41299 ("Date" text,"Tournament" text,"Surface" text,"Partnering" text,"Opponent in the final" text,"Score" text) | SELECT "Surface" FROM table_41299 WHERE "Score" = '6–4, 6–3' AND "Date" = '4 may 1992' |
Average Accepted Answer Score by Question Score for Users Like Me. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Posts (Id number,PostTyp... | SELECT Questions.Score AS QuestionScore, AVG(Answers.Score) AS AnswerScore FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts AS Answers ON Answers.Id = Questions.AcceptedAnswerId WHERE Questions.Score BETWEEN 1 AND 20 AND Tags.TagN... |
WHAT IS THE MANUFACTURER WITH 24 LAPS, AND +1.965 TIME/RETIRED? | CREATE TABLE table_47681 ("Rider" text,"Manufacturer" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Manufacturer" FROM table_47681 WHERE "Laps" = '24' AND "Time/Retired" = '+1.965' |
in what year was the last design of passenger baseplates for vehicle registration issued in vermont ? | CREATE TABLE table_203_498 (id number,"first issued" text,"design" text,"slogan" text,"serial format" text,"serials issued" text,"notes" text) | SELECT MAX("first issued") FROM table_203_498 |
What day was the oppenent the detroit lions? | CREATE TABLE table_19500 ("Week" real,"Date" text,"Opponent" text,"Final score" text,"Team record" text,"Game site" text,"Attendance" real) | SELECT "Date" FROM table_19500 WHERE "Opponent" = 'Detroit Lions' |
What is the market value of every comapny in the banking industry ordered by sales and profits? Return a bar chart. | 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, Market_Value FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion |
tell me the name of the last specimen test patient 26612 had received in 12/2102? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 outputevents (row_id number,subject_id number,hadm_i... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2102-12' ORDER BY microbiologyevents.charttime DESC LIMIT 1 |
what are the new prescriptions today of patient 006-47576 compared to the prescriptions yesterday? | 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 intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the sum of code , and group by attribute founder, show by the X from high to low please. | 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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and price , and group by attribute headquarter, and rank y-axis from low to high order please. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price |
When was the game that ended with a score of 6-4? | CREATE TABLE table_name_38 (date VARCHAR,score VARCHAR) | SELECT date FROM table_name_38 WHERE score = "6-4" |
How many goals were scored by Eugene Galekovi ? | CREATE TABLE table_name_54 (goals VARCHAR,player VARCHAR) | SELECT goals FROM table_name_54 WHERE player = "eugene galeković" |
Plot total number of memory in g by grouped by carrier as a bar graph, display by the sum memory in g in asc. | CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real)CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int)CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int) | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G) |
Which Source has a Remainder of 15%, and a Topinka of 26%? | CREATE TABLE table_75308 ("Source" text,"Date" text,"Blagojevich (D)" text,"Topinka (R)" text,"Remainder" text) | SELECT "Source" FROM table_75308 WHERE "Remainder" = '15%' AND "Topinka (R)" = '26%' |
What is the date of the Cubs game when the Cubs had a record of 1-0? | CREATE TABLE table_name_2 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_2 WHERE record = "1-0" |
give the number of patients whose drug code is phen10i and lab test category is blood gas. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "PHEN10I" AND lab."CATEGORY" = "Blood Gas" |
How many patients were admitted with pure hyperglyceridemia before 2187? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2187" AND diagnoses.long_title = "Pure hyperglyceridemia" |
What is the name of the artist that issued the single on 23 February? | CREATE TABLE table_9850 ("Volume:Issue" text,"Issue Date(s)" text,"Weeks on Top" text,"Song" text,"Artist" text) | SELECT "Artist" FROM table_9850 WHERE "Issue Date(s)" = '23 february' |
What is the result of the game on April 17 against Los Angeles? | CREATE TABLE table_8232 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text) | SELECT "Result" FROM table_8232 WHERE "Road Team" = 'los angeles' AND "Date" = 'april 17' |
List the record from the game where Wildcats had 48 points. | CREATE TABLE table_24561550_1 (record VARCHAR,wildcats_points VARCHAR) | SELECT record FROM table_24561550_1 WHERE wildcats_points = 48 |
show me the flights from PHILADELPHIA to DALLAS with 1 stop | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight (aircraft_code_sequence ... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.stops = 1 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND ... |
Show all card type codes and the number of cards in each type. | CREATE TABLE customers (customer_id number,customer_first_name text,customer_last_name text,customer_address text,customer_phone text,customer_email text,other_customer_details text)CREATE TABLE financial_transactions (transaction_id number,previous_transaction_id number,account_id number,card_id number,transaction_typ... | SELECT card_type_code, COUNT(*) FROM customers_cards GROUP BY card_type_code |
Name the song choice for michael jackson | CREATE TABLE table_23048 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text) | SELECT "Song choice" FROM table_23048 WHERE "Original artist" = 'Michael Jackson' |
How many points did the ESC Riverrats Geretsried, who lost more than 3 games, score? | CREATE TABLE table_name_17 (points INTEGER,lost VARCHAR,name VARCHAR) | SELECT SUM(points) FROM table_name_17 WHERE lost > 3 AND name = "esc riverrats geretsried" |
How big was the crowd when the away team was Richmond? | CREATE TABLE table_name_4 (crowd VARCHAR,away_team VARCHAR) | SELECT crowd FROM table_name_4 WHERE away_team = "richmond" |
Name the cyrillic name for melenci | CREATE TABLE table_3334 ("Settlement" text,"Cyrillic Name Other Names" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text) | SELECT "Cyrillic Name Other Names" FROM table_3334 WHERE "Settlement" = 'Melenci' |
current alcohol abuse | CREATE TABLE table_train_185 ("id" int,"dyscrasia" bool,"bleeding" int,"panic_disorder" bool,"renal_disease" bool,"anxiety" bool,"creatinine_clearance_cl" float,"alcohol_abuse" bool,"retinopathy" bool,"NOUSE" float) | SELECT * FROM table_train_185 WHERE alcohol_abuse = 1 |
For week number of the top 40, what was the results? | CREATE TABLE table_22736523_1 (result VARCHAR,week__number VARCHAR) | SELECT result FROM table_22736523_1 WHERE week__number = "Top 40" |
Number of posts in past 30 days. | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostType... | SELECT COUNT(*) FROM Posts WHERE PostTypeId IN (1, 2) AND CreationDate >= DATEADD(DAY, -30, GETDATE()) |
What are the age groups for the Big League World Series? | CREATE TABLE table_name_26 (age_groups VARCHAR,competition_name VARCHAR) | SELECT age_groups FROM table_name_26 WHERE competition_name = "big league world series" |
What is the money with a Score of 76-70-75-72=293? | CREATE TABLE table_58997 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money (\u00a3)" text) | SELECT "Money ( \u00a3 )" FROM table_58997 WHERE "Score" = '76-70-75-72=293' |
give me the number of patients whose language is cape and age is less than 67? | 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 WHERE demographic.language = "CAPE" AND demographic.age < "67" |
Which year has an Organization of new york yankees, and a Team of johnson city yankees? | CREATE TABLE table_name_61 (year VARCHAR,organization VARCHAR,team VARCHAR) | SELECT year FROM table_name_61 WHERE organization = "new york yankees" AND team = "johnson city yankees" |
calculate the minimum age of patients who are 83 years of age or older and were hospitalized for 43 days. | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= "83" AND demographic.days_stay = "43" |
What are the names of storms that did not affect two or more regions? | CREATE TABLE region (region_id number,region_code text,region_name text)CREATE TABLE affected_region (region_id number,storm_id number,number_city_affected number)CREATE TABLE storm (storm_id number,name text,dates_active text,max_speed number,damage_millions_usd number,number_deaths number) | SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 |
What is the average pick of player paul maclean, who had a draft before 1978? | CREATE TABLE table_12802 ("Draft" real,"Round" real,"Pick" real,"Player" text,"Nationality" text) | SELECT AVG("Pick") FROM table_12802 WHERE "Player" = 'paul maclean' AND "Draft" < '1978' |
Name the class for boten | CREATE TABLE table_1745843_9 (class VARCHAR,part_3 VARCHAR) | SELECT class FROM table_1745843_9 WHERE part_3 = "boten" |
Name the segment 1 for episode # 2/225 | CREATE TABLE table_26635 ("Episode #" text,"Segment 1" text,"Segment 2" text,"Original airdate" text,"Lessons taught" text) | SELECT "Segment 1" FROM table_26635 WHERE "Episode #" = '2/225' |
Find retaggable AS questions that are open or don't roomba. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskType... | SELECT Id AS "post_link", Body, Tags, Score, AnswerCount, CommentCount FROM Posts WHERE PostTypeId = 1 AND ((Score <= 0 AND AnswerCount > 0 AND (AcceptedAnswerId = NULL OR AcceptedAnswerId > 0)) OR (Score = 0 AND CommentCount > 0) OR (Score > 0)) ORDER BY CreationDate DESC LIMIT 1000 |
what are the four most frequent specimen tests that patients had within the same month after having been diagnosed with 29-30 comp wks gestation until 2104? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,discht... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
Who was the director of the movie having a release date of 1934-09-15, an MM Series and a production number less than 6494? | CREATE TABLE table_name_12 (director VARCHAR,release_date VARCHAR,series VARCHAR,production_num VARCHAR) | SELECT director FROM table_name_12 WHERE series = "mm" AND production_num < 6494 AND release_date = "1934-09-15" |
Which Pick # is the highest one that has a Name of william middleton, and a Round larger than 5? | CREATE TABLE table_name_32 (pick__number INTEGER,name VARCHAR,round VARCHAR) | SELECT MAX(pick__number) FROM table_name_32 WHERE name = "william middleton" AND round > 5 |
count the number of patients who have had a remove fb from periton procedure performed two or more times since 2104. | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE chartevents (row_id number,subject_id number,had... | 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 = 'remove fb from perito... |
Which Fictional narrator has a Published as serial of february july 1912, all-story? | CREATE TABLE table_14163 ("Order" real,"Published as serial" text,"Published as novel" text,"Fictional narrator" text,"Year in novel" text) | SELECT "Fictional narrator" FROM table_14163 WHERE "Published as serial" = 'february–july 1912, all-story' |
Would EEB 412 qualify for ULCS ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EEB' AND course.number = 412 AND program_course.category LIKE '%ULCS%' |
Which time/retired has a qual of 144.02? | CREATE TABLE table_name_75 (time_retired VARCHAR,qual VARCHAR) | SELECT time_retired FROM table_name_75 WHERE qual = 144.02 |
did patient 030-6441 have a wound care procedure at other hospitals? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patie... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitaldischargetime IS NULL)) AND trea... |
count the number of patients who until 4 years ago have been prescribed acd-a for crrt. | 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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE cost (row_id numbe... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acd-a for crrt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')) |
In season is 2008 09, how many wins did they have? | CREATE TABLE table_23959 ("Season" text,"GP" real,"W (OT/SO)" text,"L (OT/SO)" text,"Pts" real,"Pts/GP" text,"GF \u2013 GA" text,"Rank (league/conference)" text,"Top Scorer" text) | SELECT "W (OT/SO)" FROM table_23959 WHERE "Season" = '2008–09' |
How many people scored the most points during the game on December 10? | CREATE TABLE table_27756014_6 (high_points VARCHAR,date VARCHAR) | SELECT COUNT(high_points) FROM table_27756014_6 WHERE date = "December 10" |
For the match with a home team score of 11.14 (80), what was the venue? | CREATE TABLE table_33317 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_33317 WHERE "Home team score" = '11.14 (80)' |
How many positions are there for RB1 Motorsports? | CREATE TABLE table_3588 ("Year" real,"Starts" real,"Wins" real,"Top 10" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text) | SELECT COUNT("Position") FROM table_3588 WHERE "Team(s)" = 'RB1 Motorsports' |
what is minimum days of hospital stay of patients whose age is greater than or equal to 41? | 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 MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "41" |
Who is every high points for the Pistons team? | CREATE TABLE table_23248910_9 (high_points VARCHAR,team VARCHAR) | SELECT high_points FROM table_23248910_9 WHERE team = "Pistons" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.