Looking for a bit of advice from anyone who has created a quoted and ordering system.
In this particular case, the purpose of our system is to allow users to place orders and quotes for bathroom partitions.
At this point, my development team hasn't been able to agree on a solid schema design. Everyone is arguing over it.
This is a very simple relationship with a few tables.
A Project can have many rooms (with bathroom partitions)
A Project can have 1 To N Quotes - which is a selection of 1 to N Rooms. Rooms can be quoted more than once.
A Project can have 1 to N Orders - also a selection of 1 to N Rooms. Rooms can't be ordered more than once.
An order could be linked to a quote, but that relationship is not required to be established by the User This relationship is for the purposes of knowing what quote has been ordered.
The problem is that a quote is just an estimate and it doesn't ever match what is being ordered. Users will often work on the Rooms of a project over a period of time, verify all the measurements, and then place an order. In addition, some users will just order and not ever quote. Forcing the user to always create a quote before ordering is not an option.
As you can probably guess the quotes and orders tables are 90% identical.
Here are the arguments from various members of my team.
One application developer wants to enforce a polymorphic approach on the DB and doesn't like the use of nulls in any table. She is using an ORM (nHibernate). The proposal from the developer is to create an intermediate table that combines all the similar data between quotes and orders and then extend that table with 1 to 1 relationships. For example Table X has 1 to 1 relationship with Orders and Table X has a 1 to 1 relationship with Quotes. This will also speed up development since the code for quoting and ordering screens would be identical.
The other approach is to keep the Orders and Quotes tables separate for the sake of readability (for data warehousing, reporting etc. ). This means that the fields in each table would be 95% identical. This design would allow the tables to evolve in their own separate ways over time. It might also mean that the quoting and ordering screen application code would be redundant as well.
Another polymorphic approach is to make the Orders table an extension of the Quotes table. This means that if a project is ordered a Quote record would be created and an Order record would be created. There would be a 1 to 1 between quotes and orders.
The final option is to make one table (call it "Stakes" or "OrdersAndQuotes") that is used for both,. This table would have a field to identify if it's a quote or an order, but it would make use of nulls appropriately for each use.
IMO, I like option #2 or # 4, because I see no reason for enforcing polymorphic design principles on a database schema. Also why add in a bunch of extra joins when it's not needed. Lastly, nulls are OK.