relation
: tabletuple
: rowrelation instance
: refer to a specific instance of a relation, that is, containing a specific set of rows. The instance ofinstructor
shown in Figure 1 has 12 tuples, corresponding to 12 instructors.relation schema
: always is same torelation instance
.
superkey
: A superkey is a set of one or more attributes that, taken collectively, allow us to identify uniquely a tuple in the relation. For example, the combination of ID and name is a superkey for the relation instructor.candidate keys
: minimal superkeys. Id is candidate key,name + dept_name
is also a candidate key. butid + name
is not a candidate key, because it is not minimal.primary key
: a candidate key that is chosen by the database designer as the principal means of identifying tuples within a relation. For example, in relationclassroom (building, room number, capacity)
,building + room number
is the primary keyforeign-key
: is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in another table. The table with the foreign key is called the referencing/child table, and the table with the primary key is called the referenced/parent table.
join
: Queries can access multiple tables at once, or access the same table in such a way that multiple rows of the table are being processed at the same time. Queries that access multiple tables (or multiple instances of the same table) at one time are called join queries.