DATABASES Flashcards
Schema
determines how data is organized between tables in your database.
Database Schema
The structure of a database. (Data is organized into Tables with columns and rows) A blank structure without information.
Schema Objects
Parts of a schema (like tables, columns, relationships, data types, keys)
What are the 4 benefits to using a Database Schema?
1) Better management via logical groupings for objects
2) Better Accessibility
3) More Security Features
4) Permits ownership transfer between users
Database Modeling
Designing the database schema before inputting information.
3 Categories of a Database Schema
aka the “three-schema architecture”
1) Conceptual/logical schema (defines entities, attributes, tables and relationships)
2) Internal/physical schema that (defines the actual storage of data and access paths.)
3) External/view schema that (defines different user views.)
conceptual or logical schema
describes the structure of the entire database for all the users. It describes the structure in terms of entities and features of the entities and the relationships between them. An Entity Relationship Diagram (ER-D) is usually drawn to represent the logical schema of a database.
-At this level, details about the physical storage and retrieval of data are hidden, and the database structure is described only at a concept level. The software developers work with the database at this level.
internal or physical schema
describes the physical storage of the database. It represents the entire database but at a very low level. This means it describes how the data is really stored on disk in the form of tables, columns and records. It defines what data is stored in the database and how.
external or view schema
describes the database like an external user would want to see it. This schema only describes the part of the database that the specific user is interested in. It hides the nonrelevant details of the database from a user. For example, a user from the sales department will see only sales-related data in a database. There can be many external schemas of a single database for different users.
What 3 Things does a Database Schema Help Data Engineers Do?
1)Maintain a clean set of data in the database related to an application.
2)Avoid reverse-engineering of the underlying data model from time to time.
3)Write efficient queries to retrieve data for reporting purposes, analytics and so on.
-In other words, it prevents you from ending up with a database design that requires a database engineer to do a lot of reverse-engineering down the line, wasting time and effort that leads to increased costs for organizations.
ER Modeling (Entity Relationship Modeling)
Graph illustrating relationships between entity types.
Logical Database Schema
Refers to the organization of data in tables or entities.
Physical Database Schema
How the physical structure of a database is stored on a disk. (or step 2 after making a Logical Database Schema)
ER-D
Entity Relationship Diagram
Name the 3 Possible Table Relationships
1) One to Many
2) One to One
3) Many to Many