Ch 2: Intro to the Relational Model Flashcards

1
Q

True or False:

No two tuples in a Relation

can have exactly the same values

for all attributes

A

True!

The values of a tuple(row) must be such that they can

uniquely identify the tuple.

Therefore, we can always distinguish between tuples.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How Seperate Tables

Can Be Related

A

Use Common Attribute Names:

Example:

The “Department” and “Teachers” table both have an attribute called “Dept_Name”

Can get a Department Name from the “Department” table,

then use it to find all “Teacher” tuples that have that Department

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Relation Schema

A
  • A Relation is similar to a variable
  • A Relation Schema is more like a Type Definition

The Relation Schema consists of a list of attribute names and their corresponding domains.

Structure: Relation_Name( attribute, attribute, … )

example: department( dept_name, building, budget)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Relational Model:

Table Structure

A
  • Each table is assigned a unique name
  • Columns represent a certain Attribute and have header info
  • Each Row is a set of related data,
    • It is an n-tuple of values
  • If an attribute is unknown, or doesn’t exist for a particular relation instance, the null value is used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Relational Model:

Types of Keys

A
  • Super Key
    • A set of one or more attibutes which allow a tuple in a relation to be uniquely identified.
    • A good example would be (User_ID, Name)
  • Candidate Key
    • A Super Key that can’t be reduced further
      • No proper subset is also a Super Key
  • Primary Key
    • A Candidate Key chosen by the database designer to identify tuples within a relation.
    • Must be chosen with care
  • Foreign Key
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a

Data Model ?

A

A notation for describing data or information.

The description generally consists of 3 parts:

  • Structure of the data
  • Operations on the data
    • Queries
    • Modifications
  • Constraints on the data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Key

for a relation ?

A
  • The most fundamental kind of constraint
  • A set of attributes forms a Key for a relation when:
    • No two tuples in a relation instance may have the same values in all attributes of the key
  • This makes it a unique identifier for each tuple
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Argument for

Why the Relational Model

is preferred in DBMS

A
  • DBs are large, so access efficiency and modification efficiency are very important.
  • Ease of Use is also important

Both goals can be achieved with the Relational Model:

  • Simple, limited approach to structuring data,
    • yet reasonably versatile, so anything can be modeled
  • Limited, yet useful collection of operations on data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Two most important

Data Models for

Database Systems

A
  • Relational Model
    • Tables or arrays
    • Including Object-Relational extensions
  • Semistructured Data Model
    • trees or graphs
    • Includes XML and related standards
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly