title: Design of MySQL DB to avoid having a table with mutually exclusive fields
body: <p>I'm creating a new DB and I have this problem: I have two type of users that can place orders: registered users (that is, they have a login) and guest users (that is, no login). The data for registered users and guest users are different and that's why I'm thinking of using two different tables, but the orders (that share the same workflow) are all the same, so I'm thinking about using only one table. </p>
  
  <p>I've read <a href="https://stackoverflow.com/questions/24/throw-error-in-mysql-trigger">here</a> and <a href="https://web.archive.org/web/20180330233216/http://www.brokenbuild.com/blog/2006/08/15/mysql-triggers-how-do-you-abort-an-insert-update-or-delete-with-a-trigger/" rel="nofollow noreferrer">here</a> (even if I don't understand fully this example) that I can enforce a MySQL rule to have mutually exclusive columns in a table (in my case they'd be "idGuest" and "idUser") but I don't like that approach.</p>
  
  <p>Is there a better way to do it?</p>