Hello, I wanted to ask you for help with this endpoint.
All Queries are made to a table that has many fields, each field has a numerical value that represents whether a vote (it is a hotel quality management system) is very good (1), good (2), bad (3) , blank(0) or null(6)
As I attach in this image you can see that each field in the database shows the results well and then I execute some mathematical operations to obtain, based on those results, a satisfaction index according to each of the fields.
So far I'm going well but the problem is that this data also needs to be filtered and grouped according to the nationality of the client, this is indicated in one of the fields of the same table and is a reference to another table where all the nationalities are identified with the same id that appears in the table that I am taking the results from, I have tried to do it with Join but the results that I extract are not correct, can someone help me with another method?
Thank you so much
TABLE_votes
TABLE_countries
FUNCTION_stack
Response