Database Fundamentals/Constraints

From Wikiversity
Jump to navigation Jump to search

This lesson introduces constraints.

Objectives and Skills[edit]

Objectives and skills for the constraints portion of Microsoft Exam 98-364 Database Fundamentals include:[1]

  • Understand data storage
    • Understand primary, foreign, and composite keys
      • Understand the reason for keys in a database, choose appropriate primary keys, select appropriate data type for keys, select appropriate fields for composite keys, understand the relationship between foreign and primary keys

Readings[edit]

  1. Wikipedia: Database constraint

Multimedia[edit]

  1. Microsoft Virtual Academy: Relational Concepts
  2. YouTube: Database Objects

Activities[edit]

  1. Use SQL Server to create constraints to# update record information in the Student table in your College database.
  2. Create the following constraints:

Lesson Summary[edit]

  • A composite primary key containing at least one compound key with at least one other attribute or simple key (this is an extension of a compound key).[2]
  • A foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table.[3]
  • Foreign keys are defined in the ISO SQL Standard through a FOREIGN KEY constraint.[4]
  • The key that is selected as the primary key. Only one key within an entity is selected to be the primary key. This is the key that is allowed to migrate to other entities to define the relationships that exist among the entities. When the data model is instantiated into a physical database, it is the key that the system uses the most when accessing the table, or joining the tables together when selecting data.[5]
  • A unique key is a set of zero, one, or more attributes in database relational modeling and implementation.[6]

Key Terms[edit]

composite primary key
foreign key
foreign key constraint
primary key
unique key constraint

See Also[edit]

References[edit]

Nuvola apps edu miscellaneous.svg Type classification: this is a lesson resource.