Exam 1 Flashcards

1
Q

4 components of database system

A

Users, DB app, DBMS, DB

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

Database definition

A

self-describing collection of related records/integrated tables

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

Integrated Tables

A

Tables that store both data and the relationships among data. Thus, have metadata.

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

Tables that store both data and the relationships among data

A

Integrated Tables

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

What is a DBMS?

A

A program used to create, process, and administer a DB.

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

Difference between personal and enterprise DB systems?

A

In personal DB sys, applications and DBMS are combined from user’s perspective, while they’re separate in enterprise. Also, more powerful apps/features, usually. Personal also designed for single user/computer.

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

Personal DB Sys example?

A

Microsoft Access

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

Enterprise DB Sys examples?

A

Microsoft SQL Server, IBM DB2

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

Referential Integrity Constraint

A

Every value of a foreign key must match a value of a existing primary key in another relation

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

Every value of a foreign key must match a value of a existing primary key in another relation

A

Referential Integrity Constraint

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

Metadata

A

Data describing the structure of the DB’s data

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

Data describing the structure of the DB’s data

A

Metadata

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

Function of DB applications?

A

Create and process forms and reports, process user queries, etc.

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

Function of a DBMS?

A

Process SQL requests, create DBes/tables/relationships/keys, modify data, enforce rules and constraints, concurrency control and security, and perform backups and recovery.

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

Types of anomalies

A

Deletion, update, insertion

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

Alt names for table

A

Relation, file

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

Alt names for row

A

Record, tuple

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

Alt name for column

A

Attribute, field

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

Primary key def

A

The chosen candidate key to be main key for a relation

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

Composite key def

A

Key with 2+ attributes

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

Surrogate key def

A

Added unique, numeric key to serve as primary key

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

Foreign key def

A

Primary key from one table, placed into another table

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

Functional dependency def

A

Where attribute(s) determine the value of other attribute(s) in the same table

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

Determinant def

A

Attribute(s) that determine the value of other attribute(s) in the same table

25
Q

Functional dependency def

A

Relationship where attribute(s) determine the value of other attribute(s) in the same table

26
Q

Determinant def

A

Attribute(s) that determine the value of other attribute(s) in the same table

27
Q

Attribute(s) that determine the value of other attribute(s) in the same table

A

Determinant

28
Q

1NF

A

All tables are relation–no repeats, unique names, independent order, no multientries, same datatype cols, rows data, cols attributes

29
Q

2NF

A

No non-key attributes can be determined by a subset of the key/partial dependencies. If non-composite primary key, automatically 2NF! Cand key not non-key.

30
Q

No non-key attributes can be determined by a subset of the key. Form?

A

2NF

31
Q

Partial dependency

A

When a non-key attribute is dependent on only part of a candidate key

32
Q

When a non-key attribute is dependent on only part of a candidate key

A

Partial dependency

33
Q

3NF

A

No non-key attributes can be determined by a non-key attribute/transitive dependencies.

34
Q

No non-key attributes can be determined by a non-key attribute. Form?

A

3NF

35
Q

Transitive dependency

A

When a non-key attribute is determined by another non-key attribute. Compound key attributes not counted as non-key.

36
Q

When a non-key attribute is determined by another non-key attribute

A

Transitive dependency

37
Q

BCNF

A

No attributes are determined by a non-key attribute. If no compound candidate keys, automatic from 3NF!

38
Q

No attributes are determined by a non-key attribute. Form?

A

BCNF

39
Q

Normalization steps

A

ID a functional dependency. If determinant isn’t a candidate key, copy functional dependency to new table, keeping the determinant in the original table as a foreign key, and deleting the rest. Repeat!

40
Q

Elements of the E-R model

A

Entities, relationships, attributes, identifiers

41
Q

Weak entity

A

Entity that cannot logically exist without another entity

42
Q

ID-dependent entity

A

Entity that cannot exist or be identified without another entity; solid line time!

43
Q

Identifying relationship

A

Relationship between strong and ID-dependent weak entity

44
Q

Relationship between strong and ID-dependent weak entity

A

Identifying relationship

45
Q

Super/subtypes

A

The subtype is a special case of the supertype; subtype determined by the discriminator attribute. Subtypes can be inclusive (can have multiple) or exclusive. Subtype entities ID-dependent on supertype parent.

46
Q

Attribute that determines subtype(s)?

A

Discriminator

47
Q

Entity when there are attributes of a relationship between 2 or more entities

A

Associative entity

48
Q

Steps from model to design?

A

1, entities to tables and identifiers to primary keys; 2, verify normalization; 3, specify attribute information; 4, relationships to foreign keys

49
Q

Attribute implementation details?

A

Data type, null status, default values, data constraints

50
Q

char vs varchar

A

char is fixed length, varchar isn’t

51
Q

Intersection table

A

Table created for N:M relationships, where primary key of each connected table is used as compound key. If there’s additional attributes, it’s an association table!

52
Q

Table created for N:M relationships, where primary key of each connected table is used as compound key. No additional attributes.

A

Intersection table

53
Q

Intersection table, but with MORE PIZZAZZ

A

Association table

54
Q

Foreign keys for 1:1?

A

Slap PK of one into the other, doesn’t matter which. Don’t do both, though!

55
Q

Parent-child relationship

A

1:N relationship

56
Q

Foreign keys for 1:N?

A

Slap PK of parent into child as FK (not as primary key, though).

57
Q

Foreign keys for N:M?

A

Make an intersection table!

58
Q

Foreign keys for super/subtypes?

A

PK of supertype becomes foreign PK of subtypes.

59
Q

Foreign keys for recursive relationships?

A

For 1:1, 1:N recursive, put PK as a separate FK attribute EMPLOYEE(EmployeeNum, FirstName…, Supervisor), for N:M recursive, make intersection table with compound foreign PKs USER_INTERSECTION(Follower, Following)