1 Replies - 280 Views - Last Post: 30 May 2019 - 07:36 AM

#1 eyfrans   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 29-March 19

How could I save a "x" amount of users as column of a table?

Posted 30 May 2019 - 01:00 AM

Hey everyone,

I apologize for the vague title but I couldn't really figure out anything better/more insightful than that, I'll go ahead and explain my problem a little better here in the post content.

So my situation is:

I have a User table which holds basic infos about users (id_user, name, surname, email, password).
I have a Assignment table which holds other basic infos about assignments (id_assignment, id_user (foreign key), title, content, status (has it been graded yet?)).
I also have a Grade table that holds infos about a grading (id_paper (foreign key), id_user (foreign key), grade, comments).

Now here comes my problem, I need to have a List of users be able to submit a grade for the assignment, only those in that list can do so.
In my server side code I just have a List<User> grader_users in my Assignment class that I would ideally populate with a DB query.

Finally, question is: How do I properly store the List of users who are allowed to grade this assignment in the database? I was thinking about creating a new column under Assignment and saving somewhat of a list there but after a quick google search it looks like it's bad practice.

So how do I go from here? Do I need to create a new table?

Thanks for reading and feel free to ask any question in case I was not clear enough in my explanation.

Is This A Good Question/Topic? 0
  • +

Replies To: How could I save a "x" amount of users as column of a table?

#2 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2873
  • View blog
  • Posts: 11,236
  • Joined: 03-December 12

Re: How could I save a "x" amount of users as column of a table?

Posted 30 May 2019 - 07:36 AM

RBAC
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1