Database Design - Week 7
Which of the following is not a good guideline for deciding when to create an index for a column? a. The column is frequently used in search conditions or joins. b. The column is a foreign key. c. The column contains a large number of unique values. d. The column is frequently updated.
The column is frequently updated.
To be in the third normal form a. each non-key column must depend only on the primary key b. each non-key column must depend on the entire primary key c. the non-key columns must not contain repeating values d. all of the above
all of the above
After you identify and subdivide all of the data elements for a database, you should group them by the entities with which they're associated. The entities will become the tables of the database, and the elements will become the a. cells b. indexes c. rows d. columns
columns
When you subdivide a data element, you can easily rebuild it when necessary by ________________ the individual components. a. concatenating b. assigning c. updating d. matching
concatenating
If two tables have a many-to-many relationship, you need to define a _____________ table that relates their records. a. composite b. unique c. linking d. primary
linking
To normalize a data structure, what do you apply in sequence? a. indexes b. normal forms c. composite indexes d. none of the above
normal forms
The most common type of relationship between two tables is called what? a. one-to-many relationship b. one-to-one relationship c. primary relationship d. many-to-many relationship
one-to-many relationship
What do you typically use to relate two tables that have a one-to-one relationship? a. indexes b. composite keys c. foreign keys d. primary keys
primary keys
When you identify the data elements in a new database, you typically subdivide data elements into a. the largest practical components b. the smallest practical components c. components that can be easily parsed each time you use them
the smallest practical components
Typically, what form do most database designers consider a database structure to be normalized? a. fifth b. second c. fourth d. third
third
In a/an ________________, a table can contain information about two or more entities. a. normalized data structure b. none of the above c. foreign key constraint d. unnormalized data structure
unnormalized data structure
| Orders / OrderID, OrderDate |--- ---<| OrderLineItems / OrderID, OrderSequence, ProductID |>--- --- | Products / ProductID, ProductName | Which column or columns in each table should be defined as the primary key? a. Orders: OrderID and OrderDate OrderLineItems: OrderID and OrderSequence Products: ProductID b. Orders: OrderID OrderLineItems: OrderID Products: ProductID c. Orders: OrderID OrderLineItems: OrderID and OrderSequence Products: ProductID d. Orders: OrderID OrderLineItems: OrderID, OrderSequence, and ProductID Products: ProductID and ProductName
Orders: OrderID OrderLineItems: OrderID and OrderSequence Products: ProductID
To enforce referential integrity, the database can a. return an error instead of doing the requested action b. do the requested action and do the related changes to the related tables c. do the requested action and mark any orphans in related tables d. a or b e. a or c
a or b
What do you use to uniquely identify each row in a table? a. a primary key b. a foreign key c. a skeleton key d. an index
a primary key
To be in the first normal form, each cell in a table must contain a. a non-unique value b. a non-redundant value c. a unique value d. a single, scalar value
a single, scalar value
Which of the following does not violate the referential integrity of a database? a. updating a foreign key with a value that doesn't match a primary key in the related table b. deleting a row in a foreign key table without deleting the related row in the related primary key table c. inserting a new row into a table with a foreign key that doesn't match a primary key in the related table d. updating a primary key in a primary key table without also updating the foreign keys for the related rows in all related tables
deleting a row in a foreign key table without deleting the related row in the related primary key table
To apply the second normal form, you move columns that don't depend on the entire primary key to another table and establish a relationship between the two tables. This a. increases redundancy but makes the data more consistent b. increases redundancy but makes maintenance easier c. reduces redundancy and makes maintenance easier d. reduces redundancy but makes maintenance more difficult
reduces redundancy and makes maintenance easier
To maintain ________________, if you delete a row in a primary key table, you must also delete any related rows in foreign key tables. a. referential integrity b. foreign key values c. foreign key restraints d. primary key restraints
referential integrity
Which of the following diagrams best represents the relationship between a table of customers and a table of orders placed by customers?
| Customers / *CustomerID*, CustomerName |--- ---<| Orders / *OrderID*, CustomerID, OrderDate |
Which of the following diagrams best represents the relationship between a table of students and a table of classes for which the student is registered?
| Students/ StudentID, StudentName |--- ---<| StudentstoClasses/ StudentID, ClassID |>--- ---| Classes / StudentID, StudentName |