instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
how many teams played consecutive games due to getting a tie ? | CREATE TABLE table_203_620 (id number,"tie no" number,"home team" text,"score" text,"away team" text,"attendance" number) | SELECT COUNT(*) FROM table_203_620 WHERE "score" = "score" |
Show all distinct product categories along with the number of mailshots in each category in a bar chart, and show from high to low by the total number please. | CREATE TABLE Customers (customer_id INTEGER,payment_method VARCHAR(15),customer_name VARCHAR(80),customer_phone VARCHAR(80),customer_email VARCHAR(80),customer_address VARCHAR(255),customer_login VARCHAR(80),customer_password VARCHAR(10))CREATE TABLE Mailshot_Customers (mailshot_id INTEGER,customer_id INTEGER,outcome_c... | SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY COUNT(*) DESC |
what is the name of the top priced winnebago model ? | CREATE TABLE table_203_42 (id number,"model" text,"class" text,"length" text,"fuel" text,"starting price" text) | SELECT "model" FROM table_203_42 ORDER BY "starting price" DESC LIMIT 1 |
What is the Result for Goal 3? | CREATE TABLE table_name_30 (result VARCHAR,goal VARCHAR) | SELECT result FROM table_name_30 WHERE goal = 3 |
Which Paper Type has a Denomination of $0.50 and Date of Issue 4 February 2005? | CREATE TABLE table_name_30 (paper_type VARCHAR,denomination VARCHAR,date_of_issue VARCHAR) | SELECT paper_type FROM table_name_30 WHERE denomination = "$0.50" AND date_of_issue = "4 february 2005" |
Which Date has a Location Attendance of madison square garden 19,763, and a High rebounds of david lee (12)? | CREATE TABLE table_48735 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Date" FROM table_48735 WHERE "Location Attendance" = 'madison square garden 19,763' AND "High rebounds" = 'david lee (12)' |
Top user in all tags by score and answer count. | 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 t.TagName, a.OwnerUserId AS "user_link", SUM(a.Score) / 10 AS Score, COUNT(a.Score) AS "count", ((SUM(a.Score) / 10) + COUNT(a.Score)) / 2 AS Total FROM Posts AS a, Posts AS q INNER JOIN PostTags AS qt ON q.Id = qt.PostId INNER JOIN Tags AS t ON t.Id = qt.TagId WHERE a.ParentId = q.Id AND a.PostTypeId = 2 AND a.... |
between what years was tears of the antarctic shown ? | CREATE TABLE table_204_379 (id number,"year" text,"title" text,"hangul" text,"network" text,"further info" text) | SELECT "year" FROM table_204_379 WHERE "title" = 'tears of the antarctic' |
The 'Head of State' episode was authored by which person? | CREATE TABLE table_20348 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written By" text,"Originalairdate" text,"TV Broadcast" text) | SELECT "Written By" FROM table_20348 WHERE "Title" = 'Head of State' |
Can you tell me the Combined that has the Victories of 14? | CREATE TABLE table_name_53 (combined VARCHAR,victories VARCHAR) | SELECT combined FROM table_name_53 WHERE victories = 14 |
WHAT IS THE TRIES WITH POINTS 190? | CREATE TABLE table_name_36 (tries_for VARCHAR,points_for VARCHAR) | SELECT tries_for FROM table_name_36 WHERE points_for = "190" |
What Label released an album in August 1996? | CREATE TABLE table_name_84 (label VARCHAR,release_date VARCHAR) | SELECT label FROM table_name_84 WHERE release_date = "august 1996" |
Which Rank has Goals larger than 10, and a Scorer of choi sang-kuk? | CREATE TABLE table_37160 ("Rank" text,"Scorer" text,"Club" text,"Goals" real,"Matches" text) | SELECT "Rank" FROM table_37160 WHERE "Goals" > '10' AND "Scorer" = 'choi sang-kuk' |
What is the first name of students who got grade C in any class? | CREATE TABLE enroll (stu_num VARCHAR)CREATE TABLE student (stu_num VARCHAR) | SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C' |
What is the lowest number of field goals when the points were less than 5? | CREATE TABLE table_name_53 (field_goals INTEGER,points INTEGER) | SELECT MIN(field_goals) FROM table_name_53 WHERE points < 5 |
who was awarded an oscar for best sound for two films in the same year - king kong and rocky ? | CREATE TABLE table_203_17 (id number,"name" text,"date of death" text,"ceremony" text,"year" text,"academy award" text,"film" text,"winner" text) | SELECT "name" FROM table_203_17 WHERE "film" = 'king kong' |
When was Fitzroy the home team? | CREATE TABLE table_name_94 (date VARCHAR,home_team VARCHAR) | SELECT date FROM table_name_94 WHERE home_team = "fitzroy" |
Which Centennial has a del Pueblo of 1986? | CREATE TABLE table_name_40 (centennial VARCHAR,del_pueblo VARCHAR) | SELECT centennial FROM table_name_40 WHERE del_pueblo = "1986" |
How many total losses does the team have with an against of 2195 and the draws were greater than 0? | CREATE TABLE table_7310 ("Ballarat FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT COUNT("Losses") FROM table_7310 WHERE "Against" = '2195' AND "Draws" > '0' |
What are the draws of Cobden when there are more than 3 losses? | CREATE TABLE table_name_23 (draws INTEGER,losses VARCHAR,club VARCHAR) | SELECT AVG(draws) FROM table_name_23 WHERE losses > 3 AND club = "cobden" |
What is the rank of Rmax Rpeak ( Pflops ) of 17.173 20.133? | CREATE TABLE table_name_7 (rank INTEGER,rmax_rpeak___pflops__ VARCHAR) | SELECT AVG(rank) FROM table_name_7 WHERE rmax_rpeak___pflops__ = "17.173 20.133" |
name of the first nobel laureates from penn. . | CREATE TABLE table_203_437 (id number,"year" number,"laureate" text,"relation" text,"category" text,"rationale" text) | SELECT "laureate" FROM table_203_437 ORDER BY "year" LIMIT 1 |
What is the number of races that took place with points of 257? | CREATE TABLE table_name_28 (races INTEGER,points VARCHAR) | SELECT SUM(races) FROM table_name_28 WHERE points = 257 |
provide the number of patients whose gender is f and procedure icd9 code is 5783? | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "5783" |
how many rooms have king beds? Report the number for each decor type, and rank by the y axis in ascending. | CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER) | SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY COUNT(*) |
What is the pole position of the grand prix with 1 round? | CREATE TABLE table_name_93 (pole_position VARCHAR,round VARCHAR) | SELECT pole_position FROM table_name_93 WHERE round = 1 |
lorraine moller 's top time overall was | CREATE TABLE table_204_450 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT MIN("notes") FROM table_204_450 |
When momoiro clover z is the vocalist what is the japanese translation? | CREATE TABLE table_2461 ("#" real,"Japanese title" text,"R\u014dmaji" text,"Japanese translation" text,"Vocalist" text,"Episodes used" text) | SELECT "Japanese translation" FROM table_2461 WHERE "Vocalist" = 'Momoiro Clover Z' |
What Result F A has a League position of 2nd, and Opponents of liverpool? | CREATE TABLE table_12319 ("Date" text,"Opponents" text,"H / A" text,"Result F \u2013 A" text,"Attendance" real,"League position" text) | SELECT "Result F \u2013 A" FROM table_12319 WHERE "League position" = '2nd' AND "Opponents" = 'liverpool' |
What was the time/retired for the driver with fewer than 23 laps and grid larger than 23? | CREATE TABLE table_11669 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Time/Retired" FROM table_11669 WHERE "Laps" < '23' AND "Grid" > '23' |
Which Venue has a Country of england, and a Champion of alison nicholas? | CREATE TABLE table_name_66 (venue VARCHAR,country VARCHAR,champion VARCHAR) | SELECT venue FROM table_name_66 WHERE country = "england" AND champion = "alison nicholas" |
what is the lowest week when the date is september 16, 1979 and the attendance less than 54,212? | CREATE TABLE table_45182 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT MIN("Week") FROM table_45182 WHERE "Date" = 'september 16, 1979' AND "Attendance" < '54,212' |
What is the reason for change when maryland 6th is the district? | CREATE TABLE table_225100_4 (reason_for_change VARCHAR,district VARCHAR) | SELECT reason_for_change FROM table_225100_4 WHERE district = "Maryland 6th" |
Where was the player born when the appearances were greater than 40 and made 17 goals? | CREATE TABLE table_43686 ("Nationality" text,"Position" text,"Gillingham career" text,"Apps." real,"Goals" real) | SELECT "Nationality" FROM table_43686 WHERE "Apps." > '40' AND "Goals" = '17' |
On which day and in which zip code was the min dew point lower than any day in zip code 94107? | CREATE TABLE trip (id number,duration number,start_date text,start_station_name text,start_station_id number,end_date text,end_station_name text,end_station_id number,bike_id number,subscription_type text,zip_code number)CREATE TABLE status (station_id number,bikes_available number,docks_available number,time text)CREA... | SELECT date, zip_code FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) |
On which date did the away team score 10.11 (71)? | CREATE TABLE table_55163 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_55163 WHERE "Away team score" = '10.11 (71)' |
what was the three most commonly taken laboratory tests during a year before for patients of the age 50s? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CR... | 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 50 AND 59) AND DATETIME(labevents.chartti... |
What was the number of channels in New Zealand? | CREATE TABLE table_11323532_2 (channel VARCHAR,country_region VARCHAR) | SELECT COUNT(channel) FROM table_11323532_2 WHERE country_region = "New Zealand" |
what is the cheapest flight from DENVER to OAKLAND | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE city (city_code varchar,city... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... |
Most recently , who taught NAVARCH 583 ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varcha... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offeri... |
how many times on the current hospital encounter has patient 004-79017 received enteral perative? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunit... | 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 = '004-79017' AND patient.hospitaldischargetime IS NULL)) AND intakeoutput.ce... |
what is admission location and discharge location of subject id 84129? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "84129" |
Which venue had a lost 5-4 result? | CREATE TABLE table_45184 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" text,"Competition" text,"Man of the Match" text) | SELECT "Venue" FROM table_45184 WHERE "Result" = 'lost 5-4' |
What is the highest total number of seats with a Seat percentage of 46.5% and less than 394,118 party list votes? | CREATE TABLE table_67476 ("Party" text,"Party List votes" real,"Vote percentage" text,"Total Seats" real,"Seat percentage" text) | SELECT MAX("Total Seats") FROM table_67476 WHERE "Seat percentage" = '46.5%' AND "Party List votes" < '394,118' |
What was the frequency of the Core i7-3610QE? | CREATE TABLE table_63212 ("Model number" text,"sSpec number" text,"Cores" text,"Frequency" text,"Turbo" text,"L2 cache" text,"L3 cache" text,"GPU model" text,"GPU frequency" text,"Socket" text,"I/O bus" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text) | SELECT "Frequency" FROM table_63212 WHERE "Model number" = 'core i7-3610qe' |
What was the W-L record when HIgh Points was andre miller (30)? | CREATE TABLE table_17323042_11 (record VARCHAR,high_points VARCHAR) | SELECT record FROM table_17323042_11 WHERE high_points = "Andre Miller (30)" |
What 2008 has 2013 for the year 2013? | CREATE TABLE table_name_37 (Id VARCHAR) | SELECT 2008 FROM table_name_37 WHERE "2013" = "2013" |
give the number of female patients whose primary disease is squamous cell carcinoma oral tongue/sda. | 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 WHERE demographic.gender = "F" AND demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" |
Which current venues location is Mason, Ohio? | CREATE TABLE table_72598 ("Tournament" text,"Country" text,"Location" text,"Current Venue" text,"Began" real,"Court surface" text) | SELECT "Current Venue" FROM table_72598 WHERE "Location" = 'Mason, Ohio' |
where is a good arabic restaurant in mountain view ? | CREATE TABLE geographic (city_name varchar,county varchar,region varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar) | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 |
result is lost re-election republican gain, what is the district? | CREATE TABLE table_6338 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text) | SELECT "District" FROM table_6338 WHERE "Result" = 'lost re-election republican gain' |
How many clubs are involved when there are 4 winners from the previous rounds and more than 4 clubs remaining? | CREATE TABLE table_name_59 (clubs_involved INTEGER,winners_from_previous_round VARCHAR,clubs_remaining VARCHAR) | SELECT MIN(clubs_involved) FROM table_name_59 WHERE winners_from_previous_round = "4" AND clubs_remaining > 4 |
count how many times patient 69895 has had a urine out foley out on 02/10/2105. | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREA... | SELECT COUNT(*) 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 = 69895)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out foley' A... |
What are the details and id of the project with the most outcomes? | CREATE TABLE research_staff (staff_id number,employer_organisation_id number,staff_details text)CREATE TABLE organisations (organisation_id number,organisation_type text,organisation_details text)CREATE TABLE project_staff (staff_id number,project_id number,role_code text,date_from time,date_to time,other_details text)... | SELECT T1.project_details, T1.project_id FROM projects AS T1 JOIN project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1 |
what is the points when the goals conceded is less than 24, place is less than 6 and goals scored is less than 26? | CREATE TABLE table_name_15 (points INTEGER,goals_scored VARCHAR,goals_conceded VARCHAR,place VARCHAR) | SELECT SUM(points) FROM table_name_15 WHERE goals_conceded < 24 AND place < 6 AND goals_scored < 26 |
Top SO from seoul, south korea. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,Targe... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%seoul%' OR UPPER(Location) LIKE '%SEOUL%' OR Location LIKE '%Seoul%' AND Reputation >= 1000 ORDER BY Reputation DESC |
Who held the pole position in SPA-Francorchamps? | CREATE TABLE table_56647 ("Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text) | SELECT "Pole Position" FROM table_56647 WHERE "Location" = 'spa-francorchamps' |
Who was the home team when Carlton was the away team? | CREATE TABLE table_32578 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_32578 WHERE "Away team" = 'carlton' |
Name the prize pool for 706 (481 r, 346 a) | CREATE TABLE table_2534387_10 (prize VARCHAR,entries VARCHAR) | SELECT prize AS Pool FROM table_2534387_10 WHERE entries = "706 (481 R, 346 A)" |
What is the Week when the kick off was at 4:05 pm, and the result was w 31 14? | CREATE TABLE table_40921 ("Week" real,"Date" text,"Kickoff (ET)" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"NFL.com Recap" text) | SELECT "Week" FROM table_40921 WHERE "Kickoff ( ET )" = '4:05 pm' AND "Result" = 'w 31–14' |
What's the stadium on November 8? | CREATE TABLE table_name_26 (home VARCHAR,date VARCHAR) | SELECT home FROM table_name_26 WHERE date = "november 8" |
What is the lowest Wins, when Season is 2011, when Podiums is 1, and when Poles is less than 0? | CREATE TABLE table_50947 ("Season" text,"Series" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text) | SELECT MIN("Wins") FROM table_50947 WHERE "Season" = '2011' AND "Podiums" = '1' AND "Poles" < '0' |
How many weeks had an attendance of 60038? | CREATE TABLE table_16729071_1 (week VARCHAR,attendance VARCHAR) | SELECT COUNT(week) FROM table_16729071_1 WHERE attendance = 60038 |
give me the number of patients whose admission type is newborn and lab test category is hematology? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab."CATEGORY" = "Hematology" |
How many fatalities occurred for an unknown tail number? | CREATE TABLE table_41232 ("Location" text,"Aircraft" text,"Tail number" text,"Aircraft damage" text,"Fatalities" text) | SELECT "Fatalities" FROM table_41232 WHERE "Tail number" = 'unknown' |
Average Time to Answer for a single user. | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId... | SELECT MAX(uss.userid) AS "user_link", AVG(uss.TTA) AS "average_time_to_answer" FROM (SELECT u.Id AS userid, p.Id, p.CreationDate AS acreat, p2.CreationDate AS qcreat, (CAST((JULIANDAY(CreationDate) - JULIANDAY(p2.CreationDate)) AS INT)) AS TTA, p.Score FROM Posts AS p INNER JOIN Posts AS p2 ON p.ParentId = p2.Id INNER... |
Which largest average had 1229 yards? | CREATE TABLE table_52703 ("Player" text,"Rec." real,"Yards" real,"Avg." real,"TD's" real,"Long" real) | SELECT MAX("Avg.") FROM table_52703 WHERE "Yards" = '1229' |
What county is Whiteland Community School in? | CREATE TABLE table_66270 ("School" text,"Mascot" text,"Location" text,"Enrollment" real,"IHSAA Class" text,"IHSAA Football Class" text,"County" text) | SELECT "County" FROM table_66270 WHERE "School" = 'whiteland community' |
cheapest airfare from ORLANDO to TACOMA | CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,ser... | 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 = 'ORLANDO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... |
What's the pos for an asts less than 117? | CREATE TABLE table_name_52 (pos VARCHAR,asts INTEGER) | SELECT pos FROM table_name_52 WHERE asts < 117 |
What is the total where the nation is South Africa (rsa) and bronze is less than 1? | CREATE TABLE table_53681 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Total") FROM table_53681 WHERE "Nation" = 'south africa (rsa)' AND "Bronze" < '1' |
Which instructor teaches SOC 324 ? | 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 instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'SOC' AND course.number = 324 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.of... |
i want to go and take a plane in ATLANTA and fly to BOSTON | CREATE TABLE code_description (code varchar,description text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description 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 te... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... |
What was the largest tie when the G.P was more than 5? | CREATE TABLE table_name_56 (ties INTEGER,gp INTEGER) | SELECT MAX(ties) FROM table_name_56 WHERE gp > 5 |
A list of the top 500 users with the highest average answer score excluding
community wiki / closed posts. A list of the top 500 users with the highest average answer score excluding
community wiki / closed posts or users with less than 10 answers | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseRea... | SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Questions, Users.Reputation AS Reputation, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_question_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, Use... |
find the number of patients with left colon cancer primary disease who had urine test done. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "LEFT COLON CANCER" AND lab.fluid = "Urine" |
During the Summer , has MICRBIOL 440 ever been offered ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)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,wedn... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MICRBIOL' AND course.number = 440 AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester |
Which Distance has an Event of breaststroke, and a Location of beijing, chn? | CREATE TABLE table_name_16 (distance VARCHAR,event VARCHAR,location VARCHAR) | SELECT distance FROM table_name_16 WHERE event = "breaststroke" AND location = "beijing, chn" |
give me the number of elective hospital admission patients who had cardiopulmonary resuscitation, not otherwise specified. | 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.admission_type = "ELECTIVE" AND procedures.long_title = "Cardiopulmonary resuscitation, not otherwise specified" |
what was the total amount of wins that the bridgeport barrage had in 2002 ? | CREATE TABLE table_203_853 (id number,"date" text,"opponent" text,"home/away" text,"field" text,"result" text) | SELECT COUNT(*) FROM table_203_853 WHERE "result" = 'w' |
Who was the opponent in the game in which Hakim Warrick (14) did the most high points? | CREATE TABLE table_2677 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_2677 WHERE "High points" = 'Hakim Warrick (14)' |
what was the five most common specimen test that was given since 2102? | 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 intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllab... | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) >= '2102' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5 |
Questions that would be orphaned by automated burnination of the [row] rag. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Tags (Id number,Tag... | SELECT Id FROM Posts WHERE Tags = '<row>' |
For those records from the products and each product's manufacturer, show me about the distribution of name and code , and group by attribute founder in a bar chart, rank in asc by the total number. | 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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, rank by the Y-axis in descending. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),R... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC |
what is the name when the 2008 club is uralochka? | CREATE TABLE table_79312 ("Name" text,"Height" text,"Weight" text,"Spike" text,"2008 club" text) | SELECT "Name" FROM table_79312 WHERE "2008 club" = 'uralochka' |
which is the former pageant in the country where the new pageant is miss bahamas? | CREATE TABLE table_19227 ("Country/Territory" text,"Former pageant" text,"Last competed" real,"New pageant" text,"Franchise since" real) | SELECT "Former pageant" FROM table_19227 WHERE "New pageant" = 'Miss Bahamas' |
How many podiums for the driver with 18 stage wins? | CREATE TABLE table_18811741_15 (podiums VARCHAR,stage_wins VARCHAR) | SELECT COUNT(podiums) FROM table_18811741_15 WHERE stage_wins = 18 |
Show me school_id by acc regular season in a histogram, show in descending by the y axis. | 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_Regular_Season, School_ID FROM basketball_match ORDER BY School_ID DESC |
what's the name of the last test patient 008-10139 has received since 04/2104? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid nu... | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-10139')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2104-04' ORDER BY lab.labresult... |
How many townships are there in region number 2? | CREATE TABLE table_23010 ("No." real,"State/Region" text,"Districts" real,"Town ships" real,"Cities/ Towns" real,"Wards" real,"Village groups" real,"Villages" real) | SELECT MAX("Town ships") FROM table_23010 WHERE "No." = '2' |
select top 10 from Posts. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRenam... | SELECT * FROM Posts WHERE ViewCount > 31000 AND ViewCount <= 33000 ORDER BY ViewCount DESC |
What is the cost of 972 Min Press caused 52 death? | CREATE TABLE table_38472 ("Storm name" text,"Dates active" text,"Max 1-min wind mph (km/h)" text,"Min. press. (mbar)" text,"Damage (millions USD)" text,"Deaths" text) | SELECT "Damage (millions USD )" FROM table_38472 WHERE "Min. press. ( mbar )" = '972' AND "Deaths" = '52' |
how many patients have stayed in the hospital for more than 1 day? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "1" |
Return a bar chart on what is the total revenue of each manufacturer?, could you sort by the bars from high to low? | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name DESC |
What Outcome happened on a Date that was 20 november 2011? | CREATE TABLE table_name_61 (outcome VARCHAR,date VARCHAR) | SELECT outcome FROM table_name_61 WHERE date = "20 november 2011" |
With the title 'Memories by Moonlight', and a less than 39 number in season, and a greater than 66 number in series, who was the written by? | CREATE TABLE table_13737 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT "Written by" FROM table_13737 WHERE "No. in series" > '66' AND "No. in season" < '39' AND "Title" = 'memories by moonlight' |
What name is associated with a rank greater than 69, an altitude (meters) smaller than 2154, and a range of Sivorgfjella? | CREATE TABLE table_name_79 (name VARCHAR,altitude__meters_ VARCHAR,range VARCHAR,rank VARCHAR) | SELECT name FROM table_name_79 WHERE range = "sivorgfjella" AND rank > 69 AND altitude__meters_ < 2154 |
Bronze of 2, and a Silver smaller than 0 then what is the sum of the gold? | CREATE TABLE table_name_99 (gold INTEGER,bronze VARCHAR,silver VARCHAR) | SELECT SUM(gold) FROM table_name_99 WHERE bronze = 2 AND silver < 0 |
For those employees who did not have any job in the past, give me the comparison about the sum of salary over the job_id , and group by attribute job_id. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID var... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.