question stringlengths 43 589 | query stringlengths 19 598 |
|---|---|
who published papers in CVPR 2007?
Schema:
- venue(venueId, venueName)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- writes(...) | SELECT DISTINCT COUNT(T2.paperId) AS num_papers, T1.authorId FROM venue AS T3 JOIN paper AS T2 ON T3.venueId = T2.venueId JOIN writes AS T1 ON T1.paperId = T2.paperId WHERE T2."year" = 2007 AND T3.venueName = 'CVPR' GROUP BY T1.authorId ORDER BY num_papers DESC NULLS LAST; |
Who are the ministers who took office after 1961 or before 1959?
Schema:
- party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) | SELECT Minister FROM party WHERE Took_office > 1961 OR Took_office < 1959; |
how large is the largest city in alaska?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT population FROM city WHERE population = (SELECT MAX(population) FROM city WHERE state_name = 'alaska') AND state_name = 'alaska'; |
What are the names of all clubs?
Schema:
- Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn) | SELECT ClubName FROM Club; |
What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id?
Schema:
- employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more)) | SELECT FIRST_NAME, LAST_NAME, HIRE_DATE, SALARY, DEPARTMENT_ID FROM employees WHERE FIRST_NAME NOT LIKE '%M%' ORDER BY DEPARTMENT_ID ASC NULLS LAST; |
Which apartment type code appears the most often?
Schema:
- Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count) | SELECT apt_type_code FROM Apartments WHERE apt_type_code IS NOT NULL GROUP BY apt_type_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Return the number of accounts that the customer with the first name Art and last name Turcotte has.?
Schema:
- Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details)
- Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) | SELECT COUNT(*) AS num_accounts FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Art' AND T2.customer_last_name = 'Turcotte'; |
List the airport code and name in the city of Anthony.?
Schema:
- airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name) | SELECT AirportCode, AirportName FROM airports WHERE City = 'Anthony'; |
Return the names of the 3 most populated countries.?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more)) | SELECT Name FROM country ORDER BY Population DESC NULLS LAST LIMIT 3; |
Find the last name of the students who currently live in the state of North Carolina but have not registered in any degree program.?
Schema:
- Students(cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more))
- Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
- Student_Enrolment(...) | SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE T2.state_province_county = 'NorthCarolina' AND T1.last_name NOT IN (SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id = T4.student_id); |
Find the code of the role that have the most employees.?
Schema:
- Employees(COUNT, Date_of_Birth, Employee_ID, Employee_Name, Role_Code, employee_id, employee_name, role_code) | SELECT Role_Code FROM Employees WHERE Role_Code IS NOT NULL GROUP BY Role_Code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Give me a list of all the last names of authors sorted in alphabetical order?
Schema:
- Authors(fname, lname) | SELECT lname FROM Authors ORDER BY lname ASC NULLS LAST; |
List all 5 star Italian restaurant?
Schema:
- category(...)
- business(business_id, city, full_address, name, rating, review_count, state) | SELECT T1.name FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN category AS T3 ON T3.business_id = T1.business_id WHERE T1.rating = 5 AND T2.category_name = 'Italian' AND T3.category_name = 'restaurant'; |
How many distinct order ids correspond to each product?
Schema:
- Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity) | SELECT product_id, COUNT(DISTINCT order_id) AS num_orders FROM Order_Items GROUP BY product_id; |
Count the number of distinct product types.?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT COUNT(DISTINCT product_type_code) AS num_product_types FROM Products; |
Show the names of members and the location of performances they attended in ascending alphabetical order of their names.?
Schema:
- member_attendance(...)
- member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more))
- performance(Attendance, COUNT, Date, Location, T1) | SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member_ AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name ASC NULLS LAST; |
Count the number of tracks that are of the media type "AAC audio file".?
Schema:
- MediaType(...)
- Track(Milliseconds, Name, UnitPrice) | SELECT COUNT(*) AS num_tracks FROM MediaType AS T1 JOIN Track AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = 'AAC audio file'; |
What are the countries for each market ordered by decreasing number of cities?
Schema:
- market(Country, Number_cities) | SELECT Country FROM market ORDER BY Number_cities DESC NULLS LAST; |
Tell me the payment method used by the customer who ordered the least amount of goods in total.?
Schema:
- Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more))
- Customer_Orders(customer_id, order_date, order_id, order_shipping_charges)
- Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity) | SELECT T1.payment_method FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Order_Items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_name, T1.payment_method ORDER BY SUM(TRY_CAST(T3.order_quantity AS DOUBLE)) ASC NULLS LAST LIMIT 1; |
Find the last names of the members of the club "Bootup Baltimore".?
Schema:
- Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn)
- Member_of_club(...)
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT T3.LName FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T1.ClubName = 'Bootup Baltimore'; |
What was the most popular position at tryouts?
Schema:
- Tryout(COUNT, EX, T1, cName, decision, pPos) | SELECT pPos FROM Tryout WHERE pPos IS NOT NULL GROUP BY pPos ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Show the headquarters shared by more than two companies.?
Schema:
- Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name) | SELECT Headquarters FROM Companies WHERE Headquarters IS NOT NULL GROUP BY Headquarters HAVING COUNT(*) > 2; |
Find the total capacity of all dorms.?
Schema:
- Dorm(dorm_name, gender, student_capacity) | SELECT SUM(student_capacity) AS total_capacity FROM Dorm; |
return me the conferences, which have more than 60 papers containing keyword " Relational Database " .?
Schema:
- publication_keyword(...)
- keyword(keyword)
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
- conference(homepage, name) | SELECT T2.name FROM publication_keyword AS T4 JOIN keyword AS T1 ON T4.kid = T1.kid JOIN publication AS T3 ON T3.pid = T4.pid JOIN conference AS T2 ON T3.cid = CAST(T2.cid AS TEXT) WHERE T1.keyword = 'Relational Database' GROUP BY T2.name HAVING COUNT(DISTINCT T3.title) > 60; |
Find the name and credit score of the customers who have some loans.?
Schema:
- customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id)
- loan(...) | SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID; |
Show the different statuses and the numbers of roller coasters for each status.?
Schema:
- roller_coaster(DOUBLE, Height, LENGTH, Park, Speed, Status, TRY_CAST) | SELECT Status, COUNT(*) AS num_roller_coasters FROM roller_coaster GROUP BY Status; |
Which of the countries has the most car makers? List the country name.?
Schema:
- car_makers(...)
- countries(...) | SELECT T2.CountryName FROM car_makers AS T1 JOIN countries AS T2 ON T1.CountryId = T2.CountryId GROUP BY T2.CountryId, T2.CountryName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are the names of nations speak both English and French?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
- countrylanguage(COUNT, CountryCode, Engl, Language) | SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2."Language" IN ('English', 'French') GROUP BY T1.Name HAVING COUNT(DISTINCT T2."Language") = 2; |
What are the names of parties with at least 2 events?
Schema:
- party_events(Event_Name)
- party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) | SELECT T2.Party_name FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID, T2.Party_name HAVING COUNT(*) >= 2; |
Which employees have the role with code "HR"? Find their names.?
Schema:
- Employees(COUNT, Date_of_Birth, Employee_ID, Employee_Name, Role_Code, employee_id, employee_name, role_code) | SELECT Employee_Name FROM Employees WHERE Role_Code = 'HR'; |
Return the apartment number and the number of rooms for each apartment.?
Schema:
- Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count) | SELECT apt_number, room_count FROM Apartments; |
Find the number of students who is older than 20 in each dorm.?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
- Lives_in(...)
- Dorm(dorm_name, gender, student_capacity) | SELECT COUNT(*) AS num_students, T3.dorm_name FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name; |
List name and damage for all storms in a descending order of max speed.?
Schema:
- storm(Damage_millions_USD, Dates_active, Name, Number_Deaths) | SELECT Name, Damage_millions_USD FROM storm ORDER BY Max_speed DESC NULLS LAST; |
Find the name of accounts whose checking balance is higher than corresponding saving balance.?
Schema:
- ACCOUNTS(name)
- CHECKING(balance)
- SAVINGS(SAV, balance) | SELECT T1.name FROM ACCOUNTS AS T1 JOIN CHECKING AS T2 ON T1.custid = T2.custid JOIN SAVINGS AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance; |
What are the last names of individuals who have been contact individuals for an organization?
Schema:
- Individuals(...)
- Organization_Contact_Individuals(...) | SELECT DISTINCT T1.individual_last_name FROM Individuals AS T1 JOIN Organization_Contact_Individuals AS T2 ON T1.individual_id = T2.individual_id; |
Show me the owner of the channel with the highest rating.?
Schema:
- channel(Name, Owner, Rating_in_percent, Share_in_percent) | SELECT Owner FROM channel ORDER BY Rating_in_percent DESC NULLS LAST LIMIT 1; |
How many cities in each district have a population that is above the average population across all cities?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT COUNT(*) AS num_cities, District FROM city WHERE Population > (SELECT AVG(Population) FROM city) GROUP BY District; |
What is the first, last name, gpa of the youngest one among students whose GPA is above 3?
Schema:
- STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE) | SELECT STU_FNAME, STU_LNAME, STU_GPA FROM STUDENT WHERE STU_GPA > 3 ORDER BY STU_DOB DESC NULLS LAST LIMIT 1; |
What is the average price for a lesson taught by Janessa Sawayn?
Schema:
- Lessons(lesson_status_code)
- Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) | SELECT AVG(price) AS avg_price FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'; |
Who is the composer of track Fast As a Shark?
Schema:
- tracks(composer, milliseconds, name, unit_price) | SELECT composer FROM tracks WHERE name = 'Fast As a Shark'; |
list all female (sex is F) candidate names in the alphabetical order.?
Schema:
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
- candidate(COUNT, Candidate_ID, Consider_rate, Oppose_rate, Poll_Source, Support_rate, Unsure_rate) | SELECT T1.Name FROM people AS T1 JOIN candidate AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Sex = 'F' ORDER BY T1.Name ASC NULLS LAST; |
What is the id and weight of every pet who is older than 1?
Schema:
- Pets(PetID, PetType, pet_age, weight) | SELECT PetID, weight FROM Pets WHERE pet_age > 1; |
What are the names, classes, and dates for all races?
Schema:
- race(Class, Date, Name) | SELECT Name, Class, "Date" FROM race; |
What is the name of the document with the most number of sections?
Schema:
- Documents(COUNT, Document_Description, Document_ID, Document_Name, Document_Type_Code, I, K, Project_ID, Robb, Template_ID, access_count, document_id, ... (7 more))
- Document_Sections(...) | SELECT T1.document_name FROM Documents AS T1 JOIN Document_Sections AS T2 ON T1.document_code = T2.document_code GROUP BY T1.document_code, T1.document_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Find the names of all stores in Khanewal District.?
Schema:
- store(Type)
- store_district(...)
- district(City_Area, City_Population, District_name, d) | SELECT T1.Store_Name FROM store AS T1 JOIN store_district AS T2 ON T1.Store_ID = T2.Store_ID JOIN district AS T3 ON T2.District_ID = T3.District_ID WHERE T3.District_name = 'Khanewal District'; |
What are the names and salaries of instructors who advise students in the Math department?
Schema:
- advisor(s_ID)
- instructor(AVG, M, So, Stat, dept_name, name, salary)
- student(COUNT, H, dept_name, name, tot_cred) | SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_ID = T2.ID JOIN student AS T3 ON T1.s_ID = T3.ID WHERE T3.dept_name = 'Math'; |
Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.?
Schema:
- mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more)) | SELECT DISTINCT T1.Country FROM (SELECT Country FROM mountain WHERE Height > 5600) AS T1 JOIN (SELECT Country FROM mountain WHERE Height < 5200) AS T2 ON T1.Country = T2.Country; |
where can i eat arabic food on buchanan in san francisco ?
Schema:
- restaurant(...)
- location(...) | SELECT T2.house_number, T1.name FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T2.city_name = 'san francisco' AND T2.street_name = 'buchanan' AND T1.food_type = 'arabic' AND T1.rating > 2.5; |
Show the delegates and the names of county they belong to.?
Schema:
- county(County_name, Population, Zip_code)
- election(Committee, Date, Delegate, District, Vote_Percent, Votes) | SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District; |
What are the full names of all students?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT Fname, LName FROM Student; |
Which teachers teach in classroom 109? Give me their last names.?
Schema:
- teachers(Classroom, FirstName, LastName) | SELECT LastName FROM teachers WHERE Classroom = 109; |
Count the number of users that are logged in.?
Schema:
- Users(COUNT, password, role_code, user_log, user_name) | SELECT COUNT(*) AS num_users FROM Users WHERE TRY_CAST(user_login AS INT) = 1; |
How old is the youngest winning pilot and what is their name?
Schema:
- pilot(Age, COUNT, Join_Year, Name, Nationality, Pilot_name, Position, Rank, Team)
- match_(Competition, Date, Match_ID, Venue) | SELECT T1.Name, T1.Age FROM pilot AS T1 JOIN match_ AS T2 ON T1.Pilot_Id = T2.Winning_Pilot ORDER BY T1.Age ASC NULLS LAST LIMIT 1; |
Show the organizer and name for churches that opened between 1830 and 1840.?
Schema:
- church(Name, Open_Date, Organized_by) | SELECT Organized_by, Name FROM church WHERE Open_Date BETWEEN 1830 AND 1840; |
Find the number of distinct students enrolled in courses.?
Schema:
- Student_Course_Enrolment(course_id, date_of_completion, date_of_enrolment, student_id) | SELECT COUNT(DISTINCT student_id) AS num_students FROM Student_Course_Enrolment; |
What is the most common maximum page size?
Schema:
- product(COUNT, pages_per_minute_color, product) | SELECT max_page_size FROM product WHERE max_page_size IS NOT NULL GROUP BY max_page_size ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What is the name of the institution that "Matthias Blume" belongs to?
Schema:
- Authors(fname, lname)
- Authorship(...)
- Inst(...) | SELECT DISTINCT T3.name FROM Authors AS T1 JOIN Authorship AS T2 ON T1.authID = T2.authID JOIN Inst AS T3 ON T2.instID = T3.instID WHERE T1.fname = 'Matthias' AND T1.lname = 'Blume'; |
What grade is Kyle in?
Schema:
- Highschooler(COUNT, ID, grade, name) | SELECT grade FROM Highschooler WHERE name = 'Kyle'; |
Return the budget type codes, budget type descriptions and document ids for documents with expenses.?
Schema:
- Documents_with_Expenses(Budget_Type_Code, COUNT, Document_ID)
- Ref_Budget_Codes(Budget_Type_Code, Budget_Type_Description) | SELECT T2.Budget_Type_Code, T2.Budget_Type_Description, T1.Document_ID FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code; |
Show all locations which don't have a train station with at least 15 platforms.?
Schema:
- station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more)) | SELECT Location FROM station WHERE Location NOT IN (SELECT Location FROM station WHERE Number_of_Platforms >= 15); |
What are the names of tracks that contain the the word you in them?
Schema:
- Track(Milliseconds, Name, UnitPrice) | SELECT Name FROM Track WHERE Name LIKE '%you%'; |
What is the average weight of cars each year?
Schema:
- cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year) | SELECT AVG(Weight) AS avg_weight, "Year" FROM cars_data GROUP BY "Year"; |
Which product's detail contains the word "Latte" or "Americano"? Return the full detail.?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT product_details FROM Products WHERE product_details LIKE '%Latte%' OR product_details LIKE '%Americano%'; |
Find the name of the swimmer who has at least 2 records.?
Schema:
- swimmer(Name, Nationality, meter_100, meter_200, meter_300)
- record(...) | SELECT T1.Name FROM swimmer AS T1 JOIN record AS T2 ON T1.ID = T2.Swimmer_ID GROUP BY T2.Swimmer_ID, T1.Name HAVING COUNT(*) >= 2; |
Which authors have written a paper with title containing the word "Monadic"? Return their last names.?
Schema:
- Authors(fname, lname)
- Authorship(...)
- Papers(title) | SELECT T1.lname FROM Authors AS T1 JOIN Authorship AS T2 ON T1.authID = T2.authID JOIN Papers AS T3 ON T2.paperID = T3.paperID WHERE T3.title LIKE '%Monadic%'; |
Count the number of exhibitions that happened in or after 2005.?
Schema:
- exhibition(Theme, Ticket_Price, Year) | SELECT COUNT(*) AS num_exhibitions FROM exhibition WHERE "Year" >= 2005; |
List the object number of railways that do not have any trains.?
Schema:
- railway(Builder, COUNT, Location)
- train(Name, Service, Time, destination, name, origin, time, train_number) | SELECT ObjectNumber FROM railway WHERE Railway_ID NOT IN (SELECT Railway_ID FROM train); |
How many courses are there in total?
Schema:
- Course(CName, Credits, Days) | SELECT COUNT(*) AS num_courses FROM Course; |
how many papers in nature communications 2015?
Schema:
- venue(venueId, venueName)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT COUNT(T1.paperId) AS num_papers FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T1."year" = 2015 AND T2.venueName = 'nature communications'; |
Find the total amount claimed in the most recently created document.?
Schema:
- Claim_Headers(Amount_Piad)
- Claims_Documents(...) | SELECT SUM(T1.Amount_Claimed) AS total_amount_claimed FROM Claim_Headers AS T1 JOIN Claims_Documents AS T2 ON T1.Claim_Header_ID = T2.Claim_ID WHERE T2.Created_Date = (SELECT Created_Date FROM Claims_Documents ORDER BY Created_Date ASC NULLS LAST LIMIT 1); |
which states have cities named springfield?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT state_name FROM city WHERE city_name = 'springfield'; |
What is the first and last name of the professor in biology department?
Schema:
- PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE)
- DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
- EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME) | SELECT T3.EMP_FNAME, T3.EMP_LNAME FROM PROFESSOR AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE JOIN EMPLOYEE AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = 'Biology'; |
List the distinct positions of pilots older than 30.?
Schema:
- pilot(Age, COUNT, Join_Year, Name, Nationality, Pilot_name, Position, Rank, Team) | SELECT DISTINCT "Position" FROM pilot WHERE Age > 30; |
Show the id and details for the investors who have the top 3 number of transactions.?
Schema:
- Investors(Investor_details)
- Transactions(COUNT, DOUBLE, TRY_CAST, amount_of_transaction, date_of_transaction, investor_id, share_count, transaction_id, transaction_type_code) | SELECT T2.investor_id, T1.Investor_details FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id, T1.Investor_details ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3; |
What is the address of employee Nancy Edwards?
Schema:
- employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more)) | SELECT address FROM employees WHERE first_name = 'Nancy' AND last_name = 'Edwards'; |
List the publication dates of publications with 3 lowest prices.?
Schema:
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) | SELECT Publication_Date FROM publication ORDER BY Price ASC NULLS LAST LIMIT 3; |
What are the maximum and minimum values of area codes?
Schema:
- AREA_CODE_STATE(area_code, state) | SELECT MAX(area_code) AS max_area_code, MIN(area_code) AS min_area_code FROM AREA_CODE_STATE; |
What is the average score of submissions?
Schema:
- submission(Author, COUNT, College, Scores) | SELECT AVG(Scores) AS avg_score FROM submission; |
What are the last names of customers without invoice totals exceeding 20?
Schema:
- Customer(Email, FirstName, LastName, State, lu)
- Invoice(BillingCountry) | SELECT LastName FROM Customer WHERE LastName NOT IN (SELECT T1.LastName FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.Total > 20); |
Euclidean Distance papers citing NIPS papers?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- cite(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- venue(venueId, venueName) | SELECT DISTINCT T5.citingPaperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN cite AS T5 ON T2.paperId = T5.citingPaperId JOIN paper AS T3 ON T3.paperId = T5.citedPaperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T1.keyphraseName = 'Euclidean Distance' AND T4.venueName = 'NIPS'; |
what is the length of the colorado river in texas?
Schema:
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) | SELECT LENGTH FROM river WHERE river_name = 'colorado' AND traverse = 'texas'; |
Show the names of employees that work for companies with sales bigger than 200.?
Schema:
- employment(...)
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
- company(Bank, COUNT, Company, Headquarters, Industry, JO, Main_Industry, Market_Value, Name, Profits_in_Billion, Rank, Retail, ... (4 more)) | SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200; |
display the job title of jobs which minimum salary is greater than 9000.?
Schema:
- jobs(JOB_TITLE, diff) | SELECT JOB_TITLE FROM jobs WHERE MIN_SALARY > 9000; |
What instruments did the musician with the last name "Heilo" play in "Badlands"?
Schema:
- Performance(...)
- Band(...)
- Songs(Title)
- Instruments(COUNT, Instrument) | SELECT T4.Instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.Bandmate = T2.Id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.SongId = T3.SongId AND T4.BandmateId = T2.Id WHERE T2.Lastname = 'Heilo' AND T3.Title = 'Badlands'; |
How many candidates are there?
Schema:
- candidate(COUNT, Candidate_ID, Consider_rate, Oppose_rate, Poll_Source, Support_rate, Unsure_rate) | SELECT COUNT(*) AS num_candidates FROM candidate; |
Find the number of activities Mark Giuliano is involved in.?
Schema:
- Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex)
- Faculty_Participates_in(FacID) | SELECT COUNT(*) AS num_activities FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID WHERE T1.Fname = 'Mark' AND T1.Lname = 'Giuliano'; |
What are the all games score and location of the school called Clemson?
Schema:
- university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School)
- basketball_match(ACC_Percent, All_Home, School_ID, Team_Name) | SELECT T2.All_Games, T1.Location FROM university AS T1 JOIN basketball_match AS T2 ON T1.School_ID = T2.School_ID WHERE Team_Name = 'Clemson'; |
What are the name, independence year, and surface area of the country with the smallest population?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more)) | SELECT Name, SurfaceArea, IndepYear FROM country ORDER BY Population ASC NULLS LAST LIMIT 1; |
What are the different card type codes?
Schema:
- Customers_Cards(COUNT, card_id, card_number, card_type_code, customer_id, date_valid_from, date_valid_to) | SELECT DISTINCT card_type_code FROM Customers_Cards; |
give me the cities which are in texas?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT city_name FROM city WHERE state_name = 'texas'; |
Give me all the Moroccan restaurant in Texas?
Schema:
- category(...)
- business(business_id, city, full_address, name, rating, review_count, state) | SELECT T1.name FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN category AS T3 ON T3.business_id = T1.business_id WHERE T1.state = 'Texas' AND T2.category_name = 'Moroccan' AND T3.category_name = 'restaurant'; |
What is the checking balance of the account whose owner’s name contains the substring ‘ee’?
Schema:
- ACCOUNTS(name)
- CHECKING(balance) | SELECT T2.balance FROM ACCOUNTS AS T1 JOIN CHECKING AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'; |
what states in the united states have a city of springfield?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT state_name FROM city WHERE city_name = 'springfield'; |
Which customer is associated with the latest policy?
Schema:
- Policies(COUNT, Policy_Type_Code)
- Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) | SELECT T2.Customer_Details FROM Policies AS T1 JOIN Customers AS T2 ON T1.Customer_ID = T2.Customer_ID WHERE T1.Start_Date = (SELECT MAX(Start_Date) FROM Policies); |
Show all majors.?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT DISTINCT Major FROM Student; |
Show the average share count of transactions each each investor, ordered by average share count.?
Schema:
- Transactions(COUNT, DOUBLE, TRY_CAST, amount_of_transaction, date_of_transaction, investor_id, share_count, transaction_id, transaction_type_code) | SELECT investor_id, AVG(TRY_CAST(share_count AS DOUBLE)) AS avg_share_count FROM Transactions WHERE investor_id IS NOT NULL GROUP BY investor_id ORDER BY avg_share_count ASC NULLS LAST; |
For each zip code, return how many times max wind speed reached 25?
Schema:
- weather(AVG, COUNT, M, Ra, cloud_cover, date, diff, events, mean_humidity, mean_sea_level_pressure_inches, mean_temperature_f, mean_visibility_miles, ... (1 more)) | SELECT zip_code, COUNT(*) AS num_times FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code; |
How many lessons were taught by a staff member whose first name has the letter 'a' in it?
Schema:
- Lessons(lesson_status_code)
- Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) | SELECT COUNT(*) AS num_lessons FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE '%a%'; |
How many products have the color description 'red' and the characteristic name 'slow'?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
- Product_Characteristics(...)
- Characteristics(characteristic_name)
- Ref_Colors(color_description) | SELECT COUNT(*) AS num_products FROM Products AS T1 JOIN Product_Characteristics AS T2 ON T1.product_id = T2.product_id JOIN Characteristics AS T3 ON T2.characteristic_id = T3.characteristic_id JOIN Ref_Colors AS T4 ON T1.color_code = T4.color_code WHERE T4.color_description = 'red' AND T3.characteristic_name = 'slow'; |
For each delegate, find the names of the party they are part of.?
Schema:
- election(Committee, Date, Delegate, District, Vote_Percent, Votes)
- party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) | SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.