Comp 305-001/488-305: Database Administration
Spring 2016: Tuesdays, 4:15-6:45, Corboy L08
Week 4
Read in Elmasri & Navathe (EN). Chapters are labeled (7th edition)/(6th
edition)
- Chapter 6/4, Basic SQL
- Chapter 7/5
Resume with group by
What do we want with groups? Some fixed-per-group attributes (namely the
group-by attributes), and then some per-group aggregations of other
attributes.
- aggregation without grouping
- aggregation with grouping: group by
How does
select count(*) from employee
fit in? This is aggregation without grouping, so we're good!
What about exercise 12c? The query should be grouped by the course number,
semester and year, and should include a record for each of the students. A
count(*) in the select clause will then give the total number of students
for that course, semester and year.
Tricky Foreign-key constraint
Nulls
is null, is not null
not null constraint
Outer joins
Nested queries 1
Nested queries 2
Exists and Unique
All
Except
Having
Views
Triggers