Design And Implement Database Objects Flashcards
What is the mathematical definition of a relation?
Requires that you have no duplicated rows
TODO: Need better definition here
What are the criteria for first normal form?
- All Columns must be atomic - that is, each column should represent one value
- All rows of the table must contain the same number of values - no arrays
What is a surrogate key?
This is a artificial key that is normally used to provide performant uniqueness for a table row.
What is a natural key?
A unique values or unique combination of values that appear in row data that uniquely define the row.
What is Boyce-Codd Normal Form?
Every candidate key is identified, all attributes are fully dependent on a key, all columns must identify a fact about a key and nothing but a key.
What is second normal form
All attributes must be a fact about the entire primary key and not any non-primary key attributes.
What is third normal form?
All attributes must be a fact about the entire primary key and not any non-primary key attributes.
Would the following columns fit second normal form?
SKU (Key column 1) Location (Key column 2) ItemDisplayName ItemPrice PriceDate
No - this is because Item Display Name describes the SKU and is not specific to where the Item is sold.
No - because prices change over time. Either the PriceDate needs to be included in the Key or the price and price date need to be split out to another table.
TODO - Need a example question that differentiates between 2NF And 3NF
Need answer
What is a schema used for?
This is used to group together objects for security and logical ordering
What is Pascal-casing?
A naming convention what all the words are leading character capitalized and words are concatenated.
ItemPrice
PriceDate
CreateDateTime
What is camel casing?
A naming convention where the first word is all lower cases and subsequent word have the leading character uppercased. Also all words are concatenated.
itemPrice
priceDate
createDateTime
Note - this is for information purposes only. Probably won’t be on the exam.
What are the elements of a four part naming schema?
Server.Database.Schema.Object