Transcript

SQL Demo: Student-Teacher Database

Dr. Richard E. Turner ([email protected])

Student-Teacher Database

student enrolls course

CourseNo Course

lectured by

lecturer

SupNo SupName

M M

M

1

supervisor

M

LecNo Lecturer

StuNo StuName

The Tables

Viewing tables

Viewing tables

Schema (table schemes)

Projection (repeated elements)

Projection (no repeated elements)

Projection (identity projection)

Selection (simple)

Selection (complex)

Selection and Projection combine

Cartesian Product

Cartesian Product

Cartesian Product + Selection = Join

Simple query: step 1

Simple query: step 2

Simple query: step 3


Top Related