instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How many League Cup Goals have Total Apps of 36, and Total Goals smaller than 1? | CREATE TABLE table_name_76 (league_cup_goals VARCHAR,total_apps VARCHAR,total_goals VARCHAR) | SELECT COUNT(league_cup_goals) FROM table_name_76 WHERE total_apps = "36" AND total_goals < 1 |
The away team of Richmond played on what grounds? | CREATE TABLE table_16388230_1 (ground VARCHAR,away_team VARCHAR) | SELECT ground FROM table_16388230_1 WHERE away_team = "Richmond" |
What is the population in 2011 for the name Beaubassin East? | CREATE TABLE table_26321719_1 (population__2011_ VARCHAR,name VARCHAR) | SELECT population__2011_ FROM table_26321719_1 WHERE name = "Beaubassin East" |
What is the average position of Eesti P levkivi J hvi when they had less than 13 points and worse than a -12 goal differential? | CREATE TABLE table_71683 ("Year" text,"League" text,"Position" real,"Goals +/-" real,"Points" real) | SELECT AVG("Position") FROM table_71683 WHERE "Points" < '13' AND "Goals +/-" > '-12' |
What was the result when there were less than 3 rounds against Gil Rael? | CREATE TABLE table_4405 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Res." FROM table_4405 WHERE "Round" < '3' AND "Opponent" = 'gil rael' |
What is the winning span with the rank of 5? | CREATE TABLE table_1953516_1 (winning_span VARCHAR,rank VARCHAR) | SELECT winning_span FROM table_1953516_1 WHERE rank = "5" |
Which organizations were founded in 1972, but became WOSM members until 1977? | CREATE TABLE table_16152 ("Country" text,"Membership (from 2010)" real,"Name of member organization" text,"Year current Scouting organization joined WOSM" text,"Year member organization was founded" text,"Admits boys/girls" text) | SELECT "Name of member organization" FROM table_16152 WHERE "Year member organization was founded" = '1972' AND "Year current Scouting organization joined WOSM" = '1977' |
tell me the difference in systemicdiastolic levels of patient 029-26705 last measured on the first intensive care unit visit compared to the value first measured on the first intensive care unit visit? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna... | SELECT (SELECT vitalperiodic.systemicdiastolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-26705') AND NOT patient.unitdischarge... |
when has patient 031-24513 first been given a microbiology test until 09/2104? | 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 vitalperiodic (vitalperiodicid number,patientunitstayid number,tempe... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= ... |
Display a bar chart for how many medications are prescribed for each brand?, display from low to high by the x-axis please. | CREATE TABLE Appointment (AppointmentID INTEGER,Patient INTEGER,PrepNurse INTEGER,Physician INTEGER,Start DATETIME,End DATETIME,ExaminationRoom TEXT)CREATE TABLE Stay (StayID INTEGER,Patient INTEGER,Room INTEGER,StayStart DATETIME,StayEnd DATETIME)CREATE TABLE Department (DepartmentID INTEGER,Name VARCHAR(30),Head INTE... | SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand ORDER BY Name |
Show all the activity names and the number of faculty involved in each activity. | CREATE TABLE Faculty_participates_in (actID VARCHAR)CREATE TABLE Activity (activity_name VARCHAR,actID VARCHAR) | SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID |
For those products with a price between 60 and 120, visualize a scatter chart about the correlation between code and price . | 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 Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 |
what is the difference in wins between sevilla fc and cd toledo ? | CREATE TABLE table_204_256 (id number,"position" number,"club" text,"played" number,"points" number,"wins" number,"draws" number,"losses" number,"goals for" number,"goals against" number,"goal difference" number) | SELECT ABS((SELECT "wins" FROM table_204_256 WHERE "club" = 'sevilla fc') - (SELECT "wins" FROM table_204_256 WHERE "club" = 'cd toledo')) |
which total score was higher , game # 163 or # 181 ? | CREATE TABLE table_204_453 (id number,"#" number,"date" text,"venue" text,"opponents" text,"score" text,"comp" text,"denmark scorers" text) | SELECT "#" FROM table_204_453 WHERE "#" IN (163, 181) ORDER BY "score" + "score" DESC LIMIT 1 |
how many asian patients were admitted to the hospital before the year 2108? | 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.ethnicity = "ASIAN" AND demographic.admityear < "2108" |
questions without code examples; parameters: tags/keywords/minimum score. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)... | SELECT Id AS "post_link", Title, Score, Tags, ViewCount, AnswerCount, CommentCount, FavoriteCount, OwnerUserId FROM Posts AS q WHERE PostTypeId = 1 AND ((q.Tags LIKE '%<sap>%') OR (q.Title LIKE '% sap%' OR q.Title LIKE '%SAP%' OR q.Title LIKE '%Sap%') OR (q.Body LIKE '% sap%' OR q.Body LIKE '%SAP%' OR q.Body LIKE '%Sap... |
How many dates did Daniel Ruiz win the Spanish Grand Prix? | CREATE TABLE table_28925058_1 (date VARCHAR,grand_prix VARCHAR,race_winner VARCHAR) | SELECT COUNT(date) FROM table_28925058_1 WHERE grand_prix = "Spanish grand_prix" AND race_winner = "Daniel Ruiz" |
In which year did he finish 11th? | CREATE TABLE table_14377 ("Year" real,"Tournament" text,"Venue" text,"Result" text,"Distance" text) | SELECT COUNT("Year") FROM table_14377 WHERE "Result" = '11th' |
Who are the Opponents in the final prior to 1998 in the Bucharest, Romania Tournament? | CREATE TABLE table_name_65 (opponents_in_the_final VARCHAR,date VARCHAR,tournament VARCHAR) | SELECT opponents_in_the_final FROM table_name_65 WHERE date < 1998 AND tournament = "bucharest, romania" |
What was the conference record in the season where the Pandas had an overall record of 33-4-1? | CREATE TABLE table_27069503_2 (conf_record VARCHAR,overall VARCHAR) | SELECT conf_record FROM table_27069503_2 WHERE overall = "33-4-1" |
What is the smallest quantity having a Class to 1928 of BDi-21? | CREATE TABLE table_name_79 (quantity INTEGER,class_to_1928 VARCHAR) | SELECT MIN(quantity) FROM table_name_79 WHERE class_to_1928 = "bdi-21" |
what is admission time and discharge time of subject id 17595? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "17595" |
For each record in schedule, show average of the price for each day in a bar chart, and order x-axis in ascending order. | CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price... | SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY Date |
Name the mountain peak with location of 46.7000 n 60.5992 w | CREATE TABLE table_name_17 (mountain_peak VARCHAR,location VARCHAR) | SELECT mountain_peak FROM table_name_17 WHERE location = "46.7000°n 60.5992°w" |
What city of license has A as a class, and cbec-fm as the identifier? | CREATE TABLE table_41558 ("City of license" text,"Identifier" text,"Frequency" text,"Power" text,"Class" text,"RECNet" text) | SELECT "City of license" FROM table_41558 WHERE "Class" = 'a' AND "Identifier" = 'cbec-fm' |
Who is the constructor of the car with a Peugeot A12 EV5 3.0 V10 engine that competed in all rounds? | CREATE TABLE table_name_2 (constructor VARCHAR,rounds VARCHAR,engine VARCHAR) | SELECT constructor FROM table_name_2 WHERE rounds = "all" AND engine = "peugeot a12 ev5 3.0 v10" |
Return the login names of the students whose family name is 'Ward'. | CREATE TABLE students (student_id number,date_of_registration time,date_of_latest_logon time,login_name text,password text,personal_name text,middle_name text,family_name text)CREATE TABLE student_tests_taken (registration_id number,date_test_taken time,test_result text)CREATE TABLE course_authors_and_tutors (author_id... | SELECT login_name FROM students WHERE family_name = "Ward" |
How many races did Cale Yarborough win at an average speed of 88.924 mph? | CREATE TABLE table_22648285_1 (race_time VARCHAR,driver VARCHAR,average_speed__mph_ VARCHAR) | SELECT COUNT(race_time) FROM table_22648285_1 WHERE driver = "Cale Yarborough" AND average_speed__mph_ = "88.924" |
What is the method of opponent georges st-pierre? | CREATE TABLE table_name_22 (method VARCHAR,opponent VARCHAR) | SELECT method FROM table_name_22 WHERE opponent = "georges st-pierre" |
What is the total for Robert Stanescu ( rou ), when the B Score is larger than 8.75? | CREATE TABLE table_name_40 (total INTEGER,gymnast VARCHAR,b_score VARCHAR) | SELECT SUM(total) FROM table_name_40 WHERE gymnast = "robert stanescu ( rou )" AND b_score > 8.75 |
What is the home record for the Maccabi Tel-Aviv club? | CREATE TABLE table_name_85 (home VARCHAR,club VARCHAR) | SELECT home FROM table_name_85 WHERE club = "maccabi tel-aviv" |
What was the result for the game against the Pittsburgh Steelers? | CREATE TABLE table_name_85 (result VARCHAR,opponent VARCHAR) | SELECT result FROM table_name_85 WHERE opponent = "pittsburgh steelers" |
Name the production code # for episode 109 | CREATE TABLE table_26056 ("Episode #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original airdate" text,"Production code #" real) | SELECT COUNT("Production code #") FROM table_26056 WHERE "Episode #" = '109' |
How many years had ozone awards? | CREATE TABLE table_14418 ("Year" real,"Award" text,"Category" text,"Nominated Work" text,"Result" text) | SELECT SUM("Year") FROM table_14418 WHERE "Award" = 'ozone awards' |
On what Date is Alexandra Fusai a Partner with a Score of 4 6, 6 3, 6 1? | CREATE TABLE table_name_46 (date VARCHAR,partner VARCHAR,score VARCHAR) | SELECT date FROM table_name_46 WHERE partner = "alexandra fusai" AND score = "4–6, 6–3, 6–1" |
provide me the number of divorced patients who have td route of drug administration. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "TD" |
What is the sum of percentage of marine area with an area of territorial waters of 72,144 and exclusive economic zone area less than 996,439? | CREATE TABLE table_42098 ("Ecozone" text,"Area (km\u00b2) Territorial waters" real,"Area (km\u00b2) Exclusive Economic Zone" real,"Percentage of total area (forEEZ)" real,"Percentage of marine area (forEEZ)" real) | SELECT SUM("Percentage of marine area (forEEZ)") FROM table_42098 WHERE "Area (km\u00b2) Territorial waters" = '72,144' AND "Area (km\u00b2) Exclusive Economic Zone" < '996,439' |
What team draft a player from Canada that was picked #43 and plays right wing? | CREATE TABLE table_name_59 (nhl_team VARCHAR,pick__number VARCHAR,nationality VARCHAR,position VARCHAR) | SELECT nhl_team FROM table_name_59 WHERE nationality = "canada" AND position = "right wing" AND pick__number = "43" |
Who were the candidates in the 1922 entry? | CREATE TABLE table_1342370_12 (candidates VARCHAR,first_elected VARCHAR) | SELECT candidates FROM table_1342370_12 WHERE first_elected = 1922 |
How many of the patients tested for bilirubin have an unspecified death status? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Bilirubin" |
Name the network for 2007 total | CREATE TABLE table_25203 ("Year" real,"Network" text,"Race caller" text,"s Host" text,"s Analyst" text,"Reporters" text,"Trophy presentation" text) | SELECT COUNT("Network") FROM table_25203 WHERE "Year" = '2007' |
has the dominican republic won more or less medals than china ? | CREATE TABLE table_203_535 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT (SELECT "total" FROM table_203_535 WHERE "nation" = 'dominican republic') > (SELECT "total" FROM table_203_535 WHERE "nation" = 'china') |
What engine has a start less than 7, and 23 as a finish? | CREATE TABLE table_name_19 (engine VARCHAR,start VARCHAR,finish VARCHAR) | SELECT engine FROM table_name_19 WHERE start < 7 AND finish = 23 |
What group of juventus had an attendance larger than 47,786? | CREATE TABLE table_name_2 (group_position VARCHAR,opponents VARCHAR,attendance VARCHAR) | SELECT group_position FROM table_name_2 WHERE opponents = "juventus" AND attendance > 47 OFFSET 786 |
Which stadium is located in Adelaide, South Australia? | CREATE TABLE table_28885977_1 (stadium VARCHAR,location VARCHAR) | SELECT stadium FROM table_28885977_1 WHERE location = "Adelaide, South Australia" |
Which episode had Lavern Baker? | CREATE TABLE table_26250151_1 (episode VARCHAR,original_recording_artist VARCHAR) | SELECT episode FROM table_26250151_1 WHERE original_recording_artist = "LaVern Baker" |
What game had the date was it with the final score of 7-23 | CREATE TABLE table_69274 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text) | SELECT "Date" FROM table_69274 WHERE "Final Score" = '7-23' |
what is the number of emergency room admitted patients who are taking amiodarone hcl medication? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.drug = "Amiodarone HCl" |
Name the writers for swedish sailor | CREATE TABLE table_19852975_3 (writer_s_ VARCHAR,arties_disguises VARCHAR) | SELECT writer_s_ FROM table_19852975_3 WHERE arties_disguises = "Swedish sailor" |
how many consecutive times is china represented ? | CREATE TABLE table_204_130 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text) | SELECT COUNT(*) FROM table_204_130 WHERE "opponent" = 'china' |
Performer 1 of greg proops, and a Date of 25 august 1995 is what performer 4? | CREATE TABLE table_name_76 (performer_4 VARCHAR,performer_1 VARCHAR,date VARCHAR) | SELECT performer_4 FROM table_name_76 WHERE performer_1 = "greg proops" AND date = "25 august 1995" |
Which Total has a Club of darlington, and a League goals of 13, and a League Cup goals of 1? | CREATE TABLE table_name_68 (total INTEGER,league_cup_goals VARCHAR,club VARCHAR,league_goals VARCHAR) | SELECT SUM(total) FROM table_name_68 WHERE club = "darlington" AND league_goals = "13" AND league_cup_goals = "1" |
What pick was the player from Apopka, FL in the 2002 MLB draft | CREATE TABLE table_11677100_8 (mlb_draft VARCHAR,hometown VARCHAR) | SELECT mlb_draft FROM table_11677100_8 WHERE hometown = "Apopka, FL" |
Which club has 101 tries for? | CREATE TABLE table_59236 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text) | SELECT "Club" FROM table_59236 WHERE "Tries for" = '101' |
For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the headquarter , and group by attribute headquarter, sort by the total number in asc please. | 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 Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue) |
What is the Score of the Pingguo Tournament? | CREATE TABLE table_13957 ("Date" text,"Tournament" text,"Surface" text,"Opponent in final" text,"Score" text,"Prize Money" text) | SELECT "Score" FROM table_13957 WHERE "Tournament" = 'pingguo' |
What is the result from the game played on week 7? | CREATE TABLE table_9548 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_9548 WHERE "Week" = '7' |
Name the others for cons of 21% and lead of 24% | CREATE TABLE table_78208 ("Date(s) conducted" text,"Polling organisation/client" text,"Cons" text,"Plaid Cymru" text,"Lib Dem" text,"Others" text,"Lead" text) | SELECT "Others" FROM table_78208 WHERE "Cons" = '21%' AND "Lead" = '24%' |
How many assets can each parts be used in? List the part name and the number, display X in descending order. | CREATE TABLE Assets (asset_id INTEGER,maintenance_contract_id INTEGER,supplier_company_id INTEGER,asset_details VARCHAR(255),asset_make VARCHAR(20),asset_model VARCHAR(20),asset_acquired_date DATETIME,asset_disposed_date DATETIME,other_asset_details VARCHAR(255))CREATE TABLE Engineer_Visits (engineer_visit_id INTEGER,c... | SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY part_name DESC |
Who had the lowest interview score from South Dakota with an evening gown less than 8.513? | CREATE TABLE table_name_52 (interview INTEGER,state VARCHAR,evening_gown VARCHAR) | SELECT MIN(interview) FROM table_name_52 WHERE state = "south dakota" AND evening_gown < 8.513 |
What is the number of points for east germany, and a Places of 88? | CREATE TABLE table_name_84 (points INTEGER,nation VARCHAR,places VARCHAR) | SELECT SUM(points) FROM table_name_84 WHERE nation = "east germany" AND places = "88" |
How many players attended SE missouri state? | CREATE TABLE table_26917 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"School" text) | SELECT COUNT("Position") FROM table_26917 WHERE "School" = 'SE Missouri State' |
what are the different statement ids on accounts, and the number of accounts for each? | CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Do... | SELECT Statement_ID, COUNT(*) FROM Accounts GROUP BY Statement_ID |
count the number of patients whose admission year is less than 2105? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2105" |
Is DHYGRACK 685 required to take the course DHYGRACK 689 ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction ... | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'DHYGRACK' AND COURSE_0.number = 685 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'DHYGRACK' AND COURSE_1.number... |
Ignore movies whose director is NULL For each director, what are the titles and the highest rating among all of their movies they reviewed? Draw the result by a bar chart, order from low to high by the y-axis. | CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date) | SELECT title, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY title ORDER BY MAX(T1.stars) |
Name the high points for pepsi center 19,155 | CREATE TABLE table_23285761_8 (high_points VARCHAR,location_attendance VARCHAR) | SELECT high_points FROM table_23285761_8 WHERE location_attendance = "Pepsi Center 19,155" |
What was the result of the game on September 25 with a box score of box? | CREATE TABLE table_name_51 (result VARCHAR,box_scores VARCHAR,date VARCHAR) | SELECT result FROM table_name_51 WHERE box_scores = "box" AND date = "september 25" |
Name the location on 2006-04-07 for direct fire | CREATE TABLE table_15453 ("Date" text,"Location" text,"Nature of incident" text,"Circumstances" text,"Casualties" text) | SELECT "Location" FROM table_15453 WHERE "Date" = '2006-04-07' AND "Circumstances" = 'direct fire' |
Tell me the surface for november 28, 2010 | CREATE TABLE table_31944 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text) | SELECT "Surface" FROM table_31944 WHERE "Date" = 'november 28, 2010' |
if they played last on 12/5/1987 what is their record | CREATE TABLE table_20287 ("Kansas State vs." text,"Games played" real,"Overall Record" text,"Last 5 Meetings" text,"Last 10 Meetings" text,"Current Streak" text,"Last Meeting" text) | SELECT "Current Streak" FROM table_20287 WHERE "Last Meeting" = '12/5/1987' |
Which Comments has a Model of 18sq? | CREATE TABLE table_48873 ("Model" text,"Length Over All" text,"Beam" text,"Sail Area" text,"Crew" text,"Comments" text) | SELECT "Comments" FROM table_48873 WHERE "Model" = '18sq' |
What is the total number of top-25s for the major that has 11 top-10s? | CREATE TABLE table_name_95 (top_25 VARCHAR,top_10 VARCHAR) | SELECT COUNT(top_25) FROM table_name_95 WHERE top_10 = 11 |
Top 100 most viewed questions on a site. | 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 p.Id, p.ViewCount, p.Title, p.Score FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id WHERE pt.Name = 'Question' ORDER BY ViewCount DESC LIMIT 100 |
What is the rank for Mar 17 when the April 21 rank is 10? | CREATE TABLE table_name_96 (mar_17 VARCHAR,april_21 VARCHAR) | SELECT mar_17 FROM table_name_96 WHERE april_21 = "10" |
In what time period were 354 built? | CREATE TABLE table_name_13 (period VARCHAR,built VARCHAR) | SELECT period FROM table_name_13 WHERE built = "354" |
What are the names of customers who use payment method 'Cash'? | CREATE TABLE customers (customer_name VARCHAR,payment_method VARCHAR) | SELECT customer_name FROM customers WHERE payment_method = "Cash" |
If the end (UTC) is January 31, 2007 23:09, what is the name of the spacewalkers? | CREATE TABLE table_24973 ("#" text,"Spacecraft" text,"Spacewalkers" text,"Start (UTC)" text,"End (UTC)" text,"Duration" text) | SELECT "Spacewalkers" FROM table_24973 WHERE "End (UTC)" = 'January 31, 2007 23:09' |
List the distinct payment method codes with the number of orders mad by a pie chart. | CREATE TABLE Invoices (Invoice_ID INTEGER,Order_ID INTEGER,payment_method_code CHAR(15),Product_ID INTEGER,Order_Quantity VARCHAR(288),Other_Item_Details VARCHAR(255),Order_Item_ID INTEGER)CREATE TABLE Stores (Store_ID VARCHAR(100),Address_ID INTEGER,Marketing_Region_Code CHAR(15),Store_Name VARCHAR(255),Store_Phone VA... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code |
What is Score, when Opponent is Portland Trail Blazers, and when Record is 12-58? | CREATE TABLE table_name_35 (score VARCHAR,opponent VARCHAR,record VARCHAR) | SELECT score FROM table_name_35 WHERE opponent = "portland trail blazers" AND record = "12-58" |
What actor was nominated for best actress? | CREATE TABLE table_58893 ("Year" real,"Film" text,"Result" text,"Category" text,"Actor" text) | SELECT "Actor" FROM table_58893 WHERE "Result" = 'nominated' AND "Category" = 'best actress' |
What is the Mkhedruli symbol for the Asomtavruli ? | CREATE TABLE table_name_41 (mkhedruli VARCHAR,asomtavruli VARCHAR) | SELECT mkhedruli FROM table_name_41 WHERE asomtavruli = "ⴒ" |
give the number of patients whose primary disease is morbid obesity/sda and were admitted before the year 2184. | 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.diagnosis = "MORBID OBESITY/SDA" AND demographic.admityear < "2184" |
unanswered bounties that about to end. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE FlagTypes (Id... | SELECT Title FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id |
Which Draws have a Lexton Plains of skipton, and an Against larger than 1212? | CREATE TABLE table_name_85 (draws INTEGER,lexton_plains VARCHAR,against VARCHAR) | SELECT MAX(draws) FROM table_name_85 WHERE lexton_plains = "skipton" AND against > 1212 |
when did patient 9801 have a minimum mcv for the first time during the first 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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE chartevents (row_i... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9801 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv')... |
report the number of patients on ivpca route of drug administration who have been diagnosed with other specified procedures as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time of procedure. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other specified procedures as the cause of abnormal reaction of patient, or of later compli... |
How many socialist have a lead of 12.6%? | CREATE TABLE table_1886589_1 (socialist VARCHAR,lead VARCHAR) | SELECT COUNT(socialist) FROM table_1886589_1 WHERE lead = "12.6%" |
What is the highest amount of bronze medals when the rank was larger than 9? | CREATE TABLE table_name_46 (bronze INTEGER,rank INTEGER) | SELECT MAX(bronze) FROM table_name_46 WHERE rank > 9 |
What is top speed of a petrol engine at ps (kw; bhp)@5250-6250? | CREATE TABLE table_21154679_1 (top_speed VARCHAR,max_power VARCHAR) | SELECT top_speed FROM table_21154679_1 WHERE max_power = "PS (kW; bhp)@5250-6250" |
Suggested Edits - Percentage of 'correct' votes. | CREATE TABLE Posts (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,Tags text,Ans... | WITH CTE AS (SELECT UserId, CASE WHEN NOT ApprovalDate IS NULL AND VoteTypeId = 2 THEN 1 WHEN NOT RejectionDate IS NULL AND VoteTypeId = 3 THEN 1 ELSE 0 END AS Correct FROM SuggestedEditVotes AS sev INNER JOIN SuggestedEdits AS se ON sev.SuggestedEditId = se.Id WHERE sev.UserId = '##UserID##') SELECT UserId, COUNT(Corr... |
Return the name and country corresponding to the artist who has had the most exhibitions. | CREATE TABLE artist (artist_id number,name text,country text,year_join number,age number)CREATE TABLE exhibition (exhibition_id number,year number,theme text,artist_id number,ticket_price number)CREATE TABLE exhibition_record (exhibition_id number,date text,attendance number) | SELECT T2.name, T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY COUNT(*) DESC LIMIT 1 |
Who was the lead when Ritvars Gulbis was the skip? | CREATE TABLE table_35949 ("Nation" text,"Skip" text,"Third" text,"Second" text,"Lead" text) | SELECT "Lead" FROM table_35949 WHERE "Skip" = 'ritvars gulbis' |
What is the 1st leg of team 1 Liverpool? | CREATE TABLE table_38400 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "1st leg" FROM table_38400 WHERE "Team 1" = 'liverpool' |
Name the home team score when the away team is south melbourne | CREATE TABLE table_name_15 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team AS score FROM table_name_15 WHERE away_team = "south melbourne" |
What is the population for Rank 11? | CREATE TABLE table_name_95 (population VARCHAR,rank VARCHAR) | SELECT population FROM table_name_95 WHERE rank = 11 |
What is the name of the cornerback from 1997? | CREATE TABLE table_name_42 (player_name VARCHAR,position VARCHAR,year VARCHAR) | SELECT player_name FROM table_name_42 WHERE position = "cornerback" AND year = 1997 |
What is the economy of the player with BBI of 3/33? | CREATE TABLE table_30781 ("Player" text,"Matches" real,"Overs" text,"Wickets" real,"Average" text,"Economy" text,"BBI" text,"4wi" real) | SELECT "Economy" FROM table_30781 WHERE "BBI" = '3/33' |
What is the povery rate of the county with market income per capita of $20,518? | CREATE TABLE table_25337 ("County" text,"Population" real,"Unemployment Rate" text,"Market Income Per Capita" text,"Poverty Rate" text,"Status" text) | SELECT "Poverty Rate" FROM table_25337 WHERE "Market Income Per Capita" = '$20,518' |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of department_id bin hire_date by time in a bar chart. | 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),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),S... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.