The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major...
Transcript of The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major...
![Page 1: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/1.jpg)
Jennifer Widom
Relational Databases
The Relational Model
![Page 2: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/2.jpg)
Jennifer Widom
The Relational Model
Used by all major commercial database systems Very simple model Query with high-level languages: simple yet expressive Efficient implementations
![Page 3: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/3.jpg)
Jennifer Widom
Schema = structural description of relations in database Instance = actual contents at given point in time
The Relational Model
![Page 4: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/4.jpg)
Jennifer Widom
Schema = structural description of relations in database Instance = actual contents at given point in time
Database = set of named relations (or tables) Each relation has a set of named attributes (or columns) Each tuple (or row) has a value for each attribute Each attribute has a type (or domain)
The Relational Model
![Page 5: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/5.jpg)
Jennifer Widom
Schema = structural description of relations in database Instance = actual contents at given point in time
Database = set of named relations (or tables) Each relation has a set of named attributes (or columns) Each tuple (or row) has a value for each attribute Each attribute has a type (or domain)
The Relational Model
Schema – structural description of relations in database Instance – actual contents at given point in time
![Page 6: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/6.jpg)
Jennifer Widom
Schema = structural description of relations in database Instance = actual contents at given point in time
Database = set of named relations (or tables) Each relation has a set of named attributes (or columns) Each tuple (or row) has a value for each attribute Each attribute has a type (or domain)
The Relational Model
Schema – structural description of relations in database Instance – actual contents at given point in time NULL – special value for “unknown” or “undefined”
![Page 7: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/7.jpg)
Jennifer Widom
Schema = structural description of relations in database Instance = actual contents at given point in time
Database = set of named relations (or tables) Each relation has a set of named attributes (or columns) Each tuple (or row) has a value for each attribute Each attribute has a type (or domain)
The Relational Model
Schema – structural description of relations in database Instance – actual contents at given point in time NULL – special value for “unknown” or “undefined” Key – attribute whose value is unique in each tuple Or set of attributes whose combined values are unique
![Page 8: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/8.jpg)
Jennifer Widom
The Relational Model
Creating relations (tables) in SQL
Create Table Student(ID, name, GPA, photo)
Create Table College (name string, state char(2), enrollment integer)
![Page 9: The Relational Model - | Stanford Lagunita · Jennifer Widom The Relational Model Used by all major commercial database systems Very simple model Query with high-level languages:](https://reader030.fdocuments.us/reader030/viewer/2022041206/5d5bfb8c88c99340408b981f/html5/thumbnails/9.jpg)
Jennifer Widom
The Relational Model
Used by all major commercial database systems Very simple model Query with high-level languages: simple yet expressive Efficient implementations