instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Give me a bar chart to compare the number of state provinces located in different cities, show from low to high by the bar. | 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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAI... | SELECT STATE_PROVINCE, COUNT(STATE_PROVINCE) FROM locations GROUP BY STATE_PROVINCE ORDER BY STATE_PROVINCE |
What are the ids and names of the companies that operated more than one flight, I want to order y-axis in descending order. | CREATE TABLE airport (id int,City text,Country text,IATA text,ICAO text,name text)CREATE TABLE flight (id int,Vehicle_Flight_number text,Date text,Pilot text,Velocity real,Altitude real,airport_id int,company_id int)CREATE TABLE operate_company (id int,name text,Type text,Principal_activities text,Incorporated_in text,... | SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id ORDER BY T1.id DESC |
How many customers for different customer last name? Draw a bar chart, rank by the bar in desc. | CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(20),customer_last_name VARCHAR(20),customer_address VARCHAR(255),customer_phone VARCHAR(255),customer_email VARCHAR(255),other_customer_details VARCHAR(255))CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),othe... | SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name DESC |
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, rank in ascending by the Y. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID deci... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY) |
do you have an 819 flight from DENVER to SAN FRANCISCO | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)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 airport (airport_code varchar,airport_name text,airport_location text,sta... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time = 819 AND flight.to_airport = AIRPORT_SERVICE_1.... |
What are the remarks for 8 October 2008? | CREATE TABLE table_73181 ("Date" text,"Team #1" text,"Res." text,"Team #2" text,"Competition" text,"Attendance" real,"Remarks" text) | SELECT "Remarks" FROM table_73181 WHERE "Date" = '8 October 2008' |
What is the last date of the staff leaving the projects? | CREATE TABLE Project_Staff (date_to VARCHAR) | SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1 |
What's the lowest Floors with Feet that's larger htan 262, has a Name of Standard Bank Building, and Metres that's larger htan 138.8? | CREATE TABLE table_name_29 (floors INTEGER,metres VARCHAR,feet VARCHAR,name VARCHAR) | SELECT MIN(floors) FROM table_name_29 WHERE feet > 262 AND name = "standard bank building" AND metres > 138.8 |
what is the number of patients whose ethnicity is black/african american and drug code is myco500i? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.formulary_drug_cd = "MYCO500I" |
What NHL team picked Sergei Luchinkin? | CREATE TABLE table_2886617_8 (nhl_team VARCHAR,player VARCHAR) | SELECT nhl_team FROM table_2886617_8 WHERE player = "Sergei Luchinkin" |
What is the surface of eckental tournament with a w/o score? | CREATE TABLE table_name_94 (surface VARCHAR,tournament VARCHAR,score VARCHAR) | SELECT surface FROM table_name_94 WHERE tournament = "eckental" AND score = "w/o" |
What company is the producer in the chennai mohan power plant? | CREATE TABLE table_name_79 (producer VARCHAR,power_plant VARCHAR) | SELECT producer FROM table_name_79 WHERE power_plant = "chennai mohan" |
Give me a bar chart for the total number of each payment method code, and list by the y axis in ascending. | CREATE TABLE Marketing_Regions (Marketing_Region_Code CHAR(15),Marketing_Region_Name VARCHAR(255),Marketing_Region_Descriptrion VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Stores (Store_ID VARCHAR(100),Address_ID INTEGER,Marketing_Region_Code CHAR(15),Store_Name VARCHAR(255),Store_Phone VARCHAR(255),Store_Emai... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY COUNT(*) |
What party did candidate george mcduffie (j) represent? | CREATE TABLE table_2668254_22 (party VARCHAR,candidates VARCHAR) | SELECT party FROM table_2668254_22 WHERE candidates = "George McDuffie (J)" |
What city did Yugoslavia play against Poland in? | CREATE TABLE table_37549 ("Date" text,"City" text,"Opponent" text,"Results\u00b9" text,"Type of game" text) | SELECT "City" FROM table_37549 WHERE "Opponent" = 'poland' |
WHAT IS THE YEARS AS TALLEST WITH 01.0 10 light street? | CREATE TABLE table_61418 ("Name" text,"Street address" text,"Years as tallest" text,"Height ft (m)" text,"Floors" real) | SELECT "Years as tallest" FROM table_61418 WHERE "Street address" = '01.0 10 light street' |
What team that has a Home city of Zadar? | CREATE TABLE table_name_65 (team VARCHAR,home_city VARCHAR) | SELECT team FROM table_name_65 WHERE home_city = "zadar" |
What is the General classification for a points classification leader of Bradley Wiggins? | CREATE TABLE table_name_47 (general_classification VARCHAR,points_classification VARCHAR) | SELECT general_classification FROM table_name_47 WHERE points_classification = "bradley wiggins" |
Who is the Driver with the Team of P & L Mechanical Services? | CREATE TABLE table_38378 ("Team" text,"Manufacturer" text,"Car model" text,"Engine" text,"Driver" text) | SELECT "Driver" FROM table_38378 WHERE "Team" = 'p & l mechanical services' |
what district has the least amount of population ? | CREATE TABLE table_204_739 (id number,"districts" text,"ubigeo" number,"area\n(km2)" number,"population" number,"population density\n(/km2)" number,"created" text,"postal\ncode" number) | SELECT "districts" FROM table_204_739 ORDER BY "population" LIMIT 1 |
what was the last urine out foley-output time of patient 59049 since 02/24/2105? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE prescriptions (row_id number,subject_id numb... | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59049)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin... |
What's the United States team that played for the Grizzlies in 1995-1996? | CREATE TABLE table_8517 ("Player" text,"Nationality" text,"Position" text,"Years for Grizzlies" text,"School/Club Team" text) | SELECT "School/Club Team" FROM table_8517 WHERE "Nationality" = 'united states' AND "Years for Grizzlies" = '1995-1996' |
What is the average total of Gay Brewer from the United States with a to par of 9? | CREATE TABLE table_name_49 (total INTEGER,player VARCHAR,country VARCHAR,to_par VARCHAR) | SELECT AVG(total) FROM table_name_49 WHERE country = "united states" AND to_par = 9 AND player = "gay brewer" |
what is the school that hosts mikael renberg | CREATE TABLE table_name_91 (college_junior_club_team__league_ VARCHAR,player VARCHAR) | SELECT college_junior_club_team__league_ FROM table_name_91 WHERE player = "mikael renberg" |
What date has uefa euro 2008 qualification as the competition? | CREATE TABLE table_65675 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_65675 WHERE "Competition" = 'uefa euro 2008 qualification' |
which year has the most film appearances ? | CREATE TABLE table_203_797 (id number,"genre" text,"year" number,"title" text,"role" text,"episodes" text,"notes" text) | SELECT "year" FROM table_203_797 GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1 |
What is the Bike with 18 laps and +41.280 as the time? | CREATE TABLE table_name_51 (bike VARCHAR,laps VARCHAR,time VARCHAR) | SELECT bike FROM table_name_51 WHERE laps = 18 AND time = "+41.280" |
View comments sorted by score. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Badges (Id number,UserId number,Name text,Date ti... | SELECT * FROM Comments WHERE UserId = '##UserId##' AND Score > 0 ORDER BY Score DESC |
What position did the player from San Jose State play? | CREATE TABLE table_25259 ("Number" real,"Name" text,"Position" text,"Height" text,"Experience" text,"College" text) | SELECT "Position" FROM table_25259 WHERE "College" = 'San Jose State' |
what is the minimum total hospital cost to include a procedure called cv cath plcmt w guidance until 2104? | 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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cv cath plcmt w guidance')) AND STRFTIME('%y', cost.charg... |
Show the number of visit date from each visit date, list total number in descending order please. | CREATE TABLE Museums (Museum_ID INTEGER,Museum_Details VARCHAR(255))CREATE TABLE Street_Markets (Market_ID INTEGER,Market_Details VARCHAR(255))CREATE TABLE Visitors (Tourist_ID INTEGER,Tourist_Details VARCHAR(255))CREATE TABLE Features (Feature_ID INTEGER,Feature_Details VARCHAR(255))CREATE TABLE Tourist_Attraction_Fea... | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY COUNT(Visit_Date) DESC |
when had patient 006-195316 last had the maximum respiration on 04/17/this year? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316')) AND NOT vitalperiodic.respiration IS ... |
What event had Wang Bingyu for the skip? | CREATE TABLE table_9349 ("Event" text,"Skip" text,"Lead" text,"Alternate" text,"Result" text) | SELECT "Event" FROM table_9349 WHERE "Skip" = 'wang bingyu' |
Which episode number aired on 18 october 2012? | CREATE TABLE table_28051 ("Episode no." real,"Airdate" text,"Dave Viewers" real,"Dave Rank" real,"Rank (cable)" real,"Dave ja vu Viewers" real,"Total viewers" real) | SELECT MIN("Episode no.") FROM table_28051 WHERE "Airdate" = '18 October 2012' |
Who is in November where February is willy rey? | CREATE TABLE table_66799 ("January" text,"February" text,"March" text,"April" text,"June" text,"July" text,"August" text,"September" text,"October" text,"November" text,"December" text) | SELECT "November" FROM table_66799 WHERE "February" = 'willy rey' |
What is the production code for episode 'surgery'? | CREATE TABLE table_22591 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT "Production code" FROM table_22591 WHERE "Title" = 'Surgery' |
which electoral district in the dutch language group has the most seats allotted to it ? | CREATE TABLE table_202_161 (id number,"dutch language group\nelectoral district (as of 2012)" text,"dutch language group\nseats" text,"french language group\nelectoral district (as of 2012)" text,"french language group\nseats" text) | SELECT "dutch language group\nelectoral district (as of 2012)" FROM table_202_161 ORDER BY "dutch language group\nseats" DESC LIMIT 1 |
What U15 3rd Quad has a U15 2nd Quad of ACGS? | CREATE TABLE table_52135 ("Crew" real,"Open 1st VIII" text,"Open 2nd VIII" text,"Open 3rd VIII" text,"U16 1st VIII" text,"U16 2nd VIII" text,"U16 3rd VIII" text,"U15 1st Quad" text,"U15 2nd Quad" text,"U15 3rd Quad" text,"U15 4th Quad" text,"U15 5th Quad" text,"U15 6th Quad" text) | SELECT "U15 3rd Quad" FROM table_52135 WHERE "U15 2nd Quad" = 'acgs' |
Which Perth also has Sydney yes, Gold Coast yes, and Adelaide no? | CREATE TABLE table_name_97 (perth VARCHAR,adelaide VARCHAR,sydney VARCHAR,gold_coast VARCHAR) | SELECT perth FROM table_name_97 WHERE sydney = "yes" AND gold_coast = "yes" AND adelaide = "no" |
What is the to par for the player with fewer than 148 total points? | CREATE TABLE table_61759 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real) | SELECT SUM("To par") FROM table_61759 WHERE "Total" < '148' |
What is the number of upper level classes that have labs ? | 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 ta (campus_job_id int,student_id int,location var... | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%' |
Which Callsign includes a frequency under 1210, Newsradio 740 KTRH, and webcasts with listen live? | CREATE TABLE table_name_97 (callsign VARCHAR,brand VARCHAR,webcast VARCHAR,frequency VARCHAR) | SELECT callsign FROM table_name_97 WHERE webcast = "listen live" AND frequency < 1210 AND brand = "newsradio 740 ktrh" |
What is the Pick # for the College/junior/club team of edmonton oil kings (wchl), and the position if defence? | CREATE TABLE table_name_49 (pick__number VARCHAR,college_junior_club_team VARCHAR,position VARCHAR) | SELECT pick__number FROM table_name_49 WHERE college_junior_club_team = "edmonton oil kings (wchl)" AND position = "defence" |
how many patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and year of birth is less than 2095? | 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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dob_year < "2095" |
what is the pricing for nystatin-triamcinolone cream? | CREATE TABLE d_labitems (row_id number,itemid number,label 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)CREATE TABL... | 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 = 'nystatin-triamcinolone cream') |
What state is the University of Tennessee located in? | CREATE TABLE table_31697 ("Region" text,"Host" text,"Venue" text,"City" text,"State" text) | SELECT "State" FROM table_31697 WHERE "Host" = 'university of tennessee' |
Which Record has a Week smaller than 15, and an Opponent of at new york jets? | CREATE TABLE table_name_48 (record VARCHAR,week VARCHAR,opponent VARCHAR) | SELECT record FROM table_name_48 WHERE week < 15 AND opponent = "at new york jets" |
how many times has patient 030-53416 received a heparin gtt intake until 08/28/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 COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... |
Which Servedby has a Local authority [a ] of thurrock, and a Station of ockendon? | CREATE TABLE table_40728 ("Station" text,"Local authority [a ]" text,"Servedby" text,"Station users 2004\u201305" real,"Station users 2005\u201306" real) | SELECT "Servedby" FROM table_40728 WHERE "Local authority [a ]" = 'thurrock' AND "Station" = 'ockendon' |
Which industry has a company with a market value of 80.3 billion? | CREATE TABLE table_72824 ("Rank" real,"Company" text,"Headquarters" text,"Industry" text,"Sales (billion $)" text,"Profits (billion $)" text,"Assets (billion $)" text,"Market Value (billion $)" text) | SELECT "Industry" FROM table_72824 WHERE "Market Value (billion $)" = '80.3' |
What are the terminals for line 2? | CREATE TABLE table_20513 ("Line" text,"Terminals" text,"Status" text,"Length" text,"Total number of stations" real,"Operator" text) | SELECT "Terminals" FROM table_20513 WHERE "Line" = 'Line 2' |
What was the sum of the crowds in the matches where the away team scored 11.8 (74)? | CREATE TABLE table_33048 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT SUM("Crowd") FROM table_33048 WHERE "Away team score" = '11.8 (74)' |
what procedure did patient 99082 receive the first time in their first hospital visit. | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 inputevents_cv... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99082 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admit... |
What is the Musical Guest (Song performed) for the episode aired on 13 july 2008? | CREATE TABLE table_41389 ("Episode Number" real,"Air Date" text,"Guest Host" text,"Musical Guest (Song performed)" text,"Coat Of Cash Wearing Celebrity" text) | SELECT "Musical Guest (Song performed)" FROM table_41389 WHERE "Air Date" = '13 july 2008' |
What year was someone first elected? | CREATE TABLE table_18708 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT MIN("First elected") FROM table_18708 |
Which Regular Season Champion(s) has a Tournament Champion of west virginia in 1955 56? | CREATE TABLE table_name_4 (regular_season_champion_s_ VARCHAR,tournament_champion VARCHAR,year VARCHAR) | SELECT regular_season_champion_s_ FROM table_name_4 WHERE tournament_champion = "west virginia" AND year = "1955–56" |
How many tries against did the club with 383 points against have? | CREATE TABLE table_name_39 (tries_against VARCHAR,points_against VARCHAR) | SELECT tries_against FROM table_name_39 WHERE points_against = "383" |
Tell me the format with year more than 2000 and label of myuzyk with catalog number of mzykn08 | CREATE TABLE table_name_48 (format VARCHAR,catalog_number VARCHAR,year VARCHAR,label VARCHAR) | SELECT format FROM table_name_48 WHERE year > 2000 AND label = "myuzyk" AND catalog_number = "mzykn08" |
Who had the highest points during the game with a record of 2-7? | CREATE TABLE table_23274514_4 (high_points VARCHAR,record VARCHAR) | SELECT high_points FROM table_23274514_4 WHERE record = "2-7" |
What was the location and attendance when the team's record was 16-44? | CREATE TABLE table_13464416_8 (location_attendance VARCHAR,record VARCHAR) | SELECT location_attendance FROM table_13464416_8 WHERE record = "16-44" |
What is the Money ($) amount of the Player with a To par of e? | CREATE TABLE table_name_2 (money___$__ VARCHAR,to_par VARCHAR) | SELECT money___$__ FROM table_name_2 WHERE to_par = "e" |
Who is the player with a score of 69-70-76=215? | CREATE TABLE table_name_16 (player VARCHAR,score VARCHAR) | SELECT player FROM table_name_16 WHERE score = 69 - 70 - 76 = 215 |
how many times is the team oklahoma city? | CREATE TABLE table_3858 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT COUNT("High points") FROM table_3858 WHERE "Team" = 'Oklahoma City' |
since 1 year ago, what were the top three most frequent laboratory tests ordered for patients during the same month after receiving a incis thyroid field nec? | 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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREA... | 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... |
Name the data with a percent gain of 28.4% | CREATE TABLE table_name_41 (data VARCHAR,percent_gain VARCHAR) | SELECT data FROM table_name_41 WHERE percent_gain = "28.4%" |
What is the weight of John-Michael Liles? | CREATE TABLE table_40360 ("Position" text,"Jersey #" real,"Name" text,"Height (cm)" real,"Weight (kg)" real,"Birthdate" text,"Birthplace" text,"2008\u20132009 Team" text) | SELECT "Weight (kg)" FROM table_40360 WHERE "Name" = 'john-michael liles' |
How many companies each investor has invested? Show me a bar chart, and show by the X from low to high. | CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text) | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor ORDER BY Investor |
Which poll had a week 10 larger than 2, a week 2 of exactly 12, and a week 13 of 8? | CREATE TABLE table_38960 ("Poll" text,"Wk 1" text,"Wk 2" text,"Wk 3" text,"Wk 4" text,"Wk 5" text,"Wk 6" text,"Wk 7" text,"Wk 8" real,"Wk 9" real,"Wk 10" real,"Wk 11" real,"Wk 13" real,"Wk 14" real) | SELECT "Poll" FROM table_38960 WHERE "Wk 10" > '2' AND "Wk 2" = '12' AND "Wk 13" = '8' |
what was patient 11362 last height since 10/2105? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_labitems (row_id numbe... | 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 = 11362)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... |
What is the percentage of registered voters in which the d-r spread is +10.4%? | CREATE TABLE table_27003223_4 (registered_voters VARCHAR,d_r_spread VARCHAR) | SELECT registered_voters FROM table_27003223_4 WHERE d_r_spread = "+10.4%" |
what lab tests were given to patient 99082 for the first time on their last hospital encounter? | 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id nu... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99082 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY labevents.chartti... |
Just show the id and name of each editor using a bar chart, and could you show in desc by the Editor_ID? | CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int) | SELECT T1.Name, T1.Editor_ID FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID ORDER BY T1.Editor_ID DESC |
What location with it's corresponding attendance was the game against Utah Jazz? | CREATE TABLE table_27902171_6 (location_attendance VARCHAR,team VARCHAR) | SELECT location_attendance FROM table_27902171_6 WHERE team = "Utah Jazz" |
What is the 54 holes for The Open Championship (4)? | CREATE TABLE table_name_7 (championship VARCHAR) | SELECT 54 AS _holes FROM table_name_7 WHERE championship = "the open championship (4)" |
What is the highest amount of money a play from Scotland United States has? | CREATE TABLE table_69866 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT MAX("Money ( $ )") FROM table_69866 WHERE "Country" = 'scotland united states' |
What is the time of the 100m freestyle event? | CREATE TABLE table_62356 ("Event" text,"Time" text,"Nationality" text,"Date" text,"Meet" text,"Location" text) | SELECT "Time" FROM table_62356 WHERE "Event" = '100m freestyle' |
What is the frequency of the station owned by the Canadian Broadcasting Corporation and branded as CBC Radio One? | CREATE TABLE table_name_49 (frequency VARCHAR,owner VARCHAR,branding VARCHAR) | SELECT frequency FROM table_name_49 WHERE owner = "canadian broadcasting corporation" AND branding = "cbc radio one" |
who is the only player to play in 5 games , 1 as a sub ? | CREATE TABLE table_204_26 (id number,"name" text,"position" text,"birth date/age at start of campaign" text,"games in campaign" text,"club" text) | SELECT "name" FROM table_204_26 WHERE "games in campaign" = 5 AND "games in campaign" = '1 as sub' |
did patient 027-132801 have a heartrate that was greater than 55.0? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientuni... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-132801')) AND vitalperiodic.heartrate > 55.0 AND NOT vitalperiod... |
What's the score of Jeff Maggert in T2 place? | CREATE TABLE table_name_36 (score VARCHAR,place VARCHAR,player VARCHAR) | SELECT score FROM table_name_36 WHERE place = "t2" AND player = "jeff maggert" |
What is the Surface of indoor/carpet Outcome on 13 October 1996 | CREATE TABLE table_41141 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Outcome" FROM table_41141 WHERE "Surface" = 'indoor/carpet' AND "Date" = '13 october 1996' |
what was the first procedure time of patient 006-113829 during their last hospital encounter for stress ulcer prophylaxis - pantoprazole? | 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 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-113829' AND NOT patient.hospitaldischargetime IS NULL ORDER B... |
What are the different budget type codes, and how many documents are there for each. Plot them as bar chart. | CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Docume... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code |
For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees. | CREATE TABLE employees (employee_id number,role_code text,employee_name text,other_details text)CREATE TABLE documents_mailed (document_id number,mailed_to_address_id number,mailing_date time)CREATE TABLE ref_document_status (document_status_code text,document_status_description text)CREATE TABLE addresses (address_id ... | SELECT document_id, COUNT(DISTINCT employee_id) FROM circulation_history GROUP BY document_id |
how many patients are admitted under emergency and treated via the drug route ivpca? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "IVPCA" |
when did patient 16248 get the procedure for the first time on the first hospital visit. | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name 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,langua... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16248 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY procedures_icd.charttime LIMIT 1 |
How many stadiums does each country have. Show bar chart. | CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year ... | SELECT Country, COUNT(*) FROM stadium GROUP BY Country |
provide the number of government health insurance patients who have other percutaneous procedures on biliary tract. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Other percutaneous procedures on biliary tract" |
how many third place wins can ericsson bobry bytom call his own ? | CREATE TABLE table_203_341 (id number,"season" text,"champion" text,"runner-up" text,"score" text,"third place" text) | SELECT COUNT("third place") FROM table_203_341 WHERE "third place" = 'ericsson bobry bytom' |
during which tournament did florent average the least points per game ? | CREATE TABLE table_203_527 (id number,"tournament" text,"games played" number,"points per game" number,"rebounds per game" number,"assists per game" number) | SELECT "tournament" FROM table_203_527 ORDER BY "points per game" LIMIT 1 |
what are the number of times weld county is listed on this chart ? | CREATE TABLE table_204_279 (id number,"name of place" text,"number\nof\ncounties" number,"principal\ncounty" text,"zip code\nlower" number,"zip code\nupper" number) | SELECT COUNT(*) FROM table_204_279 WHERE "principal\ncounty" = 'weld county' |
when mixed doubles is zheng bo ma jin and womens singles is wang yihan, what was the tour? | CREATE TABLE table_24037 ("Tour" text,"Mens singles" text,"Womens singles" text,"Mens doubles" text,"Womens doubles" text,"Mixed doubles" text) | SELECT "Tour" FROM table_24037 WHERE "Mixed doubles" = 'Zheng Bo Ma Jin' AND "Womens singles" = 'Wang Yihan' |
Show the start dates and end dates of all the apartment bookings made by guests with gender code 'Female'. | CREATE TABLE apartment_facilities (apt_id number,facility_code text)CREATE TABLE view_unit_status (apt_id number,apt_booking_id number,status_date time,available_yn others)CREATE TABLE guests (guest_id number,gender_code text,guest_first_name text,guest_last_name text,date_of_birth time)CREATE TABLE apartment_bookings ... | SELECT T1.booking_start_date, T1.booking_start_date FROM apartment_bookings AS T1 JOIN guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" |
What was the Av/G of the 2009 season? | CREATE TABLE table_48435 ("Season" text,"GP\u2013GS" text,"Yards" text,"Long" text,"Avg/G" text) | SELECT "Avg/G" FROM table_48435 WHERE "Season" = '2009' |
What is the number of platforms for each location? Show the comparison with a bar chart, rank bars from high to low order. | CREATE TABLE train (Train_ID int,Name text,Time text,Service text)CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train_station (Train_ID int,Station_ID int) | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location DESC |
What is the average Bike No, when Driver / Passenger is Joris Hendrickx / Kaspars Liepins, and when Position is greater than 4? | CREATE TABLE table_name_34 (bike_no INTEGER,driver___passenger VARCHAR,position VARCHAR) | SELECT AVG(bike_no) FROM table_name_34 WHERE driver___passenger = "joris hendrickx / kaspars liepins" AND position > 4 |
Which Attendance has an Arena of arrowhead pond of anaheim, and a Loss of giguere (3 3)? | CREATE TABLE table_name_74 (attendance INTEGER,arena VARCHAR,loss VARCHAR) | SELECT MAX(attendance) FROM table_name_74 WHERE arena = "arrowhead pond of anaheim" AND loss = "giguere (3–3)" |
What is the class of facility ID 150935? | CREATE TABLE table_name_21 (class VARCHAR,facility_id VARCHAR) | SELECT class FROM table_name_21 WHERE facility_id = 150935 |
How many people attended on december 26, 1982? | CREATE TABLE table_65611 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Attendance" FROM table_65611 WHERE "Date" = 'december 26, 1982' |
Movement of Users vs Downvote Ratio. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,La... | SELECT DATEFROMPARTS(YEAR(U.CreationDate), MONTH(U.CreationDate), 1) AS YearMonth, MAX(U.Id) AS MaxUsers, MAX(U.Id) - LAG(MAX(U.Id), 1, 0) OVER (ORDER BY DATEFROMPARTS(YEAR(U.CreationDate), MONTH(U.CreationDate), 1)) AS Change, 1 / (CAST(SUM(CASE WHEN V.VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / NULLIF(CAST(SUM(CASE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.