• 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.