weaknesses from midterm 1 Flashcards

1
Q

The _______ is a constraint on the number of instances of one entity that can (or must) be associated with each instance of another entity.

A

The correct answer is: cardinality

Explanation:
Cardinality refers to the number of instances of one entity that can (or must) be associated with each instance of another entity in a relationship. It’s a key concept in database design and entity-relationship modeling.

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

What are three (3) rules that a database designer has to consider which choosing a primary key?

A
  1. Uniqueness
    The primary key must uniquely identify each record in the table.

No two rows can have the same value for the primary key.

  1. Non-nullability
    A primary key cannot contain NULL values.

Every record must have a valid value for the primary key.

  1. Immutability (Stability)
    The value of a primary key should not change over time.

It should be stable and not based on attributes that might be updated (like a phone number or email address).

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

Fill in the blanks

Conceptual Design
{Entity, [x], [x]}

Logical Design
{[x], Rows, [x]}

Implemented SQL
{[x], [x], Fields}

A

Conceptual Design
{Entity, Attribute, Identifier (Key)}

Logical Design
{Table, Rows, Primary Key}

Implemented SQL
{CREATE TABLE, Column, Fields}

This table maps how data concepts transition from high-level design to actual implementation in SQL:

Entity → Table → CREATE TABLE: Represents real-world objects stored as tables.

Attribute → Rows → Column: Characteristics of entities become data entries and columns.

Identifier → Primary Key → Fields: Unique identifiers ensure each row is distinct.

It shows how abstract ideas become structured, working SQL code.

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

What does a foreign key always refer to?

A

A foreign key always refers to a primary key (or a unique key) in another table.

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

What are TWO differences between the SQL HAVING clause and the WHERE clause in a SELECT statement?

A

WHERE filters rows before grouping; HAVING filters after grouping.

WHERE cannot use aggregate functions; HAVING can.

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

What are business rules in a database?

A

Business rules are guidelines that control how data is entered, stored, and used in a database.

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

How do business rules affect database design?

A

They help decide how tables are set up and what data can be stored.

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

Example of a business rule?

A

“Each customer must have a unique email address.”

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

What are integrity constraints?

A

They enforce business rules to make sure data is correct (e.g., unique customer IDs).

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

Types of business rules?

A

Data integrity (e.g., unique IDs)

Referential integrity (e.g., matching foreign keys)

Security (e.g., limited access to data)

Operational (e.g., max order size)

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

Why define business rules first?

A

To make sure the database works properly and data is accurate.

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

How do business rules relate to normalization?

A

Business rules guide how tables should be split and related to keep data consistent.

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