instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Visualize a bar chart about the distribution of meter_600 and ID , and order by the bars in asc. | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT meter_600, ID FROM swimmer ORDER BY meter_600 |
indicate the monthly minimum amount of arterial bp [systolic] for patient 25814 since 61 days ago. | 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE diagnoses_icd ... | SELECT MIN(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 = 25814)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... |
Find the number of students living in each city with a bar chart, and display by the Y-axis from high to low please. | CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Dorm (dormid INTEG... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC |
Show the transaction type descriptions and dates if the share count is smaller than 10. | CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR,transaction_type_code VARCHAR)CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR,transaction_type_code VARCHAR,share_count INTEGER) | SELECT T1.transaction_type_description, 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 |
What's the 2nd leg result in the round where Panionios is team #2? | CREATE TABLE table_22824 ("Team #1" text,"Agg. score" text,"Team #2" text,"1st leg" text,"2nd leg" text) | SELECT "2nd leg" FROM table_22824 WHERE "Team #2" = 'Panionios' |
what is drug type and drug route of drug code soln2? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "SOLN2" |
what is the location when the designer is glen peloso and the restaurant is joe boo's cookoos? | CREATE TABLE table_63664 ("Restaurant Name" text,"Original Name" text,"Location" text,"Chef" text,"Designer" text,"Still Open?" text) | SELECT "Location" FROM table_63664 WHERE "Designer" = 'glen peloso' AND "Restaurant Name" = 'joe boo''s cookoos' |
Find the number of rooms for each bed type Visualize by bar chart, and I want to show in descending by the y axis. | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*) DESC |
Which entrant scored less than 8 points and used a Maserati chassis? | CREATE TABLE table_70593 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Entrant" FROM table_70593 WHERE "Points" < '8' AND "Chassis" = 'maserati' |
Name the average zone for waddon railway station and has more than 2 platforms | CREATE TABLE table_name_54 (zone INTEGER,stations VARCHAR,platforms VARCHAR) | SELECT AVG(zone) FROM table_name_54 WHERE stations = "waddon railway station" AND platforms > 2 |
what is average age of patients whose insurance is government and days of hospital stay is 1? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "1" |
What is the Location when the time was 11:55? | CREATE TABLE table_name_22 (location VARCHAR,time VARCHAR) | SELECT location FROM table_name_22 WHERE time = "11:55" |
How many rebounds did Tammy Sutton-Brown have? | CREATE TABLE table_25353861_5 (rebounds VARCHAR,player VARCHAR) | SELECT rebounds FROM table_25353861_5 WHERE player = "Tammy Sutton-Brown" |
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'? | CREATE TABLE department (name VARCHAR,num_employees VARCHAR,department_id VARCHAR)CREATE TABLE management (department_id VARCHAR,temporary_acting VARCHAR) | SELECT T1.name, T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = 'Yes' |
What is the admission location and diagnosis short title of Dominga Garvin? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Dominga Garvin" |
Find all the songs that do not have a lead vocal. | CREATE TABLE vocals (songid VARCHAR)CREATE TABLE songs (title VARCHAR,songid VARCHAR) | SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "lead" |
Which 2010/ 11 has a 2011/ 12 of former non-ranking tournaments? | CREATE TABLE table_62376 ("1999/ 00" text,"2000/ 01" text,"2001/ 02" text,"2002/ 03" text,"2003/ 04" text,"2004/ 05" text,"2005/ 06" text,"2006/ 07" text,"2007/ 08" text,"2008/ 09" text,"2009/ 10" text,"2010/ 11" text,"2011/ 12" text,"2012/ 13" text) | SELECT "2010/ 11" FROM table_62376 WHERE "2011/ 12" = 'former non-ranking tournaments' |
Which virtue is acedia(Latin)? | CREATE TABLE table_36358 ("Virtue" text,"Latin" text,"Gloss" text,"(Vice)" text,"(Latin)" text) | SELECT "Virtue" FROM table_36358 WHERE "(Latin)" = 'acedia' |
What was the home team's score at Corio Oval? | CREATE TABLE table_name_20 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_20 WHERE venue = "corio oval" |
Which Grid has a Driver of cristiano da matta, and Points smaller than 33? | CREATE TABLE table_5157 ("Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Points" real) | SELECT SUM("Grid") FROM table_5157 WHERE "Driver" = 'cristiano da matta' AND "Points" < '33' |
How many married patients have left internal jugular vein thrombosis left arm edema as their primary disease? | CREATE TABLE procedures (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_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" |
Emacs users in Frederick, MD. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)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 te... | SELECT * FROM Users WHERE Location LIKE '%Frederick, MD%' ORDER BY Reputation DESC |
What is the match total for a score over 299 and under 412 innings? | CREATE TABLE table_71853 ("Matches" real,"Innings" real,"Not Out" real,"High Score" text,"Runs" real,"Average" real) | SELECT SUM("Matches") FROM table_71853 WHERE "High Score" = '299' AND "Innings" < '412' |
which two destinations were available for less than one year ? | CREATE TABLE table_203_323 (id number,"city" text,"country" text,"airport" text,"begin" number,"end" number) | SELECT "city" FROM table_203_323 WHERE "end" - "begin" < 1 |
What is the 1st party with Charles Isaac Elton as the 2nd member? | CREATE TABLE table_71438 ("Election" text,"1st Member" text,"1st Party" text,"2nd Member" text,"2nd Party" text) | SELECT "1st Party" FROM table_71438 WHERE "2nd Member" = 'charles isaac elton' |
What year is the event in athens, greece? | CREATE TABLE table_11121 ("Year" real,"Tournament" text,"Venue" text,"Result" text,"Extra" text) | SELECT MAX("Year") FROM table_11121 WHERE "Venue" = 'athens, greece' |
When seats for 2001 is greater than 15 and % 2001 is greater than 100, what is the % 2006? | CREATE TABLE table_70957 ("Parties and voter communities" text,"% 2006" real,"seats 2006" real,"% 2001" real,"seats 2001" real) | SELECT AVG("% 2006") FROM table_70957 WHERE "seats 2001" > '15' AND "% 2001" > '100' |
What is Round, when Tournament is 'Paris'? | CREATE TABLE table_name_61 (round VARCHAR,tournament VARCHAR) | SELECT round FROM table_name_61 WHERE tournament = "paris" |
Who Answers My Questions? (Tutorial). | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,... | SELECT a.Id AS "post_link", a.Score, au.Id AS "user_link" FROM Posts AS p JOIN Posts AS a ON p.Id = a.ParentId JOIN Users AS au ON a.OwnerUserId = au.Id WHERE p.PostTypeId = 1 AND p.OwnerUserId = '##UserId##' ORDER BY a.Score DESC |
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and order total number from low to high order please. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTME... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) |
What number does the player from Ohio play with? | CREATE TABLE table_11545282_10 (no VARCHAR,school_club_team VARCHAR) | SELECT no FROM table_11545282_10 WHERE school_club_team = "Ohio" |
what is the date for the tournament jou -l s-tours? | CREATE TABLE table_13951 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text) | SELECT "Date" FROM table_13951 WHERE "Tournament" = 'joué-lès-tours' |
What is the intelligence os the one that has s , 'thought'? | CREATE TABLE table_2150 ("Shekhina:" text,"Reason" text,"Mind" text,"Intelligence" text,"Thought" text,"Understanding" text) | SELECT "Intelligence" FROM table_2150 WHERE "Thought" = '思 sī, "thought' |
If the goals scored were below 6, 11 games were played, and there were 7 assists, what's the sum of points with games meeting these criteria? | CREATE TABLE table_name_78 (points INTEGER,goals VARCHAR,assists VARCHAR,games VARCHAR) | SELECT SUM(points) FROM table_name_78 WHERE assists = 7 AND games = 11 AND goals < 6 |
What Rider had a Speed of 108.347mph and Time of 1:02.40.93? | CREATE TABLE table_name_12 (rider VARCHAR,speed VARCHAR,time VARCHAR) | SELECT rider FROM table_name_12 WHERE speed = "108.347mph" AND time = "1:02.40.93" |
For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday. | 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),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGE... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
when's the first time patient 1902's heart rate was measured or taken today? | 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 d_icd_procedures (row_id number,icd9_code text,short_title tex... | SELECT chartevents.charttime 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 = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... |
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, order from low to high by the Y. | 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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varc... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) |
What locomotive built after 1895 has the highest SLM number? | CREATE TABLE table_name_26 (SLM INTEGER,built INTEGER) | SELECT MAX(SLM) AS number FROM table_name_26 WHERE built > 1895 |
What is the round when the match was against sergis kyratzis? | CREATE TABLE table_name_21 (round VARCHAR,opponent VARCHAR) | SELECT round FROM table_name_21 WHERE opponent = "sergis kyratzis" |
Draw a bar chart about the distribution of ACC_Road and the sum of School_ID , and group by attribute ACC_Road, show from low to high by the bar 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 |
Name the Time of broadcast has a Picture format of 4:3, and Hours of 20:30, and Days of the week of monday, wednesday, friday? | CREATE TABLE table_name_23 (time_of_broadcast VARCHAR,days_of_the_week VARCHAR,picture_format VARCHAR,hours VARCHAR) | SELECT time_of_broadcast FROM table_name_23 WHERE picture_format = "4:3" AND hours = "20:30" AND days_of_the_week = "monday, wednesday, friday" |
a FIRST class flight on AA to SAN FRANCISCO on tuesday in the next week | 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 flight_fare (flight_id int,... | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 22 AND DATE_DAY_0.month_number = 3 AND DATE_DAY_0.year = 1991 AND... |
how many total international races did german silva place in the top 3 spots ? | CREATE TABLE table_203_245 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT COUNT("competition") FROM table_203_245 WHERE "position" <= 3 |
Vote comments on user posts. | 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,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT *, 'http://stackoverflow.com/questions/' + QuestionId + '/#comment' + CommentId + '_' + QuestionId AS Url FROM (SELECT COALESCE(Q.Title, Posts.Title) AS Question, Comments.UserDisplayName AS Commenter, Text AS Comment, Posts.OwnerDisplayName AS Poster, PostTypes.Name AS "post_type", Posts.CreationDate, CAST(Comm... |
Which Rank by average is the lowest one that has a Total of 425, and a Place larger than 1? | CREATE TABLE table_name_54 (rank_by_average INTEGER,total VARCHAR,place VARCHAR) | SELECT MIN(rank_by_average) FROM table_name_54 WHERE total = 425 AND place > 1 |
What termini does the route with a population Area of aguilares have? | CREATE TABLE table_name_40 (termini VARCHAR,population_area VARCHAR) | SELECT termini FROM table_name_40 WHERE population_area = "aguilares" |
what is the total number of bronze medals won by france ? | CREATE TABLE table_204_311 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "bronze" FROM table_204_311 WHERE "nation" = 'france' |
Regarding players before 2000, what is the USC player's position? | CREATE TABLE table_55461 ("Year" real,"Player" text,"Position" text,"College/Country" text,"WNBA Team" text) | SELECT "Position" FROM table_55461 WHERE "Year" < '2000' AND "College/Country" = 'usc' |
how many stadiums have a capacity between 6000 and 8000 ? | CREATE TABLE table_203_420 (id number,"#" number,"stadium" text,"capacity" number,"city" text,"home team" text) | SELECT COUNT("stadium") FROM table_203_420 WHERE "capacity" >= 6000 AND "capacity" <= 8000 |
i need to fly from NASHVILLE to TACOMA first thing in the morning what is there | CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE aircr... | 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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TA... |
when was the episode on which barbara windsor and heston blumenthal guest starred broadcasted | CREATE TABLE table_29135051_3 (broadcast_date VARCHAR,guest_s_ VARCHAR) | SELECT broadcast_date FROM table_29135051_3 WHERE guest_s_ = "Barbara Windsor and Heston Blumenthal" |
What is the year with a kurtis kraft 500a chassis? | CREATE TABLE table_71618 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT SUM("Year") FROM table_71618 WHERE "Chassis" = 'kurtis kraft 500a' |
Which series occurred when the 7800 was 5040.00? | CREATE TABLE table_2544694_3 (indonesia_super_series_2008 VARCHAR) | SELECT indonesia_super_series_2008 FROM table_2544694_3 WHERE 780000 = "5040.00" |
Which Thermodynamics and Kinetics courses are worth 9 credits ? | CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE student (student_id int,lastname va... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Thermodynamics and Kinetics%' OR name LIKE '%Thermodynamics and Kinetics%') AND credits = 9 |
What is the tally when the opposition is Derry, and total is 14? | CREATE TABLE table_name_12 (tally VARCHAR,opposition VARCHAR,total VARCHAR) | SELECT tally FROM table_name_12 WHERE opposition = "derry" AND total = 14 |
Which opponent has a Time of 1:34? | CREATE TABLE table_71198 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Opponent" FROM table_71198 WHERE "Time" = '1:34' |
TOP 50 users from Michigan. Lists the top 50 users (ranked by reputation) that are located in Calicut/Kozhikode, Kerala, India according to their profile information.
Thanks to http://data.stackexchange.com/stackoverflow/qe/1157/top-100-users-from-greece | 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,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Michigan%' ORDER BY Reputation DESC LIMIT 150 |
give me the number of patients who had endoscopic excision or destruction of lesion or tissue of stomach and were hospitalized for more than 13 days. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "13" AND procedures.short_title = "Endosc destr stomach les" |
Who is the race caller when jim mckay and al michaels were s hosts in the year 1987? | CREATE TABLE table_25080 ("Year" real,"Network" text,"Race caller" text,"s Host" text,"s Analyst" text,"Reporters" text,"Trophy presentation" text) | SELECT "Race caller" FROM table_25080 WHERE "s Host" = 'Jim McKay and Al Michaels' AND "Year" = '1987' |
list names of all departments ordered by their names. | CREATE TABLE department (dept_name VARCHAR) | SELECT dept_name FROM department ORDER BY dept_name |
what is the grid when the time/retired is +27.112? | CREATE TABLE table_name_79 (grid VARCHAR,time_retired VARCHAR) | SELECT grid FROM table_name_79 WHERE time_retired = "+27.112" |
among the patients of age 40s a year before, what was the top three most frequent procedure? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT... |
Who was the visitor at the pittsburgh penguins at 7:00 pm that had a record of 0-2-2? | CREATE TABLE table_39669 ("Date" text,"Time" text,"Visitor" text,"Score" text,"Home" text,"Location/Attendance" text,"Record" text) | SELECT "Visitor" FROM table_39669 WHERE "Home" = 'pittsburgh penguins' AND "Time" = '7:00 pm' AND "Record" = '0-2-2' |
What was the score of the game on November 22? | CREATE TABLE table_name_8 (result VARCHAR,date VARCHAR) | SELECT result FROM table_name_8 WHERE date = "november 22" |
who was the lead vocalist in sweat it out ? | CREATE TABLE table_203_629 (id number,"year" number,"title" text,"lead vocalist" text,"aria chart position" number,"album" text) | SELECT "lead vocalist" FROM table_203_629 WHERE "title" = '"sweat it out"' |
Who was the partner that played against Serena Williams Venus Williams? | CREATE TABLE table_name_94 (partner VARCHAR,opponents_in_the_final VARCHAR) | SELECT partner FROM table_name_94 WHERE opponents_in_the_final = "serena williams venus williams" |
Which one is easier EECS 532 or EECS 481 ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 532 OR course.number = 481) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... |
What was the title of the episode with a production code of 1gowo04? | CREATE TABLE table_name_3 (episode_title VARCHAR,prod_code VARCHAR) | SELECT episode_title FROM table_name_3 WHERE prod_code = "1gowo04" |
What's the opening when white is Anand with fewer than 61 moves for a result of ? | CREATE TABLE table_name_83 (opening VARCHAR,result VARCHAR,white VARCHAR,moves VARCHAR) | SELECT opening FROM table_name_83 WHERE white = "anand" AND moves < 61 AND result = "½–½" |
List the number of items by the details of the organization that owns it using a bar chart, rank in ascending by the organization_details. | CREATE TABLE Residents_Services (resident_id INTEGER,service_id INTEGER,date_moved_in DATETIME,property_id INTEGER,date_requested DATETIME,date_provided DATETIME,other_details VARCHAR(255))CREATE TABLE Timed_Locations_of_Things (thing_id INTEGER,Date_and_Time DATETIME,Location_Code CHAR(15))CREATE TABLE Timed_Status_of... | SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details ORDER BY organization_details |
What is the name of the shop that has the most different kinds of devices in stock? | CREATE TABLE stock (shop_id number,device_id number,quantity number)CREATE TABLE device (device_id number,device text,carrier text,package_version text,applications text,software_platform text)CREATE TABLE shop (shop_id number,shop_name text,location text,open_date text,open_year number) | SELECT T2.shop_name FROM stock AS T1 JOIN shop AS T2 ON T1.shop_id = T2.shop_id GROUP BY T1.shop_id ORDER BY COUNT(*) DESC LIMIT 1 |
Who did he fight in Rumble of the Kings 6? | CREATE TABLE table_4985 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Opponent" FROM table_4985 WHERE "Event" = 'rumble of the kings 6' |
get me the number of patients born before 2107 who have coronary artery primary disease. | 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" AND demographic.dob_year < "2107" |
What is the film title used for nomination with the original title sedamdeset i dva dana? | CREATE TABLE table_name_65 (film_title_used_in_nomination VARCHAR,original_title VARCHAR) | SELECT film_title_used_in_nomination FROM table_name_65 WHERE original_title = "sedamdeset i dva dana" |
Top 10 Users from. | 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 Id, DisplayName, Reputation FROM Users ORDER BY Reputation DESC LIMIT 10 |
Name the season for august 16, 2010 | CREATE TABLE table_2140071_10 (season VARCHAR,premier_date VARCHAR) | SELECT season FROM table_2140071_10 WHERE premier_date = "August 16, 2010" |
What Played has a Lost smaller than 3, and a Drawn smaller than 0? | CREATE TABLE table_name_13 (played INTEGER,lost VARCHAR,drawn VARCHAR) | SELECT AVG(played) FROM table_name_13 WHERE lost < 3 AND drawn < 0 |
What is the First Pref Votes for the % FPv of 0.06? | CREATE TABLE table_9516 ("Party" text,"Leader" text,"Seats" text,"% of seats" text,"First Pref votes" text,"% FPv" text) | SELECT "First Pref votes" FROM table_9516 WHERE "% FPv" = '0.06' |
What was the value in 1989 with QF in 1997 and A in 1993? | CREATE TABLE table_77106 ("Tournament" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"Career SR" text,"Career Win-Loss" text) | SELECT "1989" FROM table_77106 WHERE "1997" = 'qf' AND "1993" = 'a' |
How difficult on average are the PreMajor classes ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE course_prerequisite (pre_course_id int,cou... | SELECT AVG(workload) FROM program_course WHERE category LIKE '%PreMajor%' |
How many orders in each day? Return a bar chart to show. | CREATE TABLE Customers (customer_id INTEGER,payment_method VARCHAR(15),customer_name VARCHAR(80),date_became_customer DATETIME,other_customer_details VARCHAR(255))CREATE TABLE Customer_Orders (order_id INTEGER,customer_id INTEGER,order_status VARCHAR(15),order_date DATETIME,order_details VARCHAR(255))CREATE TABLE Custo... | SELECT order_date, COUNT(order_date) FROM Customers AS t1 JOIN Customer_Orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered" |
What is the athlete muna lee lowest time? | CREATE TABLE table_name_45 (time INTEGER,athlete VARCHAR) | SELECT MIN(time) FROM table_name_45 WHERE athlete = "muna lee" |
What is the combined of 2 overalls and 5 slaloms? | CREATE TABLE table_name_93 (combined VARCHAR,overall VARCHAR,slalom VARCHAR) | SELECT combined FROM table_name_93 WHERE overall = "2" AND slalom = "5" |
For those employees who was hired before 2002-06-21, visualize a line chart about the change of department_id over hire_date , and could you list in descending by the X-axis? | 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 HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC |
What is the alternate title/translation of the series that premiered on December 12, 2006? | CREATE TABLE table_name_40 (alternate_title_translation VARCHAR,series_premiere VARCHAR) | SELECT alternate_title_translation FROM table_name_40 WHERE series_premiere = "december 12, 2006" |
What occurence has 0.925 listed as the matrix sim? | CREATE TABLE table_28964 ("Detailed Family Information" text,"From" real,"To" real,"Anchor" real,"Orientation" text,"Conserved in Mus Musculus" text,"Matrix Sim" text,"Sequence" text,"Occurrence" real) | SELECT MAX("Occurrence") FROM table_28964 WHERE "Matrix Sim" = '0.925' |
When the nationality is united states, and the time is 58.06, and the heat is larger than 5 what is the lowest rank? | CREATE TABLE table_63273 ("Rank" real,"Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT MIN("Rank") FROM table_63273 WHERE "Nationality" = 'united states' AND "Time" = '58.06' AND "Heat" > '5' |
What was the source of the poll that gave McAuliffe 30% on June 8? | CREATE TABLE table_21535453_1 (source VARCHAR,terry_mcauliffe VARCHAR,dates_administered VARCHAR) | SELECT source FROM table_21535453_1 WHERE terry_mcauliffe = "30%" AND dates_administered = "June 8" |
What nationality is Steven Anthony? | CREATE TABLE table_54539 ("Pick #" real,"Player" text,"Nationality" text,"Position" text,"League from" text) | SELECT "Nationality" FROM table_54539 WHERE "Player" = 'steven anthony' |
What is the enrollment ratio in preschool in the region where the enrollment ratio in primary is 93.10? | CREATE TABLE table_27316 ("Region" text,"Preschool (0\u20135 years)" text,"Primary (6\u201313 years)" text,"Secondary (14\u201317 years)" text,"Tertiary (18\u201324 years)" text) | SELECT "Preschool (0\u20135 years)" FROM table_27316 WHERE "Primary (6\u201313 years)" = '93.10' |
Are there any classes about Elementary African Languages ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Elementary African Languages%' OR name LIKE '%Elementary African Languages%') AND department = 'EECS' |
Which year's crew is varsity 8+ when the record is 7-3? | CREATE TABLE table_38331 ("Year" text,"Coach" text,"Crew" text,"Record" text,"Win %" real) | SELECT "Year" FROM table_38331 WHERE "Crew" = 'varsity 8+' AND "Record" = '7-3' |
What visitor has February 11 as the date? | CREATE TABLE table_name_37 (visitor VARCHAR,date VARCHAR) | SELECT visitor FROM table_name_37 WHERE date = "february 11" |
what is the total bill for patient 52898's hospital stay in their current hospital encounter? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id n... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898 AND admissions.dischtime IS NULL) |
How many products were not included in any order? | CREATE TABLE products (product_id VARCHAR)CREATE TABLE Order_items (product_id VARCHAR) | SELECT COUNT(*) FROM products WHERE NOT product_id IN (SELECT product_id FROM Order_items) |
what is the most laps with a grid of 20? | CREATE TABLE table_12062 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT MAX("Laps") FROM table_12062 WHERE "Grid" = '20' |
what is the lowest fare UA charges between BOSTON and SAN FRANCISCO | CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE airport (airport... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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... |
What is the i/o bus for the brand name Core i3-21xx? | CREATE TABLE table_24538587_11 (i_o_bus VARCHAR,brand_name__list_ VARCHAR) | SELECT i_o_bus FROM table_24538587_11 WHERE brand_name__list_ = "Core i3-21xx" |
What is the name of the building housing more than 101 floors, that was built after 2006? | CREATE TABLE table_54822 ("Rank" text,"Name" text,"Height m (ft)" text,"Floors" real,"Year" real) | SELECT "Name" FROM table_54822 WHERE "Year" > '2006' AND "Floors" > '101' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.