Lecture 2- Relational Data Model Flashcards
Why do you need a data model?
- Need a model for describing the structure of data and constraints
- And operations on data
What are the three layers in a data model schema?
- External
- Conceptual
- Physical
What is the physical level of a data model schema?
Problems working with data = routines hard coded to deal with physical representation
What are some characteristics of the physical level of data model schema?
- Diffucult to change the physical representation
- Application code becomes complex since it must deal with details
- Rapid implementation of new features impossible
Describe the conceptual level of a data model schema
- Hides details
- Presents data as a set of tables
- Mapping from conceptual to physical schema done by DBMS
- Physical schema can be changed without changing applications (refered to as physical data independence)
Describe the basic idea of relational database
- Organize data as a set of tables
- View each table as a set of rows
What are some advantages to relational databases?
- Simple
- Solid mathematical foundation (set theory)
- Powerful query languages
- Efficient query optimizers
What is a relational database?
A set of relations (tables)
A relationship consists of what?
- Instance
- Schema
What is an instance?
Table content, with rows and columns
What is a schema?
Table structure, with name and type of columns
More formally, a relation is a set of ______ or ______
- Rows
- Tuples
What is the cardinality, degree and domain of this example?
- Cardinality = 3
- Degree = 5
- Domain = name: char(16), age: {1,…,100}
What is domain?
The set of values from which the values of an attribute are drawn
Why use querying relations?
- Queries can be written intuitively and the DBMS is responsible for efficient evaluation
- Precise semantics for relational queries
- Allows the optimizer to extensively re-order operations and still ensure that the answer does not change