Tables and Keys Flashcards

1
Q

What is the significance of the relational model in the context of database systems?

A

The relational model is the de facto standard implemented in major database systems, providing a standardized approach for storing and querying data. It defines the format for data storage and operations for querying data.

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

What are the key components defined by the relational model?

A

The relational model defines the format for storing data and the operations for querying that data. It includes the structure of tables, relationships between tables, and operations such as SELECT, INSERT, UPDATE, and DELETE.

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

How is a database described when it conforms to the relational model?

A

A database conforming to the relational model is referred to as a relational database. It adheres to the principles and guidelines set by the relational model for organizing and managing data.

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

In the relational model, what does the term “format by which data should be stored” refer to?

A

The “format by which data should be stored” in the relational model refers to the structure of tables, including the definition of columns, data types, and relationships between tables, ensuring a standardized way of organizing data.

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

What operations are specified by the relational model for querying data?

A

The relational model specifies operations such as SELECT (for querying data), INSERT (for adding new data), UPDATE (for modifying existing data), and DELETE (for removing data), forming the basis for database manipulation.

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

Why is the relational model considered a standard in database systems?

A

The relational model is considered a standard in database systems because it provides a clear and consistent framework for data organization and manipulation. Its principles are widely implemented across major database systems, promoting interoperability and ease of use.

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

How does adherence to the relational model contribute to database consistency and integrity?

A

Adherence to the relational model contributes to database consistency and integrity by enforcing standardized rules for data organization and manipulation. This ensures that data relationships are maintained, and operations are performed in a predictable and reliable manner.

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

How does the relational model promote interoperability among different database systems?

A

The relational model promotes interoperability by establishing a common set of principles and standards, allowing applications and queries developed for one relational database system to work with others that conform to the same model.

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

What advantages does the relational model bring to data management in comparison to other models?

A

The relational model provides advantages such as simplicity, flexibility, and ease of understanding. It offers a clear structure for data organization, supports complex relationships, and facilitates powerful querying capabilities, making it widely adopted in diverse application domains.

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

What is the significance of domains in a relational schema?

A

Domains in a relational schema define the types of attributes, similar to types in a programming language. They specify the range of values an attribute can take.

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

Define a relation in the context of a relational schema.

A

In a relational schema, a relation is a set of tuples. This means it consists of rows, and each row contains a unique combination of attribute values.

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

What is the uniqueness constraint associated with tuples in a relation?

A

Tuples in a relation must be unique, meaning there can be no duplicate tuples. However, some commercial Database Management Systems (DBMSs) may allow duplicate rows in practice.

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

Why does the order of tuples not matter in a relation?

A

The order of tuples in a relation doesn’t matter because, in a mathematical set, the elements (tuples) are considered unordered. This characteristic is essential for maintaining consistency and simplicity in relational databases.

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

Is the order of attributes significant in a relation within a relational schema?

A

No, the order of attributes in a relation does not matter. The structure of a relation is defined by its attributes, and their order does not impact the integrity or functionality of the relational schema.

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

What is a Key in the context of a relational database?

A

A key is a set of attributes for which no two rows in a table can have the same values. It uniquely identifies each row in the table.

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

Define Superkey and provide an example.

A

A Superkey is a set of one or more attributes whose combined values are unique, meaning no two tuples can have the same values on these attributes. Example: In the PROF table, {pid}, {pid, name}, {pid, dept}, {pid, rank, sal} are all superkeys.

17
Q

What is a Candidate Key, and why is it important?

A

A Candidate Key in a table is a minimal set of attributes for which no two tuples can have the same values. It is essential because it uniquely identifies each tuple and is designated when the table is created. Every table should have at least one candidate key.

18
Q

Can there be multiple Superkeys for a given table?

A

Yes, there can be multiple superkeys for a given table. A superkey is “super” because it is a superset of some key and, therefore, there may be more than one way to uniquely identify rows in a table.

19
Q

How is a Foreign Key different from a Primary Key?

A

A Primary Key is a key that uniquely identifies each record in a table, while a Foreign Key is a field in one table that refers to the Primary Key in another table. The Foreign Key establishes a link between the two tables, creating a relationship.

20
Q

Why is it important to ensure that there cannot be any duplicates in a relation?

A

It’s important to ensure that there cannot be any duplicates in a relation not just for the current state but also in principle. This ensures the uniqueness of each tuple and maintains the integrity of the data in the relational database.

21
Q

Is every relation guaranteed to have a key?

A

No, not every relation is guaranteed to have a key. In some cases, it might be necessary to invent artificial new attributes, like National Insurance (NI) numbers or ISBN numbers, to ensure all tuples will be unique.

22
Q

What is a Primary Key, and how is it determined?

A

A Primary Key is one of the candidate keys chosen by the Database (DB) designer. It is a minimal set of attributes that uniquely identifies each tuple in a table. The selection of a primary key is a crucial design decision.