instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Show the number of documents in different ending date Bin ending date by year interval and group by location code with a group line chart, show by the X from low to high.
CREATE TABLE Document_Locations (Document_ID INTEGER,Location_Code CHAR(15),Date_in_Location_From DATETIME,Date_in_Locaton_To DATETIME)CREATE TABLE Ref_Calendar (Calendar_Date DATETIME,Day_Number INTEGER)CREATE TABLE Documents_to_be_Destroyed (Document_ID INTEGER,Destruction_Authorised_by_Employee_ID INTEGER,Destroyed_...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY Date_in_Locaton_To
calculate the minimum age of female patients who have government health insurance.
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,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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.insurance = "Government"
Please compare the number of names of parties using a bar chart, show by the y-axis in ascending please.
CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroller text,Attorney_General text,US_Senate text)CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE county (County_Id int,Co...
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY COUNT(T2.Party)
In 1985, how many points were earned by the entrant with the March 85B chassis?
CREATE TABLE table_name_77 (points INTEGER,year VARCHAR,chassis VARCHAR)
SELECT MAX(points) FROM table_name_77 WHERE year = 1985 AND chassis = "march 85b"
What is the title of the episode with the production code 3x5362?
CREATE TABLE table_25997153_1 (title VARCHAR,production_code VARCHAR)
SELECT title FROM table_25997153_1 WHERE production_code = "3X5362"
What are the ids of courses offered in Fall of 2009 but not in Spring of 2010?
CREATE TABLE course (course_id text,title text,dept_name text,credits number)CREATE TABLE advisor (s_id text,i_id text)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,time_slot_id text)CREATE TABLE department (dept_name text,building text,budget number)CREATE TA...
SELECT course_id FROM section WHERE semester = 'Fall' AND year = 2009 EXCEPT SELECT course_id FROM section WHERE semester = 'Spring' AND year = 2010
What is the [3 H] paroxetine with a [3 H] CFT less than 3.93, an S D greater than 1891, and a [3H] nizoxetine of 299 (180)?
CREATE TABLE table_65227 ("[ 3 H]CFT" real,"[ 3 H]Nisoxetine" text,"[ 3 H]Paroxetine" text,"N \u00f7 D" real,"S \u00f7 D" real)
SELECT "[ 3 H]Paroxetine" FROM table_65227 WHERE "[ 3 H]CFT" < '3.93' AND "S \u00f7 D" > '1891' AND "[ 3 H]Nisoxetine" = '299 (180)'
what are the five most frequently prescribed drugs that were prescribed to male patients 50s within the same month after being diagnosed with fx facial bone nec-close until 1 year ago?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE ch...
SELECT t3.drug FROM (SELECT t2.drug, 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_icd_diagnoses WHERE ...
The competitor for FIN had how many overall WC points?
CREATE TABLE table_19334 ("Rank" real,"Name" text,"Nationality" text,"1st (m)" text,"2nd (m)" text,"Points" text,"Overall WC points (Rank)" text)
SELECT "Overall WC points (Rank)" FROM table_19334 WHERE "Nationality" = 'FIN'
What kind of Takuu has a North Marquesan of /vehine/?
CREATE TABLE table_name_83 (takuu VARCHAR,north_marquesan VARCHAR)
SELECT takuu FROM table_name_83 WHERE north_marquesan = "/vehine/"
Return a bar chart on what are the ids and details for all organizations that have grants of more than 6000 dollars?
CREATE TABLE Project_Staff (staff_id DOUBLE,project_id INTEGER,role_code VARCHAR(10),date_from DATETIME,date_to DATETIME,other_details VARCHAR(255))CREATE TABLE Projects (project_id INTEGER,organisation_id INTEGER,project_details VARCHAR(255))CREATE TABLE Grants (grant_id INTEGER,organisation_id INTEGER,grant_amount DE...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details
In what year was the rank 24?
CREATE TABLE table_66838 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Year" FROM table_66838 WHERE "Rank" = '24'
What is every date of Mark Taylor as winning driver?
CREATE TABLE table_73881 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text)
SELECT "Date" FROM table_73881 WHERE "Winning driver" = 'Mark Taylor'
What is the Lane of the swimmer with a Rank of 8?
CREATE TABLE table_name_24 (lane INTEGER,rank VARCHAR)
SELECT MAX(lane) FROM table_name_24 WHERE rank = 8
count the number of patients whose procedure icd9 code is 4610.
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 procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "4610"
What is the position for Discus in 2013?
CREATE TABLE table_name_98 (position VARCHAR,event VARCHAR,year VARCHAR)
SELECT position FROM table_name_98 WHERE event = "discus" AND year = 2013
Count the number of patients who have stayed in the hospital for more than 23 days with phenylephrine hcl.
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "23" AND prescriptions.drug = "Phenylephrine HCl"
What was his position when the team was FMS International?
CREATE TABLE table_3294 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text)
SELECT "Position" FROM table_3294 WHERE "Team" = 'FMS International'
Jacques Villeneuve was on what grid?
CREATE TABLE table_51464 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text)
SELECT "Grid" FROM table_51464 WHERE "Driver" = 'jacques villeneuve'
What is the total Decile that has a state authority, fairlie area and roll smarter than 206?
CREATE TABLE table_79982 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real)
SELECT COUNT("Decile") FROM table_79982 WHERE "Authority" = 'state' AND "Area" = 'fairlie' AND "Roll" < '206'
What is the venue for the Status of Five Nations and 0 againts?
CREATE TABLE table_12576 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text)
SELECT "Venue" FROM table_12576 WHERE "Status" = 'five nations' AND "Against" = '0'
What conferences did li dong publish in in 2016 ?
CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperfield (fieldid int,p...
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'li dong' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
what was the only year the venue was in japan ?
CREATE TABLE table_204_880 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text)
SELECT "year" FROM table_204_880 WHERE "venue" = 'japan'
flights from DENVER to SEATTLE on saturday morning on CO
CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop...
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 = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND...
What is the number of types of competition?
CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE competition (Competition_ID int,...
SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type
give me the number of patients whose marital status is married and lab test chart time is 2165-06-23 22:30:00?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.charttime = "2165-06-23 22:30:00"
provide the number of patients whose ethnicity is black/african american?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN"
Show the names and ids of tourist attractions that are visited at least two times. Visualize by bar chart.
CREATE TABLE Street_Markets (Market_ID INTEGER,Market_Details VARCHAR(255))CREATE TABLE Tourist_Attraction_Features (Tourist_Attraction_ID INTEGER,Feature_ID INTEGER)CREATE TABLE Shops (Shop_ID INTEGER,Shop_Details VARCHAR(255))CREATE TABLE Visits (Visit_ID INTEGER,Tourist_Attraction_ID INTEGER,Tourist_ID INTEGER,Visit...
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID
For those employees who was hired before 2002-06-21, give me the comparison about the average of department_id over the hire_date bin hire_date by time by a bar chart, sort 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 countries (COUNTRY_ID varchar(2),...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID) DESC
What was the score of the match against duk-hee lee?
CREATE TABLE table_75596 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Score" FROM table_75596 WHERE "Opponent" = 'duk-hee lee'
Name the season number for herr ostropolyer, pastry chef
CREATE TABLE table_19852975_3 (season__number INTEGER,arties_disguises VARCHAR)
SELECT MIN(season__number) FROM table_19852975_3 WHERE arties_disguises = "Herr Ostropolyer, pastry chef"
Which Home Team has a Result of 124-101?
CREATE TABLE table_48709 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text)
SELECT "Home Team" FROM table_48709 WHERE "Result" = '124-101'
What award was Hannah Gal the recipient of?
CREATE TABLE table_name_23 (award VARCHAR,recipient VARCHAR)
SELECT award FROM table_name_23 WHERE recipient = "hannah gal"
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of revenue , and group by attribute name, I want to show Y-axis from high to low order.
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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue DESC
list each of the countries that have more than 4 in gold medals and also more than 3 in silver medals .
CREATE TABLE table_203_724 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_203_724 WHERE "gold" > 4 AND "silver" > 3
What is the highest number of losses that the team incurred while scoring less than 79 points in 10 games with a point differential less than 34?
CREATE TABLE table_name_69 (losses INTEGER,point_differential VARCHAR,points_for VARCHAR,games_played VARCHAR)
SELECT MAX(losses) FROM table_name_69 WHERE points_for < 79 AND games_played = 10 AND point_differential < 34
Who is the second member when RT Hon. Edward Stanley is the first member?
CREATE TABLE table_60787 ("Year" real,"First member" text,"First party" text,"Second member" text,"Second party" text)
SELECT "Second member" FROM table_60787 WHERE "First member" = 'rt hon. edward stanley'
What is the relationship between Credits and DNO ?
CREATE TABLE Department (DNO INTEGER,Division VARCHAR(2),DName VARCHAR(25),Room VARCHAR(5),Building VARCHAR(13),DPhone INTEGER)CREATE TABLE Enrolled_in (StuID INTEGER,CID VARCHAR(7),Grade VARCHAR(2))CREATE TABLE Course (CID VARCHAR(7),CName VARCHAR(40),Credits INTEGER,Instructor INTEGER,Days VARCHAR(5),Hours VARCHAR(11...
SELECT Credits, DNO FROM Course ORDER BY Credits
For what class is the laps 66?
CREATE TABLE table_name_65 (class VARCHAR,laps VARCHAR)
SELECT class FROM table_name_65 WHERE laps = 66
For all employees who have the letters D or S in their first name, visualize the relationship between employee_id and manager_id .
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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,J...
SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
Who was the away team when Brighton & Hove Albion was home?
CREATE TABLE table_63325 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Away team" FROM table_63325 WHERE "Home team" = 'brighton & hove albion'
When is the Save of Ayala and a Loss of Olivares
CREATE TABLE table_name_70 (date VARCHAR,save VARCHAR,loss VARCHAR)
SELECT date FROM table_name_70 WHERE save = "ayala" AND loss = "olivares"
Who was the Class AAAA champion in 2006-07?
CREATE TABLE table_19428 ("School Year" text,"Class A" text,"Class AA" text,"Class AAA" text,"Class AAAA" text,"Class AAAAA" text)
SELECT "Class AAAA" FROM table_19428 WHERE "School Year" = '2006-07'
[N] Billion Times a developer got help.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,...
SELECT NUMBER_TO_STR(COUNT(*) / @billion, 'N2') + ' Billion Times a developer got help' AS "#_helped" FROM Posts LEFT JOIN Votes ON Posts.Id = Votes.PostId WHERE PostTypeId = 0 AND (Score <= 0)
how much does it cost for emtricitabine-tenofovir?
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_labitems (row_id number,itemid number,label text)CREATE TABLE microbiologyevents (row_id number,subject_id number,...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'emtricitabine-tenofovir')
What is the Country with the T3 Place Player with a Score of 71-76-71=218?
CREATE TABLE table_8724 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_8724 WHERE "Place" = 't3' AND "Score" = '71-76-71=218'
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the amount of name , and group by attribute name, and show total number in asc 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, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name)
what is the average cost of a hospital bill that includes a drug called 0.4 ml syringe : enoxaparin sodium 40 mg/0.4ml sc soln in 2105?
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 AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '0.4 ml syringe : enoxaparin sodium 40 mg/0.4ml...
Which catalog has a date of 24 march 2006?
CREATE TABLE table_47196 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Catalog" FROM table_47196 WHERE "Date" = '24 march 2006'
Show the card type codes and the number of transactions in a pie chart.
CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER,account_id INTEGER,card_id INTE...
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code
What game site has december 24, 2000 as a date?
CREATE TABLE table_37461 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" text)
SELECT "Game site" FROM table_37461 WHERE "Date" = 'december 24, 2000'
please show me all the flights from INDIANAPOLIS to SAN DIEGO tomorrow
CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE state (state_cod...
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 = 'SAN DIEGO' AND date_day.day_number = 20 AND date_day.month_number = 1 AND...
Which location has the promotor Frank Moloney, and the opponent Gennadiy Rasalev?
CREATE TABLE table_name_21 (location VARCHAR,promotor VARCHAR,opponent VARCHAR)
SELECT location FROM table_name_21 WHERE promotor = "frank moloney" AND opponent = "gennadiy rasalev"
For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the founder , and group by attribute founder 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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
Find the number of students living in each city with a bar chart, and display in ascending by the Y.
CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1)...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*)
What Weblink has a College or Campus Name of anna university college of engineering kanchipuram?
CREATE TABLE table_78827 ("College or Campus Name" text,"Location" text,"District" text,"Affiliation" text,"Weblink" text)
SELECT "Weblink" FROM table_78827 WHERE "College or Campus Name" = 'anna university college of engineering kanchipuram'
give me the number of patients categorized under chemistry lab test who have benign neoplasm of skin of other and unspecified parts of face diagnoses.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Benign neoplasm of skin of other and unspecified parts of face" AND lab."CATEGORY" = "Chemistry"
Who scored the most points in game 4?
CREATE TABLE table_72135 ("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_72135 WHERE "Game" = '4'
what is minimum age of patients whose gender is m and year of birth is greater than 2078?
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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year > "2078"
How many FLT appearances for the player with less than 5 total goals, and 3 FA Cup appearances, 4 league goals, and plays MF?
CREATE TABLE table_61712 ("Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" text,"FA Cup Goals" real,"League Cup Apps" text,"League Cup Goals" real,"FLT Apps" text,"FLT Goals" real,"Total Apps" text,"Total Goals" real)
SELECT "FLT Apps" FROM table_61712 WHERE "Total Goals" < '5' AND "FA Cup Apps" = '3' AND "Position" = 'mf' AND "League Goals" = '4'
who is the player for the position defence and the college/junior/club team is ottawa 67's (ohl)?
CREATE TABLE table_2679061_1 (player VARCHAR,position VARCHAR,college_junior_club_team VARCHAR)
SELECT player FROM table_2679061_1 WHERE position = "Defence" AND college_junior_club_team = "Ottawa 67's (OHL)"
when has patient 77053 first had the maximum value of monocytes in 04/this year?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77053) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'monocytes') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE...
What was the little league team from Kentucky when the little league team from Michigan was Grosse Pointe Farms-City LL Grosse Pointe Farms?
CREATE TABLE table_18461045_1 (kentucky VARCHAR,michigan VARCHAR)
SELECT kentucky FROM table_18461045_1 WHERE michigan = "Grosse Pointe Farms-City LL Grosse Pointe Farms"
If the year is 2001, what are the non qatari female?
CREATE TABLE table_26214389_3 (Non VARCHAR,year VARCHAR)
SELECT Non AS qatari_female FROM table_26214389_3 WHERE year = 2001
What is the date of the game located in Madison Square Garden, when the team is Seattle and the game number is less than 6?
CREATE TABLE table_name_36 (date VARCHAR,team VARCHAR,location_attendance VARCHAR,game VARCHAR)
SELECT date FROM table_name_36 WHERE location_attendance = "madison square garden" AND game < 6 AND team = "seattle"
What was the competition on 7 June 1999?
CREATE TABLE table_77816 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Competition" FROM table_77816 WHERE "Date" = '7 june 1999'
What episode has 7.8 million viewers?
CREATE TABLE table_name_13 (episode VARCHAR,viewers__in_millions_ VARCHAR)
SELECT episode FROM table_name_13 WHERE viewers__in_millions_ = "7.8"
What was the result in 2008?
CREATE TABLE table_59414 ("Year" text,"Result" text,"Matches" text,"Wins" text,"Draws" text,"Losses" text)
SELECT "Result" FROM table_59414 WHERE "Year" = '2008'
What was the highest Pick # for the College of Simon Fraser?
CREATE TABLE table_78329 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT MAX("Pick #") FROM table_78329 WHERE "College" = 'simon fraser'
How many yachts show a corrected time d:hh:mm:ss is 4:00:05:35?
CREATE TABLE table_3312 ("Position" real,"Sail number" text,"Yacht" text,"State/country" text,"Yacht type" text,"LOA (Metres)" text,"Skipper" text,"Corrected time d:hh:mm:ss" text)
SELECT COUNT("Yacht") FROM table_3312 WHERE "Corrected time d:hh:mm:ss" = '4:00:05:35'
What school did the player that has been in Toronto from 2010-2012 go to?
CREATE TABLE table_15855 ("Player" text,"No." text,"Nationality" text,"Position" text,"Years in Toronto" text,"School/Club Team" text)
SELECT "School/Club Team" FROM table_15855 WHERE "Years in Toronto" = '2010-2012'
what is the minimum amount of total hospital cost including oth mult lb-in hosp w cs until 1 year ago?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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 ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth mult lb-in hosp w cs')) AND DATETIME(cost.chargetime) <= DA...
Which location and what was the attendance when lebron james (10) had the high assists?
CREATE TABLE table_3847 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text)
SELECT "Location Attendance" FROM table_3847 WHERE "High assists" = 'LeBron James (10)'
Which is the total number in the 2010 Census in Oconee County where the area in square miles was less than 674?
CREATE TABLE table_56570 ("County" text,"Year Founded" text,"County Seat" text,"2010 Census Population" real,"July 1,2012 Population Estimate." real,"Area (Sq. Mi.)" real,"Land Area (Sq. Mi.)" real)
SELECT SUM("2010 Census Population") FROM table_56570 WHERE "County" = 'oconee county' AND "Area (Sq. Mi.)" < '674'
Show the date and the corresponding sales of the journal which did not have any of the listed editors serving on the committee by a bar chart, and rank X-axis in ascending order.
CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)
SELECT T1.Date, T1.Sales FROM journal EXCEPT SELECT T1.Date, T1.Theme, T1.Sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.Journal_ID = T2.Journal_ID ORDER BY T1.Date
What's the total with silver being less than 0, less than 1 gold, and 3 bronze?
CREATE TABLE table_63750 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Total") FROM table_63750 WHERE "Bronze" = '3' AND "Gold" < '1' AND "Silver" < '0'
What was the win for 4 matches with a success rate of 25%?
CREATE TABLE table_name_70 (wins VARCHAR,matches VARCHAR,success_rate VARCHAR)
SELECT wins FROM table_name_70 WHERE matches = "4" AND success_rate = "25%"
Can you tell me the English translation that has the Artist of camillo felgen?
CREATE TABLE table_61981 ("Draw" real,"Language" text,"Artist" text,"English translation" text,"Place" real,"Points" real)
SELECT "English translation" FROM table_61981 WHERE "Artist" = 'camillo felgen'
Show me minimal weight by sex in a histogram, rank in desc by the bars.
CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
What is the 1988 result that has a 1994 result of A, and 3r as the 1987 result?
CREATE TABLE table_8778 ("Tournament" text,"1987" text,"1988" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"Career SR" text)
SELECT "1988" FROM table_8778 WHERE "1994" = 'a' AND "1987" = '3r'
tell me patient 56009's hospital admission time until 2100?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 56009 AND STRFTIME('%y', admissions.admittime) <= '2100'
Which Score has a Away team of walthamstow avenue?
CREATE TABLE table_7609 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Score" FROM table_7609 WHERE "Away team" = 'walthamstow avenue'
Which rd. occurred on 22 October?
CREATE TABLE table_1137718_2 (rd INTEGER,date VARCHAR)
SELECT MIN(rd) FROM table_1137718_2 WHERE date = "22 October"
Return a scatter chart about the correlation between ID and meter_100 .
CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)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 stadiu...
SELECT ID, meter_100 FROM swimmer
Give me the comparison about meter_100 over the meter_400 , I want to show bars in descending order please.
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_400 DESC
Who is moving to Metalurh Donetsk?
CREATE TABLE table_44677 ("Nat." text,"Name" text,"Moving to" text,"Type" text,"Transfer window" text,"Transfer fee" text,"Source" text)
SELECT "Name" FROM table_44677 WHERE "Moving to" = 'metalurh donetsk'
what was the number of times czech republic played against germany ?
CREATE TABLE table_203_537 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text)
SELECT COUNT(*) FROM table_203_537 WHERE "opponent" = 'germany'
What is the smallest rank number of those used to rank the islands?
CREATE TABLE table_13897690_1 (rank INTEGER)
SELECT MIN(rank) FROM table_13897690_1
When hany abu-assad category:articles with hcards is the director what is the result?
CREATE TABLE table_28779 ("Year (Ceremony)" text,"English title" text,"Arabic title" text,"Director" text,"Result" text)
SELECT "Result" FROM table_28779 WHERE "Director" = 'Hany Abu-Assad Category:Articles with hCards'
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and rank by the Y-axis from low to high.
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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID ...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID)
Which Doctor Who episode has a Original airdate (UK) of dvd only?
CREATE TABLE table_9770 ("Episode #" text,"Original airdate (UK)" text,"Episode title" text,"Doctor Who episode" text,"Webcast link" text)
SELECT "Doctor Who episode" FROM table_9770 WHERE "Original airdate (UK)" = 'dvd only'
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of code , and group by attribute name, I want to list from high to low by the bar.
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 T2.Name DESC
What is the Place of Player with To par of +6 and Score of 78-70-74=222?
CREATE TABLE table_name_79 (place VARCHAR,to_par VARCHAR,score VARCHAR)
SELECT place FROM table_name_79 WHERE to_par = "+6" AND score = 78 - 70 - 74 = 222
When Does Martijn Pieters Sleep?.
CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostLinks (Id number,Creatio...
SELECT TIME_TO_STR(CreationDate, '%I') AS "hour", COUNT(*) AS "frequency" FROM Posts WHERE OwnerUserId = '##UserID##' GROUP BY TIME_TO_STR(CreationDate, '%I')
Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.
CREATE TABLE artist (Famous_Title VARCHAR,Artist_ID VARCHAR)CREATE TABLE volume (Artist_ID VARCHAR,Weeks_on_Top INTEGER)
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2
Which type is a satellite of GPS IIIA-2?
CREATE TABLE table_name_54 (type VARCHAR,satellite VARCHAR)
SELECT type FROM table_name_54 WHERE satellite = "gps iiia-2"
Name the least ai %
CREATE TABLE table_22066 ("Story No." text,"Episode" real,"Title" text,"Directed by" text,"Written by" text,"UK viewers (million)" text,"AI (%)" real,"Original air date" text,"Production code" text)
SELECT MIN("AI (%)") FROM table_22066
What is the location attendance of the game with Kobe Bryant (18) with the highest points on November 18?
CREATE TABLE table_10118 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"Location Attendance" text,"Record" text)
SELECT "Location Attendance" FROM table_10118 WHERE "High points" = 'kobe bryant (18)' AND "Date" = 'november 18'
What is the area of the nation with GDP per capita (US$) of 11,929?
CREATE TABLE table_71504 ("Member countries" text,"Population" text,"Area (km\u00b2)" text,"GDP (billion US$)" text,"GDP per capita (US$)" text)
SELECT "Area (km\u00b2)" FROM table_71504 WHERE "GDP per capita (US$)" = '11,929'
What is the duration of the flight with end time of 21:06?
CREATE TABLE table_70276 ("Start Date/Time" text,"Duration" text,"End Time" text,"Spacecraft" text,"Crew" text)
SELECT "Duration" FROM table_70276 WHERE "End Time" = '21:06'