Unit 2 Flashcards

1
Q

Primary Key

A

attribute with information that uniquely identifies each instance in the table. There can only be one primary key.

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

Candidate Key

A

The primary key and alternative keys. All candidate keys that are not the primary key are alternative keys.

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

Alternative Key

A

All keys that could be primary keys but are not selected to be the primary key.

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

Foreign Key

A

Keys that are primary keys in other tables.

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

Composite Primary Key

A

Combines two attributes to uniquely identify instances in a table.

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

Surrogate Key

A

Auto generated values.

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

Should you use surrogate keys on every table?

A

No. Overusing surrogate keys confuses the design and relationships of the table.

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

What does it mean for data to be atomic?

A

Data values cannot be broken down any further.

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

Determinant

A

An attribute which uniquely determines other attributes. Ex: studentID uniquely identifies studentName and studentGPA.

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

Meaning of “A → B”

A

B is functionally dependent on A.

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

What makes a well-structured relation?

A
  1. minimal data redundancies.
  2. designed to avoid insert, delete, and update anomalies.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Types of Functional Dependencies

A

Full Dependency, Partial Dependency, Transitive Dependency

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

Full Dependency

A

The determinant is the primary key (s) and all attributes have a functional dependency on the determinant (s).

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

Partial Dependency

A

The determinant is part of the primary key and one or more of the attributes have a functional dependency on the determinant. Can only exist when there is a composite primary key.

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

Transitive Dependency

A

The determinant is not part of the primary key and one or more of the attributes has a functional dependency on the determinant.

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

Normal Forms and their definitions

A

3NF: 2NF, no transitive dependency.
2NF: 1NF, no partial dependency.
1NF: Unique PK, unique rows, and atomic values.

17
Q

Does 4NF exist?

A

Yes.

18
Q

What Normal Form is the industry standard?

A

3NF.

19
Q

Procedural Language

A

how to process steps; step-by-step; Java.

20
Q

Declarative Language

A

what needs to be done; SQL.

21
Q

Intracluster Skills

A

if you have an advanced understanding of Python for data analysis, you can migrate that skillset to another programming language like Ruby, Java, C++, C#, or R fairly easily because they are all in the same app/language cluster.

22
Q

Data Definition Language (DDL)

A

define a database. Ex: Create, Drop/Truncate, Alter.

23
Q

Data Manipulation Language (DML)

A

maintain/retrieve records.
- Insert, Delete, Update.
- Select (Data Query Language (DQL))

24
Q

Are Null values allocated memory? Are derived attributes allocated memory space?

A

Null values: yes.
Derived attributes: no.

25
Q

Three Integrity Rules

A

Domain, Entity, and Reference

26
Q

Domain Integrity

A

Includes the datatype and constraints for each attribute.

27
Q

Entity Integrity

A

“Primary Key” constraint; violation when values in the primary key are null or not unique.

28
Q

Reference Integrity

A

Reference statements at bottom of CREATE statement; violation when values referenced across tables do not match.

29
Q

Do attributes need identical names to reference each other in a FK-PK relationship?

A

No.

30
Q

Difference between DROP, TRUNCATE, and DELETE

A

DROP: lose data & table. Irreversible.
TRUNCATE: drop all rows. Keep table structure. Irreversible. Resets surrogate key counters.
DELETE: drop one or more rows. Must be used with WHERE clause. Doesn’t reset surrogate key counters.

31
Q

DB Frontend

A

production and daily use.

32
Q

DB Backend

A

M&A (mergers and acquisition): mass data imports.

33
Q

In what order should rows be deleted from a DB

A

Rows without foreign keys must be deleted first. Otherwise, where that key is a primary key it refers to nothing.

34
Q

In what order should tables be added to a DB

A

Tables without foreign keys must be added first. DB are built from the bottom up.