Chapter 5 Flashcards
The Relational Data Model and Relational Database Constraints
The relational Model of Data is based on the concept of a _____.
Relation
T/F: The strength of the relational approach to data management comes from the formal foundation provided by the theory of relations.
true.
A _________ is a mathematical concept based on the ideas of sets.
Relation
Informally, a relation looks like a _____ of values
table
A relation typically contains a set of ______.
rows
The data elements in each row represent certain facts that correspond to a real-world ________ or ________.
entity, relationship.
In the formal model, rows are called ________.
tuples
Each column has a ________ that gives an indication of the meaning of the data items in that column.
column header
In the formal model, the column header is called an __________.
attribute name (or just attribute)
Determine which is the attributes, tuples, and relation name in the following figure:
Each row has a value of a data item (or set of items) that uniquely identifies that row in the table called the ________.
Key of a Relation
Sometimes row-ids or sequential numbers are assigned as keys to identify the rows in a table, these are called ________.
artificial keys or surrogate keys
The __________ of a Relation Denoted by R(A1, A2, …..An). Where R is the _______ of the relation, and the ________ of the relation are A1, A2, …, An.
schema (or description), name, attributes.
(ex:
CUSTOMER (Cust-id, Cust-name, Address, Phone#)
CUSTOMER is the relation name.
attributes: Cust-id, Cust-name, Address, Phone#.
)
T/F: Each attribute has a domain or a set of valid values.
True, For example, the domain of Cust-id is 6 digit numbers.
A ______ is an ordered set of values (enclosed in angled brackets ‘< … >’). In which, each value is derived from an appropriate ______.
tuple, domain.
A row in the CUSTOMER relation:
<632895, “John Smith”, “101 Main St. Atlanta, GA 30332”, “(404) 894-2000”>
is called a 4-tuple as it has _________.
4 values.
T/F: A relation is a set of such tuples (rows).
true.
T/F: A domain also has a data-type or a format defined for it.
true, for example:
the USA_phone_numbers may have a format: (ddd)ddd-dddd where
each d is a decimal digit. or Dates have various formats such as year, month, date formatted
as yyyy-mm-dd, or as dd mm,yyyy etc.)
T/F: A domain has a logical definition.
True, Example: “USA_phone_numbers” are the set of 10 digit phone numbers valid in the U.S.
The ________ designates the role played by a domain in a relation.
attribute name (used to interpret the meaning of the data elements corresponding to that attribute. Example: The domain Date may be used to define two attributes named “Invoice-date” and “Payment-date” with different meanings.)
The _________ is a subset of the Cartesian product of the domains of its attributes.
relation state.
(each domain contains the set of all possible values the attribute can take.)
T/F: each domain contains the set of all possible values the attribute can take.
True.
The relation state r(R) is a subset of dom (A1) X dom (A2) X ….X dom(An).
A1, A2, …, An are the _______ of the relation.
R(A1, A2, …, An) is the ________ of the relation.
r(R) is ___________ of relation R – this is a set of tuples (rows).
r(R) = {t1, t2, …, tn} where each ti is an ______.
ti = <v1, v2, …, vn> where each vj is an element-of ______.
attributes, schema, a specific state (or “value” or “population”), n-tuple, dom(Aj).
T/F: Let R(A1, A2) be a relation schema where dom(A1) = {0,1}, dom(A2) = {a,b,c}, and all the possible combinations of dom(A1) X dom(A2) is {<0,a> , <0,b> , <0,c>, <1,a>, <1,b>, <1,c> }
then r(R) could be {<0,a> , <0,b> , <1,c> }.
true, this is one possible state (or “population” or “extension”) r of the relation R, defined over A1 and A2.
T/F: The tuples in the relation state r(R) are ordered/in tabular form.
false, The tuples are not considered to be ordered, even though they appear to be in the tabular form
T/F: Ordering of attributes in a relation schema R (and of values within each tuple). This representation may be called as “self-describing”.
true.
T/F: All values in a tuple are considered divisible.
false, they are considered atomic (indivisible).
T/F: Each value in a tuple must be from the domain of the attribute for that column.
True, If tuple t = <v1, v2, …, vn> is a tuple (row) in the relation state r of R(A1, A2, …, An), Then each vi must be a value from dom(Ai).
A special _______ value is used to represent values that are unknown or not available or inapplicable in certain tuples.
null
T/F: We refer to component values of a tuple t by: t[Ai] or t.Ai.
true, IT is the value vi of attribute Ai for tuple t.
t[Au, Av, …, Aw] refers to the _________ of
t containing the values of attributes Au, Av, …, Aw, respectively in t.
subtuple
__________ determine which values are permissible and which are not in the database.
constraints.
_____________ constraints, _________ constraints, and __________ constraints are the three main types of constraints.
Inherent or Implicit, Schema-based or Explicit, Application based or semantic.