CISC 332 Lecture Notes - Lecture 11: Aggregate Function, Dno

32 views2 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents