0% found this document useful (0 votes)
0 views1 page

Schema defining rules

Uploaded by

Symon Saroar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
0 views1 page

Schema defining rules

Uploaded by

Symon Saroar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 1

Schemas for Interior Nodes

• An expression tree defines a schema for the relation associated


with each interior node.
• Similarly, a sequence of assignments defines a schema for
each relation on the left of the := sign.

Schema-Defining Rules 1

• For union, intersection, and difference, the schemas


of the two operands must be the same, so use that
schema for the result.
• R and S have schemas with identical set of attributes, and
domain types for each pair of attributes (=> same arity)
• Columns of R and S must be ordered so that the order of
attributes is the same for both relations
• Selection: schema of the result is the same as the
schema of the operand.
• Projection: list of attributes (L) tells us the schema.

Schema-Defining Rules 2

• Product: the schema is the attributes of both relations.


• Use R. A, etc., to distinguish two attributes named A.
• Theta-join: same as product.
• Natural join: use attributes of both relations.
• Shared (joining) attribute names are merged.
• Renaming: the operator tells the schema.

You might also like