Chapter 4 Flashcards
When you are given a set of tables and asked to create a database to store their data, the first step is to assess the tables’ structure and content.
True
The first step in assessing table structure is to count rows and examine columns.
True
To count the number of rows in a table, use the SQL construct COUNT(ROWS).
False
To determine the number and type of columns in a table, use the SQL construct COUNT(*).
False
To limit the number of rows retrieved from a table, use the SQL TOP keyword.
True
When examining data values as a part of assessing table structure, you should try to determine two types of dependencies: functional dependencies and functional dependencies.
True
When examining data values as a part of assessing table structure, you should try to determine three types of keys: the primary key, any candidate keys and any foreign keys.
True
The second step in assessing table structure is to examine data values and determine dependencies and keys.
True
When examining data values as a part of assessing table structure, you should try to determine functional dependencies.
True
When examining data values as a part of assessing table structure, you should try to determine multivalued dependencies.
True
When examining data values as a part of assessing table structure, you should try to determine the table’s primary key.
True
When examining data values as a part of assessing table structure, there is no need to try to determine candidate keys other than the table’s primary key.
False
When examining data values as a part of assessing table structure, there is no need to try to determine foreign keys.
False
The third step in assessing table structure is to check the validity of presumed referential integrity constraints.
True
The elimination of modification anomalies and the reduction of duplicated data are advantages of normalization.
True
Database design varies depending on whether you’re building an updatable database or a read-only database.
True
Normalization eliminates modification anomalies and data duplication.
False
The presence of one or more foreign keys in a relation means that we cannot eliminate duplicated data in that table.
True
Normalization requires applications to use more complex SQL since they will need to write subqueries and joins to recombine data stored in separate relations.
True
Relations are sometimes left unnormalized to improve performance.
True
Relations in BCNF have no modification anomalies in regard to functional dependencies.
True
A defining requirement for BCNF is that every determinant must be a candidate key.
True
The SQL INSERT statement can be used to populate normalized tables.
True
The SQL DELETE TABLE statement can be used to remove unneeded tables after the normalized tables are created and populated.
False
SQL statements that can be used to create referential integrity statements for normalized tables are created during the normalization process.
True
The standard sales order/line item pattern is a classic example of unneeded normalization.
False
Multivalued dependencies create anomalies so serious that multivalued dependencies must always be eliminated.
True
Writing SQL subqueries and joins against normalized tables is simple compared to the code that must be written to handle anomalies from multivalued dependencies.
True
To eliminate multivalued dependencies, normalize your tables so that they are all in BCNF.
False
Creating a read-only database is a job often given to beginning database professionals.
True
Read-only databases are often updated.
False
Design guidelines and priorities are the same whether you’re working with an updatable database or a read-only database.
False
Normalization is an advantage for a read-only database.
False
Denormalization is the process of joining previously normalized tables back together.
True
Denormalization reduces the complexity of the SQL statements needed in an application to read required data.
True
Denormalization is simple—join the data together and store it in a table.
True
Read-only databases seldom use more than one copy of a set of same data.
False
Read-only databases often use several copies of a set of the same data, where each copy is modified for a specific use.
True
Multivalued dependencies show up under a different name as the multivalued, multicolumn problem.
True
The multivalued, multicolumn problem occurs when a set of columns are used to store data that should actually be in one column.
True
One situation created by the multivalued, multicolumn problem is that the maximum number of data values for an attribute is limited.
True
If you have a table with a set of columns named “Child01”, “Child02” and “Child03”, the table has the multivalued, multicolumn problem.
True
When you are creating a database from existing data, you will have only minor problems with inconsistent values.
False
An inconsistent values problem is created when different users have coded the same data entries differently.
True
The problem of misspelled data entries is an entirely different problem than the inconsistent values problem.
False
You are creating a BOAT table using existing data from multiple sources, and you find that you have “power boat blue”, “boat, power, blue” and “blue power boat” as data values for the same column. This is an example of the inconsistent values problem.
True
A missing value is called a null value.
True
Null values are a problem because they are ambiguous.
True
A null value in a column may indicate that there is no appropriate value for that attribute.
True
A null value in a column may indicate that there is an appropriate value for that attribute, but it is unknown.
True
A null value in a column may indicate that there is an appropriate value for that attribute, and although the value is known no one has entered the value into the database.
True
Most DBMS products will let you define a primary key on a column that contains null values.
False
The SQL IS NULL keyword can be used to count the number of nulls in a column.
True
General-purpose remarks columns rarely contain important data
False
The problem with a general-purpose remarks column is that the data it contains are likely to be verbal, inconsistent and stored in a verbose manner.
True
If you see a column name Notes, it is likely that this is a general-purpose remarks column.
True
When you are given a set of tables and asked to create a database to store their data, the first step is to ________.
assess the existing tables’ structure and content
The first step in assessing table structure includes ________.
counting rows and examining columns
The second step in assessing table structure includes ________.
examining data values
During the second step of assessing table structure, you are trying to determine ________.
multivalued dependencies, functional dependencies, and foreign keys
During the second step of assessing table structure, you are trying to determine ________.
primary keys, candidate keys and foreign keys
To count the number of rows in a table, use the SQL construct ________.
SELECT COUNT(*)
The SQL function COUNT ________.
counts the number of rows in a table
To limit the number of rows retrieved from a table, use the SQL construct ________.
SELECT TOP n *
The SQL keyword TOP ________.
limits the number of rows retrieved from a table
You have been given two tables, CUSTOMER and SALE. You want to check the referential integrity constraint:
SALE.CustomerNumber must exist in CUSTOMER.CustomerNumber
You run the following SQL query:
SELECT CustomerNumber FROM SALE WHERE CustomerNumber NOT IN (SELECT CustomerNumber FROM SALE, CUSTOMER WHERE SALE.CustomerNumber = CUSTOMER.CustomerNumber);
What is shown in the results of this query?
All values of CustomerNumber that violate the constraint.
The advantages of normalization include ________.
the elimination of modification anomalies
The disadvantages of normalization include ________.
more complex SQL for multitable subqueries and joins
The presence of one or more foreign keys in a relation prevents ________.
the elimination of duplicated data
Anomalies caused by functional dependencies can be eliminated by putting tables into ________.
BCNF
The defining characteristic of BCNF is that a table is in BCNF if ________.
all determinants are candidate keys
A classic example of unneeded normalization is when we are dealing with ________.
ZIP codes
Unlike the anomalies from functional dependencies, the anomalies from ________ are so serious that they should always be eliminated.
multivalued dependencies
Read-only databases are used for ________.
querying and reporting
For a number of reasons, ________ is not often an advantage for a read-only database.
normalization
________ is the process of joining two or more tables and storing the result as a single table.
Denormalization
An advantage of denormalization is ________.
faster querying and less complex SQL in application code
A table designed to store PhoneNumber01, PhoneNumber02 and PhoneNumber03 contains ________.
the multivalued, multicolumn problem
A form of multivalued dependency is found in ________.
the multivalued, multicolumn problem
When a table is created using existing data from multiple sources, you are likely to find that the different sources code data in slightly different ways. This is an example of ________.
the inconsistent values problem
You are creating a PRODUCT table using existing data from multiple sources. Examining the data, you find that you have “large red hat”, “large hat, red”, “red hat large” and “hat, large, red.” This is an example of ________.
the inconsistent values problem
The problem of misspelled data entries is really the same as ________.
the inconsistent values problem
When a table is created using existing data from multiple sources, you are likely to find that some data values have never been provided. This is an example of ________.
the missing values problem
When a table is created using existing data from multiple sources, you are likely to find that some data values have never been provided. This is an example of ________.
the missing values problem
Reviewing the work done on a table that was created using existing data from multiple sources, you are likely to find that some data values that were provided were never entered into the table. This is an example of ________.
the missing values problem
A missing value is called a(n) ________.
null value
A null value can indicate which of the following conditions?
The value is inappropriate, The value is appropriate but unknown, and The value is appropriate and known, but not entered into the database
To check for null values in a column in a table, use the SQL phrase ________.
IS NULL
The SQL keyword IS NULL can be used to ________.
count the number of null values in a column
Reviewing the work done on a table that was created using existing data from multiple sources, you find that a column name Remarks has been included, and it is populated with inconsistent and verbose verbal data. This is an example of ________.
the general-purpose remarks column problem