Databases
Definition of the Primary key,Foreign Key,Null and Domain.
Primary Key
A primary key is one or more columns in a table whose values are used to uniquely identify each of the rows in that table.
Foreign Key
A Foreign Key is a column or group of columns that draws its value from a domain of the primary key in a related table. And/or a FK is the means of connecting tables in a database and some explanation of how it does this.
Example:-List attributes for the new entity ‘Film-Role’, clearly identifying the primary and foreign keys.
The attributes for the line-item entity would be:
- FilmRoleNo (PK)-accept unique name
- ActorID (FK)
- FilmID (FK)
OR
ActorID, FilmID as a concatenated PK with both attributes also being FKs.
Domain
A domain is a pool of valid values from which the actual values of a column are drawn.
Null
Indication that a value is unknown
briefly describe a relation as used in the relational data model.
A relation is a table that obeys a specific set of rules.
Describe the rules that a relation must obey in the context of the relational data model.
- Every relation in a single database must have a distinct name.
- Every column in a relation must have a distinct name in that relation.
- All entries in a column must be of the same type.
- The ordering of columns has no significance.
- Duplicate rows are not allowed.
- The ordering of rows has no significance.
- Each cell can only contain an atomic value (no multiple values in a single cell).
Post a Comment
0 Comments
Keyword Enter Here