Querying Relational databases

Relational Algebra

  • Formal
  • Simbolos griegos

ID of stundent with GPA > 3.7 applying to Stanford:

\[\begin{split}\pi_{ID} \sigma_{GPA>3.7 \wedge cName=\text{'Stanford'}} (Student \bowtie Apply)\end{split}\]

SQL

Actual/Implemented

ID of stundent with GPA > 3.7 applying to Stanford:

SELECT Student.ID
FROM Student, Apply
WHERE Student.ID=Apply.ID
AND GPA>3.7 AND cName='Stanford'

Important

Se recomienda aprender primero algebra relacional antes que SQL.

Table Of Contents

Previous topic

The Relational Model

Next topic

Well-formated XML