Final Flashcards

1
Q

Insertion anomaly

A

when certain attributes cannot be inserted into the database without the presence of other attributes

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

Deletion Anomaly

A

when certain attributes are lost because of the deletion of other attributes

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

Modification/Update Anomaly

A

when one or more instances of duplicated data is updated, but not all. IE the zip code for an address changes but only some of the users get the updated zip code because the zip codes are stored redundantly

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

Functional Dependancy

A

a relationship that exists when one attribute uniquely determines another attribute

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

Armstrong’s Rules

A

Reflexivity: if Y is a subset of X, then X –> Y
Augmentation: If X–>Y then XZ–>YZ
Transitivity: If X–>Y and Y–>Z then X–>Z

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

Example of Reflexivity

A

{phone} is a subset of {sid, phone, fname, etc..}

Therfore {sid, phone, fname, etc…} –> {phone}

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

Example of Augmentation

A

You can add an attribute to both sides of an FD
if sid -> major
then sid, fname -> major, fname
Doesn’t matter what order we write these in because they are sets (unordered)

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

Union Rule

A

if X determines Y and X determines Z then X must also determine Y and Z (see Figure 11.4).

if X->Y and X->Z then X->YZ

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

Decomposition Rule

A

if X determines Y and Z, then X determines Y and X determines Z separately

if X->YZ then X->Y and X->Z

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

What is a view?

A

A view is a named query that can be used like a table

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

How is a view created in SQL?

A

CREATE VIEW viewName AS

“SQL STATEMENT HERE”

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

How are views stored?

A

In pre-compiled form

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

What is a role?

A

It’s similar to a user category and used to allow or restrict actions on a table.

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

Primary Key

A

one or more fields that uniquely identifies a row in a table. Minimum amount of attributes used

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

Foreign Key

A

a relationship between columns in two database tables

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

Composite Key

A

A primary key composed of one or more columns

17
Q

Natural Key

A

A composite primary key which is composed of attributes (fields) which already exist in the real world

18
Q

Surrogate Key

A

A primary key which is internally generated (typically auto-incremental integer value) that does not exist in the real world. IE personId

19
Q

Candidate Key

A

A candidate key is a column or group of columns that can uniquely identify a row in the table without referring to any other source. One of these is selected as Primary Key

20
Q

Prime Attribute is

A

An attribute that is attribute(s) that is a subset of a key.

21
Q

Superkey is

A

Attributes that are a superset of a key

22
Q

How do you identify 3NF?

A

A relation schema R is in 3NF if, whenever a functional dependency X -> A holds in R, either

(a) X is a superkey of R, or
(b) A is a prime attribute of R.
23
Q

Subkey

A

One or several attributes that determine some but not all the attributes in a row