Getting Started with InfoSphere Data Architect
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
72 <strong>Getting</strong> started <strong>with</strong> <strong>InfoSphere</strong> <strong>Data</strong> <strong>Architect</strong><br />
Note:<br />
If you see warnings in the Problems view, you are not required to fix warnings to create a<br />
valid, usable logical data model. Warnings simply let you know when certain analyzed items<br />
might be out of compliance or do not conform to standard data modeling rules, but it will not<br />
impact the functionality of the model.<br />
3.5 Constraints<br />
Now that you have created a couple of entities, you should create some constraints.<br />
Constraints are used to enforce business rules for data.<br />
First, let's create a constraint that checks to make sure that the student's graduation date is<br />
later than the student's start date. This check constraint will make sure that your data is<br />
valid when it's entered into the database.<br />
To add a constraint to the STUDENT entity:<br />
1. Locate and select the STUDENT entity in the <strong>Data</strong> Project Explorer: University Info<br />
System -> <strong>Data</strong> Models -> STUDENT_INFO_SYSTEM.ldm -> STUDENT INFO<br />
SYSTEM -> STUDENT.<br />
2. Right-click on the STUDENT entity, then select Add <strong>Data</strong> Object -> Constraint.<br />
3. Name the constraint DATE_CK.<br />
4. Complete the information on the General tab of the Properties view to create a<br />
constraint:<br />
a. Specify SQL as the language.<br />
b. In the Expression field, type GRADUATION_DATE>START_DATE.<br />
c. In the Transform As field, specify Check Constraint. The check constraint<br />
simply checks that the expression is true.<br />
5. Save your work.<br />
3.6 Exercise<br />
Use the process outlined above to expand upon the existing logical data model. Determine<br />
the best data type for each attribute, and document each relationship <strong>with</strong> descriptive<br />
verbs. Consider how each entity is related to other entities in the model.<br />
1. Add another entity, ACTIVITY, to describe the clubs and student organizations that<br />
each student belongs to. You will use this entity as you complete the other<br />
chapters in this book. The entity should include the following required attributes:<br />
• STUDENT ID: Stores the student ID number. This is part of the composite<br />
key.