CSC 675 Review 2 - Entity Relationship Data Model, Relational DDL Flashcards

Entity Relationship Data Model, Relational DDL

1
Q

Explain how data models are used in the database design process.

A

Data models are used in the schema design.

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

entity

A

correspond to “things” in the real world, each of which can be uniquely identified.

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

attribute

A

Properties associated with entities or relationships

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

attribute value

A

entity instances

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

relationship instance

A

associate two or more entity instances together.

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

composite attribute

A

one name, multiple named component attributes

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

multivalued attribute

A

attribute can have multiple values

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

derived attribute

A

Attribute which is related to another attribute value or entity, for example age/ birthdate, number of students/students.

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

key attribute

A

Subset of attributes which uniquely determine an entity instance

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

value set

A

(domain) - set of atomic values and type

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

What is an entity type? *

A

(entities): groups of entities with the same attributes.

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

What is an entity instance? *

A

Correspond to “things” in the real world, each of which can be uniquely identified.

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

Explain the difference between an entity instance and an entity type. *

A

Student is an example of an entity type ( student_ID , Name, … ) Nicole is an example of an entity instance ( has all the attributes of a student and exists in the real world ).

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

Explain the difference between an attribute and a value set (domain).

A

Attributes are properties associated with an identity

domain - the collection of all possible values an attribute can have

Person has the attribute name, the domain is the set of all possible combinations of character strings that are a name

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

What is a relationship type?

A

sets of relationship instances between entity instances of the same types. !

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

Explain the difference between a relationship and a relationship type.

A

relationship is actual. type is abstract

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

What is a participation role?

A

Signifies role that a participating entity from the entity type plays in each relationship means.

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

When is it necessary to use role names in the description of relationship types?

A

Role names are not necessary when all participation entities are distinct the name of identity types generally specify the role played in each entity type

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

Describe the two alternatives for specifying structural constraints on relationship types.

A

We will refer to the cardinality ratio and participation constraints, taken together, as the structural constraints of a relationship type.

lower and upper bound on number of relationship instances in existence at all times (min = 0 -> partial, min > 0 -> total)

to specify minimum
and maximum numbers (min, max) on the participation of each entity type in a relationship type.

slides 51, 52, 53

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

What are the advantages and disadvantages of specifying structural constraints on relationship types?

A

?

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

What is meant by a recursive relationship type?

A

Each entity serves a particular role in the relationship. This allows the same entity to appear more than once in a relationship type (i.e. to participate in a recursive relationship).

22
Q

Give some examples of recursive relationship types.

A

A tutor is a student and teaches a student. manager is an employee and manages an employee.

23
Q

Owner entity key

A

Primary key of the strong entity in the week entity, foreign key

it must also have least one subset of attributes which distinguish multiple entities with the same owner key.

24
Q

Weak entity type

A

some entities do not have unique keys, although they do participate in a total relationship with another entity which does have a key.

25
Q

identifying relationship type

A

The relationship type that relates a weak entity type to its owner.

26
Q

partial key

A

just part of a key - some proper subset of the key attributes

In weak entities it is the attribute that can uniquely identify weak entities that are related to the same owner entity.

27
Q

Can an identifying relationship of a weak entity type be of degree greater than two? Give examples.

A

?

28
Q

When are weak entities used in data modeling?

A

do not have unique keys

participate in a total relationship with another entity which does have a key.

29
Q

Why is it necessary for all entities in a schema to have key attributes?

A

So that they can be uniquely identified.

30
Q

Under what circumstances is it optional to specify structural constrains on a relationship? *

A

When you have a weak entity, participation is always total, there is no option

31
Q

Domain

A

The range of values of an attribute.

32
Q

Attribute

A

properties associated with entities or relationships

33
Q

Tuple *

A

Data set with specific instances in the range of each member. A row in a table.

34
Q

Relation Schema

A

A relation schema is represented by R(A1, A2, …) where R is called the name of the relation and A1, A2, … are the attributes of the schema.

It is representation of database highlighting relationships that we have created.

35
Q

Relationships ( Relation Instance )

A

associate two or more entity instances together

36
Q

Degree of a Relation

A

The degree (or arity) of a relation is the number of attributes n of its relation schema. For example, STUDENT(Name, Ssn, Home_phone, Address, Office_phone, Age, Gpa) has degree seven.

37
Q

Relational database schema *

A

the schema defines the tables, columns and relationships that make up a relational database.

a description of the database

Is represented as S = {R1, R2, …} where R1, R2, … are relation schemas. It also consists of a set of Integrity constraints.

38
Q

relational database instance

A

An instance of relational database schema S ={R1, R2, …, Rm} is a set of relation instances {r1, r2, …, rm} such that each relation instance ri is a state of corresponding relation schema Ri.

In addition, each relation instance must satisfy the integrity constraints specified in the relational database schema.

39
Q

What are tuples in a relation not ordered? *

A

A relation is defined as a set of tuples. Mathematically, elements of a set have no order among them; hence, tuples in a relation do not have any particular order. In other words, a relation is not sensitive to the ordering of tuples.

40
Q

Why are duplicate tuples not allowed in a relation? *

A

Duplicate tuples are not allowed in a relation because it violates the specifications of the relational integrity constraints, particularly the key constraint which states that no two tuples can have the same values for their attributes at any relation state of a database.

41
Q

What is the difference between a key and a super key?

A

Superkey is any subset of attributes that uniquely identifies the tuples of a relation.

A key (better: primary key) is the minimal subset

42
Q

Why do we designate one of the candidate keys of a relation to be primary key?

A

When there is more than one key in a relation schema of a database, all these keys are referred to as candidate key. We designate a primary key because it is easier to deal with a database that has a single distinct key for a relation.

43
Q

Discuss the characteristics of relations that make them different from ordinary tables and files.

A
  • The tuples are not considered to be ordered
  • the attributes in a relation are ordered.
  • All values are considered to be atomic or indivisible
44
Q

Define entity integrity

A

The entity integrity constraint states that no primary key value can be NULL and is considered to be very important.

45
Q

Why is entity integrity considered important?

A

because the primary key is used to identify individual tuples

having a null values for the primary key implies that we cannot identify some tuples.

46
Q

Define referential integrity constrains

A

constraint that specifies that a record in one file must be related to records in other files.

47
Q

Why are referential integrity constrains considered important?

A

The referential integrity constrain is specified between two relations and is used to maintain the consistency among the tuples in the two relations. Without the referential integrity constrain the database could be left in an invalid state.

48
Q

Foreign Key *

A

attribute that references another relation key

  1. The attributes in the foreign key have the same domain as the primary key
  2. A value of the foreign key occurred as the primary key of another or is null.
49
Q

What are foreign keys used for? *

A

to identify the different relationships between relations in a Relational Database Schema.

(To link one table to another)

50
Q

List the various update operations on relations and the types of integrity constraints that must be checked for each update operation.

A

insert: may violate key constraint, entity integrity constraint or referential integrity.
delete: can only violate referential integrity.
modify: only a problem when PK or FK is modified