Entities, Attributes, Data Type Flashcards

1
Q

What is a Primary Key (PK) in a database?

A

A Primary Key (PK) is a unique identifier for a record in a table, ensuring each record is distinct and can be retrieved efficiently. It cannot have null values and there can only be one primary key per table.

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

What is a Foreign Key (FK)?

A

A Foreign Key (FK) is an attribute in a table that links to the primary key of another table, used to establish a relationship between the two tables and maintain data integrity.

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

Define a Composite Key.

A

A Composite Key is a key that consists of two or more attributes combined to uniquely identify a record in a table, used when a single attribute is insufficient for uniqueness.

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

What is a Surrogate Key?

A

A Surrogate Key is a single column with artificial values used as a primary key when a natural primary key is not available (e.g., customer_id).

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

What is a Candidate Key?

A

A Candidate Key is a minimal Super Key, a key that can uniquely identify any row in the table and does not contain a subset of attributes that is also a Super Key.

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

Explain the concept of a Super Key.

A

A Super Key is a set of attributes that can uniquely identify a row in a table, functionally determining every attribute in the row.

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

What is an Alternate Key?

A

An Alternate Key is a key that has all the properties of a Candidate Key and can be a single attribute or multiple attributes. It must be unique and can be NULL.

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

What are attributes in a database?

A

Attributes are properties or characteristics of an entity, represented by columns in a table, and each attribute represents a specific piece of data.

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

What are data types in databases?

A

Data types classify data items and specify the kind of data that can be stored and manipulated, such as integers, strings, boolean, date/time, etc.

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

What is a One-to-Many relationship in databases?

A

In a One-to-Many relationship, a single record in the primary key table can relate to none, one, or many records in the related table.

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

What is a Many-to-Many relationship in databases?

A

A Many-to-Many relationship occurs when each record in both tables can relate to none or many records in the other table, requiring an intersection table to accommodate the relationship.

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

What is an Intersection table?

A

An Intersection table is used to break a Many-to-Many relationship into two One-to-Many relationships, ensuring relational systems can accommodate the data structure.

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