Comprehensive Relational Database Terms and Definitions

Fundamentals of Relation Keys and Attributes

  • Key: Defined as an attribute or a set of attributes that uniquely identifies a row in a table.
  • Key Attribute: An attribute specifically defined by the fact that it is part of a candidate key.
  • Super Key: Represents a set of attributes that uniquely identifies a tuple in a relation.
  • Candidate Key: Described as a minimal superkey; it is a column or a set of columns in a table that can uniquely identify a row.
  • Composite Key: A specific type of candidate key that consists of two or more attributes that work together to uniquely identify a row.
  • Primary Key (PK): A candidate key that has been officially chosen to uniquely identify each row in a table. Under the principles of Entity Integrity, the primary key cannot contain null values.
  • Secondary Key: An attribute or a set of attributes that uniquely identifies a tuple in a relation.
  • Foreign Key (FK): A field, or a collection of fields, located in one table that uniquely identifies a row of another table, thereby establishing a formal link between those two tables.
  • Attribute Domain: The comprehensive set of all possible values that a specific attribute is permitted to take.
  • NULL: A special marker used in SQL to indicate that a specific data value does not exist within the database.

Database Integrity Rules and Constraints

  • Entity Integrity: A critical rule in relational databases specifying that the primary key column(s) cannot contain null values, ensuring every row is uniquely identifiable.
  • Referential Integrity: A rule designed to ensure that relationships between tables remain consistent. This is typically achieved by ensuring that foreign key values refer to primary key values that already exist in the related table.
  • Functional Dependence: A relationship between attributes within a relation where the value of one attribute (or a set of attributes) determines the value of another attribute.

Relational Algebra and Set Operations

  • Relational Algebra: A procedural query language that takes instances of relations as input and yields instances of relations as output. It serves as the formal theoretical basis for relational databases.
  • PROJECT: A relational algebra operation used to select a specific subset of columns from a relation.
  • PRODUCT: A relational algebra operation that combines every individual row of one relation with every individual row of another relation.
  • SELECT (Implicitly referenced via subsetting logic): Not explicitly defined apart from PROJECT, but related to subset operations.
  • DIFFERENCE: A relational algebra operation that returns the tuples that are present in the first relation but not in the second.
  • DIVIDE: Referred to simply as division within the relational algebra context.
  • UNION: A set operator that combines the result sets derived from two or more statements, while simultaneously removing duplicate rows from the final output.
  • INTERSECT: A set operator that returns only the common rows that are found in both tables involved in the operation.

Join Operations and Clauses

  • JOIN: An SQL clause utilized to combine rows from two or more tables based on a related column existing between them.
  • Inner Join: A join operation that returns only those rows where there is a match found in both participating tables.
  • Outer Join: A join operation that returns matching rows as well as rows from one or both tables that do not have a corresponding match in the other table.
  • Left Outer Join: A join operation that returns all rows from the left table and the matching rows from the right table. For rows in the left table with no match in the right table, NULLs are displayed for the right table's columns.
  • Right Outer Join: A join operation that returns all rows from the right table and the matching rows from the left table. For rows in the right table with no match in the left table, NULLs are displayed for the left table's columns.
  • Natural Join: A join operation that links tables based on columns that share the same name and data type, implicitly utilizing an equijoin.
  • Equijoin: A join operation that links tables specifically based on equality between the corresponding columns.
  • Theta Join: A join operation that links tables based on a condition other than simple equality. Examples of such conditions include:
    • >>
    • <<
    • \ge
    • \le
    • \ne

Data Retrieval and Optimization

  • Index: A special lookup table that the database search engine can utilize to significantly speed up the data retrieval process.