question
stringlengths
43
589
query
stringlengths
19
598
What is the title, credit value, and department name for courses with more than one prerequisite? Schema: - course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title) - prereq(...)
SELECT T1.title, T1.credits, T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id, T1.title, T1.credits, T1.dept_name HAVING COUNT(*) > 1;
Give the maximum and minimum gradepoints for students living in NYC? Schema: - Enrolled_in(Fname, Grade, LName, StuID, T2, T3, gradepoint) - Gradeconversion(...) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT MAX(T2.gradepoint) AS max_gradepoint, MIN(T2.gradepoint) AS min_gradepoint FROM Enrolled_in AS T1 JOIN Gradeconversion AS T2 ON T1.Grade = T2.lettergrade JOIN Student AS T3 ON T1.StuID = T3.StuID WHERE T3.city_code = 'NYC';
What are the names of technicians and the machine series that they repair? Schema: - repair_assignment(...) - machine(...) - technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name)
SELECT T3.name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id;
how many parsing papers in ACL 2014? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - venue(venueId, venueName)
SELECT DISTINCT COUNT(T3.paperId) AS num_papers FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T1.keyphraseName = 'parsing' AND T3."year" = 2014 AND T4.venueName = 'ACL';
how many papers does Mirella Lapata cite? Schema: - writes(...) - author(...) - cite(...)
SELECT DISTINCT COUNT(T3.citedPaperId) AS num_papers FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN cite AS T3 ON T2.paperId = T3.citingPaperId WHERE T1.authorName = 'Mirella Lapata';
find the number of reviews written for " Cafe Zinho " restaurant in Texas? Schema: - category(...) - business(business_id, city, full_address, name, rating, review_count, state) - review(i_id, rank, rating, text)
SELECT COUNT(DISTINCT T3."text") AS num_reviews FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN review AS T3 ON T3.business_id = T1.business_id WHERE T1.name = 'Cafe Zinho' AND T1.state = 'Texas' AND T2.category_name = 'restaurant';
What is the number of departments in Division "AS"? Schema: - Department(Building, COUNT, DNO, DName, DPhone, DepartmentID, Division, FacID, Head, LName, Room, T2)
SELECT COUNT(*) AS num_departments FROM Department WHERE Division = 'AS';
List the main industry with highest total market value and its number of companies.? Schema: - company(Bank, COUNT, Company, Headquarters, Industry, JO, Main_Industry, Market_Value, Name, Profits_in_Billion, Rank, Retail, ... (4 more))
SELECT Main_Industry, COUNT(*) AS num_companies FROM company WHERE Main_Industry IS NOT NULL GROUP BY Main_Industry ORDER BY SUM(Market_Value) DESC NULLS LAST LIMIT 1;
Find the names of all swimmers, sorted by their 100 meter scores in ascending order.? Schema: - swimmer(Name, Nationality, meter_100, meter_200, meter_300)
SELECT Name FROM swimmer ORDER BY meter_100 ASC NULLS LAST;
Find the name of the department that offers the largest number of credits of all classes.? Schema: - COURSE(C, CRS_CODE, CRS_CREDIT, CRS_DESCRIPTION, DEPT_CODE) - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM) - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT T3.DEPT_NAME FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE JOIN DEPARTMENT AS T3 ON T1.DEPT_CODE = T3.DEPT_CODE GROUP BY T1.DEPT_CODE, T3.DEPT_NAME ORDER BY SUM(T1.CRS_CREDIT) DESC NULLS LAST LIMIT 1;
What is the minimum salary in each department? 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 MIN(SALARY) AS min_salary, DEPARTMENT_ID FROM employees GROUP BY DEPARTMENT_ID;
What are the average, maximum and total revenues of all companies? Schema: - Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue)
SELECT AVG(Revenue) AS avg_revenue, MAX(Revenue) AS max_revenue, SUM(Revenue) AS total_revenue FROM Manufacturers;
Show the name of the customer who has the most orders.? 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)
SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id, T1.customer_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
papers written by sharon goldwater? Schema: - writes(...) - author(...)
SELECT DISTINCT T2.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'sharon goldwater';
Show the enrollment and primary_conference of the oldest college.? Schema: - university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School)
SELECT Enrollment, Primary_conference FROM university ORDER BY Founded ASC NULLS LAST LIMIT 1;
What papers has sharon goldwater written ? Schema: - writes(...) - author(...)
SELECT DISTINCT T2.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'sharon goldwater';
Which authors belong to the institution "Google"? Show the first names and last names.? Schema: - Authors(fname, lname) - Authorship(...) - Inst(...)
SELECT DISTINCT T1.fname, T1.lname FROM Authors AS T1 JOIN Authorship AS T2 ON T1.authID = T2.authID JOIN Inst AS T3 ON T2.instID = T3.instID WHERE T3.name = 'Google';
List the dates and vote percents of elections.? Schema: - election(Committee, Date, Delegate, District, Vote_Percent, Votes)
SELECT "Date", Vote_Percent FROM election;
List every album's title.? Schema: - albums(I, title)
SELECT title FROM albums;
Return the type of transaction with the highest total amount.? Schema: - Financial_Transactions(COUNT, F, SUM, account_id, invoice_number, transaction_amount, transaction_id, transaction_type)
SELECT transaction_type FROM Financial_Transactions WHERE transaction_type IS NOT NULL GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC NULLS LAST LIMIT 1;
How many routes go from the United States to Canada? Schema: - routes(...) - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT COUNT(*) AS num_routes FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States');
Which cities have at least one customer but no performer? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode) - Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) - Performers(Customer_Name, Customer_Phone)
SELECT DISTINCT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = CAST(T2.Address_ID AS TEXT) WHERE T1.City_Town NOT IN (SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = CAST(T2.Address_ID AS TEXT));
How many premises are there? Schema: - Premises(premise_details, premises_type)
SELECT COUNT(*) AS num_premises FROM Premises;
what datasets did jitendra malik use ? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - paperDataset(...) - writes(...) - author(...)
SELECT DISTINCT T2.datasetId FROM paper AS T3 JOIN paperDataset AS T2 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T1.authorName = 'jitendra malik';
How many different templates do all document use? 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))
SELECT COUNT(DISTINCT Template_ID) AS num_templates FROM Documents;
which countries have more than 2 airports? Schema: - airport(Airport_Name, City, Country, Domestic_Passengers, International_Passengers, Transit_Passengers, id, name)
SELECT Country FROM airport WHERE Country IS NOT NULL GROUP BY Country HAVING COUNT(*) > 2;
what are the neighboring states for kentucky? Schema: - border_info(T1, border, state_name)
SELECT border FROM border_info WHERE state_name = 'kentucky';
Find the series name and country of the tv channel that is playing some cartoons directed by Ben Jones and Michael Chang? Schema: - TV_Channel(Content, Country, Engl, Hight_definition_TV, Language, Package_Option, Pixel_aspect_ratio_PAR, id, series_name) - Cartoon(Channel, Directed_by, Original_air_date, Production_code, Title, Written_by)
SELECT T1.series_name, T1.Country FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Directed_by IN ('Michael Chang', 'Ben Jones') GROUP BY T1.series_name, T1.Country HAVING COUNT(DISTINCT T2.Directed_by) = 2;
Find the physician who prescribed the highest dose. What is his or her name? Schema: - Physician(I, Name) - Prescribes(...)
SELECT T1.Name FROM Physician AS T1 JOIN Prescribes AS T2 ON T1.EmployeeID = T2.Physician ORDER BY T2.Dose DESC NULLS LAST LIMIT 1;
Return the names and typical buying and selling prices for products that have 'yellow' as their color description.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) - Ref_Colors(color_description)
SELECT T1.product_name, T1.typical_buying_price, T1.typical_selling_price FROM Products AS T1 JOIN Ref_Colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow';
What are the details of the lots which are not used in any transactions? Schema: - Lots(investor_id, lot_details) - Transactions_Lots(...)
SELECT DISTINCT lot_details FROM Lots WHERE lot_details NOT IN (SELECT T1.lot_details FROM Lots AS T1 JOIN Transactions_Lots AS T2 ON T1.lot_id = T2.lot_id);
List all names of courses with 1 credit? Schema: - Course(CName, Credits, Days)
SELECT CName FROM Course WHERE Credits = 1;
Find the average hours for the students whose tryout decision is no.? Schema: - Player(HS, pName, weight, yCard) - Tryout(COUNT, EX, T1, cName, decision, pPos)
SELECT AVG(T1.HS) AS avg_hours FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no';
Show ids, first names, last names, and phones for all customers.? 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))
SELECT customer_id, customer_first_name, customer_last_name, customer_phone FROM Customers;
Show the location name for document "Robin CV".? Schema: - All_Documents(Date_Stored, Document_Name, Document_Type_Code) - Document_Locations(COUNT, Date_in_Location_From, Date_in_Locaton_To, Location_Code) - Ref_Locations(Location_Code, Location_Description, Location_Name)
SELECT T3.Location_Name FROM All_Documents AS T1 JOIN Document_Locations AS T2 ON T1.Document_ID = T2.Document_ID JOIN Ref_Locations AS T3 ON T2.Location_Code = T3.Location_Code WHERE T1.Document_Name = 'Robin CV';
Return the founded year for the school with the largest enrollment.? Schema: - university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School)
SELECT Founded FROM university ORDER BY Enrollment DESC NULLS LAST LIMIT 1;
Find the average and minimum weight for each gender.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT AVG(Weight) AS avg_weight, MIN(Weight) AS min_weight, Sex FROM people GROUP BY Sex;
List the id of students who registered some courses and the number of their registered courses? 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)) - Student_Course_Registrations(COUNT, student_id)
SELECT T1.student_id, COUNT(*) AS num_courses FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id;
Count the number of tourists who did not visit any place.? Schema: - Visitors(Tourist_Details) - Visits(Visit_Date)
SELECT COUNT(*) AS num_tourists FROM Visitors WHERE Tourist_ID NOT IN (SELECT Tourist_ID FROM Visits);
which states border kentucky? Schema: - border_info(T1, border, state_name)
SELECT border FROM border_info WHERE state_name = 'kentucky';
How many activities do we have? Schema: - Activity(activity_name)
SELECT COUNT(*) AS num_activities FROM Activity;
Find the first and last name of the faculty who is involved in the largest number of activities.? Schema: - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) - Faculty_Participates_in(FacID)
SELECT T1.Fname, T1.Lname FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID, T1.Fname, T1.Lname ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
how high are the highest points of all the states? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT highest_elevation FROM highlow;
List the full name (first and last name), and salary for those employees who earn below 6000.? 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, SALARY FROM employees WHERE SALARY < 6000;
Show the name and service for all trains in order by time.? Schema: - train(Name, Service, Time, destination, name, origin, time, train_number)
SELECT Name, Service FROM train ORDER BY "Time";
What conferences did li dong publish in in 2016 ? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.venueId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN paper AS T3 ON T2.paperId = T3.paperId WHERE T1.authorName = 'li dong' AND T3."year" = 2016;
How many events had participants whose details had the substring 'Dr.'? Schema: - Participants(Participant_Details, Participant_ID, Participant_Type_Code) - Participants_in_Events(COUNT, Event_ID, Participant_ID)
SELECT COUNT(*) AS num_events FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.Participant_Details LIKE '%Dr.%';
Show the ids of the investors who have at least two 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 FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2;
Return the names of people, ordered by weight ascending.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT Name FROM people ORDER BY Weight ASC NULLS LAST;
Show all allergies and their types.? Schema: - Allergy_Type(Allergy, AllergyType, COUNT)
SELECT Allergy, AllergyType FROM Allergy_Type;
How many type of governments are in Africa? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT COUNT(DISTINCT GovernmentForm) AS num_governments FROM country WHERE Continent = 'Africa';
What are the total account balances for each customer from Utah or Texas? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id)
SELECT SUM(acc_bal) AS total_balance FROM customer WHERE state = 'Utah' OR state = 'Texas';
Return the song in the volume that has spent the most weeks on top? Schema: - volume(Artist_ID, Issue_Date, Song, Weeks_on_Top)
SELECT Song FROM volume ORDER BY Weeks_on_Top DESC NULLS LAST LIMIT 1;
Find the male friend of Alice whose job is a doctor? Schema: - Person(M, age, city, eng, gender, job, name) - PersonFriend(M, friend, name)
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor';
Find the names of items whose rank is higher than 3 and whose average rating is above 5.? Schema: - item(title) - review(i_id, rank, rating, text)
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T1.title HAVING AVG(T2.rating) > 5 AND MAX(T2."rank") > 3;
What details do we have on the students who registered for courses most recently? Schema: - Student_Course_Registrations(COUNT, student_id) - 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))
SELECT T2.student_details FROM Student_Course_Registrations AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC NULLS LAST LIMIT 1;
List the names and origins of people who are not body builders.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) - body_builder(Clean_Jerk, Snatch, Total)
SELECT T1.Name, T1.Birth_Place FROM people AS T1 LEFT JOIN body_builder AS T2 ON T1.People_ID = T2.People_ID WHERE T2.People_ID IS NULL;
List the official names of cities that have not held any competition.? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - farm_competition(Hosts, Theme, Year)
SELECT Official_Name FROM city WHERE City_ID NOT IN (SELECT Host_city_ID FROM farm_competition);
Count the number of countries.? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT COUNT(*) AS num_countries FROM country;
What are total salaries and department id for each department that has more than 2 employees? 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 DEPARTMENT_ID, SUM(SALARY) AS total_salaries FROM employees WHERE DEPARTMENT_ID IS NOT NULL GROUP BY DEPARTMENT_ID HAVING COUNT(*) >= 2;
List the name, origin and owner of each program.? Schema: - program(Beij, Launch, Name, Origin, Owner)
SELECT Name, Origin, Owner FROM program;
From what date and to what date do the staff work on a project that has the most staff and has staff in a leader role? Schema: - Project_Staff(COUNT, date_from, date_to, role_code) - IS(...)
SELECT date_from, date_to FROM (SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff WHERE project_id IS NOT NULL GROUP BY project_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1) UNION ALL SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader') WHERE date_from IS NOT NULL AND date_to IS NOT NULL GROUP BY date_from, date_to;
List the Episode of all TV series showed on TV Channel with series name "Sky Radio".? Schema: - TV_Channel(Content, Country, Engl, Hight_definition_TV, Language, Package_Option, Pixel_aspect_ratio_PAR, id, series_name) - TV_series(Air_Date, Episode, Rating, Share, Weekly_Rank)
SELECT T2.Episode FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T1.series_name = 'Sky Radio';
Find the names of all instructors who have taught some course and the course_id.? Schema: - instructor(AVG, M, So, Stat, dept_name, name, salary) - teaches(ID, Spr, semester)
SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID;
What are the songs in volumes that have resulted in a nomination at music festivals? Schema: - music_festival(COUNT, Category, Date_of_ceremony, Result) - volume(Artist_ID, Issue_Date, Song, Weeks_on_Top)
SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1."Result" = 'Nominated';
where can we find some restaurants on bethel island rd in bethel island ? 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 = 'bethel island' AND T2.street_name = 'bethel island rd';
What are the details and id of the project with the most outcomes? Schema: - Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details) - Project_Outcomes(outcome_code)
SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_Outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id, T1.project_details ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000.? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT DISTINCT T1.Publisher FROM (SELECT Publisher FROM publication WHERE Price > 10000000) T1, (SELECT Publisher FROM publication WHERE Price < 5000000) AS T2 WHERE T1.Publisher = T2.Publisher;
Show the names of members and the dates of performances they attended in descending order of attendance of the performances.? 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."Date" 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 T3.Attendance DESC NULLS LAST;
What are the themes of competitions that have corresponding host cities with more than 1000 residents? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - farm_competition(Hosts, Theme, Year)
SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000;
How many games in total did team Boston Red Stockings attend from 2000 to 2010? Schema: - home_game(attendance, year) - team(Name)
SELECT SUM(T1.attendance) AS total_attendance FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1."year" BETWEEN 2000 AND 2010;
List all song names by singers above the average age.? Schema: - singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s)
SELECT Song_Name FROM singer WHERE Age > (SELECT AVG(Age) FROM singer);
List the name and country of origin for all singers who have produced songs with rating above 9.? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT DISTINCT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9;
List the names of players that do not have coaches.? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more)) - player_coach(...)
SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM player_coach);
what is the largest capital city in the usa? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT city_name FROM city WHERE population = (SELECT MAX(T1.population) FROM state AS T2 JOIN city AS T1 ON T2.capital = T1.city_name);
How many music festivals have had each kind of result, ordered descending by count? Schema: - music_festival(COUNT, Category, Date_of_ceremony, Result)
SELECT "Result", COUNT(*) AS num_festivals FROM music_festival GROUP BY "Result" ORDER BY num_festivals DESC NULLS LAST;
Show all document names using templates with template type code BK.? Schema: - Templates(COUNT, M, Template_ID, Template_Type_Code, Version_Number) - Documents(COUNT, Document_Description, Document_ID, Document_Name, Document_Type_Code, I, K, Project_ID, Robb, Template_ID, access_count, document_id, ... (7 more))
SELECT T2.Document_Name FROM Templates AS T1 JOIN Documents AS T2 ON T1.Template_ID = T2.Template_ID WHERE T1.Template_Type_Code = 'BK';
What are the songs in volumes with more than 1 week on top? Schema: - volume(Artist_ID, Issue_Date, Song, Weeks_on_Top)
SELECT Song FROM volume WHERE Weeks_on_Top > 1;
What are the names of all products? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT Name FROM Products;
How many debates are there? Schema: - debate(Date, Venue)
SELECT COUNT(*) AS num_debates FROM debate;
through which states does the ohio run? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT traverse FROM river WHERE river_name = 'ohio';
What are the first and last names of all the candidates? Schema: - Candidates(...) - People(first_name)
SELECT T2.first_name, T2.last_name FROM Candidates AS T1 JOIN People AS T2 ON T1.candidate_id = T2.person_id;
What is the name, city, country, and elevation for every airport in the city of New York? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT name, city, country, elevation FROM airports WHERE city = 'New York';
Find the number of funiture types produced by each manufacturer as well as the company names.? Schema: - manufacturer(Manufacturer_ID, Name, Open_Year) - furniture_manufacte(...)
SELECT COUNT(*) AS num_furniture_types, T1.Name FROM manufacturer AS T1 JOIN furniture_manufacte AS T2 ON T1.Manufacturer_ID = T2.Manufacturer_ID GROUP BY T1.Manufacturer_ID, T1.Name;
Which city is post code 255 located in? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT city FROM Addresses WHERE zip_postcode = '255';
What is the average distance and price for all flights from LA? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT AVG(distance) AS avg_distance, AVG(price) AS avg_price FROM flight WHERE origin = 'Los Angeles';
Which catalog contents have length below 3 or above 5? Find the catalog entry names.? Schema: - Catalog_Contents(capacity, catalog_entry_name, height, next_entry_id, price_in_dollars, price_in_euros, product_stock_number)
SELECT catalog_entry_name FROM Catalog_Contents WHERE TRY_CAST("length" AS INT) < 3 OR TRY_CAST(width AS INT) > 5;
Show the names of pilots from team "Bradley" or "Fordham".? Schema: - pilot(Age, COUNT, Join_Year, Name, Nationality, Pilot_name, Position, Rank, Team)
SELECT Pilot_name FROM pilot WHERE Team = 'Bradley' OR Team = 'Fordham';
What are the names and types of the companies that have ever operated a flight? Schema: - operate_company(Group_Equity_Shareholding, Type) - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT T1.name, T1.Type FROM operate_company AS T1 JOIN flight AS T2 ON T1.id = T2.company_id;
What is the id of the trip that started from the station with the highest dock count? Schema: - trip(COUNT, bike_id, duration, end_station_name, id, start_date, start_station_id, start_station_name, zip_code) - station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more))
SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC NULLS LAST LIMIT 1;
where is a good arabic restaurant in mountain view ? 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 = 'mountain view' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
List the names of aircrafts and that did not win any match.? Schema: - aircraft(Description, aid, d, distance, name) - match_(Competition, Date, Match_ID, Venue)
SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM match_);
What are the names of shops that do not have any devices in stock? Schema: - shop(Address, District, INT, Location, Manager_name, Name, Number_products, Open_Year, Score, Shop_ID, Shop_Name, T1, ... (1 more)) - stock(Quantity)
SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock);
What is the average attendance of shows? Schema: - show_(Attendance)
SELECT AVG(Attendance) AS avg_attendance FROM show_;
How many rooms does the Lamberton building have? Schema: - classroom(building, capacity, room_number)
SELECT COUNT(*) AS num_rooms FROM classroom WHERE building = 'Lamberton';
Find the address of the location named "UK Gallery".? Schema: - Locations(Address, Location_Name, Other_Details)
SELECT Address FROM Locations WHERE Location_Name = 'UK Gallery';
What is the name of the artist who joined latest? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) - DESC(...)
SELECT Name FROM artist ORDER BY Year_Join DESC NULLS LAST LIMIT 1;
What is the name, location and seating for the most recently opened track? Schema: - track(Location, Name, Seat, Seating, T1, Year_Opened)
SELECT Name, Location, Seating FROM track ORDER BY Year_Opened DESC NULLS LAST LIMIT 1;
When was " Kevin Spacey " born ? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT birth_year FROM actor WHERE name = 'Kevin Spacey';
Count the number of cards the customer with the first name Art and last name Turcotte has.? Schema: - Customers_Cards(COUNT, card_id, card_number, card_type_code, customer_id, date_valid_from, date_valid_to) - 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_cards FROM Customers_Cards 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';