2nd EXAM sir sting Flashcards

(44 cards)

1
Q

Q: What is SQL normalization?

A

A: SQL normalization is the process of organizing a database into tables and columns to reduce redundancy and improve data integrity.

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

Q: What are the goals of SQL normalization?

A

A: The main goals are to reduce redundancy and improve data integrity by dividing large tables into smaller, related tables.

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

Q: What are the key characteristics of a primary key?

A

A:

Uniqueness: No two rows can have the same primary key value.
Non-nullability: A primary key cannot contain null values.
Immutability: The primary key should not change once assigned.
It can be a single column or a composite key.

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

Q: What is the goal of the First Normal Form (1NF)?

A

A: To eliminate repeating groups in a table.

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

Q: What is a primary key?

A

A: A primary key is a unique identifier for each record in a database table, ensuring no duplicate records.

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

Q: What rule does 1NF enforce?

A

A: Each column should contain atomic (indivisible) values, and each record must be unique.

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

Q: What is a transitive dependency?

A

A: A situation where a non-key column is dependent on another non-key column, rather than the primary key.

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

Q: What rule does 2NF enforce?

A

A: The table must be in 1NF, and all non-key columns must be fully dependent on the primary key.

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

Q: What happens when a table violates 1NF?1

A

A: The table has non-atomic columns, such as multiple values in one column.

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

Q: What is the goal of the Third Normal Form (3NF)?

A

A: To eliminate transitive dependencies.

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

Q: What is the goal of the Second Normal Form (2NF)?

A

A: To eliminate partial dependencies.

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

Q: What is a partial dependency?

A

A: It occurs when a non-key column is dependent on part of a composite primary key rather than the entire key.

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

Q: What rule does 3NF enforce?

A

A: The table must be in 2NF, and all columns must be directly dependent on the primary key.

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

Q: How do you normalize a table with partial dependencies to 2NF?

A

A: Split the table into separate tables where non-key columns are fully dependent on the entire primary key.

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

Q: What problem does the table in 1NF with a “Courses” column have?

A

A: It violates atomicity by containing multiple values in one column.

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

Q: How do you normalize a table with transitive dependencies to 3NF?

A

A: Create separate tables for columns that are dependent on non-key attributes.

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

Q: What is an entity in data modeling?

A

A: An entity is something that exists independently and is distinguishable, like “Customer,” “Product,” or “Order.”

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

Q: What is the purpose of conceptual database design?

A

A: It describes the data, relationships, and constraints in a database, focusing on the data rather than the processes.

13
Q

Q: What is the output of conceptual database design?

A

A: The output is a Conceptual Data Model and a Data Dictionary.

14
Q

Q: What is data modeling?

A

A: It is the iterative and progressive process of creating a specific data model to represent complex real-world data structures.

14
Q

Q: What is the bottom-up approach to data modeling?

A

A: It starts by analyzing specific details from business documents, working towards a broader understanding.

15
Q

Q: What is the top-down approach to data modeling?

A

A: It starts with a broad understanding of the business needs and gradually moves into the details.

16
Q

Q: What are attributes in data modeling?

A

A: Attributes are the characteristics or properties of an entity. For example, a “Customer” entity may have attributes like “Name” and “Email.”

17
Q

Q: What is a relationship in data modeling?

A

A: A relationship defines how entities are connected. For example, a “Customer” places an “Order.”

18
Q: What does an ERD (Entity-Relationship Diagram) represent?
A: An ERD visually represents entities, their attributes, and relationships, helping to design the database structure.
19
19
Q: What is a subtype in an EERD model?
A: A subtype is a specialized version of a supertype with additional attributes or behaviors.
19
Q: What is a supertype in an EERD model?
A: A supertype is a generic entity that can be divided into more specific subtypes.
20
Q: What is specialization in data modeling?
A: Specialization is the process of defining subtypes from a supertype based on distinct features.
20
Q: What is generalization in data modeling?
A: Generalization is the process of combining subtypes into a common supertype.
20
20
20
20
Q: Give an example of a supertype and subtype in a company.
A: Supertype: Employee Subtypes: Full-time Employee (Salary), Part-time Employee (HourlyRate)
21
21
Q: What are the common data modeling structures?
A: The common structures are: Hierarchical Model Relational Model Network Model
21
Q: How is the relational model structured?
A: Data is stored in tables with relationships defined through keys.
22
23
23
23
23
23
24