Specifications
Working with database components
74 InfoMaker
• Indexes
• Database views
• Extended attributes
• Additional database components
Tables and columns
A database usually has many tables, each of which contains rows and columns
of data. Each row in a table has the same columns, but a column’s value for a
particular row could be empty or
NULL if the column’s definition allows it.
Tables often have relationships with other tables. For example, in the EAS
Demo DB included with InfoMaker, the
Department table has a Dept_id
column, and the
Employee table also has a Dept_id column that identifies the
department in which the employee works. When you work with the
Department
table and the
Employee table, the relationship between them is specified by a
join of the two tables.
Keys
Relational databases use keys to ensure database integrity.
Primary keys A primary key is a column or set of columns that uniquely
identifies each row in a table. For example, two employees may have the same
first and last names, but they have unique ID numbers. The
Emp_id column in
the Employee table is the primary key column.
Foreign keys A foreign key is a column or set of columns that contains
primary key values from another table. For example, the
Dept_id column is the
primary key column in the
Department table and a foreign key in the Employee
table.
Key icons In InfoMaker, columns defined as keys are displayed with key
icons that use different shapes and colors for primary and foreign. InfoMaker
automatically joins tables that have a primary/foreign key relationship, with the
join on the key columns.