24.12.2012 Views

ER/Studio - Embarcadero Technologies Product Documentation

ER/Studio - Embarcadero Technologies Product Documentation

ER/Studio - Embarcadero Technologies Product Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

USING <strong>ER</strong>/STUDIO > DEVELOPING THE LOGICAL MODEL<br />

Data Movement Rules tab<br />

Displays the data movement rules that have be assigned to the attribute. Allows you to override the default rules<br />

assigned to the table/entity in the Data Movement Rules editor of the Data Dictionary. Here you can apply or<br />

remove data movement rules. The Data Movement rule could be something like “Data for this table is updated<br />

after 30 days.” For more information, see Relating Source and Target Tables and Columns.<br />

Notes<br />

• Choosing the correct datatype is a critical data integrity and storage consideration. Select a datatype that is<br />

efficient for its intended use but properly accommodates the data it stores. Your choice of database platform<br />

dictates your choice of column datatypes because each has its own set of datatypes. For example, some<br />

databases have binary datatypes; others do not. Some provide support for blobs and text, but many do not.<br />

Finally, only a few databases support user-defined datatypes. <strong>ER</strong>/<strong>Studio</strong> can convert datatypes between different<br />

databases; however, some conversions can only be approximations.<br />

• Another important consideration in specifying datatypes is determining the appropriate width, precision and<br />

scale, as applicable. You want to store data efficiently, but not at the expense of completeness, accuracy or<br />

precision.<br />

• For information on datatype mapping, see Customizing Datatype Mappings. If you want to enforce datatypes<br />

across common columns, use Data Dictionary Domains. For more information, see Reusing Attribute Definitions<br />

Using Domains.<br />

• When determining attribute and column names, make sure you consider the naming rules of the target database.<br />

Some key considerations are name length, avoiding the use of reserved words, and prohibited characters. Most<br />

databases restrict name lengths to 30 or 18 characters. All have reserved key words that cannot be used in<br />

names unless surrounded by quotes. Certain characters, such as a space, *, +, and % are also prohibited from<br />

being used in names.<br />

• You can specify naming rules, the default datatype and whether NULL values are permitted for the attributes<br />

created with the default datatype on the Logical tab of the Options Editor. Select Tools > Options > Logical.<br />

• You can specify the order in which the attributes appear on the Display tab of the Options Editor. Select Tools ><br />

Options > Display.<br />

• You can specify the level of synchronization between the attribute and column names on the Name Handling tab<br />

of the Options Editor. Select Tools > Options > Name Handling.<br />

• The status bar at the bottom right of the application window displays the number of entities in the selected model.<br />

Creating and Editing Keys<br />

The purpose of keys in a database is to enforce unique values in an entity and provide a means of sorting the tables to<br />

access entity data faster.<br />

In a relational database, there are four types of keys:<br />

• Primary Key: A primary key or unique key is a candidate key to uniquely identify each row in a table. A primary<br />

key comprises a single column or set of columns where no two distinct rows in a table can have the same value<br />

(or combination of values) in those columns. Depending on its design, a table can have many unique keys but at<br />

most one primary key. A unique key must uniquely identify all possible rows that exist in a table and not only the<br />

currently existing rows, such as social security numbers. A primary key is a special case of a unique key in that<br />

for unique keys the implicit NOT NULL constraint is not automatically enforced, while for primary keys it is. The<br />

values in a unique key column may or may not be NULL. Unique keys as well as primary keys can be referenced<br />

by foreign keys.<br />

• Alternate Key: Alternate keys are non-unique keys in a database, such as name and date of birth in an employee<br />

database.<br />

EMBARCAD<strong>ER</strong>O TECHNOLOGIES > <strong>ER</strong>/STUDIO® 8.0.3 US<strong>ER</strong> GUIDE 128

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!