Data Models Flashcards
Explain the importance of thinking through the design of a query before writing it in SQL
- You will get more accurate results
- It will speed up your work
- 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
Describe what a database is
A container used to store and organize data. Think of a wall of file drawers.
SQL for Data Science Week 1
What is a table made up of?
A table is made up of columns and rows
SQL for Data Science Week 1
What is a data model?
- 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
What are the two types of data models?
- A data model for prediction used by data scientists
- A data model that represents how tables are organized in a database
SQL for Data Science Week 1
What are 4 benefits of the relational model?
- It simplifies the connections between the data
- It allows you to retrieve and update data
- It allows you to easily write queries against it
- It allows you to write data to it
SQL for Data Science Week 1
Define and describe the relational model
- Shows the relationships between tables
- Makes querying data easy and intuitive
SQL for Data Science Week 1
Define and describe the transactional model
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
Define an entity
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
Define an attribute
Characteristic of an entity
A characteristic about Heather is she has green eyes.
SQL for Data Science Week 1
Define a relationship
A relationship describes the association among entities.
For example:
- One-to-many
- Many-to-many
- One-to-one
SQL for Data Science Week 1
Example of a one-to-one relationship
Manager to store
If there is only one manager per store
SQL for Data Science Week 1
Example of a one-to-many relationship
Customer to invoices
SQL for Data Science Week 1
Explain a many-to-many relationship
Students to classes
SQL for Data Science Week 1
What is a primary key?
A column, or set of columns, that uniquely identify every row in the table
SQL for Data Science Week 1