User Guide > Data Discovery > Project Tables
  

Project Tables

You can view the source tables in a project. You can view the primary keys and foreign keys in each table.
Click the Discover | Tables view to see the data source tables in the project. You can filter the list of tables by the table name or by the description.
Click the table name to view the table properties in the General Properties pane. View the columns in the table in the Columns view. Test Data Manager also shows the child tables in the Relationship Overview pane.

Table Classification

You can assign a classification to source tables to identify what kind of data the table contains. The classification does not affect profile operations. You can filter tables by this classification when you create entities or plans.
In the Discover | Tables view, select the tables that you want to assign a classification to. Choose one of the following table classifications:
For example, you might want to know which tables are master tables when you determine which tables are driving tables for entities. You might want to configure more filter criteria for tables that contain transactions or logs.

Constraints

Foreign key constraints define parent-child relationships between the source tables. Use constraints to determine the tables to include in a data subset. You can also limit the values that you want to store in the data subset table columns.
When you create a data entity, you select one table for the entity. The table that you select is the entity driving table. Test Data Manager adds other tables to the entity based on the constraints for the driving table.
Use data discovery to find relationships between tables. When you identify the relationships that you want to add to the TDM repository, create and edit constraints in Test Data Manager.
The following types of constraints define relationships between tables in an entity:
Primary Key
A column or combination of columns that uniquely identifies a row in a data source. A table can have one primary key.
Logical Manual
A parent-child relationship between tables based on columns that are not keys. You can create the following logical constraints:

Major and Minor Constraint Severity

When you define a foreign key constraint, configure the constraint severity as major or minor. The severity determines the scope of the data that a data subset receives based on the constraints. You can change the severity to change the final output of a subset operation. The constraint severity level does not affect the structure of an entity. You can change the severity level for a constraint after you create an entity. You can also change the severity level at run time in a subset plan. Doing this does not change the severity levels in the entity.
Major constraints are constraints that move in both directions, child to parent and parent to child. When you want the parent table to select additional child records that are related to the parent, assign a major constraint between two tables.
When you define a constraint, you define it on the child table. When you define a constraint with a major severity level, all of the children of the parent are included in the data subset. For example, you define a constraint between Customer and Leads. Customer is the parent table. You create a filter on Leads to return only high-quality leads. The subset receives the customer for a high-quality lead, but it also receives all the leads for the customer. This major constraint honors referential and transactional integrity. You can apply only such a major constraint from within an entity.
The child record selected for the subset operation pulls in related parent records from both parent tables. The parent records select all the related child records from the child table. As more records are selected in the child table, the related parent records are selected again. This is because the records selected by one parent in the child table might refer to parent records in another parent that is not a part of the subset. This process continues in a loop until there are no more related records to select.
To configure a subset operation that aims to exclude additional data, you can select the Referential Integrity Only option in a plan at run time. When you select this option, the data included remains referentially intact, but this option does not guarantee that the subset will include all child records pertaining to a parent. Therefore, the subset operation might not maintain transactional integrity.
When you change the constraint definition at run time, the relations set in the entity do not change.
Minor constraints are unidirectional constraints, from child to parent. Minor constraints do not move in the reverse direction from parent to child. When you do not want the parent table to select additional child table records that are related to the parent, assign a minor constraint between two tables.
When you define a constraint with a minor severity level, the parent row is included in the data subset, but the data subset does not receive all of the children of the parent row. From the example above, the data subset receives the high-quality leads and the customers for the high-quality leads.
If the schema has constraints that form cycles, or if the schema has objects that have more than one major parent constraint, TDM performs recursive evaluation to calculate the subset. TDM needs a staging connection to perform recursive evaluation. You must therefore create a staging connection to perform subset operations on tables with cyclic or tending to cyclic constraints. It is recommended that you use the source connection as the staging connection.

Manually Add Keys to Tables in a Project

You can manually add primary keys and foreign keys to tables to establish relationships between tables for data subset operations. When you manually add keys, you do not need to run a primary key discovery profile.
When you add keys, you define constraints for data subset, data masking, and data generation operations in the project. You do not update the source database.
You can add the following types of keys constraints:
Primary Key
You can add one column or column combination as the primary key for a table. A primary key column cannot contain null or duplicate values. You cannot add more than one primary key constraint.
Foreign Key
Add a column or column combination as a foreign key in a table. When you define a constraint, you define a foreign key in a table and relate it to a column in a parent table.
Unique Key
Add a column or set of columns as a constraint to define a unique key in a table. A unique key column can contain null values. You can create more than one unique key in table. You can perform multiple data generation assignments when you filter the columns based on unique keys.
Conditional
Add a conditional constraint to perform a data generation operation. Create a conditional constraint to restrict the data that you want to generate in a column based on the data in another column. The conditional constraint that you enter becomes a part of the metadata of the target table. Configure expressions to apply constraints at the table level.

Creating a Primary Key Constraint

You can add a logical primary key to a table to create table relationships for data subset.
    1. In a project, click the Discover | Tables view.
    2. Click a table name to select the table.
    3. Click Constraints.
    4. Click Create New Constraint.
    The New Constraint dialog box appears.
    5. Select Primary Key.
    6. Click Next.
    7. To add the columns, click Add. Select a column for which you want to add a primary key constraint.
    8. Click Finish.

Creating a Logical Relationship Between Tables

You can add a logical foreign key to a table to create a table relationship for data subset. Choose a column from a parent table to establish a key relationship between the tables.
    1. In a project, click Discover > Tables.
    2. Click the table in which you want to create the foreign key.
    3. Click the Constraints tab.
    4. Click Create New Constraint.
    5. Enter the constraint properties.
    The following table describes the constraint properties:
    Property
    Description
    Name
    Constraint identifier.
    Constraint Type
    Select the constraint type as Foreign Key.
    When you want to perform a data generation operation, you select the constraint type as Conditional.
    Severity Level
    Choose one of the following values:
    • - Major. The relationship includes the parent table and it includes the other children of the parent.
    • - Minor. The relationship includes the parent table but it does not include the other children of the parent.
    Parent Table
    Choose the parent table to establish the foreign key with.
    Enable Constraint
    Enable the foreign key relationship.
    6. Click Next.
    A list of the columns in the table appears in the left panel. A list of the columns in the parent table appears in the right pane.
    7. Click a child column from the left pane. Click a parent column from the right pane. Click the Link icon to map the parent-child relationship.
    8. Click Finish.

Creating a Unique Key Constraint

You can add a unique key to a table to create table relationships for data subset and to perform bulk generation rule assignments at a time.
    1. In a project, click the Discover | Tables view.
    2. Click a table name to select the table.
    3. Click Constraints.
    4. Click Create New Constraint.
    The New Constraint dialog box appears.
    5. Select Unique Key.
    6. Click Next.
    7. To add the columns, click Add. Select the column for which you want to add a unique key constraint.
    8. Click Finish.

Creating a Conditional Constraint

Create a conditional constraint to restrict the data generated in a column based on the data in another column. Configure an expression to create a conditional constraint.
    1. In a project, click Discover > Tables.
    2. Click the table in which you want to create the conditional constraint.
    3. Click the Constraints tab.
    4. Click Create New Constraint.
    The New Constraint dialog box appears.
    5. Enter a name for the conditional constraint.
    6. Select the constraint type as Conditional.
    7. Click Next.
    8. Create an expression in the Expression Builder. Select the required columns, functions, variables, and operators to build expressions.
    9. Click Finish.