I need some help to find the rules and/or query for knowledgebase in Prolog with information about Costumers in a supermarket.
For example I have:
Customer(Name,Age,Sex,Wage).
customer(John,30,M,2000).
customer(Mary,35,F,2500).
customer(Mark,40,M,2500).
invoice(Number, CostumerName, Product, Price).
invoice(001, John, Potatoes, 20).
invoice(002, John, Tomatoes, 10).
invoice(003, Mary, Soap, 50).
invoice(004, Mark, Potatoes, 20).
invoice(005, Mary, Detergent, 15).
Food(Potatoes).
Food(Tomatoes).
CleanProd(Soap).
CleanProd(Detergent).
If I want to find a trend for example, to understand that Female bought more clean products than Male...which kind or what rule and query should I use ?