We have an operational data store (ODS) that gets loaded nightly from the OLTP system. One of the tables we load is Deal table with the primary key deal_id generated by the OLTP. Now we have a new requirement to allow Deals to be linked into Sales Deals (2..N source deals into 1 Sales Deals). We also have to allow users to group Sales Deals and or source Deals into Liability Deals (2..N Sales or source Deals into 1 Liability Deal). The requirements stated as following:

    Requires Free Membership to View


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.
I'd really appreciate if you could please help me with the database design.

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


This was first published in November 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: