Data Models




CS157a

Chris Pollett

Sep 4, 2019

Outline

Introduction

Overview of Data Models

Important Data Models

The two most important data models in use for database systems are:

  1. The relational model, including object-relational extensions.
  2. The semistructured-data model, including XML and related standards.

The Relational Model in Brief

The Semistructured Model in Brief

Three Data Facets for Semi-Structured data

Other Data Models

Comparing Approaches

Basics of the Relational Model

Relational Model Terminology

Relational Model Terminology continued

In-Class Exercise

Come up with a relation to describe pages in a wiki system. Annotate the attributes with appropriate domains. Write down some example tuples. Give an example key.

Post your solution to the Sep 4 In-Class Exercise Thread.

Example Relational Database Schema for a Movies Database

Movies(
   title:string,
   year:integer, 
   length:integer,
   genre:string,
   studioName:string, 
   producerC#:integer
)
MovieStar(
   name:string,
   address:string,
   gender:char,
   birthdate:date
)
StarsIn(
   movieTitle:string, 
   movieYear:integer, 
   starName:string
   )
MovieExec(
   name:string, 
   address:string, 
   cert#:integer, 
   netWorth:integer
)
Studio(
   name:string,
   address:string, 
   presC#:integer 
)