Data Models Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Explain the importance of thinking through the design of a query before writing it in SQL

A
  1. You will get more accurate results
  2. It will speed up your work
  3. You will have less re-work

Above all, think before you do. Ask yourself, what is the problem you’re trying to solve and then come up with a road map before coding.

An ER diagram is instrumental in the “think before you do” step. It will help you plan.

SQL for Data Science Week 1

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

Describe what a database is

A

A container used to store and organize data. Think of a wall of file drawers.

SQL for Data Science Week 1

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

What is a table made up of?

A

A table is made up of columns and rows

SQL for Data Science Week 1

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

What is a data model?

A
  • A data model organizes information
  • A data model tells us how tables relate to each other.
  • A data model usually represents a business process and it can help you understand a business process.
  • A data model should represent a real world process as closely as possible.

SQL for Data Science Week 1

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

What are the two types of data models?

A
  1. A data model for prediction used by data scientists
  2. A data model that represents how tables are organized in a database

SQL for Data Science Week 1

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

What are 4 benefits of the relational model?

A
  1. It simplifies the connections between the data
  2. It allows you to retrieve and update data
  3. It allows you to easily write queries against it
  4. It allows you to write data to it

SQL for Data Science Week 1

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

Define and describe the relational model

A
  1. Shows the relationships between tables
  2. Makes querying data easy and intuitive

SQL for Data Science Week 1

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

Define and describe the transactional model

A

Used to simply store information. It is not built with later use in mind, so it is not conducive to querying and analysis.

SQL for Data Science Week 1

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

Define an entity

A

An entity is one of these:
1. Person
2. Place
3. Thing
4. Event

They are distinguishable, unique and distinct.

For example, Heather is the entity

SQL for Data Science Week 1

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

Define an attribute

A

Characteristic of an entity

A characteristic about Heather is she has green eyes.

SQL for Data Science Week 1

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

Define a relationship

A

A relationship describes the association among entities.

For example:
- One-to-many
- Many-to-many
- One-to-one

SQL for Data Science Week 1

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

Example of a one-to-one relationship

A

Manager to store

If there is only one manager per store

SQL for Data Science Week 1

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

Example of a one-to-many relationship

A

Customer to invoices

SQL for Data Science Week 1

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

Explain a many-to-many relationship

A

Students to classes

SQL for Data Science Week 1

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

What is a primary key?

A

A column, or set of columns, that uniquely identify every row in the table

SQL for Data Science Week 1

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

What is a foreign key?

A

One or more columns that can be used to identify a single row in another table.

SQL for Data Science Week 1

17
Q

Explain how ER diagrams are used to document and illustrate relationships

A

An ER diagram is composed of entities and specifies the relationships that can exist between instances of those entity types.

They show:
1. Relationships
2. Business Process
3. A visual representation of the database structure
4. Shows the links (primary keys/foreign key) between tables

SQL for Data Science Week 1

18
Q
A

SQL for Data Science Week 1

19
Q

ER Diagram Notation Types

A
  1. Chen Notation
  2. Crow’s Foot Notation
  3. UML Class Diagram Notation

SQL for Data Science Week 1

20
Q

Crow’s Foot Notation Example

A

SQL for Data Science Week 1

21
Q

Chen Notation Example

A

SQL for Data Science Week 1

22
Q

UML Class Diagram Notation

A

SQL for Data Science Week 1

23
Q

Example of the three types of ER Diagram Notation

A

SQL for Data Science Week 1