Question:
What are the last names of customers without invoice totals exceeding 20?
Additional table information: table: chinook_1

Answer: 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 the first names of all customers that live in Brazil and have an invoice.
Additional table information: table: chinook_1

Answer: 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?
Additional table information: table: chinook_1

Answer: SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = 'Brazil'


Question:
Find the address of all customers that live in Germany and have invoice.
Additional table information: table: chinook_1

Answer: 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?
Additional table information: table: chinook_1

Answer: SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = 'Germany'


Question:
List the phone numbers of all employees.
Additional table information: table: chinook_1

Answer: SELECT Phone FROM EMPLOYEE


Question:
What are the phone numbers for each employee?
Additional table information: table: chinook_1

Answer: SELECT Phone FROM EMPLOYEE


Question:
How many tracks are in the AAC audio file media type?
Additional table information: table: chinook_1

Answer: 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'.
Additional table information: table: chinook_1

Answer: SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = 'AAC audio file'


Question:
What is the average duration in milliseconds of tracks that belong to Latin or Pop genre?
Additional table information: table: chinook_1

Answer: 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.
Additional table information: table: chinook_1

Answer: 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:
Please show the employee first names and ids of employees who serve at least 10 customers.
Additional table information: table: chinook_1

Answer: 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?
Additional table information: table: chinook_1

Answer: 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 last names that serves no more than 20 customers.
Additional table information: table: chinook_1

Answer: 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?
Additional table information: table: chinook_1

Answer: 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 list all album titles in alphabetical order.
Additional table information: table: chinook_1

Answer: SELECT Title FROM ALBUM ORDER BY Title NULLS FIRST


Question:
What are all the album titles, in alphabetical order?
Additional table information: table: chinook_1

Answer: SELECT Title FROM ALBUM ORDER BY Title NULLS FIRST


Question:
Please list the name and id of all artists that have at least 3 albums in alphabetical order.
Additional table information: table: chinook_1

Answer: 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 NULLS FIRST


Question:
What are the names and ids of artists with 3 or more albums, listed in alphabetical order?
Additional table information: table: chinook_1

Answer: 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 NULLS FIRST


Question:
Find the names of artists that do not have any albums.
Additional table information: table: chinook_1

Answer: 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?
Additional table information: table: chinook_1

Answer: SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId


Question:
What is the average unit price of rock tracks?
Additional table information: table: chinook_1

Answer: 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.
Additional table information: table: chinook_1

Answer: SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Rock'


Question:
What are the duration of the longest and shortest pop tracks in milliseconds?
Additional table information: table: chinook_1

Answer: 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.
Additional table information: table: chinook_1

Answer: 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 birth dates of employees living in Edmonton?
Additional table information: table: chinook_1

Answer: SELECT BirthDate FROM EMPLOYEE WHERE City = 'Edmonton'


Question:
Find the birth dates corresponding to employees who live in the city of Edmonton.
Additional table information: table: chinook_1

Answer: SELECT BirthDate FROM EMPLOYEE WHERE City = 'Edmonton'


Question:
What are the distinct unit prices of all tracks?
Additional table information: table: chinook_1

Answer: SELECT DISTINCT (UnitPrice) FROM TRACK


Question:
Find the distinct unit prices for tracks.
Additional table information: table: chinook_1

Answer: SELECT DISTINCT (UnitPrice) FROM TRACK


Question:
How many artists do not have any album?
Additional table information: table: chinook_1

Answer: SELECT COUNT(*) FROM ARTIST WHERE NOT artistid IN (SELECT artistid FROM ALBUM)


Question:
Cound the number of artists who have not released an album.
Additional table information: table: chinook_1

Answer: SELECT COUNT(*) FROM ARTIST WHERE NOT artistid IN (SELECT artistid FROM ALBUM)


Question:
What are the album titles for albums containing both 'Reggae' and 'Rock' genre tracks?
Additional table information: table: chinook_1

Answer: 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.
Additional table information: table: chinook_1

Answer: 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 all the phone numbers.
Additional table information: table: insurance_fnol

Answer: SELECT customer_phone FROM available_policies


Question:
What are all the phone numbers?
Additional table information: table: insurance_fnol

Answer: SELECT customer_phone FROM available_policies


Question:
What are the customer phone numbers under the policy 'Life Insurance'?
Additional table information: table: insurance_fnol

Answer: 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'?
Additional table information: table: insurance_fnol

Answer: SELECT customer_phone FROM available_policies WHERE policy_type_code = 'Life Insurance'


Question:
Which policy type has the most records in the database?
Additional table information: table: insurance_fnol

Answer: 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?
Additional table information: table: insurance_fnol

Answer: 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?
Additional table information: table: insurance_fnol

Answer: 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.
Additional table information: table: insurance_fnol

Answer: 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 policy type used by more than 4 customers.
Additional table information: table: insurance_fnol

Answer: SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING COUNT(*) > 4


Question:
Find the policy types more than 4 customers use. Show their type code.
Additional table information: table: insurance_fnol

Answer: SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING COUNT(*) > 4


Question:
Find the total and average amount of settlements.
Additional table information: table: insurance_fnol

Answer: SELECT SUM(settlement_amount), AVG(settlement_amount) FROM settlements


Question:
Return the sum and average of all settlement amounts.
Additional table information: table: insurance_fnol

Answer: SELECT SUM(settlement_amount), AVG(settlement_amount) FROM settlements


Question:
Find the name of services that have been used for more than 2 times in first notification of loss.
Additional table information: table: insurance_fnol

Answer: SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING COUNT(*) > 2


Question:
Which services have been used more than twice in first notification of loss? Return the service name.
Additional table information: table: insurance_fnol

Answer: SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING COUNT(*) > 2


Question:
What is the effective date of the claim that has the largest amount of total settlement?
Additional table information: table: insurance_fnol

Answer: SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1


Question:
Find the claim that has the largest total settlement amount. Return the effective date of the claim.
Additional table information: table: insurance_fnol

Answer: SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1


Question:
How many policies are listed for the customer named 'Dayana Robel'?
Additional table information: table: insurance_fnol

Answer: SELECT COUNT(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Dayana Robel'


Question:
Count the total number of policies used by the customer named 'Dayana Robel'.
Additional table information: table: insurance_fnol

Answer: SELECT COUNT(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Dayana Robel'


Question:
What is the name of the customer who has the most policies listed?
Additional table information: table: insurance_fnol

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which customer uses the most policies? Give me the customer name.
Additional table information: table: insurance_fnol

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are all the policy types of the customer named 'Dayana Robel'?
Additional table information: table: insurance_fnol

Answer: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = 'Dayana Robel'


Question:
Tell me the types of the policy used by the customer named 'Dayana Robel'.
Additional table information: table: insurance_fnol

Answer: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = 'Dayana Robel'


Question:
What are all the policy types of the customer that has the most policies listed?
Additional table information: table: insurance_fnol

Answer: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC LIMIT 1)


Question:
List all the policy types used by the customer enrolled in the most policies.
Additional table information: table: insurance_fnol

Answer: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC LIMIT 1)


Question:
List all the services in the alphabetical order.
Additional table information: table: insurance_fnol

Answer: SELECT service_name FROM services ORDER BY service_name NULLS FIRST


Question:
Give me a list of all the service names sorted alphabetically.
Additional table information: table: insurance_fnol

Answer: SELECT service_name FROM services ORDER BY service_name NULLS FIRST


Question:
How many services are there?
Additional table information: table: insurance_fnol

Answer: SELECT COUNT(*) FROM services


Question:
Count the total number of available services.
Additional table information: table: insurance_fnol

Answer: SELECT COUNT(*) FROM services


Question:
Find the names of users who do not have a first notification of loss record.
Additional table information: table: insurance_fnol

Answer: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id


Question:
Which customers do not have a first notification of loss record? Give me the customer names.
Additional table information: table: insurance_fnol

Answer: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id


Question:
Find the names of customers who have used either the service 'Close a policy' or the service 'Upgrade a policy'.
Additional table information: table: insurance_fnol

Answer: SELECT t1.customer_name 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' OR t3.service_name = 'Upgrade a policy'


Question:
Which customers have used the service named 'Close a policy' or 'Upgrade a policy'? Give me the customer names.
Additional table information: table: insurance_fnol

Answer: SELECT t1.customer_name 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' OR t3.service_name = 'Upgrade a policy'


Question:
Find the names of customers who have used both the service 'Close a policy' and the service 'New policy application'.
Additional table information: table: insurance_fnol

Answer: SELECT t1.customer_name 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' INTERSECT SELECT t1.customer_name 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'


Question:
Which customers have used both the service named 'Close a policy' and the service named 'Upgrade a policy'? Give me the customer names.
Additional table information: table: insurance_fnol

Answer: SELECT t1.customer_name 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' INTERSECT SELECT t1.customer_name 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'


Question:
Find the IDs of customers whose name contains 'Diana'.
Additional table information: table: insurance_fnol

Answer: SELECT customer_id FROM customers WHERE customer_name LIKE '%Diana%'


Question:
What are the IDs of customers who have 'Diana' in part of their names?
Additional table information: table: insurance_fnol

Answer: SELECT customer_id FROM customers WHERE customer_name LIKE '%Diana%'


Question:
What are the maximum and minimum settlement amount on record?
Additional table information: table: insurance_fnol

Answer: SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements


Question:
Find the maximum and minimum settlement amount.
Additional table information: table: insurance_fnol

Answer: SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements


Question:
List all the customers in increasing order of IDs.
Additional table information: table: insurance_fnol

Answer: SELECT customer_id, customer_name FROM customers ORDER BY customer_id ASC NULLS FIRST


Question:
What is the ordered list of customer ids?
Additional table information: table: insurance_fnol

Answer: SELECT customer_id, customer_name FROM customers ORDER BY customer_id ASC NULLS FIRST


Question:
Retrieve the open and close dates of all the policies associated with the customer whose name contains 'Diana'
Additional table information: table: insurance_fnol

Answer: SELECT t2.date_opened, t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE '%Diana%'


Question:
What are the open and close dates of all the policies used by the customer who have 'Diana' in part of their names?
Additional table information: table: insurance_fnol

Answer: SELECT t2.date_opened, t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE '%Diana%'


Question:
How many kinds of enzymes are there?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT COUNT(*) FROM enzyme


Question:
What is the total count of enzymes?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT COUNT(*) FROM enzyme


Question:
List the name of enzymes in descending lexicographical order.
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name FROM enzyme ORDER BY name DESC


Question:
What are the names of enzymes in descending order?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name FROM enzyme ORDER BY name DESC


Question:
List the names and the locations that the enzymes can make an effect.
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name, LOCATION FROM enzyme


Question:
What are the names and locations of all enzymes listed?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name, LOCATION FROM enzyme


Question:
What is the maximum Online Mendelian Inheritance in Man (OMIM) value of the enzymes?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT MAX(OMIM) FROM enzyme


Question:
What is the maximum OMIM value in the database?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT MAX(OMIM) FROM enzyme


Question:
What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT product, chromosome, porphyria FROM enzyme WHERE LOCATION = 'Cytosol'


Question:
What is the product, chromosome, and porphyria of the enzymes located at 'Cytosol'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT product, chromosome, porphyria FROM enzyme WHERE LOCATION = 'Cytosol'


Question:
What are the names of enzymes who does not produce 'Heme'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name FROM enzyme WHERE product <> 'Heme'


Question:
What are the names of enzymes whose product is not 'Heme'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name FROM enzyme WHERE product <> 'Heme'


Question:
What are the names and trade names of the medicines which has 'Yes' value in the FDA record?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name, trade_name FROM medicine WHERE FDA_approved = 'Yes'


Question:
What are the names and trade names of the medcines that are FDA approved?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name, trade_name FROM medicine WHERE FDA_approved = 'Yes'


Question:
What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'?
Additional table information: table: medicine_enzyme_interaction

Answer: 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'


Question:
What are the names of the enzymes used in the medicine  Amisulpride that acts as inhibitors?
Additional table information: table: medicine_enzyme_interaction

Answer: 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'


Question:
What are the ids and names of the medicine that can interact with two or more enzymes?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.id, T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2


Question:
For every medicine id, what are the names of the medicines that can interact with more than one enzyme?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.id, T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2


Question:
What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC


Question:
What are the ids, names, and FDA approval status for medicines ordered by descending number of possible enzyme interactions?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC


Question:
What is the id and name of the enzyme with most number of medicines that can interact as 'activator'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the id and name of the enzyme that can interact with the most medicines as an activator?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'


Question:
What is the type of interaction for the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'


Question:
What is the most common interaction type between enzymes and medicine? And how many are there?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT interaction_type, COUNT(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the most common types of interactions between enzymes and medicine, and how many types are there?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT interaction_type, COUNT(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many medicines have the FDA approval status 'No' ?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT COUNT(*) FROM medicine WHERE FDA_approved = 'No'


Question:
How many medicines were not approved by the FDA?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT COUNT(*) FROM medicine WHERE FDA_approved = 'No'


Question:
How many enzymes do not have any interactions?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction)


Question:
What is the count of enzymes without any interactions?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction)


Question:
What is the id and trade name of the medicines can interact with at least 3 enzymes?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3


Question:
What are the ids and trade names of the medicine that can interact with at least 3 enzymes?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3


Question:
What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'


Question:
What are the different names, locations, and products of the enzymes that are capable inhibitor interactions?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'


Question:
List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes.
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'


Question:
What are the medicine and trade names that can interact as an inhibitor and activitor with enzymes?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'


Question:
Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'.
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'


Question:
What are the medicine and trade names that cannot interact with the enzyme with the product 'Heme'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'


Question:
How many distinct FDA approval statuses are there for the medicines?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT COUNT(DISTINCT FDA_approved) FROM medicine


Question:
How many different FDA approval statuses exist for medicines?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT COUNT(DISTINCT FDA_approved) FROM medicine


Question:
Which enzyme names have the substring 'ALA'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name FROM enzyme WHERE name LIKE '%ALA%'


Question:
What are the names of enzymes that include the string 'ALA'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name FROM enzyme WHERE name LIKE '%ALA%'


Question:
find the number of medicines offered by each trade.
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT trade_name, COUNT(*) FROM medicine GROUP BY trade_name


Question:
How many medicines are offered by each trade name?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT trade_name, COUNT(*) FROM medicine GROUP BY trade_name


Question:
List all schools and their nicknames in the order of founded year.
Additional table information: table: university_basketball

Answer: SELECT school, nickname FROM university ORDER BY founded NULLS FIRST


Question:
What are the different schools and their nicknames, ordered by their founding years?
Additional table information: table: university_basketball

Answer: SELECT school, nickname FROM university ORDER BY founded NULLS FIRST


Question:
List all public schools and their locations.
Additional table information: table: university_basketball

Answer: SELECT school, LOCATION FROM university WHERE affiliation = 'Public'


Question:
What are the public schools and what are their locations?
Additional table information: table: university_basketball

Answer: SELECT school, LOCATION FROM university WHERE affiliation = 'Public'


Question:
When was the school with the largest enrollment founded?
Additional table information: table: university_basketball

Answer: SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1


Question:
Return the founded year for the school with the largest enrollment.
Additional table information: table: university_basketball

Answer: SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1


Question:
Find the founded year of the newest non public school.
Additional table information: table: university_basketball

Answer: SELECT founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC LIMIT 1


Question:
What is the founded year of the non public school that was founded most recently?
Additional table information: table: university_basketball

Answer: SELECT founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC LIMIT 1


Question:
How many schools are in the basketball match?
Additional table information: table: university_basketball

Answer: SELECT COUNT(DISTINCT school_id) FROM basketball_match


Question:
Count the number of schools that have had basketball matches.
Additional table information: table: university_basketball

Answer: SELECT COUNT(DISTINCT school_id) FROM basketball_match


Question:
What is the highest acc percent score in the competition?
Additional table information: table: university_basketball

Answer: SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1


Question:
Return the highest acc percent across all basketball matches.
Additional table information: table: university_basketball

Answer: SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1


Question:
What is the primary conference of the school that has the lowest acc percent score in the competition?
Additional table information: table: university_basketball

Answer: SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent NULLS FIRST LIMIT 1


Question:
Return the primary conference of the school with the lowest acc percentage score.
Additional table information: table: university_basketball

Answer: SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent NULLS FIRST LIMIT 1


Question:
What is the team name and acc regular season score of the school that was founded for the longest time?
Additional table information: table: university_basketball

Answer: SELECT t2.team_name, t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded NULLS FIRST LIMIT 1


Question:
Return the name of the team and the acc during the regular season for the school that was founded the earliest.
Additional table information: table: university_basketball

Answer: SELECT t2.team_name, t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded NULLS FIRST LIMIT 1


Question:
Find the location and all games score of the school that has Clemson as its team name.
Additional table information: table: university_basketball

Answer: SELECT t2.All_Games, t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'


Question:
What are the all games score and location of the school called Clemson?
Additional table information: table: university_basketball

Answer: SELECT t2.All_Games, t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'


Question:
What are the average enrollment size of the universities that are founded before 1850?
Additional table information: table: university_basketball

Answer: SELECT AVG(enrollment) FROM university WHERE founded < 1850


Question:
Return the average enrollment of universities founded before 1850.
Additional table information: table: university_basketball

Answer: SELECT AVG(enrollment) FROM university WHERE founded < 1850


Question:
Show the enrollment and primary_conference of the oldest college.
Additional table information: table: university_basketball

Answer: SELECT enrollment, primary_conference FROM university ORDER BY founded NULLS FIRST LIMIT 1


Question:
What are the enrollment and primary conference for the university which was founded the earliest?
Additional table information: table: university_basketball

Answer: SELECT enrollment, primary_conference FROM university ORDER BY founded NULLS FIRST LIMIT 1


Question:
What is the total and minimum enrollment of all schools?
Additional table information: table: university_basketball

Answer: SELECT SUM(enrollment), MIN(enrollment) FROM university


Question:
Return the total and minimum enrollments across all schools.
Additional table information: table: university_basketball

Answer: SELECT SUM(enrollment), MIN(enrollment) FROM university


Question:
Find the total student enrollment for different affiliation type schools.
Additional table information: table: university_basketball

Answer: SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation


Question:
What are the total enrollments of universities of each affiliation type?
Additional table information: table: university_basketball

Answer: SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation


Question:
How many schools do not participate in the basketball match?
Additional table information: table: university_basketball

Answer: SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match)


Question:
Count the number of universities that do not participate in the baketball match.
Additional table information: table: university_basketball

Answer: SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match)


Question:
Find the schools that were either founded after 1850 or public.
Additional table information: table: university_basketball

Answer: SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'


Question:
What are the schools that were either founded before 1850 or are public?
Additional table information: table: university_basketball

Answer: SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'


Question:
Find how many different affiliation types there are.
Additional table information: table: university_basketball

Answer: SELECT COUNT(DISTINCT affiliation) FROM university


Question:
Count the number of different affiliation types.
Additional table information: table: university_basketball

Answer: SELECT COUNT(DISTINCT affiliation) FROM university


Question:
Find how many school locations have the word 'NY'.
Additional table information: table: university_basketball

Answer: SELECT COUNT(*) FROM university WHERE LOCATION LIKE '%NY%'


Question:
How many universities have a location that contains NY?
Additional table information: table: university_basketball

Answer: SELECT COUNT(*) FROM university WHERE LOCATION LIKE '%NY%'


Question:
Find the team names of the universities whose enrollments are smaller than the average enrollment size.
Additional table information: table: university_basketball

Answer: SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT AVG(enrollment) FROM university)


Question:
What are the names of teams from universities that have a below average enrollment?
Additional table information: table: university_basketball

Answer: SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT AVG(enrollment) FROM university)


Question:
Find the number of universities that have over a 20000 enrollment size for each affiliation type.
Additional table information: table: university_basketball

Answer: SELECT COUNT(*), affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation


Question:
What are the different affiliations, and how many schools with each have an enrollment size of above 20000?
Additional table information: table: university_basketball

Answer: SELECT COUNT(*), affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation


Question:
Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type.
Additional table information: table: university_basketball

Answer: SELECT SUM(Enrollment), affiliation FROM university WHERE founded > 1850 GROUP BY affiliation


Question:
What are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type?
Additional table information: table: university_basketball

Answer: SELECT SUM(Enrollment), affiliation FROM university WHERE founded > 1850 GROUP BY affiliation


Question:
What is the maximum enrollment across all schools?
Additional table information: table: university_basketball

Answer: SELECT MAX(Enrollment) FROM university


Question:
Return the maximum enrollment across all schools.
Additional table information: table: university_basketball

Answer: SELECT MAX(Enrollment) FROM university


Question:
List all information regarding the basketball match.
Additional table information: table: university_basketball

Answer: SELECT * FROM basketball_match


Question:
What is all the information about the basketball match?
Additional table information: table: university_basketball

Answer: SELECT * FROM basketball_match


Question:
List names of all teams in the basketball competition, ordered by all home scores in descending order.
Additional table information: table: university_basketball

Answer: SELECT team_name FROM basketball_match ORDER BY All_Home DESC


Question:
What are the names of all the teams in the basketball competition, sorted by all home scores in descending order?
Additional table information: table: university_basketball

Answer: SELECT team_name FROM basketball_match ORDER BY All_Home DESC


Question:
the names of models that launched between 2002 and 2004.
Additional table information: table: phone_1

Answer: SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004


Question:
Which model has the least amount of RAM? List the model name and the amount of RAM.
Additional table information: table: phone_1

Answer: SELECT Model_name, RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC NULLS FIRST LIMIT 1


Question:
What are the chip model and screen mode of the phone with hardware model name 'LG-P760'?
Additional table information: table: phone_1

Answer: SELECT chip_model, screen_mode FROM phone WHERE Hardware_Model_name = 'LG-P760'


Question:
How many phone hardware models are produced by the company named 'Nokia Corporation'?
Additional table information: table: phone_1

Answer: SELECT COUNT(*) FROM phone WHERE Company_name = 'Nokia Corporation'


Question:
What is maximum and minimum RAM size of phone produced by company named 'Nokia Corporation'?
Additional table information: table: phone_1

Answer: SELECT MAX(T1.RAM_MiB), MIN(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = 'Nokia Corporation'


Question:
What is the average ROM size of phones produced by the company named 'Nokia Corporation'?
Additional table information: table: phone_1

Answer: SELECT AVG(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = 'Nokia Corporation'


Question:
List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32.
Additional table information: table: phone_1

Answer: SELECT T2.Hardware_Model_name, T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32


Question:
Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.
Additional table information: table: phone_1

Answer: SELECT Hardware_Model_name, Company_name FROM phone WHERE Accreditation_type LIKE 'Full'


Question:
Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is 'LG-P760'.
Additional table information: table: phone_1

Answer: SELECT T1.Char_cells, T1.Pixels, T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = 'LG-P760'


Question:
List the hardware model name and company name for the phone whose screen mode type is 'Graphics.'
Additional table information: table: phone_1

Answer: SELECT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = 'Graphics'


Question:
Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company.
Additional table information: table: phone_1

Answer: SELECT Company_name, COUNT(*) FROM phone GROUP BY Company_name ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
List the name of the company that produced more than one phone model.
Additional table information: table: phone_1

Answer: SELECT Company_name FROM phone GROUP BY Company_name HAVING COUNT(*) > 1


Question:
List the maximum, minimum and average number of used kb in screen mode.
Additional table information: table: phone_1

Answer: SELECT MAX(used_kb), MIN(used_kb), AVG(used_kb) FROM screen_mode


Question:
List the name of the phone model launched in year 2002 and with the highest RAM size.
Additional table information: table: phone_1

Answer: SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1


Question:
What are the wifi and screen mode type of the hardware model named 'LG-P760'?
Additional table information: table: phone_1

Answer: SELECT T1.WiFi, T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = 'LG-P760'


Question:
List the hardware model name for the phones that have screen mode type 'Text' or RAM size greater than 32.
Additional table information: table: phone_1

Answer: SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = 'Text' OR T1.RAM_MiB > 32


Question:
List the hardware model name for the phones that were produced by 'Nokia Corporation' or whose screen mode type is 'Graphics.'
Additional table information: table: phone_1

Answer: SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = 'Graphics' OR t2.Company_name = 'Nokia Corporation'


Question:
List the hardware model name for the phons that were produced by 'Nokia Corporation' but whose screen mode type is not Text.
Additional table information: table: phone_1

Answer: SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = 'Nokia Corporation' AND T1.Type <> 'Text'


Question:
List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15.
Additional table information: table: phone_1

Answer: SELECT DISTINCT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15


Question:
Find the number of phones for each accreditation type.
Additional table information: table: phone_1

Answer: SELECT Accreditation_type, COUNT(*) FROM phone GROUP BY Accreditation_type


Question:
How many phones belongs to each accreditation type?
Additional table information: table: phone_1

Answer: SELECT Accreditation_type, COUNT(*) FROM phone GROUP BY Accreditation_type


Question:
Find the accreditation level that more than 3 phones use.
Additional table information: table: phone_1

Answer: SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING COUNT(*) > 3


Question:
Find the details for all chip models.
Additional table information: table: phone_1

Answer: SELECT * FROM chip_model


Question:
How many models do not have the wifi function?
Additional table information: table: phone_1

Answer: SELECT COUNT(*) FROM chip_model WHERE wifi = 'No'


Question:
Count the number of chip model that do not have wifi.
Additional table information: table: phone_1

Answer: SELECT COUNT(*) FROM chip_model WHERE wifi = 'No'


Question:
List all the model names sorted by their launch year.
Additional table information: table: phone_1

Answer: SELECT model_name FROM chip_model ORDER BY launch_year NULLS FIRST


Question:
Find the average ram mib size of the chip models that are never used by any phone.
Additional table information: table: phone_1

Answer: SELECT AVG(RAM_MiB) FROM chip_model WHERE NOT model_name IN (SELECT chip_model FROM phone)


Question:
Find the names of the chip models that are not used by any phone with full accreditation type.
Additional table information: table: phone_1

Answer: SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full'


Question:
Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types.
Additional table information: table: phone_1

Answer: SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Full'


Question:
How many countries are there in total?
Additional table information: table: match_season

Answer: SELECT COUNT(*) FROM country


Question:
Count the number of countries.
Additional table information: table: match_season

Answer: SELECT COUNT(*) FROM country


Question:
Show the country name and capital of all countries.
Additional table information: table: match_season

Answer: SELECT Country_name, Capital FROM country


Question:
What are the names and capitals of each country?
Additional table information: table: match_season

Answer: SELECT Country_name, Capital FROM country


Question:
Show all official native languages that contain the word 'English'.
Additional table information: table: match_season

Answer: SELECT Official_native_language FROM country WHERE Official_native_language LIKE '%English%'


Question:
What are the official native languages that contain the string 'English'.
Additional table information: table: match_season

Answer: SELECT Official_native_language FROM country WHERE Official_native_language LIKE '%English%'


Question:
Show all distinct positions of matches.
Additional table information: table: match_season

Answer: SELECT DISTINCT POSITION FROM match_season


Question:
What are the different positions for match season?
Additional table information: table: match_season

Answer: SELECT DISTINCT POSITION FROM match_season


Question:
Show the players from college UCLA.
Additional table information: table: match_season

Answer: SELECT Player FROM match_season WHERE College = 'UCLA'


Question:
Who are the players from UCLA?
Additional table information: table: match_season

Answer: SELECT Player FROM match_season WHERE College = 'UCLA'


Question:
Show the distinct position of players from college UCLA or Duke.
Additional table information: table: match_season

Answer: SELECT DISTINCT POSITION FROM match_season WHERE College = 'UCLA' OR College = 'Duke'


Question:
What are the different positions of players from UCLA or Duke colleges?
Additional table information: table: match_season

Answer: SELECT DISTINCT POSITION FROM match_season WHERE College = 'UCLA' OR College = 'Duke'


Question:
Show the draft pick numbers and draft classes of players whose positions are defenders.
Additional table information: table: match_season

Answer: SELECT Draft_Pick_Number, Draft_Class FROM match_season WHERE POSITION = 'Defender'


Question:
What are the draft pick numbers and draft classes for players who play the Defender position?
Additional table information: table: match_season

Answer: SELECT Draft_Pick_Number, Draft_Class FROM match_season WHERE POSITION = 'Defender'


Question:
How many distinct teams are involved in match seasons?
Additional table information: table: match_season

Answer: SELECT COUNT(DISTINCT Team) FROM match_season


Question:
Count the number of different teams involved in match season.
Additional table information: table: match_season

Answer: SELECT COUNT(DISTINCT Team) FROM match_season


Question:
Show the players and the years played.
Additional table information: table: match_season

Answer: SELECT Player, Years_Played FROM player


Question:
Who are the different players and how many years has each played?
Additional table information: table: match_season

Answer: SELECT Player, Years_Played FROM player


Question:
Show all team names.
Additional table information: table: match_season

Answer: SELECT Name FROM Team


Question:
What are the names of all teams?
Additional table information: table: match_season

Answer: SELECT Name FROM Team


Question:
Show the season, the player, and the name of the country that player belongs to.
Additional table information: table: match_season

Answer: SELECT T2.Season, T2.Player, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country


Question:
For each player, what are their name, season, and country that they belong to?
Additional table information: table: match_season

Answer: SELECT T2.Season, T2.Player, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country


Question:
Which players are from Indonesia?
Additional table information: table: match_season

Answer: SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = 'Indonesia'


Question:
Who are the players from Indonesia?
Additional table information: table: match_season

Answer: SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = 'Indonesia'


Question:
What are the distinct positions of the players from a country whose capital is Dublin?
Additional table information: table: match_season

Answer: SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = 'Dublin'


Question:
Give the different positions of players who play for the country with the capital Dublin.
Additional table information: table: match_season

Answer: SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = 'Dublin'


Question:
What are the official languages of the countries of players from Maryland or Duke college?
Additional table information: table: match_season

Answer: SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = 'Maryland' OR T2.College = 'Duke'


Question:
Return the official native languages of countries who have players from Maryland or Duke colleges.
Additional table information: table: match_season

Answer: SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = 'Maryland' OR T2.College = 'Duke'


Question:
How many distinct official languages are there among countries of players whose positions are defenders.
Additional table information: table: match_season

Answer: SELECT COUNT(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Defender'


Question:
Count the number of different official languages corresponding to countries that players who play Defender are from.
Additional table information: table: match_season

Answer: SELECT COUNT(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Defender'


Question:
Show the season, the player, and the name of the team that players belong to.
Additional table information: table: match_season

Answer: SELECT T1.Season, T1.Player, T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id


Question:
Who are the different players, what season do they play in, and what is the name of the team they are on?
Additional table information: table: match_season

Answer: SELECT T1.Season, T1.Player, T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id


Question:
Show the positions of the players from the team with name 'Ryley Goldner'.
Additional table information: table: match_season

Answer: SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Ryley Goldner'


Question:
Return the positions of players on the team Ryley Goldner.
Additional table information: table: match_season

Answer: SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Ryley Goldner'


Question:
How many distinct colleges are associated with players from the team with name 'Columbus Crew'.
Additional table information: table: match_season

Answer: SELECT COUNT(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Columbus Crew'


Question:
Count the number of different colleges that players who play for Columbus Crew are from.
Additional table information: table: match_season

Answer: SELECT COUNT(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Columbus Crew'


Question:
Show the players and years played for players from team 'Columbus Crew'.
Additional table information: table: match_season

Answer: 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'


Question:
What are the players who played for Columbus Crew, and how many years did each play for?
Additional table information: table: match_season

Answer: 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'


Question:
Show the position of players and the corresponding number of players.
Additional table information: table: match_season

Answer: SELECT POSITION, COUNT(*) FROM match_season GROUP BY POSITION


Question:
How many players played each position?
Additional table information: table: match_season

Answer: SELECT POSITION, COUNT(*) FROM match_season GROUP BY POSITION


Question:
Show the country names and the corresponding number of players.
Additional table information: table: match_season

Answer: SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name


Question:
How many players are from each country?
Additional table information: table: match_season

Answer: SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name


Question:
Return all players sorted by college in ascending alphabetical order.
Additional table information: table: match_season

Answer: SELECT player FROM match_season ORDER BY College ASC NULLS FIRST


Question:
What are all the players who played in match season, sorted by college in ascending alphabetical order?
Additional table information: table: match_season

Answer: SELECT player FROM match_season ORDER BY College ASC NULLS FIRST


Question:
Show the most common position of players in match seasons.
Additional table information: table: match_season

Answer: SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the position that is most common among players in match seasons?
Additional table information: table: match_season

Answer: SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the top 3 most common colleges of players in match seasons.
Additional table information: table: match_season

Answer: SELECT College FROM match_season GROUP BY College ORDER BY COUNT(*) DESC LIMIT 3


Question:
What are the three colleges from which the most players are from?
Additional table information: table: match_season

Answer: SELECT College FROM match_season GROUP BY College ORDER BY COUNT(*) DESC LIMIT 3


Question:
Show the name of colleges that have at least two players.
Additional table information: table: match_season

Answer: SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2


Question:
What are the names of all colleges that have two or more players?
Additional table information: table: match_season

Answer: SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2


Question:
Show the name of colleges that have at least two players in descending alphabetical order.
Additional table information: table: match_season

Answer: SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC


Question:
What are the names of colleges that have two or more players, listed in descending alphabetical order?
Additional table information: table: match_season

Answer: SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC


Question:
What are the names of teams that do no have match season record?
Additional table information: table: match_season

Answer: SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season)


Question:
Return the names of teams that have no match season record.
Additional table information: table: match_season

Answer: SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season)


Question:
What are the names of countries that have both players with position forward and players with position defender?
Additional table information: table: match_season

Answer: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Forward' INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Defender'


Question:
Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.
Additional table information: table: match_season

Answer: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Forward' INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Defender'


Question:
Which college have both players with position midfielder and players with position defender?
Additional table information: table: match_season

Answer: SELECT College FROM match_season WHERE POSITION = 'Midfielder' INTERSECT SELECT College FROM match_season WHERE POSITION = 'Defender'


Question:
Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
Additional table information: table: match_season

Answer: SELECT College FROM match_season WHERE POSITION = 'Midfielder' INTERSECT SELECT College FROM match_season WHERE POSITION = 'Defender'


Question:
How many climbers are there?
Additional table information: table: climbing

Answer: SELECT COUNT(*) FROM climber


Question:
Count the number of climbers.
Additional table information: table: climbing

Answer: SELECT COUNT(*) FROM climber


Question:
List the names of climbers in descending order of points.
Additional table information: table: climbing

Answer: SELECT Name FROM climber ORDER BY Points DESC


Question:
What are the names of the climbers, ordered by points descending?
Additional table information: table: climbing

Answer: SELECT Name FROM climber ORDER BY Points DESC


Question:
List the names of climbers whose country is not Switzerland.
Additional table information: table: climbing

Answer: SELECT Name FROM climber WHERE Country <> 'Switzerland'


Question:
What are the names of climbers who are not from the country of Switzerland?
Additional table information: table: climbing

Answer: SELECT Name FROM climber WHERE Country <> 'Switzerland'


Question:
What is the maximum point for climbers whose country is United Kingdom?
Additional table information: table: climbing

Answer: SELECT MAX(Points) FROM climber WHERE Country = 'United Kingdom'


Question:
Return the maximum number of points for climbers from the United Kingdom.
Additional table information: table: climbing

Answer: SELECT MAX(Points) FROM climber WHERE Country = 'United Kingdom'


Question:
How many distinct countries are the climbers from?
Additional table information: table: climbing

Answer: SELECT COUNT(DISTINCT Country) FROM climber


Question:
Count the number of different countries that climbers are from.
Additional table information: table: climbing

Answer: SELECT COUNT(DISTINCT Country) FROM climber


Question:
What are the names of mountains in ascending alphabetical order?
Additional table information: table: climbing

Answer: SELECT Name FROM mountain ORDER BY Name ASC NULLS FIRST


Question:
Give the names of mountains in alphabetical order.
Additional table information: table: climbing

Answer: SELECT Name FROM mountain ORDER BY Name ASC NULLS FIRST


Question:
What are the countries of mountains with height bigger than 5000?
Additional table information: table: climbing

Answer: SELECT Country FROM mountain WHERE Height > 5000


Question:
Return the countries of the mountains that have a height larger than 5000.
Additional table information: table: climbing

Answer: SELECT Country FROM mountain WHERE Height > 5000


Question:
What is the name of the highest mountain?
Additional table information: table: climbing

Answer: SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1


Question:
Return the name of the mountain with the greatest height.
Additional table information: table: climbing

Answer: SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1


Question:
List the distinct ranges of the mountains with the top 3 prominence.
Additional table information: table: climbing

Answer: SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3


Question:
What are the different ranges of the 3 mountains with the highest prominence?
Additional table information: table: climbing

Answer: SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3


Question:
Show names of climbers and the names of mountains they climb.
Additional table information: table: climbing

Answer: SELECT T1.Name, T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID


Question:
What are the names of climbers and the corresponding names of mountains that they climb?
Additional table information: table: climbing

Answer: SELECT T1.Name, T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID


Question:
Show the names of climbers and the heights of mountains they climb.
Additional table information: table: climbing

Answer: SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID


Question:
What are the names of climbers and the corresponding heights of the mountains that they climb?
Additional table information: table: climbing

Answer: SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID


Question:
Show the height of the mountain climbed by the climber with the maximum points.
Additional table information: table: climbing

Answer: SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1


Question:
What is the height of the mountain climbined by the climbing who had the most points?
Additional table information: table: climbing

Answer: SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1


Question:
Show the distinct names of mountains climbed by climbers from country 'West Germany'.
Additional table information: table: climbing

Answer: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = 'West Germany'


Question:
What are the different names of mountains ascended by climbers from the country of West Germany?
Additional table information: table: climbing

Answer: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = 'West Germany'


Question:
Show the times used by climbers to climb mountains in Country Uganda.
Additional table information: table: climbing

Answer: SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = 'Uganda'


Question:
What are the times used by climbers who climbed mountains in the country of Uganda?
Additional table information: table: climbing

Answer: SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = 'Uganda'


Question:
Please show the countries and the number of climbers from each country.
Additional table information: table: climbing

Answer: SELECT Country, COUNT(*) FROM climber GROUP BY Country


Question:
How many climbers are from each country?
Additional table information: table: climbing

Answer: SELECT Country, COUNT(*) FROM climber GROUP BY Country


Question:
List the countries that have more than one mountain.
Additional table information: table: climbing

Answer: SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1


Question:
Which countries have more than one mountain?
Additional table information: table: climbing

Answer: SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1


Question:
List the names of mountains that do not have any climber.
Additional table information: table: climbing

Answer: SELECT Name FROM mountain WHERE NOT Mountain_ID IN (SELECT Mountain_ID FROM climber)


Question:
What are the names of countains that no climber has climbed?
Additional table information: table: climbing

Answer: SELECT Name FROM mountain WHERE NOT Mountain_ID IN (SELECT Mountain_ID FROM climber)


Question:
Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.
Additional table information: table: climbing

Answer: SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200


Question:
What are the countries that have both mountains that are higher than 5600 and lower than 5200?
Additional table information: table: climbing

Answer: SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200


Question:
Show the range that has the most number of mountains.
Additional table information: table: climbing

Answer: SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which range contains the most mountains?
Additional table information: table: climbing

Answer: SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the names of mountains with height more than 5000 or prominence more than 1000.
Additional table information: table: climbing

Answer: SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000


Question:
What are the names of mountains that have a height of over 5000 or a prominence of over 1000?
Additional table information: table: climbing

Answer: SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000


Question:
How many body builders are there?
Additional table information: table: body_builder

Answer: SELECT COUNT(*) FROM body_builder


Question:
List the total scores of body builders in ascending order.
Additional table information: table: body_builder

Answer: SELECT Total FROM body_builder ORDER BY Total ASC NULLS FIRST


Question:
List the snatch score and clean jerk score of body builders in ascending order of snatch score.
Additional table information: table: body_builder

Answer: SELECT Snatch, Clean_Jerk FROM body_builder ORDER BY Snatch ASC NULLS FIRST


Question:
What is the average snatch score of body builders?
Additional table information: table: body_builder

Answer: SELECT AVG(Snatch) FROM body_builder


Question:
What are the clean and jerk score of the body builder with the highest total score?
Additional table information: table: body_builder

Answer: SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1


Question:
What are the birthdays of people in ascending order of height?
Additional table information: table: body_builder

Answer: SELECT Birth_Date FROM People ORDER BY Height ASC NULLS FIRST


Question:
What are the names of body builders?
Additional table information: table: body_builder

Answer: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID


Question:
What are the names of body builders whose total score is higher than 300?
Additional table information: table: body_builder

Answer: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300


Question:
What is the name of the body builder with the greatest body weight?
Additional table information: table: body_builder

Answer: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1


Question:
What are the birth date and birth place of the body builder with the highest total points?
Additional table information: table: body_builder

Answer: SELECT T2.Birth_Date, T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC LIMIT 1


Question:
What are the heights of body builders with total score smaller than 315?
Additional table information: table: body_builder

Answer: SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315


Question:
What is the average total score of body builders with height bigger than 200?
Additional table information: table: body_builder

Answer: SELECT AVG(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200


Question:
What are the names of body builders in descending order of total scores?
Additional table information: table: body_builder

Answer: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC


Question:
List each birth place along with the number of people from there.
Additional table information: table: body_builder

Answer: SELECT Birth_Place, COUNT(*) FROM people GROUP BY Birth_Place


Question:
What is the most common birth place of people?
Additional table information: table: body_builder

Answer: SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the birth places that are shared by at least two people?
Additional table information: table: body_builder

Answer: SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2


Question:
List the height and weight of people in descending order of height.
Additional table information: table: body_builder

Answer: SELECT Height, Weight FROM people ORDER BY Height DESC


Question:
Show all information about each body builder.
Additional table information: table: body_builder

Answer: SELECT * FROM body_builder


Question:
List the names and origins of people who are not body builders.
Additional table information: table: body_builder

Answer: SELECT Name, birth_place FROM people EXCEPT SELECT T1.Name, T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id


Question:
How many distinct birth places are there?
Additional table information: table: body_builder

Answer: SELECT COUNT(DISTINCT Birth_Place) FROM people


Question:
How many persons are not body builders?
Additional table information: table: body_builder

Answer: SELECT COUNT(*) FROM people WHERE NOT people_id IN (SELECT People_ID FROM body_builder)


Question:
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.
Additional table information: table: body_builder

Answer: SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200


Question:
What are the total scores of the body builders whose birthday contains the string 'January' ?
Additional table information: table: body_builder

Answer: SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE '%January%'


Question:
What is the minimum snatch score?
Additional table information: table: body_builder

Answer: SELECT MIN(snatch) FROM body_builder


Question:
How many elections are there?
Additional table information: table: election_representative

Answer: SELECT COUNT(*) FROM election


Question:
List the votes of elections in descending order.
Additional table information: table: election_representative

Answer: SELECT Votes FROM election ORDER BY Votes DESC


Question:
List the dates and vote percents of elections.
Additional table information: table: election_representative

Answer: SELECT Date, Vote_Percent FROM election


Question:
What are the minimum and maximum vote percents of elections?
Additional table information: table: election_representative

Answer: SELECT MIN(Vote_Percent), MAX(Vote_Percent) FROM election


Question:
What are the names and parties of representatives?
Additional table information: table: election_representative

Answer: SELECT Name, Party FROM representative


Question:
What are the names of representatives whose party is not 'Republican'?
Additional table information: table: election_representative

Answer: SELECT Name FROM Representative WHERE Party <> 'Republican'


Question:
What are the life spans of representatives from New York state or Indiana state?
Additional table information: table: election_representative

Answer: SELECT Lifespan FROM representative WHERE State = 'New York' OR State = 'Indiana'


Question:
What are the names of representatives and the dates of elections they participated in.
Additional table information: table: election_representative

Answer: SELECT T2.Name, T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID


Question:
What are the names of representatives with more than 10000 votes in election?
Additional table information: table: election_representative

Answer: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000


Question:
What are the names of representatives in descending order of votes?
Additional table information: table: election_representative

Answer: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC


Question:
What is the party of the representative that has the smallest number of votes.
Additional table information: table: election_representative

Answer: SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC NULLS FIRST LIMIT 1


Question:
What are the lifespans of representatives in descending order of vote percent?
Additional table information: table: election_representative

Answer: SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC


Question:
What is the average number of votes of representatives from party 'Republican'?
Additional table information: table: election_representative

Answer: SELECT AVG(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = 'Republican'


Question:
What are the different parties of representative? Show the party name and the number of representatives in each party.
Additional table information: table: election_representative

Answer: SELECT Party, COUNT(*) FROM representative GROUP BY Party


Question:
What is the party that has the largest number of representatives?
Additional table information: table: election_representative

Answer: SELECT Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1


Question:
What parties have at least three representatives?
Additional table information: table: election_representative

Answer: SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3


Question:
What states have at least two representatives?
Additional table information: table: election_representative

Answer: SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2


Question:
List the names of representatives that have not participated in elections listed here.
Additional table information: table: election_representative

Answer: SELECT Name FROM representative WHERE NOT Representative_ID IN (SELECT Representative_ID FROM election)


Question:
Show the parties that have both representatives in New York state and representatives in Pennsylvania state.
Additional table information: table: election_representative

Answer: SELECT Party FROM representative WHERE State = 'New York' INTERSECT SELECT Party FROM representative WHERE State = 'Pennsylvania'


Question:
How many distinct parties are there for representatives?
Additional table information: table: election_representative

Answer: SELECT COUNT(DISTINCT Party) FROM representative


Question:
How many apartment bookings are there in total?
Additional table information: table: apartment_rentals

Answer: SELECT COUNT(*) FROM Apartment_Bookings


Question:
Count the total number of apartment bookings.
Additional table information: table: apartment_rentals

Answer: SELECT COUNT(*) FROM Apartment_Bookings


Question:
Show the start dates and end dates of all the apartment bookings.
Additional table information: table: apartment_rentals

Answer: SELECT booking_start_date, booking_end_date FROM Apartment_Bookings


Question:
What are the start date and end date of each apartment booking?
Additional table information: table: apartment_rentals

Answer: SELECT booking_start_date, booking_end_date FROM Apartment_Bookings


Question:
Show all distinct building descriptions.
Additional table information: table: apartment_rentals

Answer: SELECT DISTINCT building_description FROM Apartment_Buildings


Question:
Give me a list of all the distinct building descriptions.
Additional table information: table: apartment_rentals

Answer: SELECT DISTINCT building_description FROM Apartment_Buildings


Question:
Show the short names of the buildings managed by 'Emma'.
Additional table information: table: apartment_rentals

Answer: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = 'Emma'


Question:
Which buildings does 'Emma' manage? Give me the short names of the buildings.
Additional table information: table: apartment_rentals

Answer: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = 'Emma'


Question:
Show the addresses and phones of all the buildings managed by 'Brenden'.
Additional table information: table: apartment_rentals

Answer: SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = 'Brenden'


Question:
What are the address and phone number of the buildings managed by 'Brenden'?
Additional table information: table: apartment_rentals

Answer: SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = 'Brenden'


Question:
What are the building full names that contain the word 'court'?
Additional table information: table: apartment_rentals

Answer: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE '%court%'


Question:
Find all the building full names containing the word 'court'.
Additional table information: table: apartment_rentals

Answer: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE '%court%'


Question:
What is the minimum and maximum number of bathrooms of all the apartments?
Additional table information: table: apartment_rentals

Answer: SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments


Question:
Give me the minimum and maximum bathroom count among all the apartments.
Additional table information: table: apartment_rentals

Answer: SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments


Question:
What is the average number of bedrooms of all apartments?
Additional table information: table: apartment_rentals

Answer: SELECT AVG(bedroom_count) FROM Apartments


Question:
Find the average number of bedrooms of all the apartments.
Additional table information: table: apartment_rentals

Answer: SELECT AVG(bedroom_count) FROM Apartments


Question:
Return the apartment number and the number of rooms for each apartment.
Additional table information: table: apartment_rentals

Answer: SELECT apt_number, room_count FROM Apartments


Question:
What are the apartment number and the room count of each apartment?
Additional table information: table: apartment_rentals

Answer: SELECT apt_number, room_count FROM Apartments


Question:
What is the average number of rooms of apartments with type code 'Studio'?
Additional table information: table: apartment_rentals

Answer: SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = 'Studio'


Question:
Find the average room count of the apartments that have the 'Studio' type code.
Additional table information: table: apartment_rentals

Answer: SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = 'Studio'


Question:
Return the apartment numbers of the apartments with type code 'Flat'.
Additional table information: table: apartment_rentals

Answer: SELECT apt_number FROM Apartments WHERE apt_type_code = 'Flat'


Question:
Which apartments have type code 'Flat'? Give me their apartment numbers.
Additional table information: table: apartment_rentals

Answer: SELECT apt_number FROM Apartments WHERE apt_type_code = 'Flat'


Question:
Return the first names and last names of all guests
Additional table information: table: apartment_rentals

Answer: SELECT guest_first_name, guest_last_name FROM Guests


Question:
What are the first names and last names of all the guests?
Additional table information: table: apartment_rentals

Answer: SELECT guest_first_name, guest_last_name FROM Guests


Question:
Return the date of birth for all the guests with gender code 'Male'.
Additional table information: table: apartment_rentals

Answer: SELECT date_of_birth FROM Guests WHERE gender_code = 'Male'


Question:
What are dates of birth of all the guests whose gender is 'Male'?
Additional table information: table: apartment_rentals

Answer: SELECT date_of_birth FROM Guests WHERE gender_code = 'Male'


Question:
Show the apartment numbers, start dates, and end dates of all the apartment bookings.
Additional table information: table: apartment_rentals

Answer: SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id


Question:
What are the apartment number, start date, and end date of each apartment booking?
Additional table information: table: apartment_rentals

Answer: SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id


Question:
What are the booking start and end dates of the apartments with type code 'Duplex'?
Additional table information: table: apartment_rentals

Answer: SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = 'Duplex'


Question:
Return the booking start date and end date for the apartments that have type code 'Duplex'.
Additional table information: table: apartment_rentals

Answer: SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = 'Duplex'


Question:
What are the booking start and end dates of the apartments with more than 2 bedrooms?
Additional table information: table: apartment_rentals

Answer: SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2


Question:
Find the booking start date and end date for the apartments that have more than two bedrooms.
Additional table information: table: apartment_rentals

Answer: SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2


Question:
What is the booking status code of the apartment with apartment number 'Suite 634'?
Additional table information: table: apartment_rentals

Answer: SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = 'Suite 634'


Question:
Tell me the booking status code for the apartment with number 'Suite 634'.
Additional table information: table: apartment_rentals

Answer: SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = 'Suite 634'


Question:
Show the distinct apartment numbers of the apartments that have bookings with status code 'Confirmed'.
Additional table information: table: apartment_rentals

Answer: SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Confirmed'


Question:
Which apartments have bookings with status code 'Confirmed'? Return their apartment numbers.
Additional table information: table: apartment_rentals

Answer: SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Confirmed'


Question:
Show the average room count of the apartments that have booking status code 'Provisional'.
Additional table information: table: apartment_rentals

Answer: SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Provisional'


Question:
What is the average room count of the apartments whose booking status code is 'Provisional'?
Additional table information: table: apartment_rentals

Answer: SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Provisional'


Question:
Show the guest first names, start dates, and end dates of all the apartment bookings.
Additional table information: table: apartment_rentals

Answer: SELECT T2.guest_first_name, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id


Question:
What are the guest first name, start date, and end date of each apartment booking?
Additional table information: table: apartment_rentals

Answer: SELECT T2.guest_first_name, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id


Question:
Show the start dates and end dates of all the apartment bookings made by guests with gender code 'Female'.
Additional table information: table: apartment_rentals

Answer: SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = 'Female'


Question:
What are the start date and end date of the apartment bookings made by female guests (gender code 'Female')?
Additional table information: table: apartment_rentals

Answer: SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = 'Female'


Question:
Show the first names and last names of all the guests that have apartment bookings with status code 'Confirmed'.
Additional table information: table: apartment_rentals

Answer: SELECT T2.guest_first_name, T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = 'Confirmed'


Question:
Which guests have apartment bookings with status code 'Confirmed'? Return their first names and last names.
Additional table information: table: apartment_rentals

Answer: SELECT T2.guest_first_name, T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = 'Confirmed'


Question:
Show the facility codes of apartments with more than 4 bedrooms.
Additional table information: table: apartment_rentals

Answer: SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4


Question:
What are the facility codes of the apartments with more than four bedrooms?
Additional table information: table: apartment_rentals

Answer: SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4


Question:
Show the total number of rooms of all apartments with facility code 'Gym'.
Additional table information: table: apartment_rentals

Answer: SELECT SUM(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = 'Gym'


Question:
Find the total number of rooms in the apartments that have facility code 'Gym'.
Additional table information: table: apartment_rentals

Answer: SELECT SUM(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = 'Gym'


Question:
Show the total number of rooms of the apartments in the building with short name 'Columbus Square'.
Additional table information: table: apartment_rentals

Answer: SELECT SUM(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = 'Columbus Square'


Question:
How many rooms in total are there in the apartments in the building with short name 'Columbus Square'?
Additional table information: table: apartment_rentals

Answer: SELECT SUM(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = 'Columbus Square'


Question:
Show the addresses of the buildings that have apartments with more than 2 bathrooms.
Additional table information: table: apartment_rentals

Answer: SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2


Question:
Which buildings have apartments that have more than two bathrooms? Give me the addresses of the buildings.
Additional table information: table: apartment_rentals

Answer: SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2


Question:
Show the apartment type codes and apartment numbers in the buildings managed by 'Kyle'.
Additional table information: table: apartment_rentals

Answer: SELECT T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = 'Kyle'


Question:
What apartment type codes and apartment numbers do the buildings managed by 'Kyle' have?
Additional table information: table: apartment_rentals

Answer: SELECT T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = 'Kyle'


Question:
Show the booking status code and the corresponding number of bookings.
Additional table information: table: apartment_rentals

Answer: SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code


Question:
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings.
Additional table information: table: apartment_rentals

Answer: SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code


Question:
Return all the apartment numbers sorted by the room count in ascending order.
Additional table information: table: apartment_rentals

Answer: SELECT apt_number FROM Apartments ORDER BY room_count ASC NULLS FIRST


Question:
Sort the apartment numbers in ascending order of room count.
Additional table information: table: apartment_rentals

Answer: SELECT apt_number FROM Apartments ORDER BY room_count ASC NULLS FIRST


Question:
Return the apartment number with the largest number of bedrooms.
Additional table information: table: apartment_rentals

Answer: SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1


Question:
What is the apartment number of the apartment with the most beds?
Additional table information: table: apartment_rentals

Answer: SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1