answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT "nationality" FROM table_204_866 WHERE id = 1 | which nationality is top on the chart | CREATE TABLE table_204_866 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) |
SELECT sellout___percentage_ FROM table_16331025_2 WHERE gross_sales = "$1,727,400" | What is the sellout % when the gross sales is $1,727,400? | CREATE TABLE table_16331025_2 (sellout___percentage_ VARCHAR, gross_sales VARCHAR) |
SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id | Find the subject ID, subject name, and the corresponding number of available courses for each subject. | CREATE TABLE Courses (subject_id VARCHAR); CREATE TABLE Subjects (subject_name VARCHAR, subject_id VARCHAR) |
SELECT AVG(bronze) FROM table_name_58 WHERE total < 1 | What is the number of bronze when the total is smaller than 1? | CREATE TABLE table_name_58 (
bronze INTEGER,
total INTEGER
) |
SELECT COUNT(dates__mdy_) FROM table_16331025_2 WHERE position = 9 AND sellout___percentage_ = "81%" | Who many dates are in position 9 and the sellout is 81%? | CREATE TABLE table_16331025_2 (dates__mdy_ VARCHAR, position VARCHAR, sellout___percentage_ VARCHAR) |
SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) | Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order. | CREATE TABLE Courses (subject_id VARCHAR); CREATE TABLE Subjects (subject_name VARCHAR, subject_id VARCHAR) |
SELECT "club" FROM table_204_135 WHERE "wins" = 4 | which club had a total of only four wins ? | CREATE TABLE table_204_135 (
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 COUNT(tickets_sold___available) FROM table_16331025_2 WHERE sellout___percentage_ = "82%" | What is the position of tickets sold/available when the sellout is 82%? | CREATE TABLE table_16331025_2 (tickets_sold___available VARCHAR, sellout___percentage_ VARCHAR) |
SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" | What is the date of enrollment of the course named "Spanish"? | CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, course_id VARCHAR); CREATE TABLE Courses (course_id VARCHAR, course_name VARCHAR) |
SELECT COUNT("Average") FROM table_54656 WHERE "Caps" < '69' AND "Scotland career" = '1986–1998' | What is the average cap number in scotland in 1986 1998 leass than 69? | CREATE TABLE table_54656 (
"Name" text,
"Scotland career" text,
"Caps" real,
"Goals" real,
"Average" real
) |
SELECT probable_future FROM table_16337329_5 WHERE imperative = "गरेस् gares 'may you do'" | Name the probably futures for गरेस् gares 'may you do' | CREATE TABLE table_16337329_5 (probable_future VARCHAR, imperative VARCHAR) |
SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 | What is the name of the course that has the most student enrollment? | CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR) |
SELECT school FROM table_name_8 WHERE mascot = "rebels" | What school has rebels as their mascot? | CREATE TABLE table_name_8 (
school VARCHAR,
mascot VARCHAR
) |
SELECT imperative FROM table_16337329_5 WHERE past_habitual = "गरिस् garis 'you did'" | Name the imperative for गरिस् garis 'you did' | CREATE TABLE table_16337329_5 (imperative VARCHAR, past_habitual VARCHAR) |
SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1 | What are the names of the courses that have exactly 1 student enrollment? | CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR) |
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Locaton_To) | Stacked bar of date in locaton to and the number of date in locaton to colored by Location_Code, order by the Y in ascending. | CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)... |
SELECT past_habitual FROM table_16337329_5 WHERE probable_future = "गर्छस् garchas 'you (will) do'" | Name the past habitual for गर्छस् garchas 'you (will) do' | CREATE TABLE table_16337329_5 (past_habitual VARCHAR, probable_future VARCHAR) |
SELECT T1.course_description, T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2 | What are the descriptions and names of the courses that have student enrollment bigger than 2? | CREATE TABLE Student_Course_Enrolment (course_id VARCHAR); CREATE TABLE Courses (course_description VARCHAR, course_name VARCHAR, course_id VARCHAR) |
SELECT SUM(silver) FROM table_name_69 WHERE gold = 0 AND bronze < 0 | Gold of 0, and a Bronze smaller than 0 and what is the sum of the silver? | CREATE TABLE table_name_69 (
silver INTEGER,
gold VARCHAR,
bronze VARCHAR
) |
SELECT past_habitual FROM table_16337329_5 WHERE probable_future = "गर्छ garcha 'he does'" | Name the past habitual for गर्छ garcha 'he does' | CREATE TABLE table_16337329_5 (past_habitual VARCHAR, probable_future VARCHAR) |
SELECT T1.course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name | What is the name of each course and the corresponding number of student enrollment? | CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Course_Enrolment (course_id VARCHAR) |
SELECT candidate FROM table_name_45 WHERE result = "10 fired in week 2 (1-27-2005)" | Who is the candidate that had 10 fired in week 2 (1-27-2005)? | CREATE TABLE table_name_45 (
candidate VARCHAR,
result VARCHAR
) |
SELECT injunctive FROM table_16337329_5 WHERE past_habitual = "गर्यो garyo 'he did'" | Name the injunctive for गर्यो garyo 'he did' | CREATE TABLE table_16337329_5 (injunctive VARCHAR, past_habitual VARCHAR) |
SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" | What are the enrollment dates of all the tests that have result "Pass"? | CREATE TABLE Student_Tests_Taken (registration_id VARCHAR, test_result VARCHAR); CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, registration_id VARCHAR) |
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName | List the last name of the students who do not have any food type allergy and count them in a bart chart. | CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... |
SELECT COUNT(winnings) FROM table_1637041_2 WHERE avg_finish = "29.2" | How many years did he have an average finish of 29.2? | CREATE TABLE table_1637041_2 (winnings VARCHAR, avg_finish VARCHAR) |
SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" | What are the completion dates of all the tests that have result "Fail"? | CREATE TABLE Student_Tests_Taken (registration_id VARCHAR, test_result VARCHAR); CREATE TABLE Student_Course_Enrolment (date_of_completion VARCHAR, registration_id VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Fall on stair/step NEC" | provide the number of patients who died primarily due to fall on stair/step nec. | 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 prescription... |
SELECT COUNT(avg_start) FROM table_1637041_2 WHERE position = "59th" | How many years did he finish in 59th? | CREATE TABLE table_1637041_2 (avg_start VARCHAR, position VARCHAR) |
SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = "Karson" | List the dates of enrollment and completion of the student with personal name "Karson". | CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, date_of_completion VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, personal_name VARCHAR) |
SELECT nation FROM table_name_66 WHERE bronze < 5 AND silver > 0 | Bronze smaller than 5, and a Silver larger than 0 is which nation? | CREATE TABLE table_name_66 (
nation VARCHAR,
bronze VARCHAR,
silver VARCHAR
) |
SELECT COUNT(starts) FROM table_1637041_2 WHERE year = 2003 | How many instances do you see the year 2003? | CREATE TABLE table_1637041_2 (starts VARCHAR, year VARCHAR) |
SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie" | List the dates of enrollment and completion of the student with family name "Zieme" and personal name "Bernie". | CREATE TABLE Student_Course_Enrolment (date_of_enrolment VARCHAR, date_of_completion VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, family_name VARCHAR, personal_name VARCHAR) |
SELECT "Constructor" FROM table_57592 WHERE "Tyre" = 'c' AND "Pole position" = 'eugenio castellotti' | Who was the constructor when Eugenio Castellotti was the pole position and the race had a C tyre? | CREATE TABLE table_57592 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) |
SELECT MAX(top_10) FROM table_1637041_2 WHERE position = "63rd" | What is the maximum number of top 10s when he finished in 63rd? | CREATE TABLE table_1637041_2 (top_10 INTEGER, position VARCHAR) |
SELECT T1.student_id, T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | Find the student ID and login name of the student with the most course enrollments | CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (login_name VARCHAR, student_id VARCHAR) |
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'agent specific therapy - calcium channel blockers overdose') | tell me the price of a procedure called agent specific therapy - calcium channel blockers overdose? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... |
SELECT avg_start FROM table_1637041_2 WHERE winnings = "$1,663,868" | What are the average start(s) when he had $1,663,868? | CREATE TABLE table_1637041_2 (avg_start VARCHAR, winnings VARCHAR) |
SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2 | Find the student ID and personal name of the student with at least two enrollments. | CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (personal_name VARCHAR, student_id VARCHAR) |
SELECT "Years for Rockets" FROM table_17156 WHERE "No.(s)" = '55' | Which years had a jersey number 55 | CREATE TABLE table_17156 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) |
SELECT position FROM table_1637041_6 WHERE avg_start = "9.2" | What was the position in the season when the average start is 9.2? | CREATE TABLE table_1637041_6 (position VARCHAR, avg_start VARCHAR) |
SELECT T1.student_id, T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2 | Find the student ID and middle name for all the students with at most two enrollments. | CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (middle_name VARCHAR, student_id VARCHAR) |
SELECT MIN(year) FROM table_name_40 WHERE points < 3 AND entrant = "parmalat forti ford" | What is the earliest year with less than 3 points and Parmalat Forti Ford was the entrant? | CREATE TABLE table_name_40 (
year INTEGER,
points VARCHAR,
entrant VARCHAR
) |
SELECT avg_start FROM table_1637041_6 WHERE winnings = "$7,220" | What is the average start for the season with $7,220 in winnings? | CREATE TABLE table_1637041_6 (avg_start VARCHAR, winnings VARCHAR) |
SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id | Find the personal names of students not enrolled in any course. | CREATE TABLE Student_Course_Enrolment (student_id VARCHAR); CREATE TABLE Students (personal_name VARCHAR); CREATE TABLE Students (personal_name VARCHAR, student_id VARCHAR) |
SELECT "time" FROM table_204_547 ORDER BY "time" LIMIT 1 | out of all their times , which one was fastest ? | CREATE TABLE table_204_547 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"time" number,
"notes" text
) |
SELECT winnings FROM table_1637041_6 WHERE avg_finish = "11.1" | What are the winnings for the season where the average finish is 11.1? | CREATE TABLE table_1637041_6 (winnings VARCHAR, avg_finish VARCHAR) |
SELECT COUNT(*) FROM Students WHERE NOT student_id IN (SELECT student_id FROM Student_Course_Enrolment) | How many students did not have any course enrollment? | CREATE TABLE Students (student_id VARCHAR); CREATE TABLE Student_Course_Enrolment (student_id VARCHAR) |
SELECT "Flight" FROM table_47704 WHERE "Aircraft" = 'vickers viscount type 794' | Which flight had an aircraft of vickers viscount type 794? | CREATE TABLE table_47704 (
"Date" text,
"Flight" text,
"Aircraft" text,
"Registration" text,
"Location" text,
"Fatalities" real
) |
SELECT MAX(wins) FROM table_1637041_6 WHERE starts = 22 | What is the maximum number of wins in the season with 22 starts? | CREATE TABLE table_1637041_6 (wins INTEGER, starts VARCHAR) |
SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students | Find the common login name of course authors and students. | CREATE TABLE Course_Authors_and_Tutors (login_name VARCHAR); CREATE TABLE Students (login_name VARCHAR) |
SELECT 2011 FROM table_name_65 WHERE position = "communications rep" | Who held the Communications Rep position in 2011? | CREATE TABLE table_name_65 (
position VARCHAR
) |
SELECT all_games FROM table_16372244_1 WHERE team = "Maryland" | What is the all games for Maryland? | CREATE TABLE table_16372244_1 (all_games VARCHAR, team VARCHAR) |
SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students | Find the common personal name of course authors and students. | CREATE TABLE Course_Authors_and_Tutors (personal_name VARCHAR); CREATE TABLE Students (personal_name VARCHAR) |
SELECT "Latitude" FROM table_64769 WHERE "Land ( sqmi )" < '34.401' AND "GEO ID" < '3807157722' AND "Longitude" = '-98.475995' | What is the latitude that has a sqmi smaller than 34.401, a Geo ID smaller than 3807157722, and a Longitude of -98.475995? | CREATE TABLE table_64769 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) |
SELECT kalamazoo__azo_ FROM table_1637981_7 WHERE saginaw__mbs_ = "$481.39" | What is the fare to Kalamazoo during the time frame when Saginaw's was $481.39? | CREATE TABLE table_1637981_7 (kalamazoo__azo_ VARCHAR, saginaw__mbs_ VARCHAR) |
SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING COUNT(*) > 2 UNION SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = (SELECT MAX(Amount_Claimed) F... | Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id. | CREATE TABLE Settlements (Claim_id VARCHAR); CREATE TABLE Claims (Amount_Claimed INTEGER); CREATE TABLE Claims (Date_Claim_Made VARCHAR, Claim_id VARCHAR, Amount_Claimed INTEGER) |
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC | For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the headquarter , and group by attribute headquarter, display y axis from high to low order. | 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 detroit__dtw_ FROM table_1637981_7 WHERE lansing__lan_ = "$433.59" | When Lansing's fare is $433.59, what is the Detroit fare? | CREATE TABLE table_1637981_7 (detroit__dtw_ VARCHAR, lansing__lan_ VARCHAR) |
SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims ... | Which customer had at least 2 policies but did not file any claims? List the customer details and id. | CREATE TABLE Customers (customer_details VARCHAR, customer_id VARCHAR, Customer_id VARCHAR); CREATE TABLE Customer_Policies (customer_id VARCHAR, policy_id VARCHAR); CREATE TABLE Claims (policy_id VARCHAR) |
SELECT "Runner-up" FROM table_31143 WHERE "Fourth place" = 'Sagawa Express' | Who was the runner up the season that Sagawa Express came in fourth? | CREATE TABLE table_31143 (
"Season" real,
"Winner" text,
"Runner-up" text,
"Third place" text,
"Fourth place" text
) |
SELECT lansing__lan_ FROM table_1637981_7 WHERE saginaw__mbs_ = "$470.47" | At a Saginaw fare of $470.47, what is the fare to Lansing? | CREATE TABLE table_1637981_7 (lansing__lan_ VARCHAR, saginaw__mbs_ VARCHAR) |
SELECT Payment_Method_Code, Date_Payment_Made, Amount_Payment FROM Payments ORDER BY Date_Payment_Made | List the method, date and amount of all the payments, in ascending order of date. | CREATE TABLE Payments (Payment_Method_Code VARCHAR, Date_Payment_Made VARCHAR, Amount_Payment VARCHAR) |
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND NOT vitalperiodic.heartrate IS NUL... | when is the first time that patient 002-52932 has had a heartrate measured until 03/10/2100? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid... |
SELECT kalamazoo__azo_ FROM table_1637981_7 WHERE lansing__lan_ = "$433.59" | During the year when Lansing's fare is $433.59, what is the fare to Kalamazoo? | CREATE TABLE table_1637981_7 (kalamazoo__azo_ VARCHAR, lansing__lan_ VARCHAR) |
SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1 | Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount. | CREATE TABLE Claims (Amount_Settled VARCHAR, Amount_Claimed VARCHAR) |
SELECT "Women's doubles" FROM table_15026 WHERE "Men's singles" = 'frederik kjærholm elsner' | Name the women's doubles for frederik kj rholm elsner | CREATE TABLE table_15026 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) |
SELECT grand_rapids__grr_ FROM table_1637981_7 WHERE saginaw__mbs_ = "$470.47" | When Saginaw's fare is $470.47, what was the fare to Grand Rapids? | CREATE TABLE table_1637981_7 (grand_rapids__grr_ VARCHAR, saginaw__mbs_ VARCHAR) |
SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Settled LIMIT 1 | Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount. | CREATE TABLE Claims (Amount_Settled VARCHAR, Amount_Claimed VARCHAR) |
SELECT "Leading scorer" FROM table_56464 WHERE "Date" = 'february 26' | On February 26, who was the leading scorer? | CREATE TABLE table_56464 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) |
SELECT detroit__dtw_ FROM table_1637981_7 WHERE grand_rapids__grr_ = "$377.29" | When Grand Rapids's fare was $377.29, what is the fare to Detroit? | CREATE TABLE table_1637981_7 (detroit__dtw_ VARCHAR, grand_rapids__grr_ VARCHAR) |
SELECT Date_Claim_Made, Date_Claim_Settled FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims) | Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled. | CREATE TABLE Claims (Date_Claim_Made VARCHAR, Date_Claim_Settled VARCHAR, Amount_Claimed INTEGER) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "49" AND demographic.admityear < "2198" | how many patients are below 49 years of age and admitted under the year 2198? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... |
SELECT MAX(enrollment) FROM table_16383772_1 WHERE school = "Niagara University" | Name the maximum enrollment for niagara university | CREATE TABLE table_16383772_1 (enrollment INTEGER, school VARCHAR) |
SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) | Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date. | CREATE TABLE Claims (Date_Claim_Made VARCHAR, Amount_Settled INTEGER) |
SELECT COUNT(top_10) FROM table_name_87 WHERE events > 16 AND top_5 > 5 | What's the sum of Top-10 that has Events that's larger than 16, and has a Top-5 that's also larger than 5? | CREATE TABLE table_name_87 (
top_10 VARCHAR,
events VARCHAR,
top_5 VARCHAR
) |
SELECT primary_conference FROM table_16383772_1 WHERE school = "St. Bonaventure University" | Name the primary conference for st. bonaventure university | CREATE TABLE table_16383772_1 (primary_conference VARCHAR, school VARCHAR) |
SELECT T1.Claim_id, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id | How many settlements does each claim correspond to? List the claim id and the number of settlements. | CREATE TABLE Settlements (claim_id VARCHAR); CREATE TABLE Claims (Claim_id VARCHAR, claim_id VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "26" AND diagnoses.short_title = "Joint replaced knee" | give me the number of patients whose days of hospital stay is greater than 26 and diagnoses short title is joint replaced knee? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... |
SELECT COUNT(nickname) FROM table_16383772_1 WHERE school = "St. Bonaventure University" | Name the total number of nicknames for st. bonaventure university | CREATE TABLE table_16383772_1 (nickname VARCHAR, school VARCHAR) |
SELECT T1.claim_id, T1.date_claim_made, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY COUNT(*) DESC LIMIT 1 | Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number. | CREATE TABLE Claims (claim_id VARCHAR, date_claim_made VARCHAR); CREATE TABLE Settlements (claim_id VARCHAR) |
SELECT SUM(inhabitants) FROM table_name_57 WHERE party = "five star movement" AND election < 2012 | In the election earlier than 2012 how many Inhabitants had a Party of five star movement? | CREATE TABLE table_name_57 (
inhabitants INTEGER,
party VARCHAR,
election VARCHAR
) |
SELECT COUNT(affiliation) FROM table_16383772_1 WHERE enrollment = 14898 | Name the total number of affiliation for enrollment being 14898 | CREATE TABLE table_16383772_1 (affiliation VARCHAR, enrollment VARCHAR) |
SELECT COUNT(*), T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1 | How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id. | CREATE TABLE Settlements (claim_id VARCHAR); CREATE TABLE Claims (claim_id VARCHAR, Date_Claim_Settled VARCHAR) |
SELECT distance FROM table_name_36 WHERE venue = "sale" | In what Distance has a Venue of sale? | CREATE TABLE table_name_36 (
distance VARCHAR,
venue VARCHAR
) |
SELECT acc_home FROM table_16372911_1 WHERE acc__percentage = ".813" | what was the ACC home game record for the team who's ACC winning percentage was .813? | CREATE TABLE table_16372911_1 (acc_home VARCHAR, acc__percentage VARCHAR) |
SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made LIMIT 1 | Of all the claims, what was the earliest date when any claim was made? | CREATE TABLE Claims (Date_Claim_Made VARCHAR) |
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone | List the number of the phone numbers of all employees. | CREATE TABLE Playlist (
PlaylistId integer,
Name varchar(120)
)
CREATE TABLE Artist (
ArtistId integer,
Name varchar(120)
)
CREATE TABLE MediaType (
MediaTypeId integer,
Name varchar(120)
)
CREATE TABLE Invoice (
InvoiceId integer,
CustomerId integer,
InvoiceDate datetime,
Bil... |
SELECT written_by FROM table_16384596_4 WHERE broadcast_order = "S02 E07" | Who wrote the episode for s02 e07? | CREATE TABLE table_16384596_4 (written_by VARCHAR, broadcast_order VARCHAR) |
SELECT SUM(Amount_Settled) FROM Settlements | What is the total amount of settlement made for all the settlements? | CREATE TABLE Settlements (Amount_Settled INTEGER) |
SELECT ABS((SELECT "percentage of lead shot in 30-inch circle at 40 yards" FROM table_203_112 WHERE "choke" = 'cylinder') - (SELECT "percentage of lead shot in 30-inch circle at 40 yards" FROM table_203_112 WHERE "choke" = 'skeet 1')) | what is the difference in percentage of lead shot at 25 yards between cylinder and skeet 1 barrels ? | CREATE TABLE table_203_112 (
id number,
"choke" text,
"constriction (inch)" number,
"percentage of lead shot in 30-inch circle at 40 yards" text,
"identification (notches)" number,
"identification (stars)\n(spanish shotguns)" number
) |
SELECT directed_by FROM table_16384596_4 WHERE broadcast_order = "S02 E08" | Who directed the episode for s02 e08? | CREATE TABLE table_16384596_4 (directed_by VARCHAR, broadcast_order VARCHAR) |
SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 1 | Who are the customers that had more than 1 policy? List the customer details and id. | CREATE TABLE Customers (customer_details VARCHAR, customer_id VARCHAR, Customer_id VARCHAR); CREATE TABLE Customer_Policies (Customer_id VARCHAR) |
SELECT "Record" FROM table_44824 WHERE "Decision" = 'clemmensen' AND "Game" = '42' | What is the record of game 42, which had a clemmensen decision? | CREATE TABLE table_44824 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
) |
SELECT directed_by FROM table_16384596_4 WHERE production_code = 209 | Who directed the episode with the production code 209? | CREATE TABLE table_16384596_4 (directed_by VARCHAR, production_code VARCHAR) |
SELECT Date_Claim_Made, Date_Claim_Settled FROM Settlements | What are the claim dates and settlement dates of all the settlements? | CREATE TABLE Settlements (Date_Claim_Made VARCHAR, Date_Claim_Settled VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "80" | give me the number of patients whose ethnicity is asian and age is less than 80? | 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
)
... |
SELECT COUNT(institution) FROM table_16384648_2 WHERE team_nickname = "Bobcats" | How many schools have the team nickname bobcats? | CREATE TABLE table_16384648_2 (institution VARCHAR, team_nickname VARCHAR) |
SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) DESC LIMIT 1 | What is the most popular payment method? | CREATE TABLE Payments (Payment_Method_Code VARCHAR) |
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) | Find the enrollment date for all the tests that have 'Pass' result, and count them by a bar chart, sort by the Y from low to high please. | CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Courses (
course_id INTEGER,
author_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.