Database Design Flashcards

1
Q

Why is the study of normalization critical in the implementation of a database management system (DBMS)?

A

The study of normalization is critical in the implementation of a database management system because it provides a systematic approach to organizing and structuring data. It ensures that the database is designed efficiently, with logical entities, minimal duplicate data, and optimal performance.

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

What are the benefits of normalization in a relational database?

A

Arrange the data into logical entities that form part of the whole.
Minimize the amount of duplicate data stored in a database.
Design a database that users can access and modify quickly.
Ensure the integrity of the data in the database.
Optimize query times.

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

How does normalization speed up database performance?

A

Reduces redundant data: Less redundant data means the database server has less work to do, speeding up performance.

Reduces NULL values: The use of NULLs, especially in WHERE clauses, can impact performance negatively.
Normalization helps reduce this.

Reduces the number of columns in tables: More rows can fit on a single page of data, boosting database server read performance.

Reduces SQL code: Normalization minimizes the need for complex SQL code to handle non-normalized data, leading to improved application performance.
Maximizes clustered indexes: Normalization allows for the use of clustered indexes, which are powerful for speeding up data access.

Reduces total number of indexes: Fewer columns in tables mean fewer indexes are needed, mitigating the performance impact of INSERTs, UPDATES, and DELETES.

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

Why is it essential to study functional dependencies in the context of databases?

A

Studying functional dependencies is essential because it forms the core foundation of normalization in database design. Functional dependencies define the relationships and dependencies between attributes in a relational database. Understanding functional dependencies helps in systematically organizing and structuring data to achieve desirable properties such as reducing redundancy, ensuring data integrity, and optimizing database performance through normalization.

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

What is conceptual database design, and what does it involve?

A

Conceptual database design is the process of constructing a model of the data used in an enterprise, independent of all physical considerations. It involves defining the entities, relationships, and high-level structures in a way that captures the business requirements and concepts without specifying how the data will be stored or accessed physically.

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

What is logical database design, and what distinguishes it from conceptual design?

A

Logical database design is the process of constructing a model of the data used in an enterprise based on a specific data model (e.g., relational), but independent of a particular Database Management System (DBMS) and other physical considerations. It further refines the conceptual model by specifying details such as tables, attributes, and relationships using a specific data model without considering the actual implementation.

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

What does physical database design involve, and how does it differ from logical design?

A

Physical database design is the process of producing a description of the implementation of the database on secondary storage, focusing on storage structures, access methods of base relations, integrity constraints, and security measures. Unlike logical design, physical design is concerned with the efficient implementation of the database on a specific DBMS, taking into account performance considerations, storage optimization, and access methods.

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

What is the purpose of speed-up considerations in physical database design?

A

Speed-up considerations in physical database design focus on optimizing the performance of database operations. This involves designing storage structures, access methods, and indexes in a way that minimizes response times for queries and transactions, ensuring efficient data retrieval and modification.

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

Why is creating a design from a specification considered harder than implementing one?

A

Creating a design from a specification is often considered harder than implementing one because it involves making crucial decisions about the structure, relationships, and entities in the absence of a concrete system. It requires anticipating future needs, understanding the business requirements, and dealing with ambiguity in the specification.

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

What challenges may arise when deciding whether “Company” is a class or an attribute of an employee in the conceptual design?

A

The decision about whether “Company” is a class or an attribute of an employee can be challenging because it involves interpretation and understanding of the business context. It may not always have a definitive answer, and the choice may depend on the perspective—whether “Company” represents an independent entity or is just a descriptive attribute of an employee’s workplace.

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

Why is conceptual design an iterative process, and what is its purpose?

A

Conceptual design is an iterative process because it involves refining and clarifying vague points with clients before implementation. Its purpose is to engage with stakeholders, gather feedback, and iteratively evolve the design based on ongoing discussions. This iterative approach ensures that the design aligns with the business needs and expectations.

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

Why is it mentioned that there is no single correct design for any situation?

A

There is no single correct design for any situation because design decisions often depend on various factors, including business requirements, user needs, and project constraints. Design is a trade-off between different considerations, and the best design may vary based on the context and priorities.

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

How does experience play a role in creating a database design?

A

Experience plays a crucial role in creating a database design as it provides insights into best practices, common pitfalls, and effective solutions. Designing databases requires an understanding of patterns, industry norms, and the ability to make informed decisions, all of which come with practice and experience.

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

Is it possible to derive different conceptual models from the same specification?

A

Yes, it is possible to derive different conceptual models from the same specification. Interpretation, perspective, and design decisions can lead to variations in how entities, relationships, and attributes are represented in a conceptual model, resulting in different Entity-Relationship (ER) diagrams.

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

How can normalization help in determining which logical scheme is better among different conceptual models?

A

Normalization plays a crucial role in determining the quality of different logical schemes derived from conceptual models. It involves systematically organizing and structuring data to reduce redundancy, improve data integrity, and optimize performance. By applying normalization principles, one can evaluate and compare the logical schemes derived from different conceptual models to identify which one aligns better with normalization principles and database design best practices.

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

Can you provide an example scenario where two different conceptual models might be derived from the same specification?

A

For example, consider a specification for an Employee and Department relationship. One conceptual model might represent the relationship with direct connections between Employee and Department entities. Another conceptual model might introduce an intermediary entity like “WorkAssignment,” representing the specific projects or tasks employees are assigned to within a department. Both models capture the essence of the specification but represent it differently.

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

How does normalization contribute to the overall quality of a logical database design?

A

Normalization contributes to the overall quality of a logical database design by minimizing redundancy, improving data integrity, and optimizing query performance. It ensures that data is organized efficiently, relationships are well-defined, and the database structure aligns with the principles of normalization, leading to a more robust and maintainable system.

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

What is an entity in the context of a database?

A

An entity in the context of a database refers to a thing of interest in the real world that is represented and stored within the database. It could be a person, place, object, concept, or event.

19
Q

Can you provide an example of an entity and its instances?

A

Certainly! For example, “Lecturer” can be an entity in a database. Instances of this entity could include individuals like Gary Tam and Mark Jones, who are specific examples or occurrences of the “Lecturer” entity.

20
Q

What are attributes in the context of a database and how are they related to entities?

A

Attributes in the context of a database are facts, aspects, properties, or details about an entity. Each entity has a set of attributes associated with it, representing the characteristics or features that describe the entity.

21
Q

What is the significance of underlining in the context of attributes?

A

The underlining of an attribute indicates that it is a primary key attribute. The primary key attribute uniquely identifies each instance of the entity, playing a crucial role in establishing uniqueness and integrity within the database.

22
Q

What is a multi-valued attribute in the context of a database, and how does it differ from a single-valued attribute?

A

In the context of a database, a single-valued attribute has a single value associated with it, while a multi-valued attribute can have a set of values. This means that a multi-valued attribute allows for multiple values to be associated with a single instance of an entity.

23
Q

How is a multi-valued attribute represented in a diagram?

A

A multi-valued attribute is represented in a diagram as a double ellipse. This notation helps to visually distinguish multi-valued attributes from other types of attributes in an Entity-Relationship Diagram (ERD) or a similar modeling approach.

24
Q

What is a relationship in the context of a database, and how is it related to entities?

A

In the context of a database, a relationship represents an association between one or more instances of entities. It describes how entities are connected or linked to each other based on some shared characteristics or interactions.

25
Q

How can the concept of relationships be illustrated with an example?

A

For example, in a university database:

Each student takes several modules, creating a “Takes” relationship between the “Student” and “Module” entities.
Each module is taught by a lecturer, establishing a “Teaches” relationship between the “Module” and “Lecturer” entities.
Each employee works for a single department, forming a “Works For” relationship between the “Employee” and “Department” entities.

26
Q

What components make up a relationship in an ER (Entity-Relationship) diagram?

A

A relationship in an ER diagram consists of the following components:

Name: Describes the nature or purpose of the relationship.
Possibly some attributes: Additional details or properties specific to the relationship.
Degree: The number of entities that participate in the relationship.

27
Q

What is the degree of a relationship, and can you provide an example?

A

The degree of a relationship refers to the number of entities that participate in the relationship. For example, in the relationship “Each student takes several modules,” the degree is 2 because it involves the “Student” entity and the “Module” entity.

28
Q

What types of constraints can be imposed on a relationship in an ER diagram?

A

Two types of constraints can be imposed on a relationship:

Cardinality Constraint: Describes the possible number of occurrences of one entity for a single occurrence of the other. Types include one-to-one, one-to-many (or many-to-one), and many-to-many.
Participation Constraint: Describes whether the participation of entities in the relationship is total (mandatory) or partial (optional).

29
Q

What defines a one-to-one relationship between entities A and B in an ER diagram?

A

A relationship R between entity A and B is considered one-to-one if every instance in entity A and B can participate in at most one relationship instance in R. This implies a unique and singular association between instances of entities A and B.

30
Q

How is a one-to-many relationship defined between entities A and B in an ER diagram?

A

A relationship R between entity A and B is considered one-to-many if every instance in entity A can participate in any number of relation instances in R, but an instance in entity B can participate in at most one relation instance in R. This implies that each instance in entity A can be associated with multiple instances in entity B, but each instance in entity B is associated with only one instance in entity A.

31
Q

How is a many-to-many relationship defined between entities A and B in an ER diagram?

A

A relationship R between entity A and B is considered many-to-many if every instance in entity A and B can participate in any number of relation instances in R. This implies that each instance in entity A can be associated with multiple instances in entity B, and vice versa. Many-to-many relationships are typically represented using a linking or associative entity to resolve the many-to-many association.

32
Q

What is the definition of total participation for entity A in a relationship R between entities A and B?

A

The participation of A in a relationship R is total if every instance of A must participate in at least one relation instance in R. This implies that every entity A instance is involved in the relationship and cannot exist without being associated with at least one instance in R.

33
Q

How is partial participation for entity A defined in the context of a relationship R?

A

If not every instance of A is required to participate in at least one relation instance in R, the participation of A is considered partial. This means that instances of A may or may not be involved in the relationship, providing flexibility for instances of A to be associated with zero or more instances in R.

34
Q

Can similar concepts of total and partial participation be defined for entity B in the relationship R?

A

Yes, similar concepts of total and partial participation can be defined for entity B in the relationship R. The participation of B is total if every instance of B must participate in at least one relation instance in R, and partial if not every instance of B is required to participate.

35
Q

How is the concept of mapping and participation expressed in the context of relationships in an ER diagram?

A

Mapping and participation in an ER diagram describe the associations and constraints between entities in a relationship.

36
Q

Can you provide an example of mapping and participation in the context of marriage between persons?

A

Certainly! In the context of marriage, the mapping and participation can be expressed as follows:

“A person may not marry any one. A person (husband/wife) can marry at most one person (as wife/husband).”
Or simply, “A person may marry to one another person.”

37
Q

How does the concept of mapping and participation apply to the relationship between lecturers and students?

A

In the relationship between lecturers and students, the mapping and participation can be expressed as follows:

“Lecturers can tutor many students, but some lecturers may not tutor any students at all. Every student has one lecturer as a tutor.”
Or simply, “A lecturer may tutor many students. A student has exactly one/must have one lecturer as a tutor.”

38
Q

Can you summarize the mapping and participation concept in the context of students taking modules?

A

Certainly! In the context of students taking modules, the mapping and participation can be expressed as follows:

“Each student takes many modules (and must take at least 1). Each module is taken by many students (and must be taken by at least 1).”
Or simply, “Each student must take one (or more) modules. Each module must have one (or more) students.”

39
Q

When dealing with different types of employees, what are the options for representing them in a database design?

A

When dealing with different types of employees, there are several options for representing them in a database design:

Define a single entity EMPLOYEE using all possible attributes: This option involves creating a single entity named EMPLOYEE with attributes that cover all possible characteristics of different employee types.

Define separate entities for each type of EMPLOYEE: In this approach, separate entities are created for each distinct type of employee, such as HOURLY EMP, SALARIED EMP, and CONSULTANT.

Define a supertype EMPLOYEE with subtypes (HOURLY EMP, SALARIED EMP, CONSULTANT): This option involves creating a supertype entity named EMPLOYEE, which represents common attributes shared by all employee types, and then defining subtype entities like HOURLY EMP, SALARIED EMP, and CONSULTANT with specific attributes unique to each subtype.

40
Q

What is the advantage of using a supertype/subtype approach for representing employees?

A

Using a supertype/subtype approach allows for better organization and representation of common attributes shared by all employees in the EMPLOYEE supertype, while still accommodating unique attributes for each specific employee type in the respective subtypes. It supports the concept of inheritance, making the database design more flexible and scalable.

41
Q

In the context of an ISA relationship, what does a curved line in the diagram denote?

A

In the context of an ISA (Inheritance, Subtyping, and Aggregation) relationship, a curved line in the diagram denotes an exclusive relationship. This means that exactly one subtype is required for each instance of the supertype. The curved line visually represents the exclusive nature of the relationship.

42
Q

How do subtypes in an ISA relationship relate to relations that only apply to them?

A

Subtypes in an ISA relationship can have relations (attributes or relationships) that only apply to them. This means that each subtype can have specific characteristics or associations that are unique to that subtype. The use of subtypes allows for specialization, where each subtype can capture the specific details relevant to its type while inheriting common attributes from the supertype.

43
Q

How does non-exclusive subtyping differ from exclusive subtyping in an ISA relationship?

A

In exclusive subtyping, an instance of the supertype can belong to only one subtype, ensuring exclusivity. In contrast, non-exclusive subtyping allows an instance of the supertype to be associated with more than one subtype simultaneously, providing flexibility for instances to have characteristics of multiple subtypes.