0

I'm trying to make a membership system where users can 'approve' or 'disapprove' another member only once. If they have approved the member previously or disproved the member previously, I want to be able to detect it.

I also want to display the average user approval for each member on their profile. (# of approvals/ # of approval+disapproval received)

I'm thinking of having 2 tables:
1. The `members` table - basic user info
2. The `ratings` table - each row is an entry for when user#1 votes (+ or -) for user#2.

My concern is this:
1. Is this the most efficient way to implement such a system? If not, can you please suggest a better way to do it?
2. Will it take up too much resources if I have to query the ratings table everytime I have to fetch the average rating?

Thanks for helping me. *in advance haha*

2
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by kanaku
0

Eep. Sorry for switching terms... Users are the same as members.

1

[User] table still the same
[Rating] table has (Voter_Member int #, Voted_Member int #, Rating int)
- Composed primary keys (to maintain user can't de\vote user two times)
- Rating int (if you need some higher rating 1 2 3 4 or -1 -2 -3 -4)

Votes + Comments
he saved my tables... haha
0

*googles primary key... 0.0*

So I have to set voted_memberID and voter_memberID as primary keys?

Yey! Thank you so much for the advice. ;-)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.