|
|
|
|
|
- Overview
- Unique key
- Key with duplicates
- Primary key
- Spatial key
- Simple key or composite key
Keys are specific items in the data files of an analysis. These items are used to: - easily identify the records. For example, in a "Product" data file, the reference identifies the product. This reference is unique for each product.
- organize the data stored in a data file. For example, a key defined on the "Name" item of the "Customer" data file will allow you to quickly sort the records of the data file by name.
Several types of keys can be defined in a data file A unique key is a key for which there can only be one value in the data file. For example, in a "PRODUCT" data file, each product is identified by a unique reference. The "REFERENCE" item must be a unique key. Remarks: - If no item can be defined as a unique key, use an item of type "Automatic ID". For each record, the value of this item will be a unique integer.
- Unique key with NULL as default value: When used in the index of String items, the NULL value is considered as an empty string (""), and as 0 when used in Numeric items. Therefore, unique keys cannot contain NULL values.
A key with duplicates is a key for which there can be several identical values in the data file. For example, in the "Customer" data file, you can define a key with duplicates on the "NAME" item. The content of this key can be the same in different records (e.g. for homonyms). This key enables you to perform a search by customer name. A primary key is a unique key that cannot be Null. Only one primary key can be defined for a data file. For example, in the "PRODUCT" data file, you can define a primary key on the "REFERENCE" item. Each product is identified by a unique, non-null reference. A spatial key is a key defined on an item containing spatial data ("Geographic data" or "Geometric data"). For example, in the "MUNICIPALITY" data file, it is possible to define a spatial key for the "Geometry" item corresponding to the municipality's geographic data (latitude and longitude). Each municipality is represented by a multipolygon. Simple key or composite key A simple key is a key defined on an item. A composite key is used to define a key on several items of the same data file. This key will allow access to the records of the data file based on the combined value of two items. For example, to simplify the order search, you can define a composite key containing the "Customer Number" and "Order Date" items. Note: A composite key can be: - A unique key,
- A key with duplicates,
- A primary key. In this case, none of the components of the key should support the "Null" value.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|