I have an active voting system which essentially comes down to a database table, with columns "votefrom" and "voteto".
Basically, I'm trying to work out an alert system that can detect abuse. One such case if finding a way to detect reciprocating votes (people who have the tendency to mainly vote for each other), or perhaps clusters of such votes.
The ideal outcome would be a list of users, where next to each user, there is a matched user and a percentage, showing that for instance user A is doing 10% of his votes to user B. This obviously in descending order, so that users with most tendency to vote specifically for one other user are on top.
So, my question is, would this be possible in queries alone, or how far can SQL get me?
Any pointers to existing implementations? (preferrably PHP)