instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of manufacturer , and group by attribute founder in a bar chart, display by the total number of manufacturer in asc.
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 Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer)
What are the tries against when they played against Bridgend?
CREATE TABLE table_21064 ("Team" text,"P" real,"W" real,"D" real,"L" real,"Tries for" real,"Tries against" real,"Try diff" text,"Points for" real,"Points against" real,"Points diff" text,"Pts" real)
SELECT MAX("Tries against") FROM table_21064 WHERE "Team" = 'Bridgend'
What is the result with a Round of 3, and an Opponent of keith wisniewski?
CREATE TABLE table_56025 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text,"Time" text)
SELECT "Res." FROM table_56025 WHERE "Round" = '3' AND "Opponent" = 'keith wisniewski'
what is the total number of hours that have passed since patient 006-123134's last pt lab test during the current hospital visit?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,c...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-123134' AND patient.hos...
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 order by the total number of price in desc.
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.Price DESC
Show the number of male and female assistant professors.
CREATE TABLE Faculty (sex VARCHAR,rank VARCHAR)
SELECT sex, COUNT(*) FROM Faculty WHERE rank = "AsstProf" GROUP BY sex
Played on Clay Surface, what was the Score of the Dortmund Tournament?
CREATE TABLE table_name_70 (score_in_the_final VARCHAR,surface VARCHAR,tournament VARCHAR)
SELECT score_in_the_final FROM table_name_70 WHERE surface = "clay" AND tournament = "dortmund"
i will be staying downtown in ATLANTA for two hours could you tell me what the ground transportation is available
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flig...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ATLANTA' AND ground_service.city_code = city.city_code
what were the four most common drugs prescribed to patients aged 20s during the same hospital visit after they had been diagnosed with fx lumbar vertebra-close this year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_i...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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 is themens doubles when the mens singles is flemming delfs?
CREATE TABLE table_17519 ("Year" real,"Mens singles" text,"Womens singles" text,"Mens doubles" text,"Womens doubles" text,"Mixed doubles" text)
SELECT "Mens doubles" FROM table_17519 WHERE "Mens singles" = 'Flemming Delfs'
Who is the outgoing manager when the team is simurq pfc?
CREATE TABLE table_29284 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text)
SELECT "Outgoing manager" FROM table_29284 WHERE "Team" = 'Simurq PFC'
what are the number of times 2013 appears under the commenced column ?
CREATE TABLE table_204_49 (id number,"city" text,"country" text,"iata" text,"icao" text,"airport" text,"commenced" number,"ended" text)
SELECT COUNT(*) FROM table_204_49 WHERE "commenced" = 2013
Are any of the courses I 've taken computing infrastructure courses ?
CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE requirement (requirement_id int,requirement varch...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%computing infrastructure%' AND student_record.student_id = 1
when patient 006-149778 since 6 years ago last received a procedure?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE lab (labid number,patientunitstayid num...
SELECT 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 = '006-149778')) AND DATETIME(treatment.treatmenttime) >= DATETIME(C...
What was the Event in the city of copenhagen?
CREATE TABLE table_71054 ("Date" text,"City" text,"Event" text,"Winner" text,"Prize" text)
SELECT "Event" FROM table_71054 WHERE "City" = 'copenhagen'
Show the product name and total order quantity for each product. Visualize by pie chart.
CREATE TABLE Customer_Address_History (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VARCHAR(50),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50))CREATE TABLE Customers (customer...
SELECT T1.product_name, SUM(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name
what were the number of times second place was earned ?
CREATE TABLE table_203_231 (id number,"season" text,"tier" number,"division" text,"place" text)
SELECT COUNT(*) FROM table_203_231 WHERE "place" = 2
Which 2009 year has a total of 1, and 2004 year of 7th?
CREATE TABLE table_68542 ("2001" text,"2004" text,"2009" text,"2013" text,"Total" real)
SELECT "2009" FROM table_68542 WHERE "Total" = '1' AND "2004" = '7th'
How many laps were there when the Time/Retired was +1:00.003?
CREATE TABLE table_67520 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text)
SELECT "Laps" FROM table_67520 WHERE "Time/Retired" = '+1:00.003'
What Japanese title had average ratings of 9.2% on the NHK station?
CREATE TABLE table_13778 ("Japanese Title" text,"Romaji Title" text,"TV Station" text,"Episodes" text,"Average Ratings" text)
SELECT "Japanese Title" FROM table_13778 WHERE "Average Ratings" = '9.2%' AND "TV Station" = 'nhk'
For those employees who do not work in departments with managers that have ids between 100 and 200, show me the trend about manager_id over hire_date with a line chart, I want to sort from low to high by the x-axis.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))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 countries (...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
Name the college that has 10000 enrolled
CREATE TABLE table_23138 ("Institution" text,"Nickname" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real)
SELECT "Institution" FROM table_23138 WHERE "Enrollment" = '10000'
what difference in weight did patient 8016 have second measured on the last hospital visit compared to the value first measured on the last hospital visit?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,l...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND cha...
which team #1 played again chalkida
CREATE TABLE table_21434618_1 (team__number1 VARCHAR,team__number2 VARCHAR)
SELECT team__number1 FROM table_21434618_1 WHERE team__number2 = "Chalkida"
For a year that is later than 2002 what is the class position?
CREATE TABLE table_name_53 (class VARCHAR,year INTEGER)
SELECT class AS pos FROM table_name_53 WHERE year > 2002
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name, rank by the y-axis from low to high.
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, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY COUNT(T2.Name)
Name the least podiums for 2009
CREATE TABLE table_29379 ("Season" real,"Series" text,"Team" text,"Starts" real,"Wins" real,"Podiums" real,"Poles" real,"Fastest Laps" real,"Points" text,"Place" text)
SELECT MIN("Podiums") FROM table_29379 WHERE "Season" = '2009'
What is the total Lane with a Mark of 47.02, and a Heat higher than 5?
CREATE TABLE table_48947 ("Heat" real,"Lane" real,"Name" text,"Country" text,"Mark" text)
SELECT SUM("Lane") FROM table_48947 WHERE "Mark" = '47.02' AND "Heat" > '5'
What is the number for Chauchilla Cemetery Battle with less than 511 pieces?
CREATE TABLE table_name_54 (number INTEGER,pieces VARCHAR,name VARCHAR)
SELECT AVG(number) FROM table_name_54 WHERE pieces < 511 AND name = "chauchilla cemetery battle"
Unlocked Questions From High Reputation Users Without Accepted Answers.
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 q.Id AS "post_link", q.Score, u.Id AS "user_link", u.Reputation FROM Posts AS q INNER JOIN Users AS u ON q.OwnerUserId = u.Id WHERE q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL AND q.ClosedDate IS NULL AND (SELECT COUNT(*) FROM PostHistory AS h WHERE h.PostId = q.Id AND h.PostHistoryTypeId = 14) > (SELECT COU...
What is the Tie Number when Barnsley was the away team?
CREATE TABLE table_47603 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Tie no" FROM table_47603 WHERE "Away team" = 'barnsley'
Which of V/Line Passenger's pre-conversions re-entered service on 23 November 1984?
CREATE TABLE table_34838 ("Locomotive" text,"Pre-conversion" text,"Entered service (T)" text,"Re-entered service (P)" text,"Owner" text)
SELECT "Pre-conversion" FROM table_34838 WHERE "Owner" = 'v/line passenger' AND "Re-entered service (P)" = '23 november 1984'
What was the total when the first was November 1966?
CREATE TABLE table_58732 ("Name" text,"Total" real,"First" text,"Last" text,"Highest rank" text)
SELECT SUM("Total") FROM table_58732 WHERE "First" = 'november 1966'
Name the outgoing manager for esteban vigo
CREATE TABLE table_27666856_3 (outgoing_manager VARCHAR,replaced_by VARCHAR)
SELECT COUNT(outgoing_manager) FROM table_27666856_3 WHERE replaced_by = "Esteban Vigo"
Name the number of names for exeter chiefs
CREATE TABLE table_25609 ("Season" text,"Name" text,"Teams" real,"Relegated to League" text,"Promoted to League" text,"Promoted from League" text,"Relegated from League" text)
SELECT COUNT("Name") FROM table_25609 WHERE "Promoted from League" = 'Exeter Chiefs'
give me the number of patients whose death status is 1 and procedure short title is endosc remove bile stone?
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 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.expire_flag = "1" AND procedures.short_title = "Endosc remove bile stone"
What is the average total of player Simon Donnelly, with a Scottish Cup greater than 0?
CREATE TABLE table_name_2 (total INTEGER,player VARCHAR,scottish_cup VARCHAR)
SELECT AVG(total) FROM table_name_2 WHERE player = "simon donnelly" AND scottish_cup > 0
what is the change in po2 patient 3273 experiences last measured on the first hospital visit compared to the first value measured on the first hospital visit?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label =...
What was the vacancy date for Thomas Thomasberg?
CREATE TABLE table_27782699_3 (date_of_vacancy VARCHAR,outgoing_manager VARCHAR)
SELECT date_of_vacancy FROM table_27782699_3 WHERE outgoing_manager = "Thomas Thomasberg"
Which Team classification has a Combination classification of egoi mart nez, and a Winner of tom boonen?
CREATE TABLE table_name_28 (team_classification VARCHAR,combination_classification VARCHAR,winner VARCHAR)
SELECT team_classification FROM table_name_28 WHERE combination_classification = "egoi martínez" AND winner = "tom boonen"
What date was the record 11-67?
CREATE TABLE table_22879323_10 (date VARCHAR,record VARCHAR)
SELECT date FROM table_22879323_10 WHERE record = "11-67"
Who was the elevator when the Cardinal-Deacon of S. Nicola in Carcere Tulliano was the order and title?
CREATE TABLE table_name_56 (elevator VARCHAR,order_and_title VARCHAR)
SELECT elevator FROM table_name_56 WHERE order_and_title = "cardinal-deacon of s. nicola in carcere tulliano"
Name the total number of tier 1 capital for allied irish banks
CREATE TABLE table_22368322_2 (_€_million VARCHAR,tier_1_capital VARCHAR,institution VARCHAR)
SELECT COUNT(tier_1_capital), _€_million FROM table_22368322_2 WHERE institution = "Allied Irish Banks"
flight numbers from CHICAGO to SEATTLE
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE city (city_code varchar...
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 = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL...
Tell me the final score for january 9 for cincinnati bengals
CREATE TABLE table_78513 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text)
SELECT "Final Score" FROM table_78513 WHERE "Date" = 'january 9' AND "Host Team" = 'cincinnati bengals'
Find the names of stadiums that some Australian swimmers have been to.
CREATE TABLE swimmer (id number,name text,nationality text,meter_100 number,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,time text)CREATE TABLE record (id number,result text,swimmer_id number,event_id number)CREATE TABLE event (id number,name text,stadium_id number,year text...
SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia'
For those records from the products and each product's manufacturer, find founder and the average of revenue , and group by attribute founder, and visualize them by a bar chart, could you sort x-axis in ascending order please?
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
what is the number of patients whose marital status is married and admission year is less than 2198?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2198"
What is the earliest stage where mountains classifications was awarded to Peter Stetina?
CREATE TABLE table_25802689_14 (stage INTEGER,mountains_classification VARCHAR)
SELECT MIN(stage) FROM table_25802689_14 WHERE mountains_classification = "Peter Stetina"
What is the hometown of Devon Bookert who is 6-3 tall?
CREATE TABLE table_name_62 (hometown VARCHAR,height VARCHAR,name VARCHAR)
SELECT hometown FROM table_name_62 WHERE height = "6-3" AND name = "devon bookert"
What is the sum of Points, when the Performer is fe-mail?
CREATE TABLE table_40717 ("Draw" real,"Song" text,"Performer" text,"Points" real,"Rank" text)
SELECT SUM("Points") FROM table_40717 WHERE "Performer" = 'fe-mail'
how many times adefovir dipivoxil has been prescribed to patient 18159 on their last hospital encounter?
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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'adefovir dipivoxil'
What is jos mar a olaz bal's country?
CREATE TABLE table_name_39 (country VARCHAR,player VARCHAR)
SELECT country FROM table_name_39 WHERE player = "josé maría olazábal"
how many patients in 2104 were staying in the tsicu careunit?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code tex...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND STRFTIME('%y', transfers.intime) = '2104')
Show the number of assets and group by asset make in a bar chart, order in asc by the how many asset make.
CREATE TABLE Asset_Parts (asset_id INTEGER,part_id INTEGER)CREATE TABLE Maintenance_Engineers (engineer_id INTEGER,company_id INTEGER,first_name VARCHAR(50),last_name VARCHAR(50),other_details VARCHAR(255))CREATE TABLE Engineer_Visits (engineer_visit_id INTEGER,contact_staff_id INTEGER,engineer_id INTEGER,fault_log_ent...
SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY COUNT(asset_make)
When did the episode written by Jim Morris air?
CREATE TABLE table_10470082_8 (us_air_date VARCHAR,writer VARCHAR)
SELECT us_air_date FROM table_10470082_8 WHERE writer = "Jim Morris"
Bring the number of white-russian patients who have an id route of drug administration.
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.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "ID"
which country had more competitions , germany or greece ?
CREATE TABLE table_203_715 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text)
SELECT "venue" FROM table_203_715 WHERE "venue" IN ('germany', 'greece') GROUP BY "venue" ORDER BY COUNT("competition") DESC LIMIT 1
what is the number of passengers when the capacity is 81.2%?
CREATE TABLE table_name_88 (total_passengers INTEGER,capacity_in_use VARCHAR)
SELECT SUM(total_passengers) FROM table_name_88 WHERE capacity_in_use = "81.2%"
what are the flights from ONTARIO to MEMPHIS
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_dis...
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 = 'ONTARIO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEMPHI...
Which conference is Belmont in?
CREATE TABLE table_72772 ("School" text,"Record" text,"Conference" text,"Conf. record" text,"Regular season finish" text,"Regular season second place" text)
SELECT "Conference" FROM table_72772 WHERE "School" = 'Belmont'
How many gains have a long greater than 8, with avg/g of 124.9?
CREATE TABLE table_65668 ("Name" text,"Gain" real,"Loss" real,"Long" real,"Avg/G" real)
SELECT SUM("Gain") FROM table_65668 WHERE "Long" > '8' AND "Avg/G" = '124.9'
What is the average points that Centro Asegurador earned with the McLaren M23 chassis?
CREATE TABLE table_68590 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT AVG("Points") FROM table_68590 WHERE "Chassis" = 'mclaren m23' AND "Entrant" = 'centro asegurador'
Which Home team has a score of 12.10 (82)?
CREATE TABLE table_47718 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_47718 WHERE "Home team score" = '12.10 (82)'
Where was the game played that had an away team score of 20.17 (137)?
CREATE TABLE table_10531 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_10531 WHERE "Away team score" = '20.17 (137)'
What was the away team score when the home team was the Brisbane Lions?
CREATE TABLE table_name_83 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team AS score FROM table_name_83 WHERE home_team = "brisbane lions"
What is the Location when the team was seve ballesteros & manuel pi ero?
CREATE TABLE table_name_61 (location VARCHAR,team VARCHAR)
SELECT location FROM table_name_61 WHERE team = "seve ballesteros & manuel piñero"
How many distinct artists do the volumes associate to?
CREATE TABLE music_festival (id number,music_festival text,date_of_ceremony text,category text,volume number,result text)CREATE TABLE artist (artist_id number,artist text,age number,famous_title text,famous_release_date text)CREATE TABLE volume (volume_id number,volume_issue text,issue_date text,weeks_on_top number,son...
SELECT COUNT(DISTINCT artist_id) FROM volume
what is the first place listed in this chart ?
CREATE TABLE table_203_554 (id number,"year" number,"place" text,"gold" text,"silver" text,"bronze" text)
SELECT "place" FROM table_203_554 WHERE id = 1
who lost on august 21?
CREATE TABLE table_name_10 (loss VARCHAR,date VARCHAR)
SELECT loss FROM table_name_10 WHERE date = "august 21"
On what date did the Rockets play Memphis?
CREATE TABLE table_72868 ("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_72868 WHERE "Team" = 'Memphis'
flights from ATLANTA to SEATTLE
CREATE TABLE code_description (code varchar,description text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL...
what is the number of patients whose admission year is less than 2172 and diagnoses long title is other persistent mental disorders due to conditions classified elsewhere?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2172" AND diagnoses.long_title = "Other persistent mental disorders due to conditions classified elsewhere"
what was the top four most common diagnoses until 2104.
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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
how many patients have undergone oth cardiac mon output this year after inject ca chemother nec procedure within 2 months?
CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid nu...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime 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 = 'inject ca c...
What is the mid-2010 to mid-2011 change where the July 1, 2011 density is 508?
CREATE TABLE table_59596 ("Rank" text,"County" text,"State" text,"Land area (km\u00b2)" text,"Land area (mi\u00b2)" text,"April 1,2010 census" text,"April 1,2010 density (/km\u00b2)" text,"April 1,2010 density (/mi\u00b2)" text,"July 1,2010 official estimate" text,"July 1,2010 density (/km\u00b2)" text,"July 1,2010 den...
SELECT "Mid-2010 to mid-2011 change (%)" FROM table_59596 WHERE "July 1, 2011 density (/mi\u00b2)" = '508'
Which artist has 13 points?
CREATE TABLE table_64789 ("Draw" real,"Song" text,"Artist" text,"Points" real,"Place" text)
SELECT "Artist" FROM table_64789 WHERE "Points" = '13'
What group was sunline in when he was at moonee valley?
CREATE TABLE table_2581397_2 (group VARCHAR,venue VARCHAR)
SELECT group FROM table_2581397_2 WHERE venue = "Moonee Valley"
Which Unit's Construction started on 01.07.1967?
CREATE TABLE table_70002 ("Unit" text,"Reactortype" text,"Net capacity" text,"Gross capacity" text,"Construction started" text,"Electricity Grid" text,"Commercial Operation" text,"Shutdown" text)
SELECT "Unit" FROM table_70002 WHERE "Construction started" = '01.07.1967'
How many positions did 1972 NHL Draft pick Rene Lambert play?
CREATE TABLE table_1473672_10 (position VARCHAR,player VARCHAR)
SELECT COUNT(position) FROM table_1473672_10 WHERE player = "Rene Lambert"
What was the record for the game where the opponent was the Carolina Hurricanes?
CREATE TABLE table_27537518_9 (record VARCHAR,opponent VARCHAR)
SELECT record FROM table_27537518_9 WHERE opponent = "Carolina Hurricanes"
Which City has an Average of 6.85?
CREATE TABLE table_name_27 (city VARCHAR,average VARCHAR)
SELECT city FROM table_name_27 WHERE average = 6.85
When has Attempts of 282 ?
CREATE TABLE table_name_3 (year VARCHAR,attempts VARCHAR)
SELECT year FROM table_name_3 WHERE attempts = "282"
Name the call sign for ERP W of 4
CREATE TABLE table_name_20 (call_sign VARCHAR,erp_w VARCHAR)
SELECT call_sign FROM table_name_20 WHERE erp_w = 4
What is the kickoff time for the Hubert H. Humphrey Metrodome?
CREATE TABLE table_name_12 (kickoff_ VARCHAR,a_ VARCHAR,game_site VARCHAR)
SELECT kickoff_ AS "a_" FROM table_name_12 WHERE game_site = "hubert h. humphrey metrodome"
What are the latest papers by Bill Howe ?
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 writes.paperid FROM author, paper, writes WHERE author.authorname = 'Bill Howe' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC
what is minimum area where the largest city is bloemfontein?
CREATE TABLE table_17416221_1 (area__km_2__ INTEGER,largest_city VARCHAR)
SELECT MIN(area__km_2__) FROM table_17416221_1 WHERE largest_city = "Bloemfontein"
Name the real life years of operation for amtrak
CREATE TABLE table_26781 ("Railroad" text,"Game Cost" text,"Real-Life Years of Operation" text,"Real-Life Eventual Outcome" text,"Currently\u00b9 Part Of..." text)
SELECT "Real-Life Years of Operation" FROM table_26781 WHERE "Currently\u00b9 Part Of..." = 'Amtrak'
What is the highest number of players during 1r year with a clay set and more than 4 aces?
CREATE TABLE table_name_63 (player INTEGER,year VARCHAR,sets VARCHAR,aces VARCHAR)
SELECT MAX(player) FROM table_name_63 WHERE year = "1r" AND sets = "clay" AND NOT aces > 4
what is the number of patients whose year of birth is less than 2110 and lab test name is asparate aminotransferase (ast)?
CREATE TABLE procedures (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 te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2110" AND lab.label = "Asparate Aminotransferase (AST)"
Top upvote generators history, as stacked bar.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeI...
WITH Raw AS (SELECT YEAR(Votes.CreationDate) AS Year, Posts.OwnerUserId AS UserId, COUNT(*) AS Count FROM Posts, Votes WHERE Votes.VoteTypeId = 2 AND Votes.PostId = Posts.Id GROUP BY YEAR(Votes.CreationDate), Posts.OwnerUserId), Raw2 AS (SELECT Year, UserId, Count, DENSE_RANK() OVER (PARTITION BY Year ORDER BY Count DE...
Find the name, city, and country of the airport that has the highest latitude.
CREATE TABLE airlines (alid number,name text,iata text,icao text,callsign text,country text,active text)CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,el...
SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1
what flights go from BOSTON to DALLAS
CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,d...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS'...
provide the number of patients whose age is less than 67 and diagnoses long title is schizoaffective disorder, unspecified?
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "67" AND diagnoses.long_title = "Schizoaffective disorder, unspecified"
Who constructed olivier panis' car that retired after +1 lap?
CREATE TABLE table_name_4 (constructor VARCHAR,time_retired VARCHAR,driver VARCHAR)
SELECT constructor FROM table_name_4 WHERE time_retired = "+1 lap" AND driver = "olivier panis"
Name the height in feet for the guard from north carolina-charlotte
CREATE TABLE table_name_35 (height_in_ft VARCHAR,position VARCHAR,school_club_team_country VARCHAR)
SELECT height_in_ft FROM table_name_35 WHERE position = "guard" AND school_club_team_country = "north carolina-charlotte"
Which Chassis has 0 points?
CREATE TABLE table_name_58 (chassis VARCHAR,points VARCHAR)
SELECT chassis FROM table_name_58 WHERE points = 0
What is GTO Winning Team Mike Keyser's RND number?
CREATE TABLE table_13657749_2 (rnd VARCHAR,gto_winning_team VARCHAR)
SELECT rnd FROM table_13657749_2 WHERE gto_winning_team = "Mike Keyser"
What date did the home team have a score of 9.18 (72)?
CREATE TABLE table_33592 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_33592 WHERE "Home team score" = '9.18 (72)'
Top 10 users in Kolhapur.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewT...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kolhapur%' OR UPPER(Location) LIKE '%KOLHAPUR' ORDER BY Reputation DESC LIMIT 10