What are different types of keys?
Types of keys:
(1) Primary key
(2) Composite key
(3) Surrogate key
(4) Foreign key
(5) Secondary key
(1) Primary key – A single attribute is used to uniquely identify an entity in a
table.
(2) Composite key – A combination of two or more attributes is used as a
unique identifier, also known as a composite primary key.
(3) Surrogate key – An additional attribute is used in a table as a primary key
instead of a composite key.
(4) Foreign key – An attribute in a table that references a primary key
attribute in another table.
(5) Secondary key – A non-key attribute used in the search operation.
You might also like to view...
Function arguments are …
A. the term used for the name of the function B. the term that refers to the value returned by a function C. the term that refers to the values passed to the function when the function is invoked. D. the term that refers to a function invocation.
Consider a brokerage firm database with relations Holdings(AccountId, StockSymbol, Price, Quantity) and Balance(AccountId, Balance). Write the triggers for maintaining the correctness of the account balance when stock is bought (a tuple is added to Holdings or Quantity is incremented) or sold (a tuple is deleted from Holdings or Quantity is decremented).
Write both row level and statement level triggers.