Chapter 2: Introduction to Relational Model

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

atomic

A domain is atomic if elements of the domain are considered to be indivisible units. (it only has a singular part not split parts, like a phone number[area code, etc])

referential integrity constraint

A rule that states that either each foreign key value must match a primary key value in another relation or the foreign key value must be null.

domain

For each attribute of a relation, there is a set of permitted values EX) the domain of the name attribute is the set of all possible instructor names.

Cartesian product (Relational Algebra)

Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes)

Natural join (Relational Algebra)

Output pairs of rows from the two input relations that have the same value on all attributes that have the same name.

Projection Operation (Relational Algebra)

Output specified attributes from all rows of the input relation. Remove duplicate tuples from the output

Union

Output the union of tuples from the two input relations.

Selection Operation (Relational Algebra)

Return rows of the input relation that satisfy the predicate.

How does the relational data model take its name?

Since a table is a collection of such relationships, there is a close correspondence between the concept of table and the mathematical concept of relation

Does order of tuples matter in a relation?

The order in which tuples appear in a relation is irrelevant, since a relation is a set of tuples

referencing relation

The relation r1 of the foreign key dependency in r2

referenced relation

The relation r2 that is being referenced by r1

Is it Ok to use common attributes in relation schemas?

Yes, is one way of relating tuples of distinct relations.

query language

a language in which a user requests information from the database. These languages are usually on a level higher than that of a standard programming language. Can be categorized as either procedural or nonprocedural

what consists of a relation schema?

a list of attributes and their corresponding domains.

schema diagrams

a pictorial depiction of the schema of a database that shows the relations in the database, their attributes, and primary keys and foreign keys. Each relation appears as a box, with the relation name at the top in blue, and the attributes listed inside the box. Primary key attributes are shown underlined. Foreign key dependencies appear as arrows from the foreign key attributes of the referencing relation to the primary key of the referenced relation. Referential integrity constraints other than foreign key constraints are not shown explicitly in schema diagrams.

What does a row in a table usually represent?

a relationship among a set of values.

foreign key

a set of attributes in a referencing relation, such that for each tuple in the referencing relation, the values of the foreign key attributes are guaranteed to occur as the primary key value of a tuple in the referenced relation. EX) For example, the attribute dept name in instructor is a foreign key frominstructor, referencing department, since dept name is the primary key of department.

superkey

a set of one or more attributes that, taken collectively, allow us to identify uniquely a tuple in the relation. EX)the ID attribute of the relation instructor is sufficient to distinguish one instructor tuple from another. Thus, ID is a superkey.

relational query languages

a set of operations that operate on tables, and output tables as their results. These operations can be combined to get expressions that express desired queries.

database instance

a snapshot of the data in the database at a given instant in time

null

a special value that signifies that the value is unknown or does not exist

join operation

allows the combining of two relations by merging pairs of tuples, one from each relation, into a single tuple.

Cartesian product operation

combines tuples from two relations, but unlike the join operation, its result contains all pairs of tuples from the two relations, regardless of whether their attribute values match.

relational algebra

defines a set of operations on relations, paralleling the usual algebraic operations such as addition, subtraction or multiplication, which operate on numbers.

primary key

denotes a candidate key that is chosen by the database designer as the principal means of identifying tuples within a relation. should be chosen such that its attribute values are never, or very rarely, changed It is customary to list the primary key attributes of a relation schema before the other attributes

the schema of a relation does not _______

generally change

candidate keys

is a minimal superkey, that is, a set of attributes that forms a superkey, but none of whose subsets is a superkey EX) Name and ID could be superkeys, so we call em candidate keys

relation

is used to refer to a table in the relational model

natural join operation

on two relations matches tuples whose values are the same on all attribute names that are common to both relations.

All procedural relational query languages provide a set of ______

operations that can be applied to either a single relation or a pair of relations. These operations have the nice and desired property that their result is always a single relation.

union operation (

performs a set union of two "similarly structured" tables (say a table of all graduate students and a table of all undergraduate students). (intersection and set difference can be performed as well)

relation instance

refers to a specific instance of a relation i.e., containing a specific set of rows

the result of a relational query is itself a ___

relation, relational operations can be applied to the results of queries as well as to the given set of relations.

n-tuple

relationship between n values; i.e., a tuple with n values, which corresponds to a row in a table.

tuple

simply a sequence (or list) of values. is used to refer to a row in the relational model

A relational database consists of a collection of _____

tables, each of which is assigned a unique name. user of the database system may query these tables, insert new tuples, delete tuples, and update (modify) tuples. There are several languages for expressing these operations.

A Key (whether primary, candidate, or super) is a property of ____

the entire relation, rather than of the individual tuples. The designation of a key represents a constraint in the real-world enterprise being modeled.

database schema

the logical design of the database (Structure: Schema name: (attributes))

nonprocedural language

the user describes the desired information without giving a specific procedure for obtaining that information.

the values of the attribute values of a tuple must be such that

they can uniquely identify the tuple no two tuples in a relation are allowed to have exactly the same value for all attributes.

attribute

to a column of a table.


Kaugnay na mga set ng pag-aaral

AP Physics I Final Practice Exam 1

View Set

Substance-related and addictive disorders

View Set

(103) the importance of water Unit 3

View Set

Quiz 8 Food Safety Management Systems

View Set