Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
How would your application return the total number of conversations for each user? How would your application return the total number of messages sent to a user? How would the above model differ for a NoSQL database?

What I have tried:

I have attempted a search on this but haven't found an exact concrete answer
Posted
Updated 6-Jan-22 9:02am
v2
Comments
CHill60 6-Jan-22 7:52am    
"I have attempted a search on this but haven't found an exact concrete answer" - you won't because you are supposed to do that work for yourself. You haven't given us the rest of your homework text so we couldn't help (even if we did do others homework for them - which we don't)
Richard MacCutchan 6-Jan-22 7:53am    
And it is unlikely that you will find an exact answer with such a vague question.

1 solution

At a first glance based on your vague input:

The Table with users:
Users
  Id,
  UserThisAndThat

The Tables for the messages:
Messages
  Id
  SendFromUserId
  SendToUserId
  Message

Query example:
SELECT COUNT(*) FROM Messages WHERE SendToUserId = @UserId
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900