Question: What is the average age and how many male students are there in each city?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : age (number) , city_code (text) , sex (text) , stuid (number)


Question: Find the number of students for the cities where have more than one student.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : city_code (text) , stuid (number)


Question: How many students are from each city, and which cities have more than one cities?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : city_code (text) , stuid (number)


Question: Find the first and last name of students who are not in the largest major.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , lname (text) , major (number) , stuid (number)


Question: What is the first and last name of the students who are not in the largest major?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , lname (text) , major (number) , stuid (number)


Question: Find the number of students whose age is older than the average age for each gender.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : sex (text) , age (number) , stuid (number)


Question: How many students are older than average for each gender?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : sex (text) , age (number) , stuid (number)


Question: Find the average age of students living in each dorm and the name of dorm.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : age (number) , stuid (number) | dorm : dorm_name (text) , dormid (number) | lives_in : stuid (number) , dormid (number)


Question: What is the average age for each dorm and what are the names of each dorm?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : age (number) , stuid (number) | dorm : dorm_name (text) , dormid (number) | lives_in : stuid (number) , dormid (number)


Question: Find the number of amenities for each of the dorms that can accommodate more than 100 students.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm : dormid (number) , student_capacity (number) | has_amenity : dormid (number)


Question: For each dorm, how many amenities does it have?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm : dormid (number) , student_capacity (number) | has_amenity : dormid (number)


Question: Find the number of students who is older than 20 in each dorm.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm : dorm_name (text) , dormid (number) | student : stuid (number) , age (number) | lives_in : stuid (number) , dormid (number)


Question: How many students are older than 20 in each dorm?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm : dorm_name (text) , dormid (number) | student : stuid (number) , age (number) | lives_in : stuid (number) , dormid (number)


Question: Find the first name of students who are living in the Smith Hall.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , stuid (number) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) , dorm_name (text)


Question: What are the first names of all students in Smith Hall?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , stuid (number) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) , dorm_name (text)


Question: Find the average age of students who are living in the dorm with the largest capacity.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : age (number) , stuid (number) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) , student_capacity (number)


Question: What is the average age of students who are living in the dorm with the largest capacity?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : age (number) , stuid (number) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) , student_capacity (number)


Question: Find the total number of students living in the male dorm (with gender M).

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : stuid (number) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) , gender (text)


Question: What are the total number of students who are living in a male dorm?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : stuid (number) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) , gender (text)


Question: Find the number of female students (with F sex) living in Smith Hall

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : stuid (number) , sex (text) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) , dorm_name (text)


Question: How many female students live in Smith Hall?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : stuid (number) , sex (text) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) , dorm_name (text)


Question: Find the name of amenities Smith Hall dorm have.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm_amenity : amenity_name (text) , amenid (number) | dorm : dormid (number) , dorm_name (text) | has_amenity : dormid (number) , amenid (number)


Question: What are the names of the amenities that Smith Hall has?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm_amenity : amenity_name (text) , amenid (number) | dorm : dormid (number) , dorm_name (text) | has_amenity : dormid (number) , amenid (number)


Question: Find the name of amenities Smith Hall dorm have. ordered the results by amenity names.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm_amenity : amenity_name (text) , amenid (number) | dorm : dormid (number) , dorm_name (text) | has_amenity : dormid (number) , amenid (number)


Question: What amenities does Smith Hall have in alphabetical order?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm_amenity : amenity_name (text) , amenid (number) | dorm : dormid (number) , dorm_name (text) | has_amenity : dormid (number) , amenid (number)


Question: Find the name of amenity that is most common in all dorms.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm_amenity : amenity_name (text) , amenid (number) | has_amenity : amenid (number)


Question: What is the most common amenity in the dorms?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm_amenity : amenity_name (text) , amenid (number) | has_amenity : amenid (number)


Question: Find the first name of students who are living in the dorm that has most number of amenities.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , stuid (number) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number)


Question: What are the first names of all students who live in the dorm with the most amenities?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , stuid (number) | lives_in : stuid (number) , dormid (number) | dorm : dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number)


Question: Find the name and capacity of the dorm with least number of amenities.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm : dorm_name (text) , student_capacity (number) , dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number)


Question: What is the name and capacity of the dorm with the fewest amount of amenities?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm : dorm_name (text) , student_capacity (number) , dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number)


Question: Find the name of dorms that do not have amenity TV Lounge.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm : dorm_name (text) , dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number) , amenity_name (text)


Question: What are the names of the dorm that does not have a TV Lounge?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm : dorm_name (text) , dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number) , amenity_name (text)


Question: Find the first and last name of students who are living in the dorms that have amenity TV Lounge.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , lname (text) , stuid (number) | lives_in : stuid (number) , dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number) , amenity_name (text)


Question: What are the first and last names of all students who are living in a dorm with a TV Lounge?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , lname (text) , stuid (number) | lives_in : stuid (number) , dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number) , amenity_name (text)


Question: Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , age (number) , stuid (number) | lives_in : stuid (number) , dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number) , amenity_name (text)


Question: What is the first name and age of every student who lives in a dorm with a TV Lounge?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

student : fname (text) , age (number) , stuid (number) | lives_in : stuid (number) , dormid (number) | has_amenity : dormid (number) , amenid (number) | dorm_amenity : amenid (number) , amenity_name (text)


Question: Find the name of amenities of the dorm where the student with last name Smith is living in.

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm_amenity : amenity_name (text) , amenid (number) | dorm : dormid (number) | has_amenity : dormid (number) , amenid (number) | lives_in : dormid (number) , stuid (number) | student : stuid (number) , lname (text)


Question: What are the amenities in the dorm that a student who has the last name of Smith lives in?

student : stuid (number) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (number) , city_code (text) | dorm : dormid (number) , dorm_name (text) , student_capacity (number) , gender (text) | dorm_amenity : amenid (number) , amenity_name (text) | has_amenity : dormid (number) , amenid (number) | lives_in : stuid (number) , dormid (number) , room_number (number)

dorm_amenity : amenity_name (text) , amenid (number) | dorm : dormid (number) | has_amenity : dormid (number) , amenid (number) | lives_in : dormid (number) , stuid (number) | student : stuid (number) , lname (text)


Question: How many customers are there?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)


Question: Count the number of customers.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)


Question: Find the emails and phone numbers of all the customers, ordered by email address and phone number.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : email_address (text) , phone_number (text)


Question: What are the emails and phone numbers of all customers, sorted by email address and phone number?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : email_address (text) , phone_number (text)


Question: Which city has the least number of customers whose type code is "Good Credit Rating"?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : town_city (text) , customer_type_code (text) , customer_id (number)


Question: Return the city with the customer type code "Good Credit Rating" that had the fewest customers.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : town_city (text) , customer_type_code (text) , customer_id (number)


Question: List the name of all products along with the number of complaints that they have received.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_name (text) , product_id (number) | complaints : product_id (number)


Question: What are all the different product names, and how many complains has each received?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_name (text) , product_id (number) | complaints : product_id (number)


Question: Find the emails of customers who has filed a complaints of the product with the most complaints.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : email_address (text) , customer_id (number) | complaints : customer_id (number)


Question: What are the emails of customers who have filed complaints on the product which has had the greatest number of complaints?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : email_address (text) , customer_id (number) | complaints : customer_id (number)


Question: Which products has been complained by the customer who has filed least amount of complaints?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_name (text) , product_id (number) | complaints : product_id (number) , customer_id (number) | customers : customer_id (number)


Question: Return the names of products that have had complaints filed by the customer who has filed the fewest complaints.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_name (text) , product_id (number) | complaints : product_id (number) , customer_id (number) | customers : customer_id (number)


Question: What is the phone number of the customer who has filed the most recent complaint?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : phone_number (text) , customer_id (number) | complaints : customer_id (number) , date_complaint_raised (time)


Question: Return the phone number of the customer who filed the complaint that was raised most recently.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : phone_number (text) , customer_id (number) | complaints : customer_id (number) , date_complaint_raised (time)


Question: Find the email and phone number of the customers who have never filed a complaint before.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : email_address (text) , phone_number (text) , customer_id (number) | complaints : customer_id (number)


Question: What are the emails and phone numbers of custoemrs who have never filed a complaint?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : email_address (text) , phone_number (text) , customer_id (number) | complaints : customer_id (number)


Question: Find the phone number of all the customers and staff.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : phone_number (text) | customers : phone_number (text)


Question: What are the phone numbers of all customers and all staff members?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : phone_number (text) | customers : phone_number (text)


Question: What is the description of the product named "Chocolate"?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_description (text) , product_name (text)


Question: Return the description of the product called "Chocolate".

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_description (text) , product_name (text)


Question: Find the name and category of the most expensive product.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_name (text) , product_category_code (text) , product_price (number)


Question: What is the name and category code of the product with the highest price?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_name (text) , product_category_code (text) , product_price (number)


Question: Find the prices of products which has never received a single complaint.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_price (number) , product_id (number) | complaints : product_id (number)


Question: What are the prices of products that have never gotten a complaint?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_price (number) , product_id (number) | complaints : product_id (number)


Question: What is the average price of the products for each category?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_price (number) , product_category_code (text)


Question: Return the average price of products that have each category code.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

products : product_price (number) , product_category_code (text)


Question: Find the last name of the staff member who processed the complaint of the cheapest product.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : last_name (text) , staff_id (number) | complaints : staff_id (number) , product_id (number) | products : product_id (number) , product_price (number)


Question: What is the last name of the staff member in charge of the complaint on the product with the lowest price?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : last_name (text) , staff_id (number) | complaints : staff_id (number) , product_id (number) | products : product_id (number) , product_price (number)


Question: Which complaint status has more than 3 records on file?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

complaints : complaint_status_code (text)


Question: Return complaint status codes have more than 3 corresponding complaints?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

complaints : complaint_status_code (text)


Question: Find the last name of the staff whose email address contains "wrau".

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : last_name (text) , email_address (text)


Question: What are the last names of staff with email addressed containing the substring "wrau"?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : last_name (text) , email_address (text)


Question: How many customers are there in the customer type with the most customers?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : customer_type_code (text) , customer_id (number)


Question: Count the number of customers that have the customer type that is most common.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : customer_type_code (text) , customer_id (number)


Question: What is the last name of the staff who has handled the first ever complaint?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : last_name (text) , staff_id (number) | complaints : staff_id (number) , date_complaint_raised (time)


Question: Return the last name of the staff member who handled the complaint with the earliest date raised.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : last_name (text) , staff_id (number) | complaints : staff_id (number) , date_complaint_raised (time)


Question: How many distinct complaint type codes are there in the database?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)


Question: Count the number of different complaint type codes.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)


Question: Find the address line 1 and 2 of the customer with email "vbogisich@example.org".

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : address_line_1 (text) , address_line_2 (text) , email_address (text)


Question: What are lines 1 and 2 of the addressed of the customer with the email "vbogisich@example.org"?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : address_line_1 (text) , address_line_2 (text) , email_address (text)


Question: Find the number of complaints with Product Failure type for each complaint status.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

complaints : complaint_status_code (text) , complaint_type_code (text)


Question: Of complaints with the type code "Product Failure", how many had each different status code?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

complaints : complaint_status_code (text) , complaint_type_code (text)


Question: What is first names of the top 5 staff who have handled the greatest number of complaints?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : first_name (text) , staff_id (number) | complaints : staff_id (number)


Question: Return the first names of the 5 staff members who have handled the most complaints.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

staff : first_name (text) , staff_id (number) | complaints : staff_id (number)


Question: Which state has the most customers?

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : state (text) , customer_id (number)


Question: Give the state that has the most customers.

staff : staff_id (number) , gender (text) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | customers : customer_id (number) , customer_type_code (text) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (text) | products : product_id (number) , parent_product_id (number) , product_category_code (text) , date_product_first_available (time) , date_product_discontinued (time) , product_name (text) , product_description (text) , product_price (number) | complaints : complaint_id (number) , product_id (number) , customer_id (number) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (time) , date_complaint_closed (time) , staff_id (number)

customers : state (text) , customer_id (number)


Question: How many submissions are there?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)


Question: Count the number of submissions.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)


Question: List the authors of submissions in ascending order of scores.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , scores (number)


Question: Find the author for each submission and list them in ascending order of submission score.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , scores (number)


Question: What are the authors of submissions and their colleges?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , college (text)


Question: For each submission, show the author and their affiliated college.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , college (text)


Question: Show the names of authors from college "Florida" or "Temple"

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , college (text)


Question: Which authors with submissions are from college "Florida" or "Temple"?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , college (text)


Question: What is the average score of submissions?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)


Question: Compute the average score of submissions.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)


Question: What is the author of the submission with the highest score?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , scores (number)


Question: Find the author who achieved the highest score in a submission.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , scores (number)


Question: Show different colleges along with the number of authors of submission from each college.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : college (text) , submission_id (number)


Question: For each college, return the college name and the count of authors with submissions from that college.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : college (text) , submission_id (number)


Question: Show the most common college of authors of submissions.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : college (text) , submission_id (number)


Question: Which college has the most authors with submissions?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : college (text) , submission_id (number)


Question: Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : college (text) , scores (number)


Question: Which colleges have both authors with submission score above 90 and authors with submission score below 80?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : college (text) , scores (number)


Question: Show the authors of submissions and the acceptance results of their submissions.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , submission_id (number) | acceptance : result (text) , submission_id (number)


Question: For each submission, find its author and acceptance result.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , submission_id (number) | acceptance : result (text) , submission_id (number)


Question: Show the result of the submission with the highest score.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

acceptance : result (text) , submission_id (number) | submission : submission_id (number) , scores (number)


Question: Which submission received the highest score in acceptance result. Show me the result.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

acceptance : result (text) , submission_id (number) | submission : submission_id (number) , scores (number)


Question: Show each author and the number of workshops they submitted to.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , submission_id (number) | acceptance : workshop_id (number) , submission_id (number)


Question: How many workshops did each author submit to? Return the author name and the number of workshops.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , submission_id (number) | acceptance : workshop_id (number) , submission_id (number)


Question: Show the authors who have submissions to more than one workshop.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , submission_id (number) | acceptance : submission_id (number) , workshop_id (number)


Question: Which authors have submitted to more than one workshop?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , submission_id (number) | acceptance : submission_id (number) , workshop_id (number)


Question: Show the date and venue of each workshop in ascending alphabetical order of the venue.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)


Question: Sort the each workshop in alphabetical order of the venue. Return the date and venue of each workshop.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)


Question: List the authors who do not have submission to any workshop.

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , submission_id (number) | acceptance : submission_id (number)


Question: Which authors did not submit to any workshop?

workshop : workshop_id (number) , date (text) , venue (text) , name (text) | submission : submission_id (number) , scores (number) , author (text) , college (text) | acceptance : submission_id (number) , workshop_id (number) , result (text)

submission : author (text) , submission_id (number) | acceptance : submission_id (number)


Question: Find the number of investors in total.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)


Question: Show all investor details.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)


Question: Show all distinct lot details.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)


Question: Show the maximum amount of transaction.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : amount_of_transaction (number)


Question: Show all date and share count of transactions.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : date_of_transaction (time) , share_count (text)


Question: What is the total share of transactions?

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)


Question: Show all transaction ids with transaction code 'PUR'.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : transaction_id (number) , transaction_type_code (text)


Question: Show all dates of transactions whose type code is "SALE".

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : date_of_transaction (time) , transaction_type_code (text)


Question: Show the average amount of transactions with type code "SALE".

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : amount_of_transaction (number) , transaction_type_code (text)


Question: Show the description of transaction type with code "PUR".

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

ref_transaction_types : transaction_type_description (text) , transaction_type_code (text)


Question: Show the minimum amount of transactions whose type code is "PUR" and whose share count is bigger than 50.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : amount_of_transaction (number) , transaction_type_code (text) , share_count (text)


Question: Show the maximum share count of transactions where the amount is smaller than 10000

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : share_count (text) , amount_of_transaction (number)


Question: Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : date_of_transaction (time) , share_count (text) , amount_of_transaction (number)


Question: Show the transaction type descriptions and dates if the share count is smaller than 10.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

ref_transaction_types : transaction_type_description (text) , transaction_type_code (text) | transactions : date_of_transaction (time) , transaction_type_code (text) , share_count (text)


Question: Show details of all investors if they make any transaction with share count greater than 100.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

investors : investor_details (text) , investor_id (number) | transactions : investor_id (number) , share_count (text)


Question: How many distinct transaction types are used in the transactions?

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : transaction_type_code (text)


Question: Return the lot details and investor ids.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

lots : lot_details (text) , investor_id (number)


Question: Return the lot details of lots that belong to investors with details "l"?

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

lots : lot_details (text) , investor_id (number) | investors : investor_id (number) , investor_details (text)


Question: What are the purchase details of transactions with amount bigger than 10000?

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

purchases : purchase_details (text) , purchase_transaction_id (number) | transactions : transaction_id (number) , amount_of_transaction (number)


Question: What are the sale details and dates of transactions with amount smaller than 3000?

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

sales : sales_details (text) , sales_transaction_id (number) | transactions : date_of_transaction (time) , transaction_id (number) , amount_of_transaction (number)


Question: What are the lot details of lots associated with transactions with share count smaller than 50?

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

lots : lot_details (text) , lot_id (number) | transactions_lots : lot_id (number) , transaction_id (number) | transactions : transaction_id (number) , share_count (text)


Question: What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is "PUR"?

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

lots : lot_details (text) , lot_id (number) | transactions_lots : lot_id (number) , transaction_id (number) | transactions : transaction_id (number) , share_count (text) , transaction_type_code (text)


Question: Show the average transaction amount for different transaction types.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : transaction_type_code (text) , amount_of_transaction (number)


Question: Show the maximum and minimum share count of different transaction types.

investors : investor_id (number) , investor_details (text) | lots : lot_id (number) , investor_id (number) , lot_details (text) | ref_transaction_types : transaction_type_code (text) , transaction_type_description (text) | transactions : transaction_id (number) , investor_id (number) , transaction_type_code (text) , date_of_transaction (time) , amount_of_transaction (number) , share_count (text) , other_details (text) | sales : sales_transaction_id (number) , sales_details (text) | purchases : purchase_transaction_id (number) , purchase_details (text) | transactions_lots : transaction_id (number) , lot_id (number)

transactions : transaction_type_code (text) , share_count (text)