CS338 Lecture Notes - Lecture 6: Order Of Newfoundland And Labrador, Railways Act 1921

73 views3 pages

Document Summary

Review of spj queries in sql: equivalent to using only (or x) in relational algebra, if attributes need to be renamed before joining. Renaming in sql: aliases or tuple variables, alternative names for tables or columns, eg. Sometimes renaming is necessary: a table is used more than once in a query, eg. Give last names and salaries of employees and their managers when the employee earns more than the manager. Aggregate functions: used to accumulate information from multiple tuples, forming a single tuple summary, count, sum, max, min, avrg, used in select clause, eg. Select count(*) . : counting title or director gives the same number, count (distinct year) includes each year once. How many films were directed by each director after 2001: start by partitioning relation into subsets of tuples based on grouping columns, apply function to each such group independently, product one tuple per group.

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