CS200 Final exam correct 100%
Can a tables primary key also be a foreign key? - ANSWERYes, this is a shared
primary key and relatively common
What is a composite key? - ANSWERA composite key is a primary key made up of 2 or
more columns combined that uniquely identify a row.
Neither column alone is unique only the combination is.
Give one reason why you might want to write a macro in a situation where you could
just use a formula instead. - ANSWER2 Reasons
A formula recalculates every time anything in the spreadsheet changes. This can cause
serious slowdown on large sheets.
A macro can also perform complex multi step operations (like calculating value then
formatting it or placing it somewhere specific), a formula alone cant do this.
Besides the fact that we just like to name things, why is it better to have a named range
of cells in a macro rather than a range with cell references (e.g. C13:E42)?
Give three (3) frequently-relevant and important reasons why one names cell ranges in
Excel.? - ANSWERMRR
1. Maintainability
If the data range changes size you only have to update named range definition once,
hardcoded you would have to fix every macro that uses the range.
2. Readability
The name tells you what the data represents, B3:D15 tells you nothing
3. Robustness
A named range is better in a macro since it expands or shrinks if rows are added or
removed by the macro (which they often are).
When you are designing a relational database, what two important clues indicate that
you should place information in a separate table, and why? - ANSWER1. Repeated
Data
If the same info appears in many rows (eg course desc for every student enrolled) thats
redundant a course desc table would save space and enforce consistency.
2. Many to Many Relationships
When entities relate to eachother in both directions it creates signficant duplication
issues.
What is a Many-to-many relationship? - ANSWERWhen entities relate to eachother in
both directions. eg A course has many students and students have many courses.
Can a tables primary key also be a foreign key? - ANSWERYes, this is a shared
primary key and relatively common
What is a composite key? - ANSWERA composite key is a primary key made up of 2 or
more columns combined that uniquely identify a row.
Neither column alone is unique only the combination is.
Give one reason why you might want to write a macro in a situation where you could
just use a formula instead. - ANSWER2 Reasons
A formula recalculates every time anything in the spreadsheet changes. This can cause
serious slowdown on large sheets.
A macro can also perform complex multi step operations (like calculating value then
formatting it or placing it somewhere specific), a formula alone cant do this.
Besides the fact that we just like to name things, why is it better to have a named range
of cells in a macro rather than a range with cell references (e.g. C13:E42)?
Give three (3) frequently-relevant and important reasons why one names cell ranges in
Excel.? - ANSWERMRR
1. Maintainability
If the data range changes size you only have to update named range definition once,
hardcoded you would have to fix every macro that uses the range.
2. Readability
The name tells you what the data represents, B3:D15 tells you nothing
3. Robustness
A named range is better in a macro since it expands or shrinks if rows are added or
removed by the macro (which they often are).
When you are designing a relational database, what two important clues indicate that
you should place information in a separate table, and why? - ANSWER1. Repeated
Data
If the same info appears in many rows (eg course desc for every student enrolled) thats
redundant a course desc table would save space and enforce consistency.
2. Many to Many Relationships
When entities relate to eachother in both directions it creates signficant duplication
issues.
What is a Many-to-many relationship? - ANSWERWhen entities relate to eachother in
both directions. eg A course has many students and students have many courses.