CISC 332 Lecture Notes - Lecture 11: Aggregate Function, Dno
Document Summary
Rule of thumb: do things efficiently, don"t just join everything and then project out what you need. When you do an outer join, the tuples" rows in the table that it doesn"t match up will just be null. Functions such as sum, average, min, max apply to a collection. Also: count - for couniting the number of tuples or values. Ex 1: find the number of different projects. Ex 2: find the max salary of the female employees. Tuples can be grouped based on a particular attribute and have an aggregate function applied to the group. Find the average of a column in a group. Say you have 3 cols in a table s: sid, course, mark. The first subscript is the grouping attribute (so in this case, its gouping by the. Ex 1: find the average salary for males. Ex2: for each department, show the number of employees and the minimum salary.