Chapter 4 Flashcards
A data dictionary contains metadata - data about date.
True
Current relational database software generally provides only a system catalog (and not a data dictionary).
True
As rare as 1:1 relationships should be, certain conditions absolutely require their use.
True
____ logic, used extensively in mathematics, provides a framework in which an assertion (statement of fact) can be verified as either true or false.
Predicate
The relational model’s creator, E.F. Codd, used the term relation as a synonym for _____.
Table
Date attributes contain calendar dates stored in a special format known as the ____ date format.
Julian
In the relational model, ____ are important because they are used to ensure that each row in a table is uniquely identifiable.
Keys
The attribute B is ____ the attribute A if each value in column A determines one and only one value in column B.
Functionally Dependent On
A ____ key is any key that uniquely identifies each row.
Superkey
Controlled ____ makes a relational database work.
Redundancy
A ____ key is defined as a key that is used strictly for data retrieval purposes.
Secondary
All primary key entries are unique, and no part of a primary key may be ____.
Null
____, also known as RESTRICT, yields values for all rows found in a table that satisfy a given condition.
SELECT
The ____ constraint can be placed on a column to ensure that every row in the table has a value for that column.
Not null
____ combines all rows from two tables, excluding duplicate rows.
UNION
A(n) ____ join links tables by selecting only the rows with common values in their common attribute(s).
Natural
In an outer join, the matched pairs would be retained and any unmatched values in the other table would be left ____.
Null
A ____ contains at least all of the attribute names and characteristics for each table in the system.
Data Dictionary
In a database context, the word ____ indicates the use of the same attribute name to label different attributes.
Homonym
The ____ relational type if the “relational model ideal.”
1:M
Since it is used to link the tables that originally were related in a M:N relationship, the composite entity structure includes - as foreign keys - at least the ____ keys of the tables that are to be linked.
Primary
A(n) ____ is an ordered arrangement of keys and pointers.
Index
Codd’s Rule of ____ state:
Application programs and ad hoc facilities are logically unaffected when changes are made to the table structures that preserve the original tables values (changing order of columns or inserting columns).
Logical Data Independence
To make a new table using SQL, you would use the CREATE TABLE command with mandatory appropriate data types specified for each of the attributes in the table.
True
To permanently delete a table (its structure’s existence), including any and all data it may have populated within it, which would be the SQL DDL command to accomplish that:
DROP TABLE
The following single SQL command would actually define a structure and build a table, in this case for a table named COMPANY, within a relational database.
Also, it would not create any data within the table, but would be ready for SQL statements to follow up with populating the table given that it is now implemented.
Please assume syntax is correctly specified:
CREATE TABLE Company (
Co_Code INTEGER NOT NULL UNIQUE,
Co_Name VARCHAR(30) NOT NULL,
Co_Contact VARCHAR(30) NOT NULL,
Co_State CHAR(2) NOT NULL.
Co_Start_Dt DATE,
PRIMARY KEY (Co_Code) );
True
An ERM is dependent on the database type.
False
The word “entity” in the ER model corresponds to a table.
True
The ER diagram represents the conceptual database as viewed by the end user.
True
The ER model refers to a specific table row as an entity instance.
True
In both the Chen and Crow’s Foot models, an entity is represented with a rectangle containing the entity’s name.
True
Attributes are types of entities.
False
In the original Chen model, each attribute is represented using an oval with the attribute name connected to the entity with a line.
True
Software vendors have adopted the Chen representation because of its compact representation.
False
Attributes cannot share a domain.
False
In an ER diagram, primary keys are usually bolded.
False
Ideally, a primary key is composed of several attributes.
False
All attributes are either simple or composite.
True
All simple attributes are also single-valued.
False
In the Chen model, a multivalued attribute is connected to the owning entity with a double line.
True
Derived attributes are stored in a special database table.
False
A relationship is identified by a name that describes the relationship.
True
Cardinality expresses the minimum and maximum number of entity occurrences associated with one occurrence of the related entity.
True
Connectivities and cardinalities are established by business rules.
True
A weak relationship exists if the primary key of the related entity contains at least one primary key component of the parent entity.
False
You should always load data from the 1 side of a 1:M relationship.
True
The existence of a mandatory relationship indicates that the minimum cardinality is 0 or 1 for the mandatory entity.
False
Relationships operate only in one direction.
False
A recursive relationship is one in which a relationship can exist between occurrences of the same entity set
True
The ERD represents the ____ database as viewed by the end user.
Conceptual
Some ____ database modeling concepts can be expressed only using the Chen notation.
Conceptual
The set of possible values for an attribute is a ____.
Domain
In an ER diagram, primary keys are indicated by ____.
Underlining
Ideally, an entity identifier is composed of ____ attribute(s).
One
The ____ attribute(s) make up the primary key in the table definition:
CLASS (CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM)
CRS_CODE
CLASS_SECTION
-CRS_CODE and CLASS_SECTION
There is no primary key
A ____ attribute can be further subdivided to yield additional attributes.
Composite
A ____ attribute is one that cannot be subdivided.
Simple
____ attributes can have many values.
Multivalued
Some attributes are classified as ____.
-simple
complex
defined
grouped
Although the conceptual model can handle ____ relationhips and multivalued attribues, you should not implement them in the RDBMS.
1: 1
- M:N
1: M
1: N
A derived attribute ____.
must be stored physically within the database
-need not be physically stored within the database
has many values
must be based on the value of three or more attributes
A derived attribute is indicated in the Chen model by a ____.
dashed line
A relationship is an association between ____.
entities
In the ERD, cardinality is indicated using the ____ notation.
(min,max)
Another word for existence-independent is ____.
strong
An entity is said to be ____-dependent if it can exist in the database only when it is associated with another related entity occurrence.
existence
When the PK of one entity does not contain the PK of a related entity, the relationship is ____.
weak
A ____ entity has a primary key that is partially or totally derived from the parent entity in the relationship.
weak
The term “____” is used to label any condition in which one or more optional relationships exist.
optionality
The Crow’s foot symbol with two parallel lines indicates ____ cardinality.
(1,1)
A ____ relationship exists when an association is maintained within a single entity.
unary
A ____ relationship exists when two entities are associated.
binary
____ relationships are most common.
binary
If an employee within an EMPLOYEE entity has a relationship with itself, that relationship is known as a ____ relationship.
recursive
A(n) ____ entity is composed of the primary keys of each of the entities to be connected.
associative
The following step occurs first in the process of building an ERD: ____.
Develop the initial ERD.
-Create a detailed narrative of the organization’s description of operations.
Identify the attributes and primary keys that adequately describe the entities.
Identify the business rules based on the description of operations.
The M:N relationship between STUDENT and CLASS must be divided into two 1:M relationships through the use of the ENROLL entity; the ENROLL entity is ____.
weak
Complex ____ requirements may dictate data transformations, and they may expand the number of entities and attributes within the design.
information
If Tiny College had some departments that were classified as “research only,” they would not offer courses; therefore, the COURSE entity would be ____ to the DEPARTMENT entity.
optional
A ____ relationship exists when an association is maintained within a single entity.
unary
A ____ relationship exists when three entities are associated.
ternary
If an employee within an EMPLOYEE entity has a relationship with itself, that relationship is known as a ____ relationship.
recursive
The associative entity is also known as a ____ entity.
composite
If Tiny College had some departments that were classified as “research only,” they would not offer courses; therefore, the COURSE entity would be ____ to the DEPARTMENT entity.
optional
If the focus is on data-retrieval speed, you might also be forced to include ____ attributes in the design, which would not ordinarily be done.
derived
Which of the following is used to select partial table contents?
SELECT
FROM
BY ;
LIST
FROM
BY ;
-SELECT
FROM
WHERE ;
LIST
FROM
WHERE ;
Which query will output the table contents when the value of V_CODE is not equal to 21344?
-SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE
FROM PRODUCT
WHERE V_CODE <> 21344;
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE
FROM PRODUCT
WHERE V_CODE <= 21344;
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE
FROM PRODUCT
WHERE V_CODE = 21344;
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE
FROM PRODUCT
WHERE V_CODE => 21344;
Which query will output the table contents when the value of the character field P_CODE is alphabetically less than 1558-QW1?
-SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE
FROM PRODUCT
WHERE P_CODE
The following two SQL commands would create 2 tables and would also create a relationship between the two tables with referential integrity. These two table definitions would also mean the following:
A Company can have many Products, a Product can only have one Company, and a
Company specified within a product must match a Company by its Company ID, Co_Code.
Please assume syntax is correctly specified:
CREATE TABLE Company
Co_Code INTEGER NOT NULL UNIQUE,
Co_Name VARCHAR(30) NOT NULL,
Co_Contact VARCHAR(30) NOT NULL,
Co_State CHAR(2) NOT NULL.
Co_Start_Dt DATE,
PRIMARY KEY (Co_Code) );
CREATE TABLE Product
P_Code VARCHAR(10) NOT NULL UNIQUE,
P_Desc VARCHAR(30) NOT NULL,
P_InDate Date NOT NULL,
P_QOH Smallint NOT NULL.
P_Price NUMBER(8,2),
Co_Code INTEGER,
PRIMARY KEY (P_Code),
FOREIGN KEY (Co_Code) REFERENCES Company (Co_Code) ;
True
Which of the following INSERT commands would not execute, in the sequence given, not because of bad syntax, but because of a bad value specified.
There have been no other INSERT commands given previously to the heretofore empty tables.
CREATE TABLE Company
Co_Code INTEGER NOT NULL UNIQUE,
Co_Name VARCHAR(30) NOT NULL,
Co_Contact VARCHAR(30) NOT NULL,
Co_State CHAR(2) NOT NULL.
Co_Start_Dt DATE,
PRIMARY KEY (Co_Code) );
CREATE TABLE Product
P_Code VARCHAR(10) NOT NULL UNIQUE,
P_Desc VARCHAR(30) NOT NULL,
P_InDate Date NOT NULL,
P_QOH Smallint NOT NULL.
P_Price NUMBER(8,2),
Co_Code INTEGER,
PRIMARY KEY (P_Code),
FOREIGN KEY (Co_Code) REFERENCES Company (Co_Code) ;
INSERT INTO Company
Values ( 31439, ‘Leath and Sons’, ‘Ian Leath’, ‘Mi’, ‘19-Jan-00’ );
INSERT INTO Product
Values ( ‘16T-LJB’, ‘Top-Line JunkBin’, ‘29-Mar-18’, 57, 99.49, 31439 );
-INSERT INTO Product
Values ( ‘16T-LJBC’, ‘Top-Line JB Cover’, ‘29-Mar-18’, 57, 7.99, 31440 );
No issues, the 3 above INSERT commands all execute