The Relational Model

 

Database = set of named relations (tables)

each relation has a set of named attributes (columns)

Each tuple (row) has a value for each attribute

each attribute has a type (domain)

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

Example.

Creating relations (tables) in SQL

Create Table Student(ID, name, GPA, photo)

Create Table College
(name string, state char(2), enrollment integer)

Slides from Course : Relational Databases: The Relational Model

 

Querying Relational Databases

  1. Design, create using a DDL (Data Definition Language)
  2. Bulk Load Initial Data
  3. Repeat: execute queries and modifications

Query Language / DML (Data Manipulation Language)

Compositionality – the ability to run a query over the results of a past query.

Query Languages

  • Relational Algebra (formal)
  • SQL – actual/implemented
Notes

Leave a Reply

Your email address will not be published. Required fields are marked *

RSS