CH 4- Database Design Using Normalization Flashcards

1
Q

Counting Rows in a Table

A

•Use the COUNT(*) function to count the number of rows in a table.

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

SELECT statement

A
  • to determine the number and type of the table’s columns.

–If there are a large number of rows you can limit the number or rows returned by using the TOP function
as shown on the next slide.

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

Type of Databases

A

1) Updateable database- operational databases of the company
– If updateable database, we normally want tables in BCNF.

2) Read-only databases - extracted from operational DB to re-format data
– If read-only database, we may not use BCNF tables.

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

Designing Updateable Databases

A

-Updatable databases are typically the operational databases of a company, such as the online transaction
processing (OLTP) system.

-If you are constructing an updatable database, then you need to be concerned about modification anomalies and inconsistent data.

• Consequently, you must carefully consider normalization principles.

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

Advantages of Normalization

A
– Eliminate modification anomalies
– Reduce duplicated data
        ▪ Eliminate data integrity problems
        ▪ Save file space
– Single table queries will run faster
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Disadvantages of Normalization

A

– More complicated SQL required for multitable subqueries and joins
– Extra work for DBMS can mean slower applications

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

Multivalued Dependencies

A

Anomalies from multivalued dependencies are very
problematic.

• Always place the columns of a multivalued dependency into a separate table (4NF).

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

Common Design Problems

A

1) The multivalue, multicolumn problem
2) Inconsistent values
3) Missing Values
4) General-purpose remarks column

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

multivalue, multicolumn problem

A
  • when multiple values of an attribute are stored in more than one column.
  • The solution is to use a separate table to store the multiple values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Inconsistent values

A

-occur when different users or
different data sources use slightly different forms of the
same data value:

– Different codings:
▪ SKU_Description = ‘Corn, Large Can’
▪ SKU_Description = ‘Can, Corn, Large’
▪ SKU_Description = ‘Large Can Corn‘

– Different spellings:
▪ Coffee, Cofee, Coffeee

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

Inconsistent Values

A

Particularly problematic are primary or foreign key values.

• To detect:
– Use referential integrity check already discussed for checking keys
– Use the SQL GROUP BY clause on suspected columns

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

Missing Values

A

A missing value or null value is a value that has never been provided.

– In a database table, a null value appears in upper case letters as NULL.

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

Null Values

A

1)Null values are ambiguous:
– May indicate that a value is inappropriate

2)May indicate that a value is appropriate but unknown

3)May indicate that a value is appropriate and known, but has never been entered
▪ DateOfLastChildbirth is appropriate for a female, and may be known but no one has recorded it in the database

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

Checking for Null Values

A

Use the SQL IS NULL operator to check for null values

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

General-Purpose Remarks Column

A

is a column with a name such as:
– Remarks
– Comments
– Notes

• It often contains important data stored in an inconsistent, verbal, and verbose way

Such a column may:
– Be used inconsistently
– Hold multiple data items

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

Designing Read-Only Databases

A

-are nonoperational databases using data extracted from operational databases commonly used in data warehouses.

  • They are used for querying, reporting, and data mining applications.
  • They are never updated (in the operational database sense—they may have new data imported from time to time).
17
Q

Denormalization

A

-the joining of the data in normalized tables prior to storing the data.

• The data is then stored in nonnormalized tables.

**For read-only databases, normalization is seldom an advantage.
– Application processing speed is more important.