Question: Return the staff ids and genders for any staff with the title Department Manager.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_id (number) , staff_gender (text) , staff_id (number) | staff_department_assignments : staff_id (number) , job_title_code (text) , staff_id (number)


Question: For each payment method, return how many customers use it.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : payment_method_code (text) , customer_id (number)


Question: How many customers use each payment method?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : payment_method_code (text) , customer_id (number)


Question: What is the id of the product that was ordered the most often?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_id (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , product_id (number)


Question: Give the product id for the product that was ordered most frequently.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_id (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , product_id (number)


Question: What are the name, phone number and email address of the customer who made the largest number of orders?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_name (text) , customer_phone (text) , customer_email (text) , customer_id (number) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_id (number)


Question: Return the name, phone number and email address for the customer with the most orders.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_name (text) , customer_phone (text) , customer_email (text) , customer_id (number) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_id (number)


Question: What is the average price for each type of product?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_type_code (text) , product_price (number) , product_id (number)


Question: Return the average price for each product type.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_type_code (text) , product_price (number) , product_id (number)


Question: How many department stores does the store chain South have?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) , dept_store_chain_id (number) | department_stores : dept_store_chain_id (number) , dept_store_id (number)


Question: Count the number of stores the chain South has.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) , dept_store_chain_id (number) | department_stores : dept_store_chain_id (number) , dept_store_id (number)


Question: What is the name and job title of the staff who was assigned the latest?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_name (text) , staff_id (number) , staff_id (number) | staff_department_assignments : job_title_code (text) , staff_id (number) , date_assigned_to (time) , staff_id (number)


Question: Return the name and job title of the staff with the latest date assigned.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_name (text) , staff_id (number) , staff_id (number) | staff_department_assignments : job_title_code (text) , staff_id (number) , date_assigned_to (time) , staff_id (number)


Question: Give me the product type, name and price for all the products supplied by supplier id 3.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_type_code (text) , product_name (text) , product_price (number) , product_id (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , supplier_id (number) , product_id (number) | suppliers : supplier_id (number) , supplier_id (number) | supplier_addresses : supplier_id (number) , supplier_id (number)


Question: Return the product type, name, and price for products supplied by supplier 3.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_type_code (text) , product_name (text) , product_price (number) , product_id (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , supplier_id (number) , product_id (number) | suppliers : supplier_id (number) , supplier_id (number) | supplier_addresses : supplier_id (number) , supplier_id (number)


Question: Return the distinct name of customers whose order status is Pending, in the order of customer id.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_name (text) , customer_id (number) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_status_code (text) , order_id (number)


Question: What are the distinct names of customers with an order status of Pending, sorted by customer id?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_name (text) , customer_id (number) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_status_code (text) , order_id (number)


Question: Find the name and address of the customers who have both New and Pending orders.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_name (text) , customer_address (text) , customer_id (number) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_status_code (text) , order_id (number)


Question: What are the names and addressed of customers who have both New and Pending orders?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_name (text) , customer_address (text) , customer_id (number) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_status_code (text) , order_id (number)


Question: Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_id (number) , product_price (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , supplier_id (number) , product_id (number) | suppliers : supplier_id (number) , supplier_id (number) | supplier_addresses : supplier_id (number) , supplier_id (number)


Question: What are the ids of products from the supplier with id 2, which are more expensive than the average price across all products?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_id (number) , product_price (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , supplier_id (number) , product_id (number) | suppliers : supplier_id (number) , supplier_id (number) | supplier_addresses : supplier_id (number) , supplier_id (number)


Question: What is the id and name of the department store that has both marketing and managing department?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

department_stores : dept_store_id (number) , store_name (text) , dept_store_id (number) | departments : dept_store_id (number) , department_name (text) , department_id (number)


Question: What are the ids and names of department stores with both marketing and managing departments?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

department_stores : dept_store_id (number) , store_name (text) , dept_store_id (number) | departments : dept_store_id (number) , department_name (text) , department_id (number)


Question: What are the ids of the two department store chains with the largest number of department stores?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

department_store_chain : dept_store_chain_id (number) , dept_store_chain_id (number) | department_stores : dept_store_chain_id (number) , dept_store_id (number)


Question: Return the ids of the two department store chains with the most department stores.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

department_store_chain : dept_store_chain_id (number) , dept_store_chain_id (number) | department_stores : dept_store_chain_id (number) , dept_store_id (number)


Question: What is the id of the department with the least number of staff?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

departments : department_id (number) , department_id (number) | staff_department_assignments : department_id (number) , staff_id (number)


Question: Return the id of the department with the fewest staff assignments.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

departments : department_id (number) , department_id (number) | staff_department_assignments : department_id (number) , staff_id (number)


Question: For each product type, return the maximum and minimum price.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_type_code (text) , product_price (number) , product_id (number)


Question: What are the maximum and minimum product prices for each product type?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_type_code (text) , product_price (number) , product_id (number)


Question: Find the product type whose average price is higher than the average price of all products.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_type_code (text) , product_price (number) , product_id (number)


Question: What is the code of the product type with an average price higher than the average price of all products?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_type_code (text) , product_price (number) , product_id (number)


Question: Find the id and name of the staff who has been assigned for the shortest period.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_id (number) , staff_name (text) , staff_id (number) | staff_department_assignments : staff_id (number) , date_assigned_to (time) , date_assigned_from (time) , staff_id (number)


Question: What is the id and name of the staff who has been assigned for the least amount of time?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_id (number) , staff_name (text) , staff_id (number) | staff_department_assignments : staff_id (number) , date_assigned_to (time) , date_assigned_from (time) , staff_id (number)


Question: Return the names and ids of all products whose price is between 600 and 700.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_name (text) , product_id (number) , product_price (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , product_id (number)


Question: What are the names and ids of products costing between 600 and 700?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_name (text) , product_id (number) , product_price (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , product_id (number)


Question: Find the ids of all distinct customers who made order after some orders that were Cancelled.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_id (number) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_date (time) , order_status_code (text) , order_id (number)


Question: What are the distinct ids of customers who made an order after any order that was Cancelled?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_id (number) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_date (time) , order_status_code (text) , order_id (number)


Question: What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_id (number) , staff_id (number) | staff_department_assignments : staff_id (number) , date_assigned_to (time) , job_title_code (text) , staff_id (number)


Question: Return the id of the staff whose Staff Department Assignment was earlier than that of any Clerical Staff.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_id (number) , staff_id (number) | staff_department_assignments : staff_id (number) , date_assigned_to (time) , job_title_code (text) , staff_id (number)


Question: What are the names and ids of customers whose address contains TN?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_name (text) , customer_id (number) , customer_address (text) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_id (number)


Question: Return the names and ids of customers who have TN in their address.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_name (text) , customer_id (number) , customer_address (text) , customer_id (number) | customer_addresses : customer_id (number) , customer_id (number) | customer_orders : customer_id (number) , order_id (number)


Question: Return the name and gender of the staff who was assigned in 2016.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_name (text) , staff_gender (text) , staff_id (number) , staff_id (number) | staff_department_assignments : staff_id (number) , date_assigned_from (time) , staff_id (number)


Question: What are the names and genders of staff who were assigned in 2016?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_name (text) , staff_gender (text) , staff_id (number) , staff_id (number) | staff_department_assignments : staff_id (number) , date_assigned_from (time) , staff_id (number)


Question: List the name of staff who has been assigned multiple jobs.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_name (text) , staff_id (number) , staff_id (number) | staff_department_assignments : staff_id (number) , staff_id (number)


Question: What are the names of staff who have been assigned multiple jobs?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

staff : staff_name (text) , staff_id (number) , staff_id (number) | staff_department_assignments : staff_id (number) , staff_id (number)


Question: List the name and phone number of all suppliers in the alphabetical order of their addresses.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

suppliers : supplier_name (text) , supplier_phone (text) , supplier_id (number) , supplier_id (number) | supplier_addresses : supplier_id (number) , address_id (number) , supplier_id (number) | product_suppliers : supplier_id (number) , product_id (number) | addresses : address_id (number) , address_details (text) , address_id (number) | customer_addresses : address_id (number) , customer_id (number)


Question: What are the names and phone numbers for all suppliers, sorted in alphabetical order of their addressed?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

suppliers : supplier_name (text) , supplier_phone (text) , supplier_id (number) , supplier_id (number) | supplier_addresses : supplier_id (number) , address_id (number) , supplier_id (number) | product_suppliers : supplier_id (number) , product_id (number) | addresses : address_id (number) , address_details (text) , address_id (number) | customer_addresses : address_id (number) , customer_id (number)


Question: What are the phone numbers of all customers and suppliers.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_phone (text) , customer_id (number) | suppliers : supplier_phone (text) , supplier_id (number)


Question: Return the phone numbers for all customers and suppliers.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

customers : customer_phone (text) , customer_id (number) | suppliers : supplier_phone (text) , supplier_id (number)


Question: Return the ids of all products that were ordered more than three times or supplied more than 80000.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_id (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , total_amount_purchased (text) , product_id (number)


Question: What are the ids of all products that were either ordered more than 3 times or have a cumulative amount purchased of above 80000?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_id (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , total_amount_purchased (text) , product_id (number)


Question: What are id and name of the products whose price is lower than 600 or higher than 900?

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_id (number) , product_name (text) , product_price (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , product_id (number)


Question: Give the ids and names of products with price lower than 600 or higher than 900.

addresses : address_id (number) , address_details (text) | staff : staff_id (number) , staff_gender (text) , staff_name (text) | suppliers : supplier_id (number) , supplier_name (text) , supplier_phone (text) | department_store_chain : dept_store_chain_id (number) , dept_store_chain_name (text) | customers : customer_id (number) , payment_method_code (text) , customer_code (text) , customer_name (text) , customer_address (text) , customer_phone (text) , customer_email (text) | products : product_id (number) , product_type_code (text) , product_name (text) , product_price (number) | supplier_addresses : supplier_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_addresses : customer_id (number) , address_id (number) , date_from (time) , date_to (time) | customer_orders : order_id (number) , customer_id (number) , order_status_code (text) , order_date (time) | department_stores : dept_store_id (number) , dept_store_chain_id (number) , store_name (text) , store_address (text) , store_phone (text) , store_email (text) | departments : department_id (number) , dept_store_id (number) , department_name (text) | order_items : order_item_id (number) , order_id (number) , product_id (number) | product_suppliers : product_id (number) , supplier_id (number) , date_supplied_from (time) , date_supplied_to (time) , total_amount_purchased (text) , total_value_purchased (number) | staff_department_assignments : staff_id (number) , department_id (number) , date_assigned_from (time) , job_title_code (text) , date_assigned_to (time)

products : product_id (number) , product_name (text) , product_price (number) , product_id (number) | order_items : product_id (number) , order_item_id (number) | product_suppliers : product_id (number) , product_id (number)