db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
coffee_shop | select avg(num_of_staff) , avg(score) from shop | Question: what are the average score and average staff number of all shops? | Tables: shop -> Shop_ID, Address, Num_of_staff, Score, Open_Year. member -> Member_ID, Name, Membership_card, Age, Time_of_purchase, Level_of_membership, Address. happy_hour -> HH_ID, Shop_ID, Month, Num_of_shaff_in_charge. happy_hour_member ... | what are the average score and average staff number of all shops? |
coffee_shop | select shop_id , address from shop where score < (select avg(score) from shop) | Question: find the id and address of the shops whose score is below the average score. | Tables: shop -> Shop_ID, Address, Num_of_staff, Score, Open_Year. member -> Member_ID, Name, Membership_card, Age, Time_of_purchase, Level_of_membership, Address. happy_hour -> HH_ID, Shop_ID, Month, Num_of_shaff_in_charge. happy_h... | find the id and address of the shops whose score is below the average score. |
coffee_shop | select address , num_of_staff from shop where shop_id not in (select shop_id from happy_hour) | Question: find the address and staff number of the shops that do not have any happy hour. | Tables: shop -> Shop_ID, Address, Num_of_staff, Score, Open_Year. member -> Member_ID, Name, Membership_card, Age, Time_of_purchase, Level_of_membership, Address. happy_hour -> HH_ID, Shop_ID, Month, Num_of_shaff_in_charge. happ... | find the address and staff number of the shops that do not have any happy hour. |
coffee_shop | select t1.address , t1.shop_id from shop as t1 join happy_hour as t2 on t1.shop_id = t2.shop_id where month = 'may' | Question: what are the id and address of the shops which have a happy hour in may? | Tables: shop -> Shop_ID, Address, Num_of_staff, Score, Open_Year. member -> Member_ID, Name, Membership_card, Age, Time_of_purchase, Level_of_membership, Address. happy_hour -> HH_ID, Shop_ID, Month, Num_of_shaff_in_charge. happy_hour_... | what are the id and address of the shops which have a happy hour in may? |
coffee_shop | select shop_id , count(*) from happy_hour group by shop_id order by count(*) desc limit 1 | Question: which shop has happy hour most frequently? list its id and number of happy hours. | Tables: shop -> Shop_ID, Address, Num_of_staff, Score, Open_Year. member -> Member_ID, Name, Membership_card, Age, Time_of_purchase, Level_of_membership, Address. happy_hour -> HH_ID, Shop_ID, Month, Num_of_shaff_in_charge. ha... | which shop has happy hour most frequently? list its id and number of happy hours. |
coffee_shop | select month from happy_hour group by month order by count(*) desc limit 1 | Question: which month has the most happy hours? | Tables: shop -> Shop_ID, Address, Num_of_staff, Score, Open_Year. member -> Member_ID, Name, Membership_card, Age, Time_of_purchase, Level_of_membership, Address. happy_hour -> HH_ID, Shop_ID, Month, Num_of_shaff_in_charge. happy_hour_member -> HH_ID, Member_ID, Total_a... | which month has the most happy hours? |
coffee_shop | select month from happy_hour group by month having count(*) > 2 | Question: which months have more than 2 happy hours? | Tables: shop -> Shop_ID, Address, Num_of_staff, Score, Open_Year. member -> Member_ID, Name, Membership_card, Age, Time_of_purchase, Level_of_membership, Address. happy_hour -> HH_ID, Shop_ID, Month, Num_of_shaff_in_charge. happy_hour_member -> HH_ID, Member_ID, To... | which months have more than 2 happy hours? |
chinook_1 | select count(*) from album | Question: how many albums are there? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, BirthDate, HireDate... | how many albums are there? |
chinook_1 | select count(*) from album | Question: find the number of albums. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, BirthDate, HireDate... | find the number of albums. |
chinook_1 | select name from genre | Question: list the names of all music genres. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, BirthDate,... | list the names of all music genres. |
chinook_1 | select name from genre | Question: what are the names of different music genres? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, ... | what are the names of different music genres? |
chinook_1 | select * from customer where state = 'ny' | Question: find all the customer information in state ny. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo,... | find all the customer information in state ny. |
chinook_1 | select * from customer where state = 'ny' | Question: what is all the customer information for customers in ny state? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, ... | what is all the customer information for customers in ny state? |
chinook_1 | select firstname , lastname from employee where city = 'calgary' | Question: what are the first names and last names of the employees who live in calgary city. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, La... | what are the first names and last names of the employees who live in calgary city. |
chinook_1 | select firstname , lastname from employee where city = 'calgary' | Question: find the full names of employees living in the city of calgary. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, ... | find the full names of employees living in the city of calgary. |
chinook_1 | select distinct(billingcountry) from invoice | Question: what are the distinct billing countries of the invoices? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ... | what are the distinct billing countries of the invoices? |
chinook_1 | select distinct(billingcountry) from invoice | Question: find the different billing countries for all invoices. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Re... | find the different billing countries for all invoices. |
chinook_1 | select name from artist where name like '%a%' | Question: find the names of all artists that have 'a' in their names. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Titl... | find the names of all artists that have 'a' in their names. |
chinook_1 | select name from artist where name like '%a%' | Question: what are the names of artist who have the letter 'a' in their names? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstN... | what are the names of artist who have the letter 'a' in their names? |
chinook_1 | select title from album as t1 join artist as t2 on t1.artistid = t2.artistid where t2.name = 'ac/dc' | Question: find the title of all the albums of the artist 'ac/dc'. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, R... | find the title of all the albums of the artist 'ac/dc'. |
chinook_1 | select title from album as t1 join artist as t2 on t1.artistid = t2.artistid where t2.name = 'ac/dc' | Question: what are the titles of albums by the artist 'ac/dc'? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Repo... | what are the titles of albums by the artist 'ac/dc'? |
chinook_1 | select count(*) from album as t1 join artist as t2 on t1.artistid = t2.artistid where t2.name = 'metallica' | Question: hom many albums does the artist 'metallica' have? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Reports... | hom many albums does the artist 'metallica' have? |
chinook_1 | select count(*) from album as t1 join artist as t2 on t1.artistid = t2.artistid where t2.name = 'metallica' | Question: find the number of albums by the artist 'metallica'. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Repo... | find the number of albums by the artist 'metallica'. |
chinook_1 | select t2.name from album as t1 join artist as t2 on t1.artistid = t2.artistid where t1.title = 'balls to the wall' | Question: which artist does the album 'balls to the wall' belong to? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title... | which artist does the album 'balls to the wall' belong to? |
chinook_1 | select t2.name from album as t1 join artist as t2 on t1.artistid = t2.artistid where t1.title = 'balls to the wall' | Question: find the name of the artist who made the album 'balls to the wall'. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstNa... | find the name of the artist who made the album 'balls to the wall'. |
chinook_1 | select t2.name from album as t1 join artist as t2 on t1.artistid = t2.artistid group by t2.name order by count(*) desc limit 1 | Question: which artist has the most albums? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, BirthDate, H... | which artist has the most albums? |
chinook_1 | select t2.name from album as t1 join artist as t2 on t1.artistid = t2.artistid group by t2.name order by count(*) desc limit 1 | Question: what is the name of the artist with the greatest number of albums? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstNam... | what is the name of the artist with the greatest number of albums? |
chinook_1 | select name from track where name like '%you%' | Question: find the names of all the tracks that contain the word 'you'. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Ti... | find the names of all the tracks that contain the word 'you'. |
chinook_1 | select name from track where name like '%you%' | Question: what are the names of tracks that contain the the word you in them? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstNa... | what are the names of tracks that contain the the word you in them? |
chinook_1 | select avg(unitprice) from track | Question: what is the average unit price of all the tracks? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Reports... | what is the average unit price of all the tracks? |
chinook_1 | select avg(unitprice) from track | Question: find the average unit price for a track. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, Birth... | find the average unit price for a track. |
chinook_1 | select max(milliseconds) , min(milliseconds) from track | Question: what are the durations of the longest and the shortest tracks in milliseconds? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastNa... | what are the durations of the longest and the shortest tracks in milliseconds? |
chinook_1 | select max(milliseconds) , min(milliseconds) from track | Question: find the maximum and minimum durations of tracks in milliseconds. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName... | find the maximum and minimum durations of tracks in milliseconds. |
chinook_1 | select t1.title , t2.albumid , count(*) from album as t1 join track as t2 on t1.albumid = t2.albumid group by t2.albumid | Question: show the album names, ids and the number of tracks for each album. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstNam... | show the album names, ids and the number of tracks for each album. |
chinook_1 | select t1.title , t2.albumid , count(*) from album as t1 join track as t2 on t1.albumid = t2.albumid group by t2.albumid | Question: what are the names and ids of the different albums, and how many tracks are on each? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, ... | what are the names and ids of the different albums, and how many tracks are on each? |
chinook_1 | select t1.name from genre as t1 join track as t2 on t1.genreid = t2.genreid group by t2.genreid order by count(*) desc limit 1 | Question: what is the name of the most common genre in all tracks? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ... | what is the name of the most common genre in all tracks? |
chinook_1 | select t1.name from genre as t1 join track as t2 on t1.genreid = t2.genreid group by t2.genreid order by count(*) desc limit 1 | Question: find the name of the genre that is most frequent across all tracks. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstNa... | find the name of the genre that is most frequent across all tracks. |
chinook_1 | select t1.name from mediatype as t1 join track as t2 on t1.mediatypeid = t2.mediatypeid group by t2.mediatypeid order by count(*) asc limit 1 | Question: what is the least common media type in all tracks? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Report... | what is the least common media type in all tracks? |
chinook_1 | select t1.name from mediatype as t1 join track as t2 on t1.mediatypeid = t2.mediatypeid group by t2.mediatypeid order by count(*) asc limit 1 | Question: what is the name of the media type that is least common across all tracks? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, ... | what is the name of the media type that is least common across all tracks? |
chinook_1 | select t1.title , t2.albumid from album as t1 join track as t2 on t1.albumid = t2.albumid where t2.unitprice > 1 group by t2.albumid | Question: show the album names and ids for albums that contain tracks with unit price bigger than 1. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employ... | show the album names and ids for albums that contain tracks with unit price bigger than 1. |
chinook_1 | select t1.title , t2.albumid from album as t1 join track as t2 on t1.albumid = t2.albumid where t2.unitprice > 1 group by t2.albumid | Question: what are the titles and ids for albums containing tracks with unit price greater than 1? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employee... | what are the titles and ids for albums containing tracks with unit price greater than 1? |
chinook_1 | select count(*) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'rock' | Question: how many tracks belong to rock genre? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, BirthDat... | how many tracks belong to rock genre? |
chinook_1 | select count(*) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'rock' | Question: count the number of tracks that are part of the rock genre. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Titl... | count the number of tracks that are part of the rock genre. |
chinook_1 | select avg(unitprice) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'jazz' | Question: what is the average unit price of tracks that belong to jazz genre? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstNa... | what is the average unit price of tracks that belong to jazz genre? |
chinook_1 | select avg(unitprice) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'jazz' | Question: find the average unit price of jazz tracks. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, Bi... | find the average unit price of jazz tracks. |
chinook_1 | select firstname , lastname from customer where email = 'luisg@embraer.com.br' | Question: what is the first name and last name of the customer that has email 'luisg@embraer.com.br'? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Emplo... | what is the first name and last name of the customer that has email 'luisg@embraer.com.br'? |
chinook_1 | select firstname , lastname from customer where email = 'luisg@embraer.com.br' | Question: find the full name of the customer with the email 'luisg@embraer.com.br'. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, F... | find the full name of the customer with the email 'luisg@embraer.com.br'. |
chinook_1 | select count(*) from customer where email like '%gmail.com%' | Question: how many customers have email that contains 'gmail.com'? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ... | how many customers have email that contains 'gmail.com'? |
chinook_1 | select count(*) from customer where email like '%gmail.com%' | Question: count the number of customers that have an email containing 'gmail.com'. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, Fi... | count the number of customers that have an email containing 'gmail.com'. |
chinook_1 | select t2.firstname , t2.lastname from customer as t1 join employee as t2 on t1.supportrepid = t2.employeeid where t1.firstname = 'leonie' | Question: what is the first name and last name employee helps the customer with first name leonie? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employee... | what is the first name and last name employee helps the customer with first name leonie? |
chinook_1 | select t2.firstname , t2.lastname from customer as t1 join employee as t2 on t1.supportrepid = t2.employeeid where t1.firstname = 'leonie' | Question: find the full names of employees who help customers with the first name leonie. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastN... | find the full names of employees who help customers with the first name leonie. |
chinook_1 | select t2.city from customer as t1 join employee as t2 on t1.supportrepid = t2.employeeid where t1.postalcode = '70174' | Question: what city does the employee who helps the customer with postal code 70174 live in? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, La... | what city does the employee who helps the customer with postal code 70174 live in? |
chinook_1 | select t2.city from customer as t1 join employee as t2 on t1.supportrepid = t2.employeeid where t1.postalcode = '70174' | Question: find the cities corresponding to employees who help customers with the postal code 70174. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employe... | find the cities corresponding to employees who help customers with the postal code 70174. |
chinook_1 | select count(distinct city) from employee | Question: how many distinct cities does the employees live in? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Repo... | how many distinct cities does the employees live in? |
chinook_1 | select count(distinct city) from employee | Question: find the number of different cities that employees live in. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Titl... | find the number of different cities that employees live in. |
chinook_1 | select t2.invoicedate from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t1.firstname = 'astrid' and lastname = 'gruber' | Question: find all invoice dates corresponding to customers with first name astrid and last name gruber. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Em... | find all invoice dates corresponding to customers with first name astrid and last name gruber. |
chinook_1 | select t2.invoicedate from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t1.firstname = 'astrid' and lastname = 'gruber' | Question: what are the invoice dates for customers with the first name astrid and the last name gruber? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Emp... | what are the invoice dates for customers with the first name astrid and the last name gruber? |
chinook_1 | select lastname from customer except select t1.lastname from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t2.total > 20 | Question: find all the customer last names that do not have invoice totals larger than 20. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, Last... | find all the customer last names that do not have invoice totals larger than 20. |
chinook_1 | select lastname from customer except select t1.lastname from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t2.total > 20 | Question: what are the last names of customers without invoice totals exceeding 20? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, F... | what are the last names of customers without invoice totals exceeding 20? |
chinook_1 | select distinct t1.firstname from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t1.country = 'brazil' | Question: find the first names of all customers that live in brazil and have an invoice. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastNa... | find the first names of all customers that live in brazil and have an invoice. |
chinook_1 | select distinct t1.firstname from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t1.country = 'brazil' | Question: what are the different first names for customers from brazil who have also had an invoice? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employ... | what are the different first names for customers from brazil who have also had an invoice? |
chinook_1 | select distinct t1.address from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t1.country = 'germany' | Question: find the address of all customers that live in germany and have invoice. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, Fi... | find the address of all customers that live in germany and have invoice. |
chinook_1 | select distinct t1.address from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t1.country = 'germany' | Question: what are the addresses of customers living in germany who have had an invoice? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastNa... | what are the addresses of customers living in germany who have had an invoice? |
chinook_1 | select phone from employee | Question: list the phone numbers of all employees. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, Birth... | list the phone numbers of all employees. |
chinook_1 | select phone from employee | Question: what are the phone numbers for each employee? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, ... | what are the phone numbers for each employee? |
chinook_1 | select count(*) from mediatype as t1 join track as t2 on t1.mediatypeid = t2.mediatypeid where t1.name = 'aac audio file' | Question: how many tracks are in the aac audio file media type? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Rep... | how many tracks are in the aac audio file media type? |
chinook_1 | select count(*) from mediatype as t1 join track as t2 on t1.mediatypeid = t2.mediatypeid where t1.name = 'aac audio file' | Question: count the number of tracks that are of the media type 'aac audio file'. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, Fir... | count the number of tracks that are of the media type 'aac audio file'. |
chinook_1 | select avg(milliseconds) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'latin' or t1.name = 'pop' | Question: what is the average duration in milliseconds of tracks that belong to latin or pop genre? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employe... | what is the average duration in milliseconds of tracks that belong to latin or pop genre? |
chinook_1 | select avg(milliseconds) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'latin' or t1.name = 'pop' | Question: find the average millisecond length of latin and pop tracks. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Tit... | find the average millisecond length of latin and pop tracks. |
chinook_1 | select t1.firstname , t1.supportrepid from customer as t1 join employee as t2 on t1.supportrepid = t2.employeeid group by t1.supportrepid having count(*) >= 10 | Question: please show the employee first names and ids of employees who serve at least 10 customers. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employ... | please show the employee first names and ids of employees who serve at least 10 customers. |
chinook_1 | select t1.firstname , t1.supportrepid from customer as t1 join employee as t2 on t1.supportrepid = t2.employeeid group by t1.supportrepid having count(*) >= 10 | Question: what are the first names and support rep ids for employees serving 10 or more customers? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employee... | what are the first names and support rep ids for employees serving 10 or more customers? |
chinook_1 | select t1.lastname from customer as t1 join employee as t2 on t1.supportrepid = t2.employeeid group by t1.supportrepid having count(*) <= 20 | Question: please show the employee last names that serves no more than 20 customers. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, ... | please show the employee last names that serves no more than 20 customers. |
chinook_1 | select t1.lastname from customer as t1 join employee as t2 on t1.supportrepid = t2.employeeid group by t1.supportrepid having count(*) <= 20 | Question: what are the last names of employees who serve at most 20 customers? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstN... | what are the last names of employees who serve at most 20 customers? |
chinook_1 | select title from album order by title | Question: please list all album titles in alphabetical order. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Repor... | please list all album titles in alphabetical order. |
chinook_1 | select title from album order by title | Question: what are all the album titles, in alphabetical order? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Rep... | what are all the album titles, in alphabetical order? |
chinook_1 | select t2.name , t1.artistid from album as t1 join artist as t2 on t1.artistid = t2.artistid group by t1.artistid having count(*) >= 3 order by t2.name | Question: please list the name and id of all artists that have at least 3 albums in alphabetical order. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Emp... | please list the name and id of all artists that have at least 3 albums in alphabetical order. |
chinook_1 | select t2.name , t1.artistid from album as t1 join artist as t2 on t1.artistid = t2.artistid group by t1.artistid having count(*) >= 3 order by t2.name | Question: what are the names and ids of artists with 3 or more albums, listed in alphabetical order? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> Employ... | what are the names and ids of artists with 3 or more albums, listed in alphabetical order? |
chinook_1 | select name from artist except select t2.name from album as t1 join artist as t2 on t1.artistid = t2.artistid | Question: find the names of artists that do not have any albums. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, Re... | find the names of artists that do not have any albums. |
chinook_1 | select name from artist except select t2.name from album as t1 join artist as t2 on t1.artistid = t2.artistid | Question: what are the names of artists who have not released any albums? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, ... | what are the names of artists who have not released any albums? |
chinook_1 | select avg(t2.unitprice) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'rock' | Question: what is the average unit price of rock tracks? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo,... | what is the average unit price of rock tracks? |
chinook_1 | select avg(t2.unitprice) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'rock' | Question: find the average unit price of tracks from the rock genre. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title... | find the average unit price of tracks from the rock genre. |
chinook_1 | select max(milliseconds) , min(milliseconds) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'pop' | Question: what are the duration of the longest and shortest pop tracks in milliseconds? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastNam... | what are the duration of the longest and shortest pop tracks in milliseconds? |
chinook_1 | select max(milliseconds) , min(milliseconds) from genre as t1 join track as t2 on t1.genreid = t2.genreid where t1.name = 'pop' | Question: find the maximum and minimum millisecond lengths of pop tracks. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, ... | find the maximum and minimum millisecond lengths of pop tracks. |
chinook_1 | select birthdate from employee where city = 'edmonton' | Question: what are the birth dates of employees living in edmonton? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title,... | what are the birth dates of employees living in edmonton? |
chinook_1 | select birthdate from employee where city = 'edmonton' | Question: find the birth dates corresponding to employees who live in the city of edmonton. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, Las... | find the birth dates corresponding to employees who live in the city of edmonton. |
chinook_1 | select distinct(unitprice) from track | Question: what are the distinct unit prices of all tracks? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsT... | what are the distinct unit prices of all tracks? |
chinook_1 | select distinct(unitprice) from track | Question: find the distinct unit prices for tracks. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, Birt... | find the distinct unit prices for tracks. |
chinook_1 | select count(*) from artist where artistid not in(select artistid from album) | Question: how many artists do not have any album? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Title, ReportsTo, BirthD... | how many artists do not have any album? |
chinook_1 | select count(*) from artist where artistid not in(select artistid from album) | Question: cound the number of artists who have not released an album. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, LastName, FirstName, Titl... | cound the number of artists who have not released an album. |
chinook_1 | select t1.title from album as t1 join track as t2 on t1.albumid = t2.albumid join genre as t3 on t2.genreid = t3.genreid where t3.name = 'reggae' intersect select t1.title from album as t1 join track as t2 on t1.albumid = t2.albumid join genre as t3 on t2.genreid = t3.genreid where t3.name = 'rock' | Question: what are the album titles for albums containing both 'reggae' and 'rock' genre tracks? | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId... | what are the album titles for albums containing both 'reggae' and 'rock' genre tracks? |
chinook_1 | select t1.title from album as t1 join track as t2 on t1.albumid = t2.albumid join genre as t3 on t2.genreid = t3.genreid where t3.name = 'reggae' intersect select t1.title from album as t1 join track as t2 on t1.albumid = t2.albumid join genre as t3 on t2.genreid = t3.genreid where t3.name = 'rock' | Question: find the titles of albums that contain tracks of both the reggae and rock genres. | Tables: Album -> AlbumId, Title, ArtistId. Artist -> ArtistId, Name. Customer -> CustomerId, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId. Employee -> EmployeeId, Las... | find the titles of albums that contain tracks of both the reggae and rock genres. |
insurance_fnol | select customer_phone from available_policies | Question: find all the phone numbers. | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Opened, Date_Closed. First_Notification_of_Loss -> FNOL_ID, Customer_ID, Po... | find all the phone numbers. |
insurance_fnol | select customer_phone from available_policies | Question: what are all the phone numbers? | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Opened, Date_Closed. First_Notification_of_Loss -> FNOL_ID, Customer_ID... | what are all the phone numbers? |
insurance_fnol | select customer_phone from available_policies where policy_type_code = 'life insurance' | Question: what are the customer phone numbers under the policy 'life insurance'? | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Opened, Date_Closed. First_Notif... | what are the customer phone numbers under the policy 'life insurance'? |
insurance_fnol | select customer_phone from available_policies where policy_type_code = 'life insurance' | Question: what are the phone numbers of customers using the policy with the code 'life insurance'? | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Opened, Date_C... | what are the phone numbers of customers using the policy with the code 'life insurance'? |
insurance_fnol | select policy_type_code from available_policies group by policy_type_code order by count(*) desc limit 1 | Question: which policy type has the most records in the database? | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Opened, Date_Closed. First_Notification_of_Loss... | which policy type has the most records in the database? |
insurance_fnol | select policy_type_code from available_policies group by policy_type_code order by count(*) desc limit 1 | Question: which policy type appears most frequently in the available policies? | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Opened, Date_Closed. First_Notific... | which policy type appears most frequently in the available policies? |
insurance_fnol | select customer_phone from available_policies where policy_type_code = (select policy_type_code from available_policies group by policy_type_code order by count(*) desc limit 1) | Question: what are all the customer phone numbers under the most popular policy type? | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Opened, Date_Closed. First_... | what are all the customer phone numbers under the most popular policy type? |
insurance_fnol | select customer_phone from available_policies where policy_type_code = (select policy_type_code from available_policies group by policy_type_code order by count(*) desc limit 1) | Question: find the phone numbers of customers using the most common policy type among the available policies. | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Ope... | find the phone numbers of customers using the most common policy type among the available policies. |
insurance_fnol | select policy_type_code from available_policies group by policy_type_code having count(*) > 4 | Question: find the policy type used by more than 4 customers. | Tables: Customers -> Customer_ID, Customer_name. Services -> Service_ID, Service_name. Available_Policies -> Policy_ID, policy_type_code, Customer_Phone. Customers_Policies -> Customer_ID, Policy_ID, Date_Opened, Date_Closed. First_Notification_of_Loss -> ... | find the policy type used by more than 4 customers. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.