human
Schema:
Addresses (Address_ID, address_details)
Locations (Location_ID, Other_Details)
Products (Product_ID, Product_Type_Code, Product_Name, Product_Price)
Parties (Party_ID, Party_Details)
Assets (Asset_ID, Other_Details)
Channels (Channel_ID, Other_Details)
Finances (Finance_ID, Other_Details)
Events (Event_ID, Address_ID, Channel_ID, Event_Type_Code, Finance_ID, Location_ID)
Products_in_Events (Product_in_Event_ID, Event_ID, Product_ID)
Parties_in_Events (Party_ID, Event_ID, Role_Code)
Agreements (Document_ID, Event_ID)
Assets_in_Events (Asset_ID, Event_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the names of products that are in at least two events in ascending alphabetical order of product name.
assistant
SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT( * ) > = 2 ORDER BY T1.Product_Name;
human
What is the product price of men suits?
assistant
SELECT Product_Price FROM Products WHERE Product_Name = 'Men suits';
human
What is the most expensive product price?
assistant
SELECT MAX( Product_Price ) FROM Products;
human
How about the least expensive?
assistant
SELECT MIN( Product_Price ) FROM Products ;