DB_brainscape_flashcards

(18 cards)

1
Q

What is an entity?

A

An entity is a person, place, object, event, or concept about which data is stored.

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

What is the difference between an entity type and an entity instance?

A

An entity type is a collection of similar entities (e.g., EMPLOYEE), while an entity instance is a single occurrence (e.g., ‘John Doe’).

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

What is a strong entity? Give an example.

A

A strong entity exists independently (e.g., EMPLOYEE). It doesn’t depend on another entity for its identity.

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

What is a weak entity? Give an example.

A

A weak entity depends on a strong entity (e.g., DEPENDENT relies on EMPLOYEE) and cannot exist without it.

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

What is an attribute?

A

An attribute is a property or characteristic of an entity or relationship (e.g., age, salary).

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

What is the difference between required and optional attributes?

A

Required attributes must have a value (e.g., EmployeeID), while optional attributes may be left blank (e.g., MiddleName).

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

Define simple vs composite attribute with examples.

A

A simple attribute holds a single value (e.g., Age), while a composite attribute consists of multiple sub-values (e.g., Address = Street + City + State).

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

Define single-valued vs multivalued attributes with examples.

A

Single-valued attributes have one value per instance (e.g., Name), while multivalued can hold multiple values (e.g., Skills).

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

What is a derived attribute? Give an example.

A

A derived attribute is calculated from other attributes (e.g., YearsEmployed derived from DateHired).

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

What is an identifier (key)? Give an example.

A

An identifier uniquely identifies instances of an entity type (e.g., EmployeeID).

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

What is a relationship in a database?

A

A relationship is a link between entities that shows how they interact (e.g., Employee works for Department).

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

Explain the degree of a relationship and list the types.

A

Degree is the number of entity types involved: unary (one), binary (two), ternary (three).

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

What is a binary relationship? Give an example.

A

A binary relationship involves two entity types (e.g., Employee works for Department).

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

Define cardinality constraints: one-to-one, one-to-many, many-to-many.

A

One-to-one: each entity relates to one other (e.g., one person has one passport). One-to-many: one entity relates to many (e.g., Department has many Employees). Many-to-many: many entities relate to many (e.g., Students enroll in many Courses).

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

What is an associative entity and when is it used?

A

An associative entity is used when a relationship has attributes, turning the relationship into an entity (e.g., Certificate links Student and Course with completion date).

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

What conditions must be met for an associative entity?

A

All relationships are many-to-many, the entity has its own meaning independent of others, and it has a unique identifier.

17
Q

What is time stamping in databases and why is it used?

A

Time stamping tracks changes by associating timestamps with data values (e.g., PriceHistory records when each price was valid).

18
Q

Give an example of how time stamping tracks data changes.

A

In PriceHistory, each price entry for a product has a timestamp indicating when that price was set.