I was given an assignment that basically involves performing a SQL query for 2 “indexes” which you can imagine as just 2 categories of things. For example, we were provided a list like this for example:
[“A LA PIPE”, “P GROUP 3”]
And we were asked to basically compare the numeric results that result from inputting each of those String index names into different parts of the query.
My question is how would I design the logic to compare more than just 2 indexes, and to do it in order? For example, if there were 4 total names, how would I compare the results of:
(0, 1) (0,2) (0,3) (0,4) (1, 0) (1, 2) (1,3) (1,4)
In that pattern? Would this involve nested for loops? Basically, saying grab this current value and the value next to it, then run the query? Is this the most efficient way?