DAD_220_-_3-1_QUIZ

.docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

220

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

6

Uploaded by AdmiralAlbatrossPerson792

Report
Question 1 2 / 2 points Your cousin asks you to help her prepare for her computer science exam next week. She gives you two clues about a type of relational database key: No column values may be NULL, and columns must be necessary for uniqueness. Which type of key is she referring to? Select one answer. Alternate key o Composite primary key Foreign key Simple primary key w Hide question 1 feedback A primary key is a column, or group of columns, used to identify a row. A composite primary key contains multiple columns. When all columns are necessary for uniqueness, it is known as a minimal primary key. In a composite primary key, no column value can be NULL, and when grouped together, the values must be unique. Question 2 2 / 2 points During a casual discussion, your colleague claims that both data types and names of foreign and primary keys must be the same. Is this true or false? True e False w Hide question 2 feedback A foreign key is a column, or group of columns, that refer to a primary key. Foreign key values that are not NULL must match some value of the primary key. The data types of the primary key and the foreign key must be the same, but they don't need to have the same name. For example, the names of cities could be listed in two tables under different column names, such as State Capital and Largest City. Assume that Largest City refers to State Capital—then Largest City is a foreign key referring to the primary key, State Capital.
Question 3 2 / 2 points There are four actions and outcomes listed below. These four actions can be implemented on a database to autocorrect violations of referential integrity. Match the action name with the outcome. Instructions: Choose your responses from the drop-down menus below. Responses cannot be used more than once. Sets invalid foreign keys to a default primary ~7 " key value, specified in SQL 1. Restrict __1 _Rejects an insert, update, or delete 2. Set Null __2__ Sets invalid foreign keys to NULL 3. Set Default Propagates primary key changes to foreign 4. Cascade 7 keys w Hide question 3 feedback Manual corrections of referential integrity are time-consuming and often cause errors. To avoid them, databases can be programmed to autocorrect violations by four actions: 1. Restrict results in rejection of an insert, update, or delete. 2. Set Null sets invalid foreign keys to NULL. 3. Set Default sets invalid foreign keys to a default primary key value, which is specified in SQL. 4. Cascade propagates primary key changes to foreign keys.
Question 4 2 / 2 points How can referential integrity be violated? Select all that apply. A primary key is inserted. | A row containing a primary key is deleted. ~ A foreign key is updated. A row containing a foreign key is deleted. ~ | A primary key is updated. ~ A row containing a foreign key is inserted. w Hide question 4 feedback Referential integrity requires that all foreign key values must either be fully NULL or match some primary key value. Sometimes violations occur due to data entry errors or incomplete data. These violations can happen in four ways: A primary key is updated, a foreign key is updated, a row containing a foreign key is inserted, or a row containing a primary key is deleted. Question 5 2 / 2 points For primary key deletions and updates, most databases support only the corrective action Restrict. True e False w Hide question 5 feedback Databases can automatically correct referential integrity violations with any of four corrective actions: Restrict, Set Null, Set Default, and Cascade. For primary key deletions and updates, most databases support all four corrective actions. For foreign key insertions and updates, most databases support only the action Restrict.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help