question
stringlengths
43
589
query
stringlengths
19
598
What are the names of the enzymes used in the medicine Amisulpride that acts as inhibitors? Schema: - enzyme(Chromosome, Location, OMIM, Porphyria, Product, name) - medicine_enzyme_interaction(interaction_type) - medicine(FDA_approved, Trade_Name, name)
SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor';
Which park did the most people attend in 2008? Schema: - home_game(attendance, year) - park(city, state)
SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1."year" = 2008 ORDER BY T1.attendance DESC NULLS LAST LIMIT 1;
How many students have advisors? Schema: - advisor(s_ID)
SELECT COUNT(DISTINCT s_ID) AS num_students FROM advisor;
What are the statement ids, statement details, and account details, for all accounts? Schema: - Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details) - Statements(Statement_Details, Statement_ID)
SELECT T1.Statement_ID, T2.Statement_Details, T1.Account_Details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID;
Which courses are taught on days MTW? Schema: - Course(CName, Credits, Days)
SELECT CName FROM Course WHERE Days = 'MTW';
Which cities have served as host cities more than once? Return me their GDP and population.? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - hosting_city(Host_City, Year)
SELECT T1.GDP, T1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City GROUP BY T2.Host_City, T1.GDP, T1.Regional_Population HAVING COUNT(*) > 1;
Show the details and star ratings of the 3 least expensive hotels.? Schema: - Hotels(hotel_id, other_hotel_details, pets_allowed_yn, price_range, star_rating_code)
SELECT other_hotel_details, star_rating_code FROM Hotels ORDER BY price_range ASC NULLS LAST LIMIT 3;
What are the name, id and the corresponding number of visits for each tourist attraction? Schema: - Tourist_Attractions(Al, COUNT, How_to_Get_There, Name, Opening_Hours, Rosal, T1, T3, Tour, Tourist_Attraction_ID, Tourist_Details, Tourist_ID, ... (2 more)) - Visits(Visit_Date)
SELECT T1.Name, T2.Tourist_Attraction_ID, COUNT(*) AS num_visits FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID, T1.Name;
What is the average amount of items ordered in each order? Schema: - Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity)
SELECT AVG(TRY_CAST(order_quantity AS DOUBLE)) AS avg_order_quantity FROM Order_Items;
How many different allergy types exist? Schema: - Allergy_Type(Allergy, AllergyType, COUNT)
SELECT COUNT(DISTINCT AllergyType) AS num_allergy_types FROM Allergy_Type;
Count the number of invoices.? Schema: - Invoices(COUNT, DOUBLE, Order_Quantity, Product_ID, TRY_CAST, invoice_date, invoice_details, invoice_number, order_id, payment_method_code)
SELECT COUNT(*) AS num_invoices FROM Invoices;
What are the names of the technicians aged either 36 or 37? Schema: - technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name)
SELECT name FROM technician WHERE Age = 36 OR Age = 37;
List all tracks bought by customer Daan Peeters.? Schema: - tracks(composer, milliseconds, name, unit_price) - invoice_lines(...) - invoices(billing_city, billing_country, billing_state, total) - customers(Mart, city, company, country, email, first_name, last_name, phone, state)
SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = 'Daan' AND T4.last_name = 'Peeters';
What are years of founding for orchestras that have had more than a single performance? Schema: - orchestra(COUNT, Major_Record_Format, Record_Company, Year_of_Founded) - performance(Attendance, COUNT, Date, Location, T1)
SELECT T1.Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID, T1.Year_of_Founded HAVING COUNT(*) > 1;
Find the student ID and middle name for all the students with at most two enrollments.? Schema: - Student_Course_Enrolment(course_id, date_of_completion, date_of_enrolment, 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 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, T2.middle_name HAVING COUNT(*) <= 2;
List the number of all matches who played in years of 2013 or 2016.? Schema: - matches_(COUNT, T1, loser_age, loser_name, minutes, tourney_name, winner_age, winner_hand, winner_name, winner_rank, winner_rank_points, year)
SELECT COUNT(*) AS num_matches FROM matches_ WHERE "year" = 2013 OR "year" = 2016;
Please show the date of ceremony of the volumes that last more than 2 weeks on top.? Schema: - music_festival(COUNT, Category, Date_of_ceremony, Result) - volume(Artist_ID, Issue_Date, Song, Weeks_on_Top)
SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2;
what state has the highest elevation? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT state_name FROM highlow WHERE highest_elevation = (SELECT MAX(highest_elevation) FROM highlow);
What is the accelerate of the car make amc hornet sportabout (sw)? Schema: - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year) - car_names(COUNT, Model)
SELECT T1.Accelerate FROM cars_data AS T1 JOIN car_names AS T2 ON T1.Id = T2.MakeId WHERE T2.Make = 'amc hornet sportabout (sw)';
How many flights have a velocity larger than 200? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT COUNT(*) AS num_flights FROM flight WHERE Velocity > 200;
Who is a coauthor with Noah A Smith ? Schema: - writes(...) - author(...)
SELECT DISTINCT T1.authorId FROM writes AS T3 JOIN author AS T2 ON T3.authorId = T2.authorId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T2.authorName = 'Noah A Smith';
How many bookings did each customer make? List the customer id, first name, and the count.? 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)) - Bookings(Actual_Delivery_Date, COUNT, Order_Date, Planned_Delivery_Date, Status_Code)
SELECT T1.customer_id, T1.first_name, COUNT(*) AS num_bookings FROM Customers AS T1 JOIN Bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id, T1.first_name;
Show all team names.? Schema: - team(Name)
SELECT Name FROM team;
Give me ids for all the trip that took place in a zip code area with average mean temperature above 60.? Schema: - trip(COUNT, bike_id, duration, end_station_name, id, start_date, start_station_id, start_station_name, zip_code) - 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 T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code, T1.id HAVING AVG(T2.mean_temperature_f) > 60;
How many distinct companies are there? Schema: - entrepreneur(COUNT, Company, Investor, Money_Requested)
SELECT COUNT(DISTINCT Company) AS num_companies FROM entrepreneur;
how many states does usa have? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT COUNT(state_name) AS num_states FROM state WHERE country_name = 'United States';
Show the product type codes that have at least two products.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT Product_Type_Code FROM Products WHERE Product_Type_Code IS NOT NULL GROUP BY Product_Type_Code HAVING COUNT(*) >= 2;
What are the players who played for Columbus Crew, and how many years did each play for? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more)) - team(Name)
SELECT T1.Player, T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Columbus Crew';
What are all the payment methods? 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 DISTINCT payment_method FROM Customers;
How many budget types do we have? Schema: - Ref_Budget_Codes(Budget_Type_Code, Budget_Type_Description)
SELECT COUNT(*) AS num_budget_types FROM Ref_Budget_Codes;
Which film has the highest rental rate? And what is the rate? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more))
SELECT title, rental_rate FROM film ORDER BY rental_rate DESC NULLS LAST LIMIT 1;
Show card type codes with at least 5 cards.? Schema: - Customers_Cards(COUNT, card_id, card_number, card_type_code, customer_id, date_valid_from, date_valid_to)
SELECT card_type_code FROM Customers_Cards WHERE card_type_code IS NOT NULL GROUP BY card_type_code HAVING COUNT(*) >= 5;
Which role is most common for the staff? Schema: - Project_Staff(COUNT, date_from, date_to, role_code)
SELECT role_code FROM Project_Staff WHERE role_code IS NOT NULL GROUP BY role_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the ordered list of customer ids? 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 FROM Customers ORDER BY Customer_ID ASC NULLS LAST;
Which authors have first name "Amal"? List their last names.? Schema: - Authors(fname, lname)
SELECT lname FROM Authors WHERE fname = 'Amal';
convolution paper by brian curless? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.authorId, T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T5 ON T2.keyphraseId = T5.keyphraseId JOIN paper AS T3 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 = 'brian curless' AND T5.keyphraseName = 'convolution';
Count the number of budget codes.? Schema: - Ref_Budget_Codes(Budget_Type_Code, Budget_Type_Description)
SELECT COUNT(*) AS num_budget_codes FROM Ref_Budget_Codes;
Which policy type has the most records in the database? Schema: - Available_Policies(COUNT, Customer_Phone, Life, policy_type_code)
SELECT policy_type_code FROM Available_Policies WHERE policy_type_code IS NOT NULL GROUP BY policy_type_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
list names of all departments ordered by their names.? Schema: - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT DEPT_NAME FROM DEPARTMENT ORDER BY DEPT_NAME ASC NULLS LAST;
Find the name of the campuses opened before 1800.? Schema: - Campuses(Campus, County, Franc, Location)
SELECT Campus FROM Campuses WHERE "Year" < 1800;
return me the number of papers after 2000 .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT COUNT(DISTINCT title) AS num_papers FROM publication WHERE "year" > 2000;
what state is the largest in population? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT state_name FROM state WHERE population = (SELECT MAX(population) FROM state);
What are the names of cities in Europe for which English is not the official language? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more)) - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - countrylanguage(COUNT, CountryCode, Engl, Language)
SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode = T1.Code WHERE T1.Continent = 'Europe' AND T1.Name NOT IN (SELECT T3.Name FROM country AS T3 JOIN countrylanguage AS T4 ON T3.Code = T4.CountryCode WHERE T4.IsOfficial = 'T' AND T4."Language" = 'English');
Count the number of devices.? Schema: - device(COUNT, Carrier, Software_Platform)
SELECT COUNT(*) AS num_devices FROM device;
Count the number of different scientists assigned to any project.? Schema: - AssignedTo(Scientist)
SELECT COUNT(DISTINCT Scientist) AS num_scientists FROM AssignedTo;
List the title of films that do not have any market estimation.? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more)) - film_market_estimation(High_Estimate, Low_Estimate, Type)
SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation);
Return the document id, template id, and description for the document with the name Robbin CV.? 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 Document_ID, Template_ID, Document_Description FROM Documents WHERE Document_Name = 'Robbin CV';
Find the number of items without any review.? Schema: - item(title) - review(i_id, rank, rating, text)
SELECT COUNT(*) AS num_items FROM item WHERE i_id NOT IN (SELECT i_id FROM review);
Find the titles of items whose rating is higher than the average review rating of all items.? 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 WHERE T2.rating > (SELECT AVG(rating) FROM review);
What is the total number of languages used in Aruba? 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 COUNT(T2."Language") AS num_languages FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Aruba';
What is the content of TV Channel with serial name "Sky Radio"? Schema: - TV_Channel(Content, Country, Engl, Hight_definition_TV, Language, Package_Option, Pixel_aspect_ratio_PAR, id, series_name)
SELECT Content FROM TV_Channel WHERE series_name = 'Sky Radio';
What are the birth years and citizenships of the singers? Schema: - singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s)
SELECT Birth_Year, Citizenship FROM singer;
in what conferences does Daniella Coelho publish ? 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 = 'Daniella Coelho';
What are the student IDs and middle names of the students enrolled in at most two courses? Schema: - Student_Course_Enrolment(course_id, date_of_completion, date_of_enrolment, 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 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, T2.middle_name HAVING COUNT(*) <= 2;
Find the name of the youngest organization.? Schema: - Organizations(date_formed, organization_name)
SELECT organization_name FROM Organizations ORDER BY date_formed DESC NULLS LAST LIMIT 1;
What are the names and players of all the clubs? Schema: - club(Region, Start_year, name) - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
SELECT T1.name, T2.Player_ID FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID;
How many transcripts are listed? Schema: - Transcripts(other_details, transcript_date)
SELECT COUNT(*) AS num_transcripts FROM Transcripts;
How many schools are in the basketball match? Schema: - basketball_match(ACC_Percent, All_Home, School_ID, Team_Name)
SELECT COUNT(DISTINCT School_ID) AS num_schools FROM basketball_match;
Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order.? Schema: - ACCOUNTS(name) - SAVINGS(SAV, balance)
SELECT T1.name, T2.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid ORDER BY T2.balance DESC NULLS LAST LIMIT 3;
List the name of products in ascending order of price.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT Product_Name FROM Products ORDER BY Product_Price ASC NULLS LAST;
What is the title, phone and hire date of 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 title, phone, hire_date FROM employees WHERE first_name = 'Nancy' AND last_name = 'Edwards';
What are the different continents and the total popuation and average life expectancy corresponding to each, for continents that have an average life expectancy less than 72? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT SUM(Population) AS total_population, AVG(LifeExpectancy) AS avg_life_expectancy, Continent FROM country WHERE Continent IS NOT NULL GROUP BY Continent HAVING AVG(LifeExpectancy) < 72;
How many bookings do we have? Schema: - Bookings(Actual_Delivery_Date, COUNT, Order_Date, Planned_Delivery_Date, Status_Code)
SELECT COUNT(*) AS num_bookings FROM Bookings;
kentucky borders how many states? Schema: - border_info(T1, border, state_name)
SELECT COUNT(border) AS num_borders FROM border_info WHERE state_name = 'kentucky';
number of papers by year from jamie callan? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(T3.paperId) AS num_papers, T3."year" 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 = 'jamie callan' GROUP BY T3."year";
List the earnings of poker players in descending order.? Schema: - poker_player(Best_Finish, Earnings, Final_Table_Made, Money_Rank)
SELECT Earnings FROM poker_player ORDER BY Earnings DESC NULLS LAST;
What is the count of singers? Schema: - singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s)
SELECT COUNT(*) AS num_singers FROM singer;
What are the distinct last names of the students who have president votes but do not have 2192 as the advisor? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) - Voting_record(Election_Cycle, President_Vote, Registration_Date, Secretary_Vote, Vice_President_Vote)
SELECT DISTINCT T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = President_Vote WHERE T1.LName NOT IN (SELECT DISTINCT LName FROM Student WHERE Advisor = '2192');
List the most common hometown of teachers.? Schema: - teacher(Age, COUNT, D, Hometown, Name)
SELECT Hometown FROM teacher WHERE Hometown IS NOT NULL GROUP BY Hometown ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
who wrote papers in 2015? Schema: - writes(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T1.authorId FROM writes AS T1 JOIN paper AS T2 ON T1.paperId = T2.paperId WHERE T2."year" = 2015;
List the names, color descriptions and product descriptions of products with category "Herbs".? 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, T2.color_description, T1.product_description FROM Products AS T1 JOIN Ref_Colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = 'Herbs';
what is the most populous state in the us? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT state_name FROM state WHERE population = (SELECT MAX(population) FROM state);
where are some good places for arabic 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;
What are the names of the products that have a color description of 'red' and the 'fast' characteristic? 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 product_name 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 = 'fast';
For each file format, return the number of artists who released songs in that format.? Schema: - files(COUNT, duration, f_id, formats)
SELECT COUNT(*) AS num_artists, formats FROM files GROUP BY formats;
What are the greatest and average capacity for rooms in each building? Schema: - classroom(building, capacity, room_number)
SELECT MAX(capacity) AS max_capacity, AVG(capacity) AS avg_capacity, building FROM classroom GROUP BY building;
List the most common result of the musicals.? Schema: - musical(Award, COUNT, Name, Nom, Nominee, Result, T1)
SELECT "Result" FROM musical GROUP BY "Result" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the country of origin of the artist who is female and produced a song in Bangla? 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 T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = 'Female' AND T2.languages = 'bangla';
what rivers run through illinois? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river WHERE traverse = 'illinois';
What are the names and cities of bank branches that offer loans for business? Schema: - bank(SUM, bname, city, morn, no_of_customers, state) - loan(...)
SELECT T1.bname, T1.city FROM bank AS T1 JOIN loan AS T2 ON CAST(T1.branch_ID AS TEXT) = T2.branch_ID WHERE T2.loan_type = 'Business';
Find the states where have the colleges whose enrollments are less than the largest size.? Schema: - College(M, cName, enr, state)
SELECT DISTINCT state FROM College WHERE enr < (SELECT MAX(enr) FROM College);
Count the number of paragraphs.? Schema: - Paragraphs(COUNT, Document_ID, Other_Details, Paragraph_Text, T1)
SELECT COUNT(*) AS num_paragraphs FROM Paragraphs;
Who are the customers that had more than 1 policy? List the customer details and id.? 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_Policies(COUNT, Policy_Type_Code)
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, T1.Customer_Details HAVING COUNT(*) > 1;
What is the maximum horsepower and the make of the car models with 3 cylinders? Schema: - car_names(COUNT, Model) - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT T2.Horsepower, T1.Make FROM car_names AS T1 JOIN cars_data AS T2 ON T1.MakeId = T2.Id WHERE T2.Cylinders = 3 ORDER BY T2.Horsepower DESC NULLS LAST LIMIT 1;
Return the poll source corresponding to the candidate who has the oppose rate.? Schema: - candidate(COUNT, Candidate_ID, Consider_rate, Oppose_rate, Poll_Source, Support_rate, Unsure_rate)
SELECT Poll_Source FROM candidate ORDER BY Oppose_rate DESC NULLS LAST LIMIT 1;
Which cities have higher temperature in Feb than in Jun or have once served as host cities? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - temperature(...) - hosting_city(Host_City, Year)
SELECT DISTINCT City FROM (SELECT T1.City FROM city AS T1 JOIN temperature AS T2 ON T1.City_ID = T2.City_ID WHERE T2.Feb > T2.Jun UNION ALL SELECT T3.City FROM city AS T3 JOIN hosting_city AS T4 ON T3.City_ID = T4.Host_City);
return me the author who has the most number of papers in the VLDB conference .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - conference(homepage, name) - writes(...) - author(...)
SELECT T1.name FROM publication AS T4 JOIN conference AS T2 ON T4.cid = CAST(T2.cid AS TEXT) JOIN writes AS T3 ON T3.pid = T4.pid JOIN author AS T1 ON T3.aid = T1.aid WHERE T2.name = 'VLDB' GROUP BY T1.name ORDER BY COUNT(DISTINCT T4.title) DESC NULLS LAST LIMIT 1;
How many different kinds of lens brands are there? Schema: - camera_lens(brand, name)
SELECT COUNT(DISTINCT brand) AS num_brands FROM camera_lens;
What are the names of musicals with nominee "Bob Fosse"? Schema: - musical(Award, COUNT, Name, Nom, Nominee, Result, T1)
SELECT Name FROM musical WHERE Nominee = 'Bob Fosse';
What are the different product sizes? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT DISTINCT product_size FROM Products;
How many people live in Gelderland district? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT SUM(Population) AS total_population FROM city WHERE District = 'Gelderland';
Which customers have the substring "Diana" in their names? Return the customer details.? 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_Details FROM Customers WHERE Customer_Details LIKE '%Diana%';
In which conferences does Daniella Coelho typically publish ? 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 = 'Daniella Coelho';
Find the names of customers who have used both the service "Close a policy" and the service "New policy application".? 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)) - First_Notification_of_Loss(...) - Services(Service_Type_Code, Service_name)
SELECT DISTINCT T1.Customer_name FROM (SELECT T1.Customer_name, T1.Customer_ID FROM Customers AS T1 JOIN First_Notification_of_Loss AS T2 ON T1.Customer_ID = T2.Customer_ID JOIN Services AS T3 ON T2.Service_ID = T3.Service_ID WHERE T3.Service_name = 'Close a policy') AS T1 JOIN (SELECT T1.Customer_name, T1.Customer_ID FROM Customers AS T1 JOIN First_Notification_of_Loss AS T2 ON T1.Customer_ID = T2.Customer_ID JOIN Services AS T3 ON T2.Service_ID = T3.Service_ID WHERE T3.Service_name = 'New policy application') AS T2 ON T1.Customer_name = T2.Customer_name AND T1.Customer_ID = T2.Customer_ID;
what datasets are used in papers by jitendra malik? 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 project staff worked as leaders or started working before '1989-04-24 23:51:54'? Schema: - Project_Staff(COUNT, date_from, date_to, role_code)
SELECT COUNT(*) AS num_staff FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54';
Show ids, customer ids, names for all accounts.? Schema: - Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details)
SELECT account_id, customer_id, account_name FROM Accounts;
What are the song names for every song whose rating is less than the minimum rating for English songs? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english');
What are the states or counties of the address of the stores with marketing region code "CA"? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode) - Stores(...)
SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = CAST(T2.Address_ID AS TEXT) WHERE T2.Marketing_Region_Code = 'CA';
What are the average, maximum, and minimum number of floors for all buildings? Schema: - building(Floors, Height_feet, Name, build)
SELECT AVG(Floors) AS avg_floors, MAX(Floors) AS max_floors, MIN(Floors) AS min_floors FROM building;