You are on page 1of 9

Relational Databases

The Relational Model


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

Jennifer Widom

The Relational Model


Schema = structural description of relations in database Instance = actual contents at given point in time

Jennifer Widom

The Relational Model


Database = structural description of relations in database Schema set of named relations (or tables) Each relation has acontents at given point in time Instance = actual set of named attributes (or columns) Each tuple (or row) has a value for each attribute Each attribute has a type (or domain)

Jennifer Widom

The Relational Model


Database = structural description of relations in database Schema set of named relations (or tables) Schema structural description of relations in database Each relation has acontents at given point in time Instance actual contents at given point in (or columns) Instance = actual set of named attributes time Each tuple (or row) has a value for each attribute Each attribute has a type (or domain)

Jennifer Widom

The Relational Model


Database = structuralfor unknown relations in database Schema set of named relations (or undefined NULL structural description of ortables) Schemaspecial value description of relations in database Each relation has acontents at given point in time Instance actual contents at given point in (or columns) Instance = actual set of named attributes time Each tuple (or row) has a value for each attribute Each attribute has a type (or domain)

Jennifer Widom

The Relational Model


Database = structuralfor unknown relations in database Schema set whose value is unique undefined Key attribute of named relations (or tables) NULL structural description of orin each database Schemaspecial value description of relations intuple Each relation has acontents at given point inarecolumns) Instance actual contents at given point in time Or set of attributes whose combined values (or Instance = actual set of named attributes timeunique Each tuple (or row) has a value for each attribute Each attribute has a type (or domain)

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)

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

Jennifer Widom

You might also like