Chapter 2
2.2 Entity:
One theme or topic; something of importance to a user that needs to be represented in a database. In the entity-relationship model, entities are restricted to things that can be represented by a single table. An example of this is in the EMPLOYEE table; data about the entity (the employee) is in the table rows and data about the entity’s attributes are in the rows.
2.3 List the characteristics a table must have to be a relation: * Each row of the table holds data that pertain to some entity or a portion of some entity * Each column contains data of the attributes of the entity * The cells must hold a single value; no repeating elements * All of the entries in any column must be the same kind * Each column must have a unique name and the column order is unimportant * The order of the rows in unimportant * No two rows in the table may hold identical data values
2.10 Define the term unique key and give an example:
A key that defines a unique row. An example of a unique key in the EMPLOYEE table is EmployeeNumber; the query of any EmployeeNumber (223 for example) will only produce a single row and data for one employee.
2.11 Non-unique key:
A key that potentially identifies more than one row. In the EMPLOYEE table from our book, Department is a non-unique key because it identifies several rows.
2.12 Give an example of a relation with a unique composite key:
A composite key contains two or more attributes. An example of a unique composite key in the EMPLOYEE table is if we combined LastName, FirstName, and Department as a key; these three attributes combined would insure that we would identify only one row.
2.13 Explain the difference between a primary key and a candidate key:
Candidate keys are keys that uniquely identify each row in a relation. They can be single or composite. The primary key is the candidate key that is chosen as the key that the DBMS