WEEK 2 Flashcards

(26 cards)

1
Q

Importance of Data Models

A

Are a communication tool
Give an overall view of the database Organize data for various users

Are an abstraction for the creation of good database

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

Data Model Basic Building Blocks

A

ENTITY
ATTRIBUTE
RELATIONSHIP

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

A person, place, thing, concept or event about which data will be collected and stored
Example: customer

A

Entity:

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

A characteristic of an entity
Example: last name or first name of a customer

A

Attribute:

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

Describes an association among entities

A

Relationship:
RELATIONSHIP:
One-to-many (1:M or 1..*)
Many-to-many (M:N, M:M or ..)
One-to-one (1:1 or 1..1)

example:
Painter paints painting
EMPLOYEE leanrs SKILL
EMPLOYEE manages STORES

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

a restriction placed on the data, usually expressed in the form of rules
ensure data integrity

Examples:
An employee’s salary must have values between 6,000 and 350,000
A student’s GPA must be between 0.00 and 4.00
Each class must have one and only one teacher.

A

Constraint:

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

is a brief, precise, and unambiguous description of a policy, procedure, or principle within a specific organization.

Examples:
A customer may generate many invoices.
An invoice is generated by only one customer.
A training session cannot be scheduled for fewer than 10 employees or for more than 30 employees.

A

business rule

Business rules establish entities, relationships, and constraints.

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

Sources of Business Rules

A

Company managers
Policy makers
Department managers
Written documentation
Direct interviews with end users

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

Student and Class
In how many classes can one student enroll? Many
How many students can enroll in one class? Many

A

Many-to-many

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

Customer and Invoice
One customer may generate many invoices.
An invoice is generated by only one customer.

A

One-to-many

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

Introduced by E.F. Codd in 1970

A

The Relational Model

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

Matrix composed of intersecting tuple and attribute
Tuple: Rows
Attribute: Columns

A

Relation or table:

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

A Logical View of Data

Relational database model enables logical representation of the data and its relationships
Logical simplicity yields simple and effective database design methodologies
Facilitated by the creation of data relationships based on a logical construct called a relation

A

A Logical View of Data

Relational database model enables logical representation of the data and its relationships
Logical simplicity yields simple and effective database design methodologies
Facilitated by the creation of data relationships based on a logical construct called a relation

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

The Relational Model

Table schema:
Book (Bid: char(2), Title: char(50), Author: char(20), Price: decimal(5,2))

A

The Relational Model

Table schema:
Book (Bid: char(2), Title: char(50), Author: char(20), Price: decimal(5,2))

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

Consist of one or more attributes that determine other attributes
Used to:
Ensure that each row in a table is uniquely identifiable
Establish relationships among tables and to ensure the integrity of the data

A

KEYS

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

Attribute or combination of attributes that uniquely identifies any given row

A

Primary key (PK):

17
Q

: Key that is composed of more than one attribute

A

Composite key

18
Q

Attribute that is a part of a key

A

Key attribute:

19
Q

Condition in which each row in the table has its own unique identity
All of the values in the primary key must be unique
No key attribute in the primary key can contain a null (cannot be left empty)

A

Entity integrity:

20
Q

Absence of any data value that could represent:
An unknown attribute value
A known, but missing, attribute value
A inapplicable condition

21
Q

Every reference to an entity instance by another entity instance is valid
refers to the relationship between tables. Because each table in a database must have a primary key, this primary key can appear in other tables because of its relationship to data within those tables. When a primary key from one table appears in another table, it is called a foreign key .
It is important because it ensures that all data in a database remains consistent and up to date. It helps to prevent incorrect records from being added, deleted, or modified.

A

Referential integrity:

22
Q

Key used strictly for data retrieval purposes
For example, using your phone number, when you don’t have your customer ID

A

Secondary key:

23
Q

An attribute or combination of attributes that uniquely identifies each row in a table

24
Q

A minimal (irreducible) superkey; a superkey that does not contain a subset of attributes that is itself a superkey

A

Candidate key

25
A candidate key selected to uniquely identify all other attribute values in any given row; cannot contain null entries
Primary key
26
Primary key = follow the entity integrity rule. Foreign key = can be null / follow the referential integrity
Primary key = follow the entity integrity rule. Foreign key = can be null / follow the referential integrity