0

I have the following columns for a simple request/action process between two users:

request_type
request_to
request_by
request_msg
request_time

and

action_type
action_by
action_msg
action_time

The top reply from When we need to use 1-to-1 relationship in database design? suggests my example does not fit any of the reasons accepted for partitioning here. However, I still find myself wondering whether these two sets of columns should belong in the same table because:

  • the process is essentially two row inserts, but with the latter having to be applied using an update because the table contains both sets of columns
  • each set cannot be updated, so two tables would lend itself to denying update privileges
  • half the table is null fields while the action is pending
  • while directly related, they still feel like two semantically different user actions

Thanks for any thoughts.

Community
  • 1
  • 1
videocakes
  • 57
  • 2
  • 5

1 Answers1

0

You could have two tables, one for requests and one for actions.

request
=======
request_id (primary key identity(1,1))
request_type (fk to type table)
request_to (fk to user table)
request_by (fk to user table)
request_msg 
request_time (default getdate())

action
======
action_id (primary key identity(1,1))
request_id (fk to request table)
action_type (fk to type table)
action_by (fk to user table)
action_msg 
action_time (default getdate())
Chris Gessler
  • 22,727
  • 7
  • 57
  • 83