Please bare me if my question is too blunt
I am working on a social network where I need to show similar profiles to users
Every profiles has 40 parameters to match with other profiles.
I want to fetch results in a manner that users with maximum similarity with current logged-in user i.e if user has exact same values to other users then they must be shown at top.
After that users with lesser similarities should be shown i.e 39 similarities
I am planning to use 2 tables
[user][table] -> id, name, email, password, username etc [user_values][table] -> It will have 40 columns for all 40 parameters and user_id
Can this be done using single query ?
So we will have 40 values of current login user. Whenever they reach a matches page we should be able to hit a query which will fetch users in order to descending match of columns.
I can change database design/structure if needed.