instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Just list the name and price of its most expensive product in a bar chart, and could you sort in ascending by the bars?
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY Name
Name the total number of language of films for m ga-plex taschereau imax
CREATE TABLE table_2461720_1 (language_of_films VARCHAR,theatre_name VARCHAR)
SELECT COUNT(language_of_films) FROM table_2461720_1 WHERE theatre_name = "Méga-Plex Taschereau IMAX"
flights from LONG BEACH to NASHVILLE
CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE airport_service (city_code ...
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 = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NAS...
find the number of patients under the procedure icd9 code 66 who were admitted in emergency.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "66"
which is the biggest number of episode in the season, when the director of the episode was Constantine Makris?
CREATE TABLE table_25665 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" text,"Viewers (millions)" text)
SELECT MAX("No. in season") FROM table_25665 WHERE "Directed by" = 'Constantine Makris'
Show the number of documents for different budget type code in a bar chart, show in ascending by the total number.
CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Description VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER,State...
SELECT T1.Budget_Type_Code, COUNT(T1.Budget_Type_Code) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.Budget_Type_Code ORDER BY COUNT(T1.Budget_Type_Code)
provide the number of patients whose marital status is single and lab test name is transferrin?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Transferrin"
Name the number of party for kentucky 1
CREATE TABLE table_2668378_5 (party VARCHAR,district VARCHAR)
SELECT COUNT(party) FROM table_2668378_5 WHERE district = "Kentucky 1"
What opponent has a week less than 16, with September 7, 2008 as the date?
CREATE TABLE table_name_43 (opponent VARCHAR,week VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_43 WHERE week < 16 AND date = "september 7, 2008"
Where the audience share is 8%, what is the original airing?
CREATE TABLE table_name_60 (original_airing VARCHAR,audience_share__average_ VARCHAR)
SELECT original_airing FROM table_name_60 WHERE audience_share__average_ = "8%"
what are the three most commonly performed lab tests for patients who have been diagnosed with hypercalcemia previously within the same hospital visit, during the last year?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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)C...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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 W...
Who won the election of 1942 in the district Illinois 13?
CREATE TABLE table_1342256_13 (incumbent VARCHAR,district VARCHAR)
SELECT incumbent FROM table_1342256_13 WHERE district = "Illinois 13"
Who made the car that Alberto Ascari went more than 35 laps on a grid less than 7?
CREATE TABLE table_name_4 (constructor VARCHAR,driver VARCHAR,grid VARCHAR,laps VARCHAR)
SELECT constructor FROM table_name_4 WHERE grid < 7 AND laps > 35 AND driver = "alberto ascari"
Give me the comparison about the sum of School_ID over the ACC_Road , and group by attribute ACC_Road, and I want to display in asc by the ACC_Road please.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
How many resulted in a loss with 479 points against?
CREATE TABLE table_70631 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT "Lost" FROM table_70631 WHERE "Points against" = '479'
Find the average and total capacity of dorms for the students with gender X.
CREATE TABLE dorm (student_capacity INTEGER,gender VARCHAR)
SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'
What is the latest year featuring candace parker?
CREATE TABLE table_33504 ("Year" real,"Player" text,"Nationality" text,"Position played" text,"Team represented" text)
SELECT MAX("Year") FROM table_33504 WHERE "Player" = 'candace parker'
Can you tell me the School that has the IHSAA Class of a, and the Enrollment 08-09 off 244?
CREATE TABLE table_65009 ("School" text,"Location" text,"Mascot" text,"Enrollment 08-09" real,"IHSAA Class" text,"County" text,"Year Joined" real,"Previous Conference" text)
SELECT "School" FROM table_65009 WHERE "IHSAA Class" = 'a' AND "Enrollment 08-09" = '244'
Name the Runs has a Venue of bellerive oval , hobart, and a Season of 2004/05, and a Rank of 5?
CREATE TABLE table_8606 ("Rank" text,"Runs" text,"Player" text,"Opponent" text,"Venue" text,"Season" text)
SELECT "Runs" FROM table_8606 WHERE "Venue" = 'bellerive oval , hobart' AND "Season" = '2004/05' AND "Rank" = '5'
What is the sum of skin depth with a resistivity of 1.12 and a relative permeability larger than 1?
CREATE TABLE table_68994 ("Material" text,"Resistivity (10 \u22126 ohm-inches)" real,"Relative permeability" real,"Skin depth,inches" real,"Surface resistance,Relative to copper" real)
SELECT SUM("Skin depth, inches") FROM table_68994 WHERE "Resistivity (10 \u22126 ohm-inches)" = '1.12' AND "Relative permeability" > '1'
How many patients with primary disease of brain mass intracranial hemorrhage died in or before 2131?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.dod_year <= "2131.0"
What is the average fee on a CSU campus in 2005?
CREATE TABLE campuses (id number,campus text,location text,county text,year number)CREATE TABLE csu_fees (campus number,year number,campusfee number)CREATE TABLE enrollments (campus number,year number,totalenrollment_ay number,fte_ay number)CREATE TABLE faculty (campus number,year number,faculty number)CREATE TABLE dis...
SELECT AVG(campusfee) FROM csu_fees WHERE year = 2005
Name the location for 2-1 record
CREATE TABLE table_25709 ("Date" text,"Location" text,"Opponent" text,"Cardinal Points" real,"Opp. Points" real,"Record" text)
SELECT "Location" FROM table_25709 WHERE "Record" = '2-1'
What was home team North Melbourne's opponents score?
CREATE TABLE table_55837 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_55837 WHERE "Home team" = 'north melbourne'
search a question that appeared on Google - now deleted.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId n...
SELECT P.* FROM Posts AS P WHERE P.Id = 33665453
Who is the athlete who's rank is 8 and competed in the olympics during 1948 1952?
CREATE TABLE table_24942 ("Rank" real,"Athlete" text,"Nation" text,"Olympics" text,"Gold" real,"Silver" real,"Bronze" real,"Total(min. 2 medals)" real)
SELECT "Athlete" FROM table_24942 WHERE "Rank" = '8' AND "Olympics" = '1948–1952'
Who is the comedian that has a pair no larger than 5 with a comedian II: Jimmy Moses?
CREATE TABLE table_70253 ("Pair No." real,"Comedian:1" text,"Comedian:II" text,"Tansen(Singers)" text,"Place(Result)" text)
SELECT "Comedian:1" FROM table_70253 WHERE "Pair No." > '5' AND "Comedian:II" = 'jimmy moses'
what were the five diagnoses that have the lowest two year survival rate?
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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id numbe...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
What is the average number of Byes for the team that had 15 Losses, and less than 1 Win?
CREATE TABLE table_40779 ("Ballarat FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT AVG("Byes") FROM table_40779 WHERE "Losses" = '15' AND "Wins" < '1'
how many patients of black/cape verdean ethnicity are diagnosed with unspecified problem with head, neck or trunk?
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 procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND diagnoses.long_title = "Unspecified problem with head, neck, or trunk"
What is the at Manhattan record against TCU?
CREATE TABLE table_15740666_4 (at_manhattan VARCHAR,kansas_state_vs VARCHAR)
SELECT at_manhattan FROM table_15740666_4 WHERE kansas_state_vs = "TCU"
What's the highest First Elected with a Result of Re-elected and DIstrict of California 5?
CREATE TABLE table_74880 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text)
SELECT MAX("First elected") FROM table_74880 WHERE "Result" = 're-elected' AND "District" = 'california 5'
Bin all date of transactions into the weekday interval, and sum the share count of each bin Return the result using a bar chart, order in asc by the total number of share count please.
CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction DATETIME,amount_of_transaction DEC...
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY SUM(share_count)
How many heights does chad henne have?
CREATE TABLE table_15017024_2 (height VARCHAR,player_name VARCHAR)
SELECT COUNT(height) FROM table_15017024_2 WHERE player_name = "Chad Henne"
What were the bowling figures for the competition at Pietermaritzburg?
CREATE TABLE table_name_19 (bowling_figures_wickets_runs__overs_ VARCHAR,venue VARCHAR)
SELECT bowling_figures_wickets_runs__overs_ FROM table_name_19 WHERE venue = "pietermaritzburg"
Show the minimum room count of apartments in different type with a bar chart, and I want to rank by the Y-axis in desc please.
CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATETIME,available_yn BIT)CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt_number CHAR(10),bathroom_count INTEGER,bedroom_count INTEGER,room_count CHAR(5))CREATE TABLE Apartment_Facilities (apt_id INTE...
SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code ORDER BY MIN(room_count) DESC
What is the Record when antonio davis (14) had the high rebounds?
CREATE TABLE table_name_37 (record VARCHAR,high_rebounds VARCHAR)
SELECT record FROM table_name_37 WHERE high_rebounds = "antonio davis (14)"
What is the start source of the irl country, which ended on 13 April?
CREATE TABLE table_name_7 (start_source VARCHAR,country VARCHAR,ended VARCHAR)
SELECT start_source FROM table_name_7 WHERE country = "irl" AND ended = "13 april"
A pie chart showing the minimum weight for each gender.
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)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex
A bar chart for what are the number of the dates in which the mean sea level pressure was between 303 and 31?, display Y-axis from low to high order.
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 INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INT...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date)
What is the saturated fat with 28g of polyunsaturated fat?
CREATE TABLE table_name_6 (saturated_fat VARCHAR,polyunsaturated_fat VARCHAR)
SELECT saturated_fat FROM table_name_6 WHERE polyunsaturated_fat = "28g"
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the average of salary bin hire_date by time, and visualize them by a bar chart.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
What is the most points for a vehicle with a lola thl1, chassis later than 1986?
CREATE TABLE table_name_54 (points INTEGER,chassis VARCHAR,year VARCHAR)
SELECT MAX(points) FROM table_name_54 WHERE chassis = "lola thl1" AND year > 1986
what is the four most frequently ordered lab tests until 1 year ago in patients of age 20s?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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)C...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND DATETIME(labevents.chartti...
What was the score when attendance was 19,887?
CREATE TABLE table_32479 ("Week" text,"Opponent" text,"Result" text,"Stadium" text,"Record" text,"Attendance" text)
SELECT "Record" FROM table_32479 WHERE "Attendance" = '19,887'
Who owns the station on channel 33.3?
CREATE TABLE table_1404984_1 (station_ownership VARCHAR,virtual_channel VARCHAR)
SELECT station_ownership FROM table_1404984_1 WHERE virtual_channel = "33.3"
how many patients whose drug code is dapt500i and lab test fluid is ascites?
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 diagnoses (subject_id text,hadm_id tex...
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 = "DAPT500I" AND lab.fluid = "Ascites"
What is Pick, when Position is OL, and when Round is less than 6?
CREATE TABLE table_48611 ("Round" real,"Pick" text,"Player" text,"Position" text,"School/Club Team" text)
SELECT "Pick" FROM table_48611 WHERE "Position" = 'ol' AND "Round" < '6'
What was the score of the game that had a loss of Embree (1-2)?
CREATE TABLE table_name_98 (score VARCHAR,loss VARCHAR)
SELECT score FROM table_name_98 WHERE loss = "embree (1-2)"
How many wins did the driver with 1 second and more than 12 races have?
CREATE TABLE table_48401 ("Driver" text,"Points" real,"Races" real,"Wins" text,"Second" text,"Third" text)
SELECT "Wins" FROM table_48401 WHERE "Second" = '1' AND "Races" > '12'
What is the average position of club burgos cf, which has more than 42 goals against and more than 14 losses?
CREATE TABLE table_12154 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT AVG("Position") FROM table_12154 WHERE "Goals against" > '42' AND "Club" = 'burgos cf' AND "Losses" > '14'
What Attack has a Source of NCIOM?
CREATE TABLE table_6489 ("Source" text,"Date" text,"GERB" text,"Attack" text,"Blue Coalition" text)
SELECT "Attack" FROM table_6489 WHERE "Source" = 'nciom'
What is the position of the player for Washington school?
CREATE TABLE table_name_44 (position VARCHAR,school VARCHAR)
SELECT position FROM table_name_44 WHERE school = "washington"
How many patients had a lab test of fluid for ascites after removal of t-tube, other bile duct tube, or liver tube?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Removal of T-tube, other bile duct tube, or liver tube" AND lab.fluid = "Ascites"
are there any nonstop flights from SAN FRANCISCO to BOSTON on THURSDAY
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE restriction (restriction_code...
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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code AND...
What date was the Competition of 2014 fifa world cup qualification, with a Score of 1 0?
CREATE TABLE table_58451 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Date" FROM table_58451 WHERE "Competition" = '2014 fifa world cup qualification' AND "Score" = '1–0'
Select Top 30 posts with Bounty containing tag.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT Posts.CreationDate, Posts.Id, Votes.BountyAmount, Posts.Title, Posts.AcceptedAnswerId, Posts.Tags FROM Posts LEFT JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.Tags LIKE ('%##Tag##%') AND BountyAmount > 0 ORDER BY Posts.CreationDate DESC LIMIT 30
What was the undecided with Roy Barnes at 47%?
CREATE TABLE table_38455 ("Poll source" text,"Dates administered" text,"Roy Barnes" text,"Thurbert Baker" text,"DuBose Porter" text,"David Poythress" text,"Undecided" text)
SELECT "Undecided" FROM table_38455 WHERE "Roy Barnes" = '47%'
what were the top five most common microbiology tests that followed during the same month for patients who had a surgery consultation in the last year?
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 t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'surgery consultation' AND DATETIME(treatment...
What is the pick of the NFL club buffalo bills?
CREATE TABLE table_43666 ("Player" text,"Position" text,"Round" real,"Pick" real,"NFL Club" text)
SELECT "Pick" FROM table_43666 WHERE "NFL Club" = 'buffalo bills'
How many years of NBA experience does the player who plays position g for the Portland Trail Blazers?
CREATE TABLE table_name_28 (years_of_nba_experience_ VARCHAR,a_ VARCHAR,pos VARCHAR,team VARCHAR)
SELECT years_of_nba_experience_ AS "a_" FROM table_name_28 WHERE pos = "g" AND team = "portland trail blazers"
What is the Position, when the Birthplace is Buffalo, New York?
CREATE TABLE table_name_92 (position VARCHAR,birthplace VARCHAR)
SELECT position FROM table_name_92 WHERE birthplace = "buffalo, new york"
List the id of students who registered some courses and the number of their registered courses in a scatter chart
CREATE TABLE Student_Course_Attendance (student_id INTEGER,course_id INTEGER,date_of_attendance DATETIME)CREATE TABLE Student_Course_Registrations (student_id INTEGER,course_id INTEGER,registration_date DATETIME)CREATE TABLE People_Addresses (person_address_id INTEGER,person_id INTEGER,address_id INTEGER,date_from DATE...
SELECT T1.student_id, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id
When the away team scored 9.8 (62) what was the crowd turnout?
CREATE TABLE table_53147 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Crowd" FROM table_53147 WHERE "Away team score" = '9.8 (62)'
Find the transaction type descriptions and dates if the share count is smaller than 10, group by transaction type, count the date of transaction, and bin the date into the weekday interval Show the result with a grouping line chart, and order by the x axis in descending.
CREATE TABLE Investors (investor_id INTEGER,Investor_details VARCHAR(255))CREATE TABLE Transactions_Lots (transaction_id INTEGER,lot_id INTEGER)CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction DATETIME,amount_of_transaction DECIMAL(19,4),share_c...
SELECT T2.date_of_transaction, COUNT(T2.date_of_transaction) FROM Ref_Transaction_Types AS T1 JOIN Transactions AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 GROUP BY transaction_type_description ORDER BY date_of_transaction DESC
List the types of competition and the number of competitions of each type Visualize by bar chart, sort bars in asc order please.
CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club_ID_2 int,Score text)CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE competition (Competition_ID int,Year real,Competition_ty...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type
what were the three most commonly ordered lab tests for patients who had received open liver biopsy before in the same month since 2103?
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 chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,value...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
Return the apartment number and the number of rooms for each apartment by a bar chart, and list by the room_count in asc.
CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE Guests (guest_id INTEGER,gender_code CHAR(1),guest_first_name VARCHAR(80),guest_last_name VARCHAR(80),date_of_birth DATETIME)CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR...
SELECT apt_number, room_count FROM Apartments ORDER BY room_count
What was the score when Nacional was the champion, River Plate was the runner-up, and the venue was Centenario?
CREATE TABLE table_60560 ("Year" real,"Champion" text,"Runner-up" text,"Score" text,"City" text,"Venue" text)
SELECT "Score" FROM table_60560 WHERE "Champion" = 'nacional' AND "Venue" = 'centenario' AND "Runner-up" = 'river plate'
Who was the worship leader that had a lead supporting vocal Marcus Temu?
CREATE TABLE table_name_33 (worship_leader VARCHAR,lead_supporting_vocal VARCHAR)
SELECT worship_leader FROM table_name_33 WHERE lead_supporting_vocal = "marcus temu"
how long is the horsemen track ?
CREATE TABLE table_203_353 (id number,"#" number,"title" text,"producer(s)" text,"featured guest(s)" text,"time" text)
SELECT "time" FROM table_203_353 WHERE "title" = '"horsemen"'
What was the term of Bruce Biers Kendall whose hometown is Anchorage?
CREATE TABLE table_name_6 (term VARCHAR,hometown VARCHAR,name VARCHAR)
SELECT term FROM table_name_6 WHERE hometown = "anchorage" AND name = "bruce biers kendall"
What is the Release date of the Album Your Friend?
CREATE TABLE table_60268 ("Album#" text,"English Title" text,"Chinese (Traditional)" text,"Chinese (Simplified)" text,"Release date" text,"Label" text)
SELECT "Release date" FROM table_60268 WHERE "English Title" = 'your friend'
If the points is 20, what was the team name?
CREATE TABLE table_21867 ("Fin. Pos" real,"Car No." real,"Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Laps Led" real,"Points" text)
SELECT "Team" FROM table_21867 WHERE "Points" = '20'
What is the capacity for the stadium of kadrioru stadium and a current manager of sergei ratnikov?
CREATE TABLE table_5960 ("Club" text,"Location" text,"Stadium" text,"Capacity" real,"Current manager" text)
SELECT AVG("Capacity") FROM table_5960 WHERE "Stadium" = 'kadrioru stadium' AND "Current manager" = 'sergei ratnikov'
How many weeks are there?
CREATE TABLE table_10647639_1 (week INTEGER)
SELECT MAX(week) FROM table_10647639_1
how many times has the team finished 9th ?
CREATE TABLE table_203_183 (id number,"season" text,"tier" number,"division" number,"place" text)
SELECT COUNT(*) FROM table_203_183 WHERE "place" = 9
What is the entrant in 1999?
CREATE TABLE table_68990 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT "Entrant" FROM table_68990 WHERE "Year" = '1999'
Who is the winning driver of the Oschersleben circuit with Timo Scheider as the pole position?
CREATE TABLE table_74934 ("Circuit" text,"Date" text,"Pole position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text,"Winning manufacturer" text)
SELECT "Winning driver" FROM table_74934 WHERE "Pole position" = 'timo scheider' AND "Circuit" = 'oschersleben'
Possible editors for the 'rebol' tag. Lists every user who has ever answered a question on the 'rebol' tag, along with if they have sufficient rep to edit questions
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDa...
SELECT MAX(Users.Reputation), Users.Id AS "user_link", 'can_edit' = CASE WHEN MAX(Users.Reputation) >= 2000 THEN 'yes' ELSE 'no' END FROM Posts, Users, PostTags, Tags WHERE Posts.OwnerUserId = Users.Id AND Posts.ParentId = PostTags.PostId AND PostTags.TagId = Tags.Id AND Tags.TagName = 'rebol' GROUP BY Users.Id ORDER B...
How many different teams had an average start of 12.9?
CREATE TABLE table_2182562_2 (team_s_ VARCHAR,avg_start VARCHAR)
SELECT COUNT(team_s_) FROM table_2182562_2 WHERE avg_start = "12.9"
Search comments by any keyword.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text...
SELECT c.Text, c.Id AS "comment_link", CreationDate FROM Comments AS c WHERE c.Text LIKE '%##keyword1##%' AND LENGTH(c.Text) <= 25 ORDER BY CreationDate DESC LIMIT 100
What Circuit has a Winning constructor of bugatti, and a Winning driver of edward bret?
CREATE TABLE table_name_20 (circuit VARCHAR,winning_constructor VARCHAR,winning_driver VARCHAR)
SELECT circuit FROM table_name_20 WHERE winning_constructor = "bugatti" AND winning_driver = "edward bret"
who had a larger transfer fee ? gavin rae or bajram fetai ?
CREATE TABLE table_203_237 (id number,"n" number,"p" text,"nat." text,"name" text,"age" number,"moving from" text,"type" text,"transfer\nwindow" text,"ends" number,"transfer\nfee" text)
SELECT "name" FROM table_203_237 WHERE "name" IN ('gavin rae', 'bajram fetai') ORDER BY "transfer\nfee" DESC LIMIT 1
What is the celtics record after game 33 when they score of the game was 111-108?
CREATE TABLE table_49647 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text)
SELECT "Record" FROM table_49647 WHERE "Game" > '33' AND "Score" = '111-108'
What is the highest position for Nelson, with a played entry of more than 24?
CREATE TABLE table_58779 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text)
SELECT MAX("Position") FROM table_58779 WHERE "Team" = 'nelson' AND "Played" > '24'
Which game did Bruesa GBC play in with fewer than 275 rebounds that is ranked less than 4?
CREATE TABLE table_name_80 (games INTEGER,team VARCHAR,rank VARCHAR,rebounds VARCHAR)
SELECT SUM(games) FROM table_name_80 WHERE rank < 4 AND rebounds < 275 AND team = "bruesa gbc"
have a bmi of less than the 90 percentile for age.
CREATE TABLE table_train_215 ("id" int,"hemoglobin_a1c_hba1c" float,"hgba1c" float,"estimated_glomerular_filtration_rate_egfr" int,"kidney_disease" bool,"body_mass_index_bmi" float,"age" float,"NOUSE" float)
SELECT * FROM table_train_215 WHERE body_mass_index_bmi < 90
What is the attribute data type of the attribute with name 'Green'?
CREATE TABLE Attribute_Definitions (attribute_data_type VARCHAR,attribute_name VARCHAR)
SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = "Green"
count the number of patients whose insurance is private and procedure icd9 code is 12?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "12"
Who constructed grid 14?
CREATE TABLE table_55662 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Constructor" FROM table_55662 WHERE "Grid" = '14'
until 2104 what are the four most commonly ordered medications for patients of age 60 or above?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname tex...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', medication.drugstarttime) <= '2104' GROUP BY medication.drugname) AS t1 W...
heart rate for patient 25233 second measured on the first icu visit is less than the value first measured on the first icu visit?
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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm...
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 = 25233) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
How many positions does Greg Bryant play?
CREATE TABLE table_17077 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text)
SELECT COUNT("Position") FROM table_17077 WHERE "Player" = 'Greg Bryant'
In 2008, what was the world ranking that ranked 5th in L.A.?
CREATE TABLE table_58237 ("Index (Year)" text,"Author / Editor / Source" text,"Year of publication" text,"Countries sampled" real,"World Ranking (1)" text,"Ranking L.A. (2)" text)
SELECT "World Ranking (1)" FROM table_58237 WHERE "Ranking L.A. (2)" = '5th' AND "Year of publication" = '2008'
What is the College of the Player from PBA Team Alaska Milkmen with a Pick number of 3 or less?
CREATE TABLE table_65065 ("Pick" real,"Player" text,"Country of origin*" text,"PBA team" text,"College" text)
SELECT "College" FROM table_65065 WHERE "Pick" < '3' AND "PBA team" = 'alaska milkmen'
what was the three most frequently ordered laboratory tests for patients who had already been diagnosed with ac alcoholic hepatitis during the same month, since 2103?
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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE prescriptions (r...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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.i...
What nationality has a pick greater than 129?
CREATE TABLE table_name_38 (nationality VARCHAR,pick INTEGER)
SELECT nationality FROM table_name_38 WHERE pick > 129
What is the maximum age of patient who speaks English and is diagnosed for hypertension; rule out coronary artery disease/caridac cath?
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 MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
Find the average age for students with different sex in a bar chart.
CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)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 (StuI...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex