SPJ query – Selection, Projection and Join where Selection selects a row of a relation based on a condition, projection selects columns/attributes from a relation and Join is a standard join on a condition. I also include the Renaming operator which just renames an attribute name to another name.
I want to find a proof that shows I can translate any such query into a simple select SQL query which only uses Distinct in the select clause and and from and where clause using only AND in the where clause.
These definitions match those in Ramakrishnan & Gehrke
I know that SQL translates nicely into a SPJ query by considering the FROM clause first as a Join and then the WHERE clause which acts as a Selection and then the SELECT clause which acts as a Projection. So my idea was to see if for every SPJ query there is an equivalent one of this form using various identity and equivalences in Relational Algebra. Although I am struggling to get a proof.