SWDL3.1 A deal can be linked according to the following rules:
- SWDL3.1.1 A Source Deal can be part of only one Sales Deal link.
- SWDL3.1.2 A Source Deal, that is not linked to a Sales Deal, can be part of only one Liability Deal link.
- SWDL3.1.3 A Sales Deal can be part of only one Liability Deal link. And business users should be able to build ad-hoc queries in a query tool like MSQuery.
Requirement SWDL3.1.1 can be dealt with using a unique constraint.
Requirement SWDL3.1.3 can also be dealt with using a unique constraint.
Requirement SWDL3.1.2 is a bit more of a challenge. Because it requires knowledge of another table's relationships (whether there is a Sales Deal for a given Source Deal), it would need to be implemented as a trigger instead of a constraint.
I don't see any relationship between the requirements and the ability to use any particular query tool. Regardless of how these requirements are implemented, the user should be able to use any query tool that suits them (and is permitted/supported by corporate policy).
For More Information
- Dozens more answers to tough database design questions from Pat Phelan
- The Best Database Design Web Links: tips, tutorials, scripts, and more
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your database design questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.
This was first published in November 2002